Skip to main content
PayChoice raises invoices automatically as payment schedule items fall due. You can also create ad-hoc invoices for a customer and pay them on demand with a stored token. {invoice} is the integer invoice_number.

Create

date
required
When the invoice is due.
string
required
Line description. Add further lines as item[1][...], item[2][...]. At least one line is required.
decimal
required
Line amount, up to two decimal places.
integer
1 scheduled invoice, 0 payment link.
In line_items[] the keys are swapped: description holds the amount and amount holds the description text. Read them accordingly.
integer
The invoice ID.
date
Due date.
string
Total, decimal.
string
Pending, Processing, Completed, Canceled or Dismissed.
array
Payment attempts: receipt_number, id (charge ID), reference, amount, amount_applied, date, type, status, error_code, description, payment_method (Credit Card / Bank Account), token_name, token_number. Empty until a payment is made.

Pay

POST /customer/{customer}/invoice/{invoice}/pay charges the invoice to a stored token. Pass card_token or bank_token; if neither is given, the customer’s default payment method is used, and an error is returned if there isn’t one.
transaction_id is the PayChoice charge ID — use it to match the webhook. A bank payment is Processing at this point; the final outcome arrives by webhook.