POST charges · Checkout API
POST charges
POST
/api/v1/profiles/{reference}/balance/charges[Coming soon] Postponement support.
Creates a new balance charge.
- Make sure to check if charge is allowed for the profile first.
Parameter
referencestringErforderlichThe unique token identifier or an OTP of the profile.
Request-Header
Content-Typeapplication/json; charset=utf-8AuthorizationToken <accessToken>Idempotency-Key<idempotencyKey>Security-Token<securityToken>Timestamp<timestamp>Originaler Blueprint-Ausschnitt
API Blueprint
### POST charges [POST /api/v1/profiles/{reference}/balance/charges]
Creates a new balance charge.
+ Make sure to check if charge is allowed for the profile first.
+ Parameters
+ reference (string, required) - The unique token identifier or an OTP of the profile.
+ Request (application/json; charset=utf-8)
+ Headers
Authorization: Token <accessToken>
Idempotency-Key: <idempotencyKey>
Security-Token: <securityToken>
Timestamp: <timestamp>
+ Attributes (object)
+ amount: 195 (number, required) - The amount to be deducted from the profile's balance, expressed in the currency's minor unit.
+ currency: EUR (string, required) - The currency of the amount to be deducted from the profile's balance.
+ reservation (object) - Contains balance reservation information. Include to perform the charge against reserved balance.
+ reference: `f032f960-9b87-43eb-b434-48a65d7d3efe` (string, required) - The reference of the reservation that will be charged.
+ cancelRemainingAmount: false (boolean) - Cancel the reservation after payment, causing any leftover reserved balance to become freely available again without waiting for the reservation to time out.
+ Body
{
"amount": 195,
"currency": "EUR",
"reservation": {
"reference": "f032f960-9b87-43eb-b434-48a65d7d3efe",
"cancelRemainingAmount": false
}
}
+ Schema
{
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"currency": {
"type": "string"
},
"reservation": {
"type": "object",
"properties": {
"reference": {
"type": "string",
"format": "uuid"
},
"cancelRemainingAmount": {
"type": "boolean"
}
}
}
}
}
+ Response 200 (application/json; charset=utf-8)
+ Attributes (object)
+ oldAmount: 1050 (number, required) - The old amount before making the charge request, expressed in the currency's minor unit.
+ newAmount: 855 (number, required) - The new amount after making the charge request, expressed in the currency's minor unit.
+ currency: EUR (string, required) - The currency of the amounts.
+ reservation (object)
+ oldAmountExcludingReservation: 850 (number) - The profile's balance prior to the transaction, factoring out the reservation that is used for the charge, expressed in the currency's minor unit.
+ newAmountExcludingReservation: 850 (number) - The profile's balance after the transaction, factoring out the potentially remaining amount of the used reservation, expressed in the currency's minor unit.
+ reservedAmountRemaining: 5 (number) - The remaining amount of the reservation, expressed in the currency's minor unit.
+ reservedAmountUsed: 195 (number) - The amount of the reservation used by the transaction, expressed in the currency's minor unit.
+ unreservedAmountUsed: 0 (number) - The amount of unreserved profile balance used by the transaction in case the reserved amount was insufficient to cover the whole transaction, expressed in the currency's minor unit.
+ Body
{
"oldAmount": 1050,
"newAmount": 855,
"currency": "EUR",
"reservation": {
"oldAmountExcludingReservation": 850,
"newAmountExcludingReservation": 850,
"reservedAmountRemaining": 5,
"reservedAmountUsed": 195,
"unreservedAmountUsed": 0
}
}
+ Schema
{
"type": "object",
"properties": {
"oldAmount": {
"type": "number"
},
"newAmount": {
"type": "number"
},
"currency": {
"type": "string"
},
"reservation": {
"type": "object",
"properties": {
"oldAmountExcludingReservation": {
"type": "number"
},
"newAmountExcludingReservation": {
"type": "number"
},
"reservedAmountRemaining": {
"type": "number"
},
"reservedAmountUsed": {
"type": "number"
},
"unreservedAmountUsed": {
"type": "number"
}
}
}
}
}