Void payments
Release all or part of a pre-authorized amount that you no longer want to capture.
A void cancels all or part of a pre-authorization. The voided amount is released to your customer and can't be captured anymore. Void the amount you no longer need, for example when your customer cancels the order or part of it.
Voids work on transactions created with capture_mode set to manual or delayed, as long as they haven't been captured yet. To return money after a capture, create a refund instead.
Void the full amount
Send a POST request to the voids endpoint of the transaction. No request body is needed:
curl https://api.pay.paytrim.com/v1/orders/$ORDER_ID/transactions/$TRANSACTION_ID/voids/ \
--user "$API_KEY:" \
--request POSTThe full remaining authorized amount is released.
Void a partial amount
Send the amount to void, in the smallest currency unit, and a description to the voids/amount endpoint. This example reduces a € 100.00 pre-authorization by € 25.00:
curl https://api.pay.paytrim.com/v1/orders/$ORDER_ID/transactions/$TRANSACTION_ID/voids/amount/ \
--user "$API_KEY:" \
--header "Content-Type: application/json" \
--data '{
"amount": 2500,
"description": "Void 25.00 of the full 100.00"
}'| Field | Required | Description |
|---|---|---|
amount | Yes | Amount to void in the smallest currency unit. |
description | Yes | Description of the void. |
The pre-authorization is reduced to € 75.00, which you can still capture.