Skip to content

Payments: Capture

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_idstringrequired

    The identifier for payment

Request body PaymentsCaptureRequest (object)

  • merchant_idstring, nullable

    The unique identifier for the merchant. This is usually inferred from the API key.

  • amount_to_captureinteger, nullable

    The amount to capture, in the lowest denomination of the currency. If omitted, the entire amount_capturable of the payment will be captured. Must be less than or equal to the current amount_capturable.

  • refund_uncaptured_amountboolean, nullable

    Decider to refund the uncaptured amount. (Currently not fully supported or behavior may vary by processor).

  • statement_descriptor_suffixstring, nullable

    A 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, nullable

    An 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, nullable

    If true, returns stringified processor raw response body

Responses

  • 200Payment captured
  • 400Missing 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
}