Gift Cards
Add Gift Card
post /giftcards.jsonThe Add Gift Card endpoint is only called when the system is configured to be using gift cards of type voucher (printed on receipt printer).
Delivery Text
Email address when using deliverytype "email"
Mobile in MSISDN format when using deliverytype "sms"
Product reference (usually SKU)
Gift Card PIN
{ "type": "giftcard", "currencycode": "USD", "transactions": [ { "moneyamount": "500.00", "merchant_reference": "SC101" } ]}
{ "giftcard": { "type": "giftcard", "currencycode": "USD", "cardnumber": "95116763063530548720", "cardnumber_display": "95** **** **** **** 8720", "redeemable": true, "date_expires": 1866322799, "date_created": 1550669776, "moneyamount": "500.00", "requirespin": false, "transactions": [ { "transactionid": "3458", "date": 1550669776, "moneyamount": "500.00", "merchant_reference": "SC101", "staff_reference": null, "transaction_reference": null } ] }, "addedtransactionids": [ "3458", "a8e9cbd970ebfc2c20037b8e41c7e3c0aa522238" ], "receipttext": null, "print_voucher": false, "print_pin": null}
HTTP Status Code Summary | |
---|---|
200 | Returns an object of type GiftCardResponse |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Get Gift Card
get /giftcards/{cardnumber}.jsonValidate gift card PIN.
{ "type": "giftcard", "currencycode": "USD", "cardnumber": "95123456789012345678", "cardnumber_display": "95** **** **** **** 5678", "redeemable": true, "date_expires": 1888181999, "date_created": 1569923445, "moneyamount": "371.00", "requirespin": false, "transactions": [ { "transactionid": "3456", "date": 1569923445, "moneyamount": "500.00", "merchant_reference": "SC101", "staff_reference": null, "transaction_reference": null }, { "transactionid": "3457", "date": 1570540431, "moneyamount": "-129.00", "merchant_reference": "SC102", "staff_reference": null, "transaction_reference": null } ]}
HTTP Status Code Summary | |
---|---|
200 | Returns an object of type GiftCardResponse. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The URL is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Add Gift Card Transaction
post /giftcards/{cardnumber}/transactions.jsonGift Card PIN (Required if requirespin is set to true).
{ "moneyamount": "-299.00", "merchant_reference": "SC102"}
{ "giftcard": { "type": "giftcard", "currencycode": "USD", "cardnumber": "95116763063530548720", "cardnumber_display": "95** **** **** **** 8720", "redeemable": true, "date_expires": 1866322799, "date_created": 1550669776, "moneyamount": "201.00", "requirespin": false, "transactions": [ { "transactionid": "3458", "date": 1550669776, "moneyamount": "500.00", "merchant_reference": "SC101", "staff_reference": null, "transaction_reference": null }, { "transactionid": "3459", "date": 1550669776, "moneyamount": "-299.00", "merchant_reference": "SC102", "staff_reference": null, "transaction_reference": null } ] }, "addedtransactionids": [ "3459", "a57a121adda749bd7c8e37d13913724cabe7c56e" ], "receipttext": null, "print_voucher": false, "print_pin": null}
HTTP Status Code Summary | |
---|---|
200 | Returns and object of type GiftCardResponse |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The URL is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Delete Gift Card Transactions
delete /giftcards/{cardnumber}/transactions.jsonUsed for rollback of transaction that has been performed.
[ "3459", "a57a121adda749bd7c8e37d13913724cabe7c56e"]
true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The URL is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Objects
DeliveryTypestring
email
Emailpreprinted
PrePrintedprintout
Printoutsms
SMS
GiftCardobject
The gift card object.
The type of gift card.
Currency for the gift card. (ISO 4217, alpha-3)
The unique ID of the gift card (card number).
The masked card number, used for public display.
If true, the gift card is active for redeem with the moneyamount available.
The date for the expiration of the gift card. (If passed, the gift card is invalid)
The date that the gift card was created.
Current monetary value of the gift card.
Indicates if PIN is required when redeeming the gift card.
The transactions for this gift card. An array of GiftCardTransaction.
GiftCardResponseobject
Response object for gift card operations.
The gift card object.
An array of transactionids added by the request. (Used for rollback)
Optional text printed on the receipt.
If set to true, a gift card voucher should be printed.
Optional PIN printed for the gift card (usually 4-6 digits).
GiftCardTransactionobject
Gift card transaction object.
The unique ID of this transaction.
The date that this transaction occurred.
Money added or subtracted by this transaction.
Optional merchant/store reference for this transaction. (Sitoo POS will send warehouse external ID in this field)
Optional staff reference for this transaction.
Optional reference for this transaction. (Sitoo POS will send receipt ID in this field)
GiftCardTypestring
giftcard
Gift Cardcreditnote
Credit Note
Moneystring
Timestampinteger
Number of seconds since the Unix Epoch.