Activate a Giftcard
Activate a Giftcard
POST
/service/v1.1/gift_cards/:giftcardId/activate
Activate a giftcard. Activating is charging a giftcard with money, i.e. selling a giftcard for a certain amount.
Path Parameters
giftcardId
string
A giftcard's unique ID.
Request Body
accessToken
string
The access token of the giftcard that you want to activate.
metadata
object
A set of key-value pairs that you can attach to this giftcard transaction (activation).
{
"expectedAction": "redeem",
"authorizedActions": [
"redeem",
"activate"
],
"availableBalance": 2000,
"balance": 2000,
"id": "18jja4mf08fn08f7gp9l",
"initialAmount": 2000,
"shortId": "QTHX",
"accessToken": "hg84zhgnzuigui4hg3hg7834",
"currency": "EUR",
"transactions": [
{
"confirmedAt": "20171124T213259Z",
"statementDescriptor": "Aktiviert von DeinRestaurant",
"retailerId": "15h3k83g45anmatlbyie",
"amount": 2000,
"id": "18k5ejn09hm88394qz32"
}
]
}
Example Request
curl -X POST https://posapi.zmyledemo.de/service/v1.1/gift_cards/18jja4mf08fn08f7gp9l/activate \
-u {api_key}:{api_secret}
-d '{"accessToken": "hg84zhgnzuigui4hg3hg7777", "metadata": { "store": "Filiale-01", "bonnummer": "12" }}'
Response Error Codes
error code
reason
api:io:missingRequiredParam
A required parameter is missing.
api:io:malformedId
The giftcard ID is not right.
api:io:malformedToken
The access token is not right.
api:biz:noSuchGiftcard
The API could not find the giftcard. This either means that such a giftcard simply does not exist, or that you are not authorized to access this giftcard at all (not your giftcard or not your network).
api:biz:notAuthorizedToActivateGiftcard
You don't have permission to activate this giftcard.
api:biz:notPreprintedGiftcard
This giftcard can not be activated.
api:biz:giftcardAlreadyActive
This giftcard was already activated.
api:biz:retailerStatus
Your account is not in good standing.
Last updated
Was this helpful?