Skip to content

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 Programs

    • LoyaltyPointDefinitionId The loyalty program ID. Multiple loyalty programs can be combined.
    • Loads Loading of points (zero, one or more)
      • Value Number of points
      • BalanceExpiresAt When this balance load should expire. If omitted (recommended) default business rules are applied.
      • AccountExpiresAt When this account load should expire. If omitted (recommended) default business rules are applied.
    • Redemptions
      • Value Points to be deducted (zero, one or more)
    • Purchases Voucher purchases (zero, one or more)

      • VoucherID The ID of the voucher that the customer purchased (this is configured in the Loyalty program screen as a ‘Buy vouchers @ POS’ type loyalty program).
      • Use If 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.
      • ValidFrom The date from which the voucher is valid to use. If omitted (recommended) default business rules are applied.
      • ExpiresAt The date the voucher expires. If omitted (recommended) default business rules are applied.
    • VoucherRedemptions Loyalty program specific vouchers that should be redeemed (zero, one or more)

      • SerialID The redeemed voucher serial number.
      • Void Whether the voucher should be marked as void instead of redeemed. Use this for voiding vouchers from backoffice applications.
  • VoucherRedemptions Vouchers 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)

    • SerialID The redeemed voucher serial number.
    • Void Whether the voucher should be marked as void instead of redeemed.
  • Context

    • ReceiptNr The sales receipt number / Online order number.
    • ShopId For the web store, this could be any value, e.g., web store.
    • PosId The terminal ID where the transaction was created.
    • OperatorId The POS operator. For the web store, this could be any value, or it can be left blank since no operator is involved.
    • Comment Additional 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:

  1. Load balance
  2. Redeem balance
  3. Purchase vouchers
  4. 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"
    }
}