curl --request POST \
--url https://{host}/bonus/v1/payments \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"memberId": "12396909",
"operationId": "8d2f6b1e-4c7a-4f3b-b6d9-2a5e7c9f1d34",
"amount": 25.5,
"reserveAvailable": false,
"instantCapture": false,
"metadata": {
"storeId": "475",
"receiptId": "475-0002-000381"
}
}
'{
"transactionId": 9154377,
"amount": 25.5,
"conversionRate": 1
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Create a payment
The POS or your backend calls this when a customer pays with bonus. It takes the amount off the customer’s
active account as a transaction of the type Payment.
With instantCapture=false the amount is reserved first. It leaves the available balance at once, and the
transaction waits until you capture it with POST /v2/transactions/{id}/capture, when the purchase is final, or
release it with POST /v2/transactions/{id}/cancel. With instantCapture=true the payment is final at once. To
pay bonus back after a return, call POST /v2/transactions/{id}/refund.
The account must be allowed to spend and must have the bonus available. With reserveAvailable=true a customer
who has less than amount available pays with all there is, and the response’s amount says how much that was.
With false the call is refused with NotEnoughMoney.
The call is idempotent on operationId: repeating it with the same id and the same values returns the first
answer and takes nothing twice. The same id with another customer, amount, reserveAvailable or
instantCapture is refused with InconsistentRetry.
curl --request POST \
--url https://{host}/bonus/v1/payments \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"memberId": "12396909",
"operationId": "8d2f6b1e-4c7a-4f3b-b6d9-2a5e7c9f1d34",
"amount": 25.5,
"reserveAvailable": false,
"instantCapture": false,
"metadata": {
"storeId": "475",
"receiptId": "475-0002-000381"
}
}
'{
"transactionId": 9154377,
"amount": 25.5,
"conversionRate": 1
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Authorizations
Body
The payment to create.
A payment with bonus.
Response
The payment was reserved or made, or an earlier call with the same operationId had done so already. amount is what was taken.
The payment that was created.