> ## Documentation Index
> Fetch the complete documentation index at: https://www.smartretry.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Capture

> Settle a previously authorized pre-authorization.

Capture settles a pre-authorization and moves the reserved funds to your account. You must have a successful [pre-authorization](/docs/api-reference/payments/preauth) before calling this endpoint.

<Note>
  The capture amount must not exceed the originally authorized amount. If you omit `amount`, the full authorized amount is captured.
</Note>

<Note>
  Safe retries for this POST endpoint use the `Idempotency-Key` header. Reuse the same key only when retrying the exact same request body. See [Idempotency](/docs/api-reference/idempotency).
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://terminal.smartretry.com/v1/payments/capture/ABC123 \
    --header 'x-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --header 'Idempotency-Key: capture-20260331-001' \
    --data '{
      "transaction_reference_id": "TX8A3F2C",
      "order_reference_id": "OR7B9E1D",
      "merchant_transaction_id": "capture-20260331-001",
      "amount": 49.99
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://terminal.smartretry.com/v1/payments/capture/ABC123",
      headers={
          "x-api-key": "YOUR_API_KEY",
          "Content-Type": "application/json",
          "Idempotency-Key": "capture-20260331-001"
      },
      json={
          "transaction_reference_id": "TX8A3F2C",
          "order_reference_id": "OR7B9E1D",
          "merchant_transaction_id": "capture-20260331-001",
          "amount": 49.99
      }
  )

  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://terminal.smartretry.com/v1/payments/capture/ABC123",
    {
      method: "POST",
      headers: {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json",
        "Idempotency-Key": "capture-20260331-001"
      },
      body: JSON.stringify({
        transaction_reference_id: "TX8A3F2C",
        order_reference_id: "OR7B9E1D",
        merchant_transaction_id: "capture-20260331-001",
        amount: 49.99
      })
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "transaction_id": "TX9C4D1E",
    "order_id": "OR7B9E1D",
    "merchant_transaction_id": "capture-20260331-001",
    "accepted": true
  }
  ```

  ```json 400 theme={null}
  {
    "type": "https://terminal.smartretry.com/errors/validation",
    "title": "Bad Request",
    "status": 400,
    "detail": "amount exceeds the authorized amount",
    "reason_code": "AMOUNT_EXCEEDS_AUTHORIZED"
  }
  ```
</ResponseExample>

## Path parameters

<ParamField path="terminal_friendly_id" type="string" required>
  Your terminal identifier. Exactly 6 characters.
</ParamField>

## Request body

<ParamField body="transaction_reference_id" type="string" required>
  The `transaction_id` returned by the original pre-authorization. Exactly 8 characters.
</ParamField>

<ParamField body="order_reference_id" type="string" required>
  The `order_id` returned by the original pre-authorization. Exactly 8 characters.
</ParamField>

<ParamField body="merchant_transaction_id" type="string">
  Your unique identifier for this capture transaction. Must be different from the `merchant_transaction_id` used in the pre-authorization.
</ParamField>

<ParamField body="amount" type="number">
  Amount to capture in major currency units (e.g., `49.99` for \$49.99). If omitted, the full authorized amount is captured. If provided, must be less than or equal to the authorized amount.
</ParamField>

<ParamField body="description" type="string">
  Human-readable description of the capture. Maximum 500 characters.
</ParamField>

## Response

<ResponseField name="transaction_id" type="string" required>
  SmartRetry's unique identifier for this capture transaction. Exactly 8 characters.
</ResponseField>

<ResponseField name="order_id" type="string">
  The order identifier, matching the `order_id` from the original pre-authorization.
</ResponseField>

<ResponseField name="merchant_transaction_id" type="string">
  The `merchant_transaction_id` you provided in the request, echoed back for confirmation.
</ResponseField>

<ResponseField name="merchant_order_id" type="string">
  The `merchant_order_id` associated with the order, when present.
</ResponseField>

<ResponseField name="accepted" type="boolean" required>
  `true` if the capture was accepted for processing. Poll the [status endpoint](/docs/api-reference/payments/status) using the returned `transaction_id` to confirm settlement.
</ResponseField>

<Warning>
  Each pre-authorization can only be captured once. Attempting to capture an already-captured or voided pre-authorization will return a `400` error.
</Warning>
