Selling Giftcards

You can sell giftcards through this API. You can only sell pre-created giftcards. This API does not allow you to create new giftcards on demand. We provide pre-printed, non-activated giftcards for this purpose. Send us an email to [email protected] if you are interested in selling giftcards (either your own or our community giftcards).

When you sell a giftcard, you are activating a giftcard in our system. Thats why we sometimes use the terms "activate" and "sell" interchangeably.

Fetch Giftcard Data

Before you can activate a giftcard you need to fetch the giftcard data from our API. You can find more info on how to find a giftcard in our API reference. Once you have the giftcard data, you can determine if and how you can activate that giftcard.

A possible scenario: imagine a customer grabs a giftcard off the stack in your store. During checkout, you'd want this giftcard to show up as an item with a price tag amongst your checkout items. With the help of our API, your cash register can fetch the giftcard and simply add it to the checkout items.

Eligibility to Sell

Once you received the giftcard from our API, before you can activate, you need to check if you are even ok to activate this giftcard. There is two attributes in the giftcard data for this purpose:

  • expectedAction: this field should have a value of activate. Otherwise this giftcard cannot be activated.

  • authorizedActions: this is an array of strings. This array needs to contain the string activate. Otherwise this giftcard cannot be activated by you.

Charge Amount

Fixed Amount Giftcards vs. Dynamic Amount Giftcards

Fixed amount giftcards have a predefined amount for activation. For example, if a giftcard has a fixed amount of 25,00 EUR then it is meant to be charged with 25,00 EUR (sold for 25,00 EUR).

Dynamic amount giftcards don't have a predefined amount for activation. You can charge those giftcards with a custom amount.

You can see if the giftcard is a fixed amount giftcard or a dynamic amount giftcard by checking in activation.isDynamicAmount.

If the giftcard is dynamic, you can use any custom amount between activation.minAmount and activation.maxAmount .

For fixed-amount giftcards, use the amount in activation.amount.

Remember that all our money values are given in cents.

Activate a Giftcard

To activate, you need to use the id and the accessToken from the giftcard object:

curl --request POST \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --user '<your-api-key>:<your-api-secret>' \
  --data-raw '{"accessToken": "di1l1bm6h3ben40eeipzsn"}' \
  https://posapi.zmyledemo.de/service/v1.1/gift_cards/<id>/activate

For dynamic-amount giftcards, you also provide the desired amount:

curl --request POST \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --user '<your-api-key>:<your-api-secret>' \
  --data-raw '{"accessToken": "di1l1bm6h3ben40eeipzsn", "amount": 5000}' \
  https://posapi.zmyledemo.de/service/v1.1/gift_cards/<id>/activate

Last updated

Was this helpful?