curl --request POST \
--url https://{host}/bonus/v1/transactions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"toAccountId": 48213,
"operationId": "3f1c9a52-8a4e-4d0b-9a3e-5f0d6c2b7e11",
"amount": 150,
"transactionType": "CampaignBonus",
"metadata": {
"storeId": "475",
"receiptId": "475-0002-000381"
},
"instantCapture": true,
"expirationDate": "2027-12-31T23:59:59Z"
}
'{
"transactionId": 9154290,
"amount": 150
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Create a transaction on an account
Your backend calls this to add bonus to an account, or to take bonus off it, when it knows the account by its
accountId: for example to post an accrual your own system calculated. To address the account through the
customer, call POST /v1/members/{memberId}/transactions. To let a customer pay with bonus, call
POST /v1/payments: the types Payment and Refund are refused here.
A positive amount adds bonus to the account in toAccountId, a negative one takes it off. With
instantCapture left at true the transaction is final at once. With false the amount is only reserved and
the transaction waits: finish it with POST /v2/transactions/{id}/capture or
POST /v2/transactions/{id}/cancel, or send autoCaptureDate and Lobyco captures it at that time.
With fromAccountId the call moves bonus between two accounts: the amount comes from that account, never more
than it has available, and all it has available when amount is left out.
Where the account type has a maximum balance, an amount that would take the account over it is cut down to what
still fits, and the response’s amount says how much was booked. An account that is already at its maximum
refuses the call with AccountTypeMaxBalanceExceeded. Taking bonus off is not checked against the balance,
which can go below zero.
The call is idempotent on operationId: repeating it with the same id and the same values returns the first
answer and books nothing new. The same id with another account, amount, type or instantCapture is refused with
InconsistentRetry.
curl --request POST \
--url https://{host}/bonus/v1/transactions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"toAccountId": 48213,
"operationId": "3f1c9a52-8a4e-4d0b-9a3e-5f0d6c2b7e11",
"amount": 150,
"transactionType": "CampaignBonus",
"metadata": {
"storeId": "475",
"receiptId": "475-0002-000381"
},
"instantCapture": true,
"expirationDate": "2027-12-31T23:59:59Z"
}
'{
"transactionId": 9154290,
"amount": 150
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Authorizations
Body
The transaction to create.
A transaction to create on an account.
Response
The transaction was created, or an earlier call with the same operationId had created it already. amount is what was booked.
The transaction that was created.