Payment object
The API's main purpose is to provide you with various ways to query the status of payments that were made against your merchant account.
Credit card processing can take a few seconds and because the API caters for real-time queries it affects how the API works. If a query contains any pending payments it is necessary to poll the API until the result is available, for real-time applications we recommend that you make use of our webhook service. Seeing as webhooks can fail due to various reasons (eg. timeouts) an integration should allow the client to manually request the status of payments.
The payment object
Payment objects always have all possible attributes but if an attribute is not defined it will be null.
The following attributes are provided by all QR codes:
| Attribute | Type | Description |
|---|---|---|
| id | Integer | Our unique ID for the payment. The ID is sequential and starts from 1. |
| status | String | Indicates whether the payment was successful or failed. Possible values are: completed, error, pending |
| date | String | The UTC date of when the payment was started. The date is ISO8601 formatted, eg: 1999-12-31T23:00:00Z |
| totalAmount | Integer | The total amount in cents paid by the user. |
| tipAmount | Integer | If this feature is enabled for your account it will include the tip amount in cents paid by the user (totalAmount includes the tipAmount). |
| snapCode | String | The unique reference encoded in the QR code which is linked to your account. The code is always the same for payments made through the QR. |
| snapCodeReference | String | A reference that you can choose to be defined on the QR code which will always be the same for payments made through it. |
| userReference | String | If this feature is enabled for your account it will include the reference defined by the user when he made the payment. |
| statementReference | String | If the payment has been settled into your bank account it will include the statement reference for the associated settlement. This is the reference that will appear on your bank statement. |
| isVoucher | Boolean | Indicates whether or not a voucher was purchased for this payment. |
| isVoucherRedemption | Boolean | Indicates whether or not a voucher was used to perform this payment. |
| deviceSerialNumber | String | The unique serial number of the card terminal used to make the payment. |
| transactionType | String | Indicates the transaction type of the payment. Can either be 'payment' or 'refund'. |
| extra | Object | Any extra parameters that were sent as part of the payment URL. |
The following attributes will be returned on the payment object if you generate QR codes using the relevant payment parameters specified here:
| Attribute | Type | Description |
|---|---|---|
| requiredAmount | Integer | The amount in cents that was required to be paid by the user. |
| merchantReference | String | A unique reference defined by you and encoded in the QR code. |
| authCode | String | A random number that is generated by us for payments that have a required amount and merchant reference defined. The number is 6 digits long and will be displayed to the user if the payment was successful. |