Payment Methods API

6 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

Responses

  • 200 — Payment method retrieved successfully

Set payment method nickname

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

Update the nickname/display name of a payment method

Request body

FieldTypeDescription
nickname requiredstringNew nickname for the payment method

Responses

  • 200 — Nickname updated successfully

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.

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

List payment methods

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

Retrieve all payment methods for a customer (both active and inactive)

Responses

  • 200 — Payment methods retrieved successfully

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

Request body

FieldTypeDescription
activebooleanFilter by active status
primary_methodbooleanFilter to only primary payment methods
backup_methodbooleanFilter to only backup payment methods
typestring (bank | card)Filter by payment method type
payment_gatewaystringFilter by payment gateway name

Responses

  • 200 — Payment methods retrieved successfully

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.

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 credit card / direct debit gateway is used based on the payment details provided.
payment_tokenstringPayment gateway token (for tokenized card storage)
cc_namestringName on the credit card
cc_numberstringCredit card number
cc_expiry_monthstringCard expiry month (MM)
cc_expiry_yearstringCard expiry year (YYYY)
cc_cvvstringCard CVV/security code
bank_account_namestringAccount holder name
bank_namestringBank name
bank_bsbstringBSB number (Australian banks)
bank_account_numberstringBank account number
set_primarybooleanSet this as the primary payment method
set_backupbooleanSet this as the backup payment method
nicknamestringNickname for the payment method

Responses

  • 200 — Payment method added successfully

← All API groups