Transaction
Overview
The transaction object represents a completed customer purchase and is central to loyalty processing. It is used to record purchases, trigger benefit calculations, log redemptions, award points, and support segmentation.
When to Use This Object
Include the transaction object in API calls when:
- Logging a purchase via
/transaction - Associating a loyalty payment with a purchase via
/payment - Providing event context in
/eventcalls for segmentation purposes
Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Yes | Unique identifier for the transaction (e.g., POS receipt or order ID) |
dateTime | string | Yes | ISO 8601 timestamp when the transaction was finalized |
totalAmount | number | Yes | Total transaction value before discounts or taxes (in smallest currency) |
otherDiscountsTotal | number | No | Other discounts not managed by the loyalty engine |
type | string | No | Optional context such as "dineIn" or "delivery". Responses echo this back as orderType |
items | array | Yes | Line items representing products or services sold |
payments | array | Yes | Breakdown of payment methods used (cash, card, points, etc.). Responses echo this back as meansOfPayment |
tags | array | No | Optional metadata flags for internal segmentation or tracking |
employee | string | No | Identifier of the staff member or operator handling the transaction |
Sample Payload
{
"transaction": {
"transactionId": "TX12345",
"dateTime": "2025-06-17T11:45:00Z",
"totalAmount": 5000,
"otherDiscountsTotal": 500,
"type": "dineIn",
"items": [
{
"lineId": 1,
"code": "PLU123",
"name": "Burger",
"departmentCode": "FOOD",
"departmentName": "Main Dishes",
"quantity": 2,
"subtotal": 3000,
"total": 2500,
"tags": ["combo"]
},
{
"lineId": 2,
"code": "PLU124",
"name": "Fries",
"departmentCode": "FOOD",
"departmentName": "Sides",
"quantity": 1,
"subtotal": 2000,
"total": 1500,
"tags": []
}
],
"payments": [
{
"type": "CASH",
"amount": 4000
},
{
"type": "CARD",
"amount": 1000
}
],
"tags": ["delivery"],
"employee": "Jane Doe"
}
}
info
- All monetary amounts must be integers in the smallest unit of the currency (cents or kuruş).
totalAmountandpayments[].amountreject decimals outright, so99.90fails validation where9990succeeds. - Ensure
transactionIdis unique within your system context. - The total of
paymentsshould equaltotalAmountto ensure payment consistency. - Unknown fields are rejected. The request body is validated strictly, so any key not listed above returns a
400rather than being ignored.
Request and response use different names
Three fields are named one way when you send them and another way when you read them back. Send the request name; expect the response name.
| You send | You read back | Notes |
|---|---|---|
payments | meansOfPayment | Same array, renamed internally |
type | orderType | Same value, renamed internally |
| (nothing) | openTime | Set by the API to your dateTime. Never send it on /transaction |
dateTime is the only timestamp you send.
Related Use
This object is closely tied to member, payment, and assets when processing redemptions or tracking loyalty activity.