POST tokens/{id}/withdrawBalance?balanceToWithdraw={balanceToWithdraw}&pin={pin} · POS API
POST tokens/{id}/withdrawBalance?balanceToWithdraw={balanceToWithdraw}&pin={pin}
/tokens/{id}/withdrawBalance?balanceToWithdraw={balanceToWithdraw}&pin={pin}This allows you to withdraw an amount from the credit of the token. If the amount to be withdrawn is greater than the credit balance, the call is rejected.
Please create a checksum (see Security-Token) for the '{id}_{balanceToWithdraw}' ** (e.g. 'card123_1.99') and enter it in the 'SecurityToken' header.
Parameter
idstringErforderlichEnter the token read from a carrier medium here.
'cardId123'balanceToWithdrawdecimalErforderlichSpecify the amount to be withdrawn. Negative amounts are not allowed
'1.99'pinstringEnter the optional PIN here in case the field RequiresPin of the response of GET tokens/{id}/info is set to true. The PIN will usually be printed on the gift card
'PQ123'Request-Header
DevKey{Your Key}TrackingUnitId{trackingUnitId}SecurityToken{checksum over '{id}_{balanceToWithdraw}'} (in this example via 'card123_1.99')Kontext: tokens
Tokens are arbitrary, but always different, non-repeatable strings, which can be used for identification purposes as well as for of a consumer ('consumer') as well as for the identification of a credit balance ('balance'). As a rule these tokens are stored on any carrier medium and sent to a consumer in the form of a 'customer card' or 'gift card handed over. The consumer will have to present this carrier medium at the POS with his next purchases in order to access the to be able to access credit or to be credited with menio-Rewards.
Originaler Blueprint-Ausschnitt
### POST tokens/{id}/withdrawBalance?balanceToWithdraw={balanceToWithdraw}&pin={pin} [POST]
This allows you to withdraw an amount from the credit of the token. If the amount to be withdrawn is greater than the credit balance,
the call is rejected.
*Please create a checksum (see [Security-Token](#introduction/basic/security-token)) for the* **'{id}_{balanceToWithdraw}'** ** (e.g. 'card123_1.99') and enter it in the 'SecurityToken' header.
+ Parameters
+ id (string, `'cardId123'`) ... Enter the token read from a carrier medium here.
+ balanceToWithdraw (decimal, `'1.99'`) ... Specify the amount to be withdrawn. Negative amounts are not allowed
+ pin (optional, string, `'PQ123'`) ... Enter the optional PIN here in case the field `RequiresPin` of the response of GET tokens/{id}/info is set to `true`. The PIN will usually be printed on the gift card
+ Request
+ Headers
DevKey: {Your Key}
TrackingUnitId: {trackingUnitId}
SecurityToken: {checksum over '{id}_{balanceToWithdraw}'} (in this example via 'card123_1.99')
+ response 200
{
"oldBalance":3.49
"newBalance":1.5
}
+ response 500
// HTTP-InternalServerError: An unknown problem occurred during processing
{
"ErrorMessage": "some explanation"
"StackTrace": "text"
}
+ response 403
// HTTP-Forbidden: trackingUnitId is not yet activated by the merchant
+ Response 401
// HTTP-Unauthorized: DevKey, trackingUnitId or SecurityToken not specified/wrong
+ response 400
{
"ErrorId":123,
"ErrorText": "Details of the error"
}
// here all possible error codes incl. texts for this resource
// 13001: token unknown
// 13004: token is locked, no further action possible
// 13005: Only positive values are allowed for charging or lifting
// 13006: Limit for lift-off/recharge exceeded
// 13010: withdrawing balance not yet allowed in current store
// 13012: not enugh balance
// 13015: PIN is wrong, only if PIN is provided as query parameter