Post Transaction¶
/api/v1.0/LoyaltyVault/Account/{accountNumber}/Transaction
The post-transaction call is the final call when the basked is paid to close the transaction. This call will be used by the web shop when the sale is completed and by the OMS when the loyalty points are updated on fulfilment.
Request details¶
{
"loyaltyPrograms": [
{
"loyaltyPointDefinitionId": "string",
"loads": [
{
"value": 0,
"balanceExpiresAt": "2025-01-14T11:53:46.598Z",
"accountExpiresAt": "2025-01-14T11:53:46.598Z"
}
],
"redemptions": [
{
"value": 0
}
],
"purchases": [
{
"voucherId": "string",
"use": true,
"validFrom": "2025-01-14T11:53:46.598Z",
"expiresAt": "2025-01-14T11:53:46.598Z"
}
],
"voucherRedemptions": [
{
"serialId": "string",
"void": true
}
]
}
],
"voucherRedemptions": [
{
"serialId": "string",
"void": true
}
],
"context": {
"receiptNr": "string",
"shopId": "string",
"posId": "strin",
"operatorId": "string",
"comment": "string"
}
}
-
Loyalty ProgramsLoyaltyPointDefinitionIdThe loyalty program ID. Multiple loyalty programs can be combined.LoadsLoading of points (zero, one or more)ValueNumber of pointsBalanceExpiresAtWhen this balance load should expire. If omitted (recommended) default business rules are applied.AccountExpiresAtWhen this account load should expire. If omitted (recommended) default business rules are applied.
RedemptionsValuePoints to be deducted (zero, one or more)
-
PurchasesVoucher purchases (zero, one or more)VoucherIDThe ID of the voucher that the customer purchased (this is configured in the Loyalty program screen as a ‘Buy vouchers @ POS’ type loyalty program).UseIf the purchased voucher is to be immediately redeemed in this same transaction. Note: Points are not redeemed manually when the voucher is purchased, i.e., it should not be included in the ‘redemptions’ above, as the points are automatically redeemed in Treazure as a result of buying the voucher.ValidFromThe date from which the voucher is valid to use. If omitted (recommended) default business rules are applied.ExpiresAtThe date the voucher expires. If omitted (recommended) default business rules are applied.
-
VoucherRedemptionsLoyalty program specific vouchers that should be redeemed (zero, one or more)SerialIDThe redeemed voucher serial number.VoidWhether the voucher should be marked as void instead of redeemed. Use this for voiding vouchers from backoffice applications.
-
VoucherRedemptionsVouchers redemptions which are not linked to a loyalty program. Important to note that these are only vouchers issued in Treazure and not voucher attributes assigned in the CRM system (zero, one or more)SerialIDThe redeemed voucher serial number.VoidWhether the voucher should be marked as void instead of redeemed.
-
ContextReceiptNrThe sales receipt number / Online order number.ShopIdFor the web store, this could be any value, e.g., web store.PosIdThe terminal ID where the transaction was created.OperatorIdThe POS operator. For the web store, this could be any value, or it can be left blank since no operator is involved.CommentAdditional comment. Not visible for customer.
Combine transactions¶
It is possible to combine multiple operations for multiple loyalty programs in a single transaction. All operations are performed transactional.
The order of processing is:
- Load balance
- Redeem balance
- Purchase vouchers
- Redeem vouchers
OMS transaction API call example¶
Below is an example of the API call when the OMS fulfils the order and confirms the points earned.
{
"LoyaltyPrograms": [
{
"LoyaltyPointDefinitionld": "LOY22-BuyVouchers",
"Loads": [
{
"Value": 1000
}
]
}
],
"Context": {
"Shopld": "Webshop",
"Comment": "Order 12345 fulfilled"
}
}
Web shop API call example¶
Below is an example of the API call when the web shop does the transaction API call.
{
"loyaltyPrograms": [
{
"loyaltyPointDefinitionId": "LOY22-IssueThreshold",
"voucherRedemptions": [
{
"serialId": "6666160395443995410"
}
]
}
],
"voucherRedemptions": [
{
"serialId": "6666270046419031265"
}
],
"context": {
"shopId": "Webshop",
"comment": "Order 12345"
}
}