This API is used to read the list of vouchers. For information about how to get started using the APIs available, see API Access.
Parameters
- 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.
Note you can retrieve a specific voucher by its ID. See later.
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 information about a voucher.
Each row contains the following fields.
- id (integer)
- url (string)
- code (string)
- originator_id (integer)
- originator_name (string)
- type (integer)
Flight (0), Ground school (1) - recipient_user_id (integer)
- recipient_user_name (string)
- recipient_name (string)
- issued_at (integer)
- duration_mins (integer)
- purchase_price (decimal)
- purchaser_name (string)
- purchaser_email (string)
- purchaser_address (string)
- billing (object)
An object containing two fields, invoice and payment. Both are of the billing transactions type. - greeting (string)
- message (string)
- edits_completed (integer)
Timestamp when edits were completed and finalised by the purchaser. - expire_at (integer)
- unsubscribed (true)
- unsubscribed_at (integer)
If the purchaser receives an email follow-up because the voucher has not been used, they can unsubscribe from future emails about the voucher. - sku (string)
If the voucher is deleted, the following fields exist:
- deleted (0/1)
- deleted_at (integer)
- deleted_by (string)
- deleted_notes (string)
Notes
Not all fields are present for every voucher. For example, if the voucher was manually added to the system the billing and purchaser_address fields are not present.
Example
curl -H "Accept: application/json" -H "Authorization: Bearer fb1f233e08aeef0a213dc87cea70cedbd7dbcd0a2229cac4f64e14e3c462cc8e" "https://acme.flightschoolbooking.com/club/voucher"
To retrieve a specific voucher by its ID, use the endpoint ending /club/voucher/<VOUCHER-CODE>.
(Use your own site's URL, replacing acme with the name of your subdomain and use your own token)