Payment Methods API

11 PracBill API endpoints for payment methods. Base URL https://billing.pracbill.com.au/api.

Get payment method

GET /{api_key}/customer/paymentMethods/{id}

Retrieve details for a specific payment method. Bank account numbers are returned unmasked. Failure description: `Payment method not found`.

Responses

  • 200 — Payment method retrieved successfully
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Set payment method nickname

POST /{api_key}/customer/paymentMethods/{id}/nickname

Update the nickname/display name of a payment method. The body is parsed with the shared request extractor: raw JSON, url-encoded JSON, or the legacy `name={json}` form. Failure descriptions: `Nickname is required`, `Payment method not found`.

Request body

FieldTypeDescription
nickname requiredstringNew nickname for the payment method (empty string clears it)

Responses

  • 200 — Nickname updated successfully (description: `Payment method nickname updated`)
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Set payment method status

POST /{api_key}/customer/paymentMethods/{id}/status

Update the status of a payment method. Valid statuses: primary, backup, inactive. Setting a method to primary or backup will also set it as active. Setting to inactive deactivates the method. The body is parsed with the shared request extractor: raw JSON, url-encoded JSON, or the legacy `name={json}` form. Failure descriptions: `Status is required. Valid values: primary, backup, inactive`, `Invalid status. Valid values: primary, backup, inactive`, `Payment method not found`; when the gateway refuses the change the description may be an empty string.

Request body

FieldTypeDescription
status requiredstring (primary | backup | inactive)New status for the payment method. 'primary' sets as primary and activates, 'backup' sets as backup and activates, 'inactive' deactivates the method.

Responses

  • 200 — Status updated successfully (description: `Payment method status updated to {status}`)
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

List payment methods

GET /{api_key}/customer/{cid}/paymentMethods

Retrieve all payment methods for a customer (both active and inactive), active first, then primary, backup, newest.

Responses

  • 200 — Payment methods retrieved successfully
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Filter payment methods

POST /{api_key}/customer/{cid}/paymentMethods

Retrieve payment methods with optional filters for active status, type (bank/card), primary/backup method, and payment gateway. Same response shape as the GET. The body is parsed with the shared request extractor: raw JSON, url-encoded JSON, or the legacy `name={json}` form.

Request body

FieldTypeDescription
activebooleanFilter by active status (true/false; when omitted both are returned)
primary_methodbooleanWhen truthy, only primary payment methods (false is ignored)
backup_methodbooleanWhen truthy, only backup payment methods (false is ignored)
typestring (bank | card)Filter by type; any other value is ignored
payment_gatewaystringFilter by payment gateway name (exact match)

Responses

  • 200 — Payment methods retrieved successfully
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Add payment method

POST /{api_key}/customer/{cid}/paymentMethods/add

Add a new payment method to a customer. Can be a credit card (via token or full card details) or bank account. Supply `gateway` to nominate a gateway configured for the department, otherwise the gateway is automatically selected based on the data provided. The body is parsed with the shared request extractor: raw JSON, url-encoded JSON, or the legacy `name={json}` form. Failure descriptions include `No data provided`, `No Bank/Direct Debit Gateway configured for this department`, `No Credit Card Gateway configured for this department`, `Payment gateway '{name}' is not configured for this department`, `Payment gateway '{name}' is not available`, or the gateway's own message.

Request body

FieldTypeDescription
gatewaystringOptional payment gateway name (payment_gateways.gateway_name) to create and tokenise the payment method against, e.g. "ezidebit". Must be a gateway configured for the authenticated department; an unknown, deleted or other-department gateway is rejected. When omitted the department default direct debit gateway is used if `bank_account_name` or `bank_name` is supplied, otherwise the default credit card gateway.
payment_tokenstringPayment gateway token (for tokenized card storage)
card_tokenstringAlias of payment_token
tokenstringAlias of payment_token
cc_namestringName on the credit card
cc_numberstringCredit card number
cc_expmonthstringCard expiry month
cc_expyearstringCard expiry year
cc_ccvstringCard CVV/security code
bank_account_namestringAccount holder name
bank_account_numberstringBank account number
bank_namestringAlias for bank_account_name (account holder name; takes precedence when both are supplied)
bank_numberstringAccount number, used together with `bank_name`
bank_bsbstringBSB number (Australian banks)

Responses

  • 200 — Request processed. Check `success`.
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

List payment methods

GET /{api_key}/customer/{cid}/paymentMethods/list

Alias of `/{api_key}/customer/{cid}/paymentMethods`. Retrieve all payment methods for a customer (both active and inactive), active first, then primary, backup, newest.

Responses

  • 200 — Payment methods retrieved successfully
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Filter payment methods

POST /{api_key}/customer/{cid}/paymentMethods/list

Alias of `/{api_key}/customer/{cid}/paymentMethods`. Retrieve payment methods with optional filters for active status, type (bank/card), primary/backup method, and payment gateway. Same response shape as the GET. The body is parsed with the shared request extractor: raw JSON, url-encoded JSON, or the legacy `name={json}` form.

Request body

FieldTypeDescription
activebooleanFilter by active status (true/false; when omitted both are returned)
primary_methodbooleanWhen truthy, only primary payment methods (false is ignored)
backup_methodbooleanWhen truthy, only backup payment methods (false is ignored)
typestring (bank | card)Filter by type; any other value is ignored
payment_gatewaystringFilter by payment gateway name (exact match)

Responses

  • 200 — Payment methods retrieved successfully
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Get payment method

GET /{api_key}/paymentMethods/{id}

Alias of `/{api_key}/customer/paymentMethods/{id}`. Retrieve details for a specific payment method. Bank account numbers are returned unmasked. Failure description: `Payment method not found`.

Responses

  • 200 — Payment method retrieved successfully
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Set payment method nickname

POST /{api_key}/paymentMethods/{id}/nickname

Alias of `/{api_key}/customer/paymentMethods/{id}/nickname`. Update the nickname/display name of a payment method. The body is parsed with the shared request extractor: raw JSON, url-encoded JSON, or the legacy `name={json}` form. Failure descriptions: `Nickname is required`, `Payment method not found`.

Request body

FieldTypeDescription
nickname requiredstringNew nickname for the payment method (empty string clears it)

Responses

  • 200 — Nickname updated successfully (description: `Payment method nickname updated`)
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

Set payment method status

POST /{api_key}/paymentMethods/{id}/status

Alias of `/{api_key}/customer/paymentMethods/{id}/status`. Update the status of a payment method. Valid statuses: primary, backup, inactive. Setting a method to primary or backup will also set it as active. Setting to inactive deactivates the method. The body is parsed with the shared request extractor: raw JSON, url-encoded JSON, or the legacy `name={json}` form. Failure descriptions: `Status is required. Valid values: primary, backup, inactive`, `Invalid status. Valid values: primary, backup, inactive`, `Payment method not found`; when the gateway refuses the change the description may be an empty string.

Request body

FieldTypeDescription
status requiredstring (primary | backup | inactive)New status for the payment method. 'primary' sets as primary and activates, 'backup' sets as backup and activates, 'inactive' deactivates the method.

Responses

  • 200 — Status updated successfully (description: `Payment method status updated to {status}`)
  • default — Failure envelope. The legacy API answers failures with HTTP 200 and `success: false` plus a `description` (e.g. `invalid key`, `Customer not found`).

← All API groups