Create a Transaction Intent
Create a Transaction Intent
PUT
/service/v1.1/transaction_intents
Create a new transaction intent. This will reserve funds on a giftcard and hold them for you for redeeming. You can then commit the action by confirming the transaction intent. If you do not confirm nor cancel the transaction intent, then the funds will automatically be released back into the giftcard after some time (usually 30 minutes).
Request Body
giftcardId
string
Unique ID of the giftcard that you want to redeem.
accessToken
string
Access token of the giftcard that you want to redeem.
amount
integer
Amount that you want to redeem. Must be a positive integer representing a money amount in the smallest currency unit. May not exceed the gift card's available balance.
metadata
object
A set of key-value pairs that you can attach to this transaction intent. This metadata will be copied into the gift card transaction upon confirmation.
{
"expiresAt": "20171127T052256Z",
"statementDescriptor": "MegaStore",
"retailerId": "15h3k83g45anfnwibyie",
"amount": 100,
"giftcardId": "18jja4mf08fn08f7gp9l",
"id": "18k78hj3e2j65686vhipw560u6sm",
"status": "NEEDS_CONFIRMATION",
"createdAt": "20171127T045256Z",
"currency": "EUR",
"metadata": {
"store": "megastore-filiale-holzweg",
"receiptNumber": "Bon 2017-79732"
}
}
Example Request
curl -X PUT https://posapi.zmyledemo.de/service/v1.1/transaction_intents \
-u {api_key}:{api_secret}
-d '{"giftcardId": "18jja4mf08fn08f7gp9l","accessToken": "hg84zhgnzuigui4hg3hg7777","amount": 100,"metadata": {"store": "megastore-filiale-holzweg","receiptNumber": "Bon 2017-79730"}}'
Response Error Codes
error code
reason
api:io:missingRequiredParam
A required parameter is missing.
api:io:malformedNumber
The amount is not a positive integer.
api:io:negativeNumber
The amount is not a positive integer.
api:io:malformedId
The gift card ID is not right.
api:io:malformedToken
The access token is not right.
api:biz:noSuchGiftcard
The API could not find the gift card. This either means that such a gift card simply does not exist, or that you are not authorized to access this gift card at all (not your gift card or not your network).
api:biz:notAuthorizedToRedeemGiftcard
You don't have permission to redeem this gift card.
api:biz:unpaidGiftcard
The gift card was not paid yet.
api:biz:insufficientFunds
The amount you provided exceeds the available balance of the gift card.
api:biz:retailerStatus
Your account is not in good standing.
Last updated
Was this helpful?