Payments: Capture
La référence API est disponible en anglais uniquement.
POST/payments/{payment_id}/capture
Captures the funds for a previously authorized payment intent where capture_method was set to manual and the payment is in a requires_capture state.
Upon successful capture, the payment status usually transitions to succeeded.
The amount_to_capture can be specified in the request body; it must be less than or equal to the payment's amount_capturable. If omitted, the full capturable amount is captured.
A payment must be in a capturable state (e.g., requires_capture). Attempting to capture an already succeeded (and fully captured) payment or one in an invalid state will lead to an error.
Path parameters
payment_idstringrequiredThe identifier for payment
Request body PaymentsCaptureRequest (object)
merchant_idstring, nullableThe unique identifier for the merchant. This is usually inferred from the API key.
amount_to_captureinteger, nullableThe amount to capture, in the lowest denomination of the currency. If omitted, the entire
amount_capturableof the payment will be captured. Must be less than or equal to the currentamount_capturable.refund_uncaptured_amountboolean, nullableDecider to refund the uncaptured amount. (Currently not fully supported or behavior may vary by processor).
statement_descriptor_suffixstring, nullableA dynamic suffix that appears on your customer's credit card statement. This is concatenated with the (shortened) descriptor prefix set on your account to form the complete statement descriptor. The combined length should not exceed processor-specific limits (typically 22 characters).
statement_descriptor_prefixstring, nullableAn optional prefix for the statement descriptor that appears on your customer's credit card statement. This can override the default prefix set on your merchant account. The combined length of prefix and suffix should not exceed processor-specific limits (typically 22 characters).
all_keys_requiredboolean, nullableIf true, returns stringified processor raw response body
Responses
200Payment captured400Missing mandatory fields
Request
curl --request POST \
--url https://sandbox.cardencer.com/payments/{payment_id}/capture \
--header 'Content-Type: application/json' \
--header 'api-key: snd_...' \
--data '{
"amount_to_capture": 654
}'Response
{
"payment_id": "pay_mbabizu24mvu3mela5njyhpit4",
"merchant_id": "merchant_1668273825",
"status": "requires_confirmation",
"amount": 6540,
"net_amount": 6540,
"amount_capturable": 6540,
"processor_merchant_id": "merchant_1689512302",
"currency": "AED",
"payment_method": "card",
"attempt_count": 0
}{
"error_type": "invalid_request",
"message": "Missing required param: {param}",
"code": "IR_04"
}