/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": 99.90
}
],
"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": "transactions-unique-id",
"confirmation": "transactions-unique-id"
}
]
}
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 | POS-generated transaction identifier |
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 | Internal purchase key |
confirmation | string | Unique identifier for the transaction |
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 |
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