Skip to Content
Docs

Hold and capture

Reserve funds on a customer's card, then capture them when you're ready or cancel the hold to release them.

The hold and capture flow, also known as authorization and capture, lets you reserve funds on a customer's card and capture them at a later time. It's an advanced flow typically used by businesses that only take money when a service is fulfilled, such as hotels, airlines, or e-commerce platforms that ship physical goods. If you decide not to go ahead, you cancel the hold and the reserved funds go back to the customer.

Requirements

Before performing a hold and capture, make sure you have the following:

Create and capture a hold

Reserve the funds with a hold, then capture them in one or more capture requests.

  1. 1

    Create a hold

    To reserve funds without capturing them, send a POST request to the /v1/holds endpoint. A successful response returns a Hold object with status: requires_capture, indicating the funds are reserved on the customer's card but not yet captured. Amounts are in minor units (the smallest currency unit), so 10000 equals $100.00 USD.

    You can create a hold using raw card data or a stored payment method.

    {
      "amount": 10000,
      "currency": "usd",
      "source_data": {
        "type": "card",
        "card": {
          "number": "4242424242424242",
          "expiry_month": "12",
          "expiry_year": "2028",
          "cvv": "123",
          "name": "John Smith"
        },
        "billing_details": {
          "name": "John Smith",
          "email": "john.smith@example.com"
        }
      },
      "description": "Hold for Order #12350",
      "reference": "order-12350",
      "payment_method_options": {
        "card": {
          "duplicate_card_check": false
        }
      }
    }

    If the API returns the hold with status: requires_authentication, the issuer requires 3D Secure. Create a linked authentication session with resource set to the hold ID (hld_…) and show the challenge, as described in create a charge with 3DS. If you pass confirm: false, the hold moves to requires_confirmation. Call POST /v1/holds/{hold_id}/confirm after the customer returns. The hold then moves to requires_capture and you can capture it.

    Holds expire after a set number of days (7 by default). The exact window depends on the card network and acquirer. If a hold expires before you capture it, the funds are released back to the customer and the hold transitions to status: canceled with cancellation_reason: hold_on_funds_expired. Pay.com sends a hold.funds_about_to_expire webhook event before a hold expires. Capture or cancel the hold before then to avoid unexpected releases.

  2. 2

    Capture funds

    When you are ready to capture the funds, send a POST request to /v1/holds/{hold_id}/capture. Replace {hold_id} with the id returned when you created the hold.

    You can capture the full amount in one call, or capture part of it.

    To capture the entire reserved amount, omit the amount_to_capture field. The API returns the new charge object. The hold transitions to status: succeeded and amount_capturable drops to 0.

    POST https://api.sandbox.pay.com/v1/holds/{hold_id}/capture

    {}

    The capture endpoint returns the new charge object. To see the updated hold with its current amount_capturable and status, retrieve it with GET /v1/holds/{hold_id}, or listen for the hold.captured and hold.succeeded webhook events, which deliver the full hold object.

Cancel a hold

If you decide not to proceed with a transaction, cancel the hold to release the reserved funds back to the customer before any funds move to your account. Send a POST request to /v1/holds/{hold_id}/cancel with the hold id returned when you created the hold. You can cancel a hold unless it's fully captured or already canceled.

Cancellation is all or nothing, and it's final:

  • Cancellation always releases the full remaining amount_capturable. Partial releases are not supported.
  • If you want to release only part of the reserved funds, capture only what you need first (see Capture funds). The rest stays capturable, and you can call this endpoint to release it.
  • Once canceled, the hold is permanently closed. It can't be reopened or used for future captures. If you need to charge the customer again, create a new hold or charge.
curl -X POST https://api.sandbox.pay.com/v1/holds/hld_686178331611104256/cancel \
  -u ':sk-pay-com-sandbox-…' \
  -H "idempotency-key: $(uuidgen)"

When the request succeeds, the hold status changes from requires_capture to canceled and amount_capturable drops to 0. Unlike a refund, which can take several days, a canceled hold usually frees the customer's funds sooner. The customer's card issuer decides when.

The response includes a cancellation_reason field indicating why the hold was canceled:

ValueDescription
requested_by_merchantThe merchant called the cancel endpoint.
hold_on_funds_expiredThe hold expired because it was not captured within the allowed window.

Listen for webhooks

Use webhooks to track the lifecycle of the hold and keep your order management system up to date.

  • hold.requires_capture: Sent when a hold is approved and funds are successfully reserved and awaiting capture.
  • hold.captured: Sent for every capture you perform. If you partially capture funds from the same hold three times, your system receives this webhook three times.
  • hold.succeeded: Sent only for the first capture. It tells your system that the initial capture was successful and does not fire again for subsequent captures against the same hold.
  • hold.canceled: Sent when you cancel the hold or when it expires.
  • hold.failed: Sent if the initial attempt to create the hold is declined.

Verify each event's signature with the Pay-Signature header and your endpoint's signing secret (HMAC SHA-256) to make sure the event is legitimate. See verify webhook signatures.

Next steps

  • Refund a charge: return funds after a capture has already settled.
  • Create a charge: see how a standard charge differs from the hold and capture flow, or charge the customer after canceling a hold.
  • Webhooks: verify signatures and handle hold lifecycle events reliably.
Was this page helpful?