REST API v2.8

Gift Cards

Create, validate, redeem and refill gift cards.

Get Gift Card

Endpoint

GET accounts/{accountid}/sites/{siteid}/giftcards/{cardnumber}

Parameters

pin

Validate gift card PIN.

HTTP Response Status

200

OK. Returns data (see below).

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.

Returns

Returns a giftcardresponse.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/giftcards/95123456789012345678.json

Response

{ "type": "giftcard", "currencycode": "SEK", "cardnumber": "95123456789012345678", "cardnumber_display": "95** **** **** **** 5678", "redeemable": true, "date_expires": 1570571999, "date_created": 1538387445, "moneyamount": "371.00", "requirespin": false, "transactions": [ { "transactionid": "3456", "date": 1538387445, "moneyamount": "500.00", "merchant_reference": "SC101", "staff_reference": null }, { "transactionid": "3457", "date": 1539004431, "moneyamount": "-129.00", "merchant_reference": "SC102", "staff_reference": null } ] }

Add Gift Card

Endpoint

POST accounts/{accountid}/sites/{siteid}/giftcards

Request body

See giftcard for fields.
Required fields:
typecurrencycode

Parameters

deliverytype

Delivery Type ValueDescription"printout"Printout"preprinted"PrePrinted"email"Email"sms"SMSDefault: "preprinted"

deliverytext

Delivery Text

email

Email address when using deliverytype "email"

mobile

Mobile in MSISDN format when using deliverytype "sms"

product_reference

Product reference (usually SKU)

pin

Gift Card PIN

HTTP Response Status

200

OK. Returns data (see below).

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.

Returns

Returns giftcardresponse if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/giftcards.json?deliverytype=preprinted { "type": "giftcard", "currencycode": "SEK", "cardnumber": "95116763063530548720", "transactions": [ { "moneyamount": "500.00", "merchant_reference": "SC101" } ] }

Response

{ "giftcard": { "type": "giftcard", "currencycode": "SEK", "cardnumber": "95116763063530548720", "cardnumber_display": "95** **** **** **** 8720", "redeemable": true, "date_expires": 1575413999, "date_created": 1543832754, "moneyamount": "500.00", "requirespin": false, "transactions": [ { "transactionid": "3458", "date": 1543832754, "moneyamount": "500.00", "merchant_reference": "SC101", "staff_reference": null } ] }, "addedtransactionids": [ "3458", "a8e9cbd970ebfc2c20037b8e41c7e3c0aa522238" ], "receipttext": null, "print_voucher": false, "print_pin": null }

Add Gift Card Transaction

Endpoint

POST accounts/{accountid}/sites/{siteid}/giftcards/{cardnumber}/transactions

Request body

See giftcardtransaction for fields.
Required fields:
moneyamount

Parameters

pin

Gift Card PIN (Required if requirespin is set to true).

HTTP Response Status

200

OK. Returns data (see below).

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.

Returns

Returns giftcardresponse if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/giftcards/95116763063530548720/transactions.json { "moneyamount": "-299.00", "merchant_reference": "SC102" }

Response

{ "giftcard": { "type": "giftcard", "currencycode": "SEK", "cardnumber": "95116763063530548720", "cardnumber_display": "95** **** **** **** 8720", "redeemable": true, "date_expires": 1575413999, "date_created": 1543832754, "moneyamount": "201.00", "requirespin": false, "transactions": [ { "transactionid": "3458", "date": 1543832754, "moneyamount": "500.00", "merchant_reference": "SC101", "staff_reference": null }, { "transactionid": "3459", "date": 1543832754, "moneyamount": "-299.00", "merchant_reference": "SC102", "staff_reference": null } ] }, "addedtransactionids": [ "3459", "a57a121adda749bd7c8e37d13913724cabe7c56e" ], "receipttext": null, "print_voucher": false, "print_pin": null }

Delete Gift Card Transactions

Used for rollback of transaction that has been performed.

Endpoint

DELETE accounts/{accountid}/sites/{siteid}/giftcards/{cardnumber}/transactions

Request body

String array (as received in addedtransactionids in giftcardresponse)

HTTP Response Status

200

OK. Returns data (see below).

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.

Returns

Returns true if successful.

Example

Request

DELETE https://api.mysitoo.com/v2/accounts/1500/sites/1/giftcards/95116763063530548720/transactions.json [ "3459", "a57a121adda749bd7c8e37d13913724cabe7c56e" ]

Response

true