Gift Card Codes via API

LeahLeah Moderator, Lightspeed Staff Posts: 222 moderator

We’re introducing a new permission scope that will make it possible to view gift card codes in the API.

The “employee:customers_view_gift_card_numbers” scope is now available to be used as part of the authorization grant flow. In order to authorize the scope, the authorizing employee within the merchant account must have the equivalent “Customers - View Gift Card Numbers” employee access right.

This new permission scope will enable authorized integrators to view and synchronize gift card codes from the Retail to external platforms.

Without the scope, all but the last four digits of the gift card codes will be masked in the response payloads.

GET https://api.lightspeedretail.com/API/Account/#/CreditAccount.json?giftCard=true

{

"@attributes": {

"count": "1",

"offset": "0",

"limit": "100"

},

"CreditAccount": {

"creditAccountID": "1",

"name": "Gift Card 2022-01-05",

"code": "********5678",

"creditLimit": "0",

"description": "",

"giftCard": "true",

"archived": "false",

"timeStamp": "2022-01-05T20:33:35+00:00",

"customerID": "1",

"balance": "-100"

}

}


If the scope is authorized, the value will be unmasked:


GET https://api.lightspeedretail.com/API/Account/#/CreditAccount.json?giftCard=true


{

"@attributes": {

"count": "1",

"offset": "0",

"limit": "100"

},

"CreditAccount": {

"creditAccountID": "1",

"name": "Gift Card 2022-01-05",

"code": "230012345678",

"creditLimit": "0",

"description": "",

"giftCard": "true",

"archived": "false",

"timeStamp": "2022-01-05T20:33:35+00:00",

"customerID": "1",

"balance": "-100"

}

}

API Support
Lightspeed HQ
Sign In or Register to comment.