Capture API
POST/rest/capture
/rest/captureProduction URL
https://api.betterpayment.de/rest/captureTest URL
https://testapi.betterpayment.de/rest/captureCapture API is used to capture funds from previously authorized transactions. Partial captures are supported, allowing you to capture less than the authorized amount. However, the captured amount cannot exceed the original authorization. A successful capture will change the transaction status to completed.
note
Partial Captures: You can capture multiple times as long as the total captured amount does not exceed the original authorization. This is useful when you want to capture amounts in stages or when the final amount is less than originally authorized.
Capture API Request
transaction_idStringrequiredID of the authorized transaction to be captured
amountFloatWhen not given, full authorized amount will be captured. Can be smaller but not larger than the authorized amount
vatFloatVAT of the captured amount, if known
Example Request
POST /rest/capture
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"transaction_id": "e06dec72-788e-471a-a33f-a9d0deeeb4df",
"amount": 12.40,
"vat": 1.98
}
Capture API Response
transaction_idStringID of the captured transaction
status_codeIntegerStatus code of the transaction (3 for completed)
statusStringStatus of the transaction (typically "completed")
order_idStringOrder ID of the transaction
messageStringAny message returned from the payment processor
card_last_fourStringLast four digits of the card (for card payments)
card_expiry_yearIntegerCard expiry year (for card payments)
card_expiry_monthIntegerCard expiry month (for card payments)
card_brandStringCard brand (e.g., VISA, Mastercard)
error_codeIntegerError code for the response (0 for success)
Example Response
{
"transaction_id": "e06dec72-788e-471a-a33f-a9d0deeeb4df",
"status_code": 3,
"status": "completed",
"order_id": "AUTH-12345",
"message": null,
"card_last_four": "0509",
"card_expiry_year": 2026,
"card_expiry_month": 12,
"card_brand": "VISA",
"error_code": 0
}