/transactions
Overview
This endpoint retrieves purchase history for all members in the business. Unlike /member/transactions, this endpoint does not require a specific member to be identified and returns transactions across all members.
When to Use This Endpoint
Use this endpoint in the following cases:
- To generate business-wide reports on all purchases
- To analyze sales patterns and trends across all members
- To export transaction data for business intelligence or accounting
- To support business analytics and reporting needs
- To audit or review all purchase activities in the system
Key Considerations
- By default, returns transactions from the last 90 days when no date range is specified
- Results can be filtered by custom date range using
fromDateandtoDate - Pagination is supported through the
limitparameter - Includes both completed and cancelled transactions (identified by the
cancelledflag) - Does not require a specific member to be identified
- Returns transactions with member identification (
membershipKey) included
Request Details
Method & URL
POST /transactions
See API Servers for the base URL to use in place of {{server}}.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
x-api-key | string | Yes | API key for authentication |
x-source-type | string | Yes | Origin of the request (e.g., POS, Web) |
x-source-name | string | Yes | Name of the client or integration system |
x-pos-id | string | Yes | POS terminal identifier |
x-branch-id | string | Yes | Branch or store location identifier |
Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | No | 40 | Max number of records (1-100) |
offset | integer | No | 0 | Number of records to skip for pagination (≥0) |
fromDate | string | No | 90 days ago | Filter start date (ISO 8601 format) |
toDate | string | No | Now | Filter end date (ISO 8601 format) |
Request Example
curl --location --request POST 'https://{{server}}/v1/transactions' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{api-key}}' \
--header 'x-source-type: POS' \
--header 'x-source-name: pos_terminal_01' \
--header 'x-pos-id: POS001' \
--header 'x-branch-id: BR001' \
--data-raw '{
"limit": 10,
"offset": 0,
"fromDate": "2024-01-01T00:00:00Z",
"toDate": "2024-12-31T23:59:59Z"
}'
Success Response
{
"status": "success",
"transactions": [
{
"createdAt": "2024-06-15T15:00:00.000Z",
"openTime": "2024-06-15T14:00:00.000Z",
"transactionId": "TXN-001",
"totalAmount": 9990,
"tags": [],
"employee": "NONE",
"sourceName": "MyPOS",
"sourceVersion": "1.0.0",
"sourceType": "POS",
"cancelled": false,
"otherDiscountsTotal": 0,
"meansOfPayment": [
{
"type": "CASH",
"amount": 9990
}
],
"items": [
{
"lineId": 1,
"code": "ITEM-001",
"name": "Coffee",
"departmentCode": "BVRG",
"departmentName": "Beverages",
"quantity": 2,
"grossAmount": 990,
"netAmount": 990,
"tags": []
}
],
"branchId": "BRANCH-01",
"posId": "POS-01",
"membershipKey": "member-unique-id",
"key": "purchase-db-id",
"confirmation": "our-sale-code-uuid",
"deals": [
{
"key": "62261a65d66c6be0a63c051f",
"name": "Spring 10%",
"appliedAmount": 500
}
],
"posDeals": []
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
status | string | Request status indicator |
transactions | array | Array of transaction objects |
createdAt | string | ISO 8601 timestamp when transaction was created |
openTime | string | ISO 8601 timestamp when transaction was opened |
transactionId | string | The POS order id sent on the sale |
totalAmount | number | Total transaction amount |
tags | array | Transaction-level tags |
employee | string | Employee identifier |
sourceName | string | Name of the source system |
sourceVersion | string | Version of the source system |
sourceType | string | Type of source (POS, KIOSK, etc.) |
cancelled | boolean | Whether the transaction was cancelled |
otherDiscountsTotal | number | Other discounts not managed by the loyalty engine |
meansOfPayment | array | Payment methods used |
items | array | List of purchased items |
branchId | string | Branch identifier where transaction occurred |
posId | string | POS terminal identifier |
membershipKey | string | The member's membership key |
key | string | Our internal id of the stored sale |
confirmation | string | Our code for the sale, returned by /submitPurchase. Earn and gift rows in /assets and /payments carry this same code |
deals | array | Loyalty deals applied to the sale, as reported on /submitPurchase. Each entry has key (the key the POS reported, normally the deal id), name (the deal name, empty when the key matches no deal of this business) and appliedAmount (the amount the POS reported for the deal, in the smallest currency unit, or null when it reported none) |
posDeals | array | POS deals applied to the sale, as reported on /submitPurchase. Same entry shape as deals |
Error Response Examples
Missing Required Header
{
"status": "error",
"error": {
"code": "101",
"message": "Missing X-Api-Key header"
}
}
Invalid Date Format
{
"status": "error",
"error": {
"code": "1002",
"message": "Invalid fromDate format. Use ISO 8601 format"
}
}
Internal Server Error
{
"status": "error",
"error": {
"code": "1020",
"message": "Internal server error"
}
}
Error Codes
| Code | Description |
|---|---|
101 | Missing X-Api-Key header |
102 | Missing X-Source-Type header |
103 | Missing X-Source-Name header |
104 | Missing X-Pos-Id header |
105 | Missing X-Branch-Id header |
1002 | Invalid fromDate format |
1003 | Invalid toDate format |
1011 | Invalid limit (must be an integer between 1 and 100) |
1012 | Invalid offset (must be an integer of 0 or more) |
1020 | Internal server error |
Related Use Cases
- Generating business-wide sales and purchase reports
- Analyzing sales trends and patterns across all members
- Exporting transaction data for business intelligence tools
- Supporting business analytics and reporting needs
- Auditing all purchase activities across the business
- Monitoring business performance and customer behavior