Skip to Content
Docs
Partial approvals

Handle partial approvals from your server

Confirm or cancel partially approved charges and payment sessions from your server using the partial approval API.

With server-to-server partial approval, a charge or payment session approved for less than the requested amount pauses for your server's decision. Display the approved amount to the customer, then confirm it, confirm a lower amount or predefined package, or cancel the payment.

Requirements

Before you start, make sure you have:

  • Your API credentials and environment base URL (sandbox: https://api.sandbox.pay.com/v1, with an sk-pay-com-sandbox- key).
  • A unique idempotency-key header for each POST request.
  • Server-to-server partial approval enabled on your account (contact your account manager). Without it, the confirm and cancel endpoints return 403 with S2S Partial approval is not enabled for this merchant.

Handle a partial approval

Follow these steps to enable partial approvals on a payment and confirm or cancel the approved amount from your server.

  1. 1

    Accept partial approval on the payment

    Include payment_method_options.card.partial_approval when creating a charge (POST /v1/charges) or payment session (POST /v1/sessions/payment). This example requests $10.00 USD (1000 in minor units) and cancels any approval below $5.00 USD or below 20% of the requested amount:

    POST /v1/charges

    {
      "amount": 1000,
      "currency": "usd",
      "source": "pm_card_685125127054035968",
      "payment_method_options": {
        "card": {
          "partial_approval": {
            "accept": true,
            "percentage_threshold": 20,
            "amount_threshold": 500,
            "approved_by_default": true
          }
        }
      }
    }

    See Request fields for every option, including products for packages, and Response fields for the details the payment returns.

  2. 2

    Detect the partial approval status

    When the issuer approves a lower amount, the charge or payment session returns status: "requires_partial_approval_action", and Pay.com sends the charge.requires_partial_approval_action webhook event. The charge's amount reflects the approved amount rather than the originally requested amount.

    {
      "id": "chrg_656422478087717888",
      "resource": "charge",
      "amount": 800,
      "status": "requires_partial_approval_action",
      "payment_method_details": {
        "card": {
          "partial_approval": {
            "status": "pending",
            "amount_requested": 1000,
            "amount_authorized": 800
          }
        }
      }
    }

    No funds are captured yet. Show the customer the approved amount and confirm or cancel within 5 minutes (unless your account manager configured a different window). When time expires, approved_by_default determines the outcome:

    • true or omitted: Pay.com confirms the approved amount. If products were sent, Pay.com charges the largest package that fits within the approved amount.
    • false: Pay.com cancels the payment.
  3. 3

    Confirm or cancel the partial approval

    Call the confirm or cancel endpoint with the customer's decision.

    Confirming captures the funds. Send POST /v1/charges/{charge_id}/partial_approval/confirm (or POST /v1/sessions/payment/{session_id}/partial_approval/confirm for a payment session).

    With an empty body, Pay.com captures the full approved amount (800 for $8.00 USD). To capture less, send amount in minor units. If you created the payment with products, you can send product_id instead to charge one of those packages, such as plan_basic from Offer packages. Neither can exceed the approved amount.

    {
      "amount": 800
    }

    The charge status becomes succeeded_partially, and a payment session status becomes completed_partially. The partial_approval object reports amount_requested (original amount), amount_authorized (approved amount), and amount_charged (captured amount).

Errors

The confirm and cancel endpoints return these HTTP error statuses.

StatusCause
400The charge or session isn't awaiting a partial approval decision, amount exceeds the approved amount, or product_id doesn't match one of the payment's products.
403Server-to-server partial approval isn't enabled for your account.
404The charge or session doesn't exist or belongs to another account.

Listen for webhooks

Subscribe to these webhook events to track partial approvals on your backend.

Event typeDescription
charge.requires_partial_approval_actionThe issuer approved a lower amount, and the charge awaits confirmation or cancellation.
charge.succeededThe partial approval was confirmed and funds were captured. The charge status is succeeded_partially.
charge.failedThe partial approval was canceled or timed out with approved_by_default: false. No funds were captured.

See Webhooks to set up an endpoint and verify event signatures.

Testing

The sandbox test cards approve 80% of the requested amount. See Testing for the card numbers.

Next steps

Was this page helpful?