Get all payments
Returns all payments that have been made against your QR codes (SnapCodes). If no parameters are provided all payments made to you will be returned, subject to pagination. By default if the status parameter isn't provided completed, errored and pending payments will be returned.
A successful response is always an array and is paginated. If no payments match your query parameters the array will be empty. Payments are ordered by descending IDs, ie. the first payment will always be the latest in the returned result.
HTTP request
GET https://pos.snapscan.io/merchant/api/v1/paymentscurl -u your-api-key: "https://pos.snapscan.io/merchant/api/v1/payments"The above command returns JSON structured like this:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 2,
"status": "error",
"date": "2000-01-01T01:00:00Z",
"totalAmount": 2050,
"tipAmount": 550,
"requiredAmount": 1500,
"snapCode": "STB115",
"snapCodeReference": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
"userReference": "Jane Doe",
"merchantReference": "INV002",
"statementReference": "SNAPSCAN 20150109",
"authCode": "654321",
"extra": null,
"deviceSerialNumber": "R28K10HBQTX",
"transactionType": "payment",
},
{
"id": 1,
"status": "completed",
"date": "1999-12-31T23:00:00Z",
"totalAmount": 1000,
"tipAmount": 0,
"requiredAmount": 1000,
"snapCode": "STB115",
"snapCodeReference": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
"userReference": "John Doe",
"merchantReference": "INV001",
"statementReference": "SNAPSCAN 20150109",
"authCode": "123456",
"extra": null,
"deviceSerialNumber": "R28K10HBQTX",
"transactionType": "payment",
}
]Query parameters
All parameters are optional.
| Parameter | Description |
|---|---|
| startDate | Payments that were started at or after this time, eg: 2000-01-01T01:00:00Z |
| endDate | Payments that were started before this time, eg: 2000-01-01T01:00:00Z |
| status | A comma separated string of the following values: completed, error or pending, eg. completed,pending |
| snapCode | Payments with the SnapCode. |
| snapCodeReference | Payments with the SnapCode reference. |
| userReference | Payments with the user reference. |
| merchantReference | Payments with your reference. |
| statementReference | Payments included in the settlement with the provided reference. |
Response codes
| Description | Description | JSON Response |
|---|---|---|
| OK | 200 | Array of payment objects |
| Invalid parameter | 400 | Object containing a message key |