Skip to Content
Docs

Transactions

Understand charges, holds, and refunds in Pay.com, including their lifecycles and status models.

Every movement of money in Pay.com is represented as a transaction object: money-in transactions (charges and holds) and money-out transactions (refunds and payouts).

Transaction typeUse case
ChargesImmediate payment capture
HoldsReserve funds before capture
RefundsReturn funds from completed charges
PayoutsSend funds to customers

For 3D Secure authentication on charges and holds, see 3D Secure. For payout statuses, see Track and manage payouts.

Charges

A charge captures funds from a customer's payment method into your account.

Creating a charge

How you create a charge depends on your integration path:

Create a payment session with capture: true (the default) via POST /v1/sessions/payment. Pay.com.js handles payment collection, 3D Secure, and processing, and creates the charge automatically.

See Universal checkout, Headless checkout, or Headless wallet payments.

Charge statuses

A charge can resolve immediately or pass through authentication and confirmation steps, depending on your 3D Secure configuration:

  1. Create charge
  2. Pay.com API
    • succeeded
    • failed
    • blocked
    • pending
      • Final result by webhook
        • succeeded
        • failed
    • requires_authentication
      • 3DS challenge
        • succeeded
        • failed
        • requires_confirmation
          • Confirm charge
            • succeeded
            • failed

A charge has one of these statuses:

StatusMeaning
succeededThe charge was approved and funds have been captured.
succeeded_partiallyThe issuer approved only part of the amount. See Handle partial approvals.
pendingThe result isn't final yet (for example, with redirect-based payment methods). Wait for the webhook with the outcome.
failedThe charge was declined by the issuer.
blockedA payment rule blocked the charge.
requires_authenticationThe charge needs 3D Secure authentication before it can be completed.
requires_confirmationAuthentication is complete, but you must confirm the charge (when you create it with confirm: false).
requires_partial_approval_actionThe charge was partially approved and server-to-server partial approval is on. Confirm or cancel the partial amount. See Handle partial approvals.
awaiting_final_confirmationThe payment method approved the charge, but its final confirmation is still pending.

When the API returns requires_authentication, create a linked authentication session to complete the challenge. With Pay.com.js, 3D Secure is handled automatically. Pay.com.js shows the challenge and handles the redirects, so you don't need extra code.

For the charge webhook events, see Webhook events.

Charge object fields

When you retrieve a charge with GET /v1/charges/{charge_id}, the response includes these fields:

FieldDescription
amountThe charge amount in the smallest currency unit (for example, cents).
amount_refundedThe total amount that has been refunded from this charge.
statusThe current status of the charge.
payment_methodThe ID of the payment method used.
holdIf this charge was created by capturing a hold, the hold ID.
payment_sessionIf this charge was created from a payment session, the session ID.
refundsA list of refund objects linked to this charge.
metadataCustom key-value pairs attached to the charge.
paidWhether the charge has been settled and paid to your bank account. A charge with status: succeeded can have paid: false because settlement happens after approval. Use status to confirm the charge was approved, and paid to confirm funds have reached your account.

A charge can also be created by capturing a hold. When you capture a hold (fully or partially), a charge object is created and linked to the original hold through the hold field. See Holds and captures.

Holds and captures

A hold (also called an authorization) reserves funds on a customer's payment method without capturing them. This is useful when you need to confirm an order, verify inventory, or wait for fulfillment before taking the money. Once a hold is approved, you decide when to capture the funds or cancel the hold to release them back to the customer.

Creating a hold

There are two ways to create a hold, depending on your integration path:

Create a payment session with capture: false via POST /v1/sessions/payment. Pay.com.js handles the rest, and on success Pay.com creates a hold instead of a charge.

The hold lifecycle

A hold moves from creation through authorization to its final state, captured or canceled:

  1. Create hold
  2. Pay.com API
    • failed
    • blocked
    • requires_capture, Approved (no 3DS)
      • Capture hold
        • succeeded
      • Cancel hold
        • canceled
      • canceled, Expired (hold_on_funds_expired)
    • requires_authentication
      • 3DS challenge
        • failed
        • requires_capture
          • Capture hold
            • succeeded
          • Cancel hold
            • canceled
          • canceled, Expired (hold_on_funds_expired)
        • requires_confirmation
          • Confirm hold
            • requires_capture
              • Capture hold
                • succeeded
              • Cancel hold
                • canceled
              • canceled, Expired (hold_on_funds_expired)

Hold statuses

A hold has one of these statuses:

StatusMeaning
requires_captureThe hold was approved. Funds are reserved and waiting for you to capture or cancel.
succeededAt least one capture was made, and a charge was created for each capture.
canceledThe hold was canceled or expired. All reserved funds have been released to the customer.
failedThe hold was declined by the issuer.
blockedA payment rule blocked the hold.
requires_authentication3D Secure is needed to complete the authorization.
requires_confirmationAuthentication succeeded, and the hold is waiting for you to confirm it (when you create it with confirm: false).
succeeded_partiallyThe approved amount differs from the requested amount. A hold that accepts partial approval returns requires_capture for the approved amount instead. See Partial approvals on holds.
pendingThe hold was approved, with no approved amount yet.

Hold expiration

Holds don't last forever. By default, an uncaptured hold expires after 7 days. The exact window depends on the card network and acquirer rules. When a hold expires, the reserved funds are released back to the customer automatically. The hold transitions to status: canceled with cancellation_reason: hold_on_funds_expired, and Pay.com sends a hold.canceled webhook event.

Capture or cancel a hold before it expires. Pay.com sends a hold.funds_about_to_expire webhook event before it does.

Capturing a hold

Once a hold is in requires_capture status, you capture it via POST /v1/holds/{hold_id}/capture to move the funds. Pay.com supports three capture strategies:

  • Full capture: Omit amount_to_capture (or set it to the full hold amount) to capture the entire authorized amount.
  • Partial capture: Set amount_to_capture below the authorized amount. The rest stays capturable (see amount_capturable) until you capture it, cancel the hold, or the hold expires.
  • Multiple captures: You can capture a hold in multiple steps, as long as the total captured amount doesn't exceed the original authorization. Each capture creates a separate charge object linked to the hold.

The hold object includes an amount_capturable field that tells you how much is still available to capture. This value decreases with each capture you make.

Not all payment providers support partial or multiple captures. If the provider doesn't, the API returns a 422 error with type: "invalid_request_error" and the message Provider only allows capturing the full amount or Provider only allows capturing a payment once. If you encounter this, capture the full remaining amount in a single request instead, or cancel the hold to release what's left.

For detailed instructions, see the Hold and capture guide.

Canceling a hold

If you no longer need to capture the funds, cancel the hold via POST /v1/holds/{hold_id}/cancel to release the reservation. The customer's issuer decides when the released funds are available to them again.

Cancellation is full only. You can't partially cancel a hold. To release only part of the funds, capture only the amount you need (a partial capture).

For detailed instructions, see the Cancel a hold guide.

Hold object fields

When you retrieve a hold with GET /v1/holds/{hold_id}, the response includes these fields:

FieldDescription
amountThe original authorized amount.
amount_capturableThe remaining amount available to capture. Decreases as you make captures.
charges.dataAn array of charge objects created from this hold (via capture).
canceledWhether the hold has been canceled.
cancellation_reasonWhy the hold was canceled: requested_by_merchant or hold_on_funds_expired.
payment_sessionIf this hold was created from a payment session, the session ID.

To list the charges created from a hold's captures, call GET /v1/holds/{hold_id}/charges.

Common patterns

Holds are commonly used across a range of business scenarios:

  • Pre-authorization in e-commerce: Place a hold at checkout, capture when the order ships, and cancel if the order is canceled before shipment.
  • Partial fulfillment: Ship an order in multiple packages and use multiple partial captures so the customer is only charged for what has shipped.
  • Tip adjustment in hospitality: Place a hold for the base amount, then capture for the adjusted total including the tip.

For the hold webhook events, see Webhook events.

Refunds

A refund returns funds from a completed charge back to the customer's original payment method. Pay.com supports full refunds, partial refunds, and multiple refunds on the same charge.

Creating a refund

Pay.com.js has no refund component. Create a refund with the API or in the Pay.com dashboard.

With the API, call POST /v1/refunds with the charge ID and optionally an amount. In the Pay.com dashboard, open the transaction and click Refund.

A refund request takes these parameters:

ParameterRequiredDescription
chargeYesThe ID of the charge to refund, for example chrg_686511195653406720.
amount_to_refundNoThe amount to refund in the smallest currency unit. Omit for a full refund.
referenceNoYour custom reference string for this refund.
metadataNoCustom key-value pairs to attach to the refund.

For a step-by-step walkthrough, see the Refund a charge guide.

Full, partial, and multiple refunds

Pay.com gives you three ways to return funds from a single charge. A full refund returns the entire charge amount. To issue one, omit amount_to_refund. A partial refund returns less than the full charge. Set amount_to_refund to a smaller value. You can also issue multiple refunds against the same charge, as long as the total refunded amount doesn't exceed the original charge amount. Each refund creates a separate refund object.

A refund returns money from a completed charge to the customer. A hold cancellation releases a reserved authorization without capturing it. Refunds happen after payment, and hold cancellations happen before it. Refunds can be partial or multiple, but a cancellation is always for the full hold. To release part of a hold, use a partial capture instead.

Tracking refunded amounts

The charge object provides two fields to help you track how much has been refunded. The amount_refunded field shows the total amount refunded so far (the sum of all refunds), and the refunds.data array contains all individual refund objects linked to the charge. To check how much is still available to refund, subtract amount_refunded from amount. To list a charge's refunds on their own, call GET /v1/charges/{charge_id}/refunds.

The refunded field on the charge object is true only when the charge has been fully refunded, meaning amount_refunded equals amount.

Refund statuses

A refund moves through these statuses:

  1. Create refund
  2. Pay.com API
    • failed
    • pending
      • Bank processes transfer
        • succeeded
        • failed
StatusMeaning
pendingThe refund was submitted. The final result arrives by webhook (refund.succeeded or refund.failed).
succeededThe refund was processed successfully. Funds are being returned to the customer.
failedThe refund could not be processed.
blockedA payment rule blocked the refund.

For the refund webhook events, see Webhook events.

Refund object fields

When you retrieve a refund with GET /v1/refunds/{refund_id}, the response includes these fields:

FieldDescription
amountThe refund amount in the smallest currency unit.
chargeThe ID of the charge this refund was issued against.
statusThe current status of the refund (pending, succeeded, failed, or blocked).
referenceYour custom reference, if provided when creating the refund.
metadataCustom key-value pairs attached to the refund.

Next steps

Related payment guides:

Was this page helpful?