This API is used to read the list of financial transactions from the billing system. For information about how to get started using the APIs available, see API Access.
Parameters (optional)
- page (integer)
Zero-based page number. The query returns up to 50 rows per page. Based on has_more you might increment the page and request the next set of results. - customer_id (integer)
Returns all transactions for a specific customer.
Output
- total (integer)
Total number of records available (not affected by the page parameter). - has_more (boolean)
True if there are more records available by incrementing the page parameter. When false you have read the whole list. - change_id (string)
A string value which indicates whether any records have changed. If you have read all data previously and the next read returns the same change_id, nothing has changed. However, if the value changes you might discard your current result set and read again from the first page. - rows (array)
Each row contains a billing transaction.
Each row contains the following fields.
- id (integer)
- url (string)
- timestamp (integer)
- date (string/Y-m-d)
Timestamp and date are the document date - type_id (integer)
Invoice (0), Credit (1), Payment (2), Refund (3), Opening balance (4), Adjustment (5). - type_text (string)
- drcr (string)
Debit (dr) or credit (cr) the Accounts Receivables. - due_date (string/Y-m-d)
For invoices only. - paid_same_day (boolean)
For invoices only. Indicates whether a sale was made and payment taken the same day (not left on customer's account) - reference (string)
- customer_id (integer)
- customer_name (string)
- total (decimal)
- tax_content (decimal)
- processor_fee (decimal)
Processor fees appear only for payments (receipts via Stripe). - lines (array)
Line items, see later.
If the transaction is voided, the following fields exist:
- deleted (0/1)
- deleted_at (integer)
- deleted_by (string)
- deleted_notes (string)
Line items
Each line in the lines array represents a line item on an invoice / credit etc. Each contains the following fields.
- line_number (integer)
- timestamp (integer)
- description (string)
- quantity (integer)
- each (decimal)
- total (decimal)
- tax_code (string)
- tax_content (decimal)
Tax fields only for invoices and credits. - plan_reference (string)
- plan_version (integer)
Plan fields are included if the invoice or credit was created by the system. - accounts_code (string)
- item_start (integer)
- item_stop (integer)
- url (string)
A url for the item sold, e.g. the flight, ground school record etc. - voucher (string)
- aircraft (string)
- instructor (string)
Notes
Amounts are in the local currency.
Example
curl -H "Accept: application/json" -H "Authorization: Bearer fb1f233e08aeef0a213dc87cea70cedbd7dbcd0a2229cac4f64e14e3c462cc8e" "https://acme.flightschoolbooking.com/club/billing/all"
(Use your own site's URL, replacing acme with the name of your subdomain and use your own token)