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
| Field | Type | Description |
|---|---|---|
nickname required | string | New 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
| Field | Type | Description |
|---|---|---|
status required | string (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
| Field | Type | Description |
|---|---|---|
active | boolean | Filter by active status |
primary_method | boolean | Filter to only primary payment methods |
backup_method | boolean | Filter to only backup payment methods |
type | string (bank | card) | Filter by payment method type |
payment_gateway | string | Filter 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
| Field | Type | Description |
|---|---|---|
gateway | string | Optional 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_token | string | Payment gateway token (for tokenized card storage) |
cc_name | string | Name on the credit card |
cc_number | string | Credit card number |
cc_expiry_month | string | Card expiry month (MM) |
cc_expiry_year | string | Card expiry year (YYYY) |
cc_cvv | string | Card CVV/security code |
bank_account_name | string | Account holder name |
bank_name | string | Bank name |
bank_bsb | string | BSB number (Australian banks) |
bank_account_number | string | Bank account number |
set_primary | boolean | Set this as the primary payment method |
set_backup | boolean | Set this as the backup payment method |
nickname | string | Nickname for the payment method |
Responses
200— Payment method added successfully