Treazure Giftcard - Frontend API¶
Giftcard api requires api_switch scope.
Gift card identification¶
Gift card provider can be manully identified by providing parameter SwitchId. This parameter is optional, if not provided this is automatically determined based on tender configuration.
A gift card itself can be identified in 2 ways:
CardIdthis is the barcode that is usually scanned on a Point-of-SaleSerialNumber+ScratchCodethis information is generally entered on a website. These properties can be printed on a physical gift card, with the latter being under a scratch-off mask.
Hint
Note that either CardId or SerialNumber object is to be provided. They cannot be provided both as this will result in 400.
Status¶
A gift card can have the following status:
| Status | Description |
|---|---|
Refunded |
Gift card is refunded. |
Expired |
Gift card is expired. Balance is zero. |
Void |
Gift card is void. Balance is zero. |
Created |
Gift card is ready for sale and does not yet have balance. |
Active |
Gift card is active and has balance. |
Redeemed |
Gift card is fully redeemed/depleted. Balance is zero. |
History¶
Gift card balance mutations are recorded in history.
This history contains:
- ShopId
- PosId
- ReceiptNr
- OperatorId
- Comment
- Old status
- New status
- Balance mutation
- Balance
History is available on two levels: regular and condensed. Condensed history is recommended for human evalution. Regular history contains reconciliation information and is intended for booking systems.
Expiry¶
Gift cards can expire. By default, expiry is disabled.
When expiring, balance is fully redeemed.
Article set restriction¶
Some giftcards return an article set code restriction. This means this gift card can only be used to purchase specific items.
This code does not indicate what items the restriction applies to. This information can be obtained for a basket using endpoint /PemCalculation-1-0/json/GetArticleSetSummary of Treazure Promo.
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 |
Get balance¶
Endpoint: /api/v1.0/Switch/giftcard/GetBalance
Returns the giftcard information for the specified cardId/barcode or serialnumber/scratch-code.
Activate / Load¶
Endpoint: /api/v1.0/Switch/giftcard/Activate
Activates/loads giftcard. Use this to sell a
Cancel¶
Endpoint: /api/v1.0/Switch/giftcard/Activate/Cancel
Cancels activation/load of giftcard. Can only be executed immediately after activate/load.
Redeem¶
Endpoint: /api/v1.0/Switch/giftcard/Redeem
Cancel¶
Endpoint: /api/v1.0/Switch/giftcard/Redeem/Cancel
Cancels redemption of giftcard. Can only be executed immediately after redemption.
Issue¶
Endpoint: /api/v1.0/Switch/giftcard/Issue
Issues a virtual giftcard.