Skip to content

Treazure Coupon

Coupon api requires api_switch scope.

Default headers

The following headers can be provided with all requests:

Property Description
SiteId ID of shop
PosId ID of pos
ReceiptReference Reference of transaction
UtcOffset Time offset in format HH:mm

Sequence diagram

The following flow indicates how a point-of-sale (POS) should integrate with Treazure Coupon and Treazure Promo:

sequenceDiagram
  autonumber
  POS->>POS: Customer enters coupon code
  POS->>Vault: Validate coupon
  Vault-->>POS: Result
  POS->>POS: Check result validity
  POS->>POS: Add coupon to basket
  POS->>Promo: Calculate basket
  Promo-->>POS: Result
  POS->>POS: Checkout
  loop For unique coupons
    POS->>Vault: Redeem coupon
    Vault-->>POS: Result
    POS->>POS: Check result
  end
  loop If rolling back
    POS->>Vault: Cancel coupon redemption
    Vault-->>POS: Result
    POS->>POS: Check result
  end

Unique vs generic

Coupon API's work with CouponDefinitionId. This is a generic code. This code is used to configure coupons in promotions.

Unique coupons cannot be directly fed into Treazure Promo calculation. These coupons have to be identified first using Coupon API. Use the validate endpoint for identifying either generic or unique coupons.

Coupon status

A coupon can have the following status:

Status Description
Created The coupon has been created, but not yet issued.
Active The coupon has been issued and can be redeemed.
PartiallyRedeemed The coupon has been redeemed partially (this allows for multiple redeems), meaning that it can be redeemed again.
Redeemed The coupon has been redeemed, it cannot be redeemed again.
Expired The coupon has been expired, it cannot be redeemed anymore.
Void The coupon has been voided, it cannot be redeemed anymore.