Payment Sessions

Void a payment session

Changed on

Releases all remaining capturable funds back to the payer. The session must have a positive capturable balance.

This is an asynchronous operation. The void is returned in pending status and transitions to succeeded or failed.

After voiding, no further captures can be made. Unlike Cancel, which works before authorization, void works after authorization.

post/v2/payment-sessions/{paymentSessionId}/voids

Request

  • Base URL
    https://api.cdp.coinbase.com/platform
  • Auth
    HTTP bearer

Path parameters

paymentSessionId, string required

The ID of the payment session, a UUID prefixed by paymentSession_.

Example:paymentSession_82c879c1-84e1-44ed-a8c2-1ac239cf09ad

The unique identifier of the payment session.

Headers

X-Idempotency-Key, string

An optional string request header for making requests safely retryable. When included, duplicate requests with the same key will return identical responses. Refer to our Idempotency docs for more information on using idempotency keys.

Request body

CreateVoidRequest required

A request to create a void for a payment session. A void releases all remaining capturable funds back to the payer, including after partial refunds as long as a capturableAmount remains.

metadata, Metadata

Optional metadata as key-value pairs. Use this to store additional structured information on a resource, such as customer IDs, order references, or any application-specific data. Up to 10 key/value pairs may be provided. Keys and values are both strings. Keys must be ≤ 40 characters; values must be ≤ 500 characters.

externalReferenceId, string

An optional merchant-provided internal identifier for this void, from the merchant's own system—not visible to the payer.

customerDisplay, OperationCustomerDisplay

Optional customer-facing display data for this void, shown to the payer. Falls back to the session's orderCode when referenceCode is omitted.

Example request

{
  "metadata": {
    "customer_id": "cust_12345",
    "order_reference": "order-67890"
  },
  "externalReferenceId": "merchant-void-abc123",
  "customerDisplay": {
    "referenceCode": "REF-ABC123"
  }
}

Response

Successfully created void.

Void required

A release of uncaptured authorized funds back to the payer. Voids release all remaining capturable funds in a single operation, including after partial refunds as long as a capturableAmount remains.

voidId, string

The unique identifier of the void.

paymentSessionId, string

The ID of the payment session this void belongs to.

status, 'pending' | 'succeeded' | 'failed'

The current status of the void.

amount, string

A decimal representation of the voided amount, denominated in the session's asset.

error, PaymentError

An error that occurred during a payment operation.

metadata, Metadata

Optional metadata as key-value pairs. Use this to store additional structured information on a resource, such as customer IDs, order references, or any application-specific data. Up to 10 key/value pairs may be provided. Keys and values are both strings. Keys must be ≤ 40 characters; values must be ≤ 500 characters.

externalReferenceId, string

A merchant-provided internal identifier for this void, from the merchant's own system—not visible to the payer. Present only when supplied on the create void request.

customerDisplay, OperationCustomerDisplay

Customer-facing display data for this void, shown to the payer. Present when supplied on the create void request or when the session's orderCode fallback applies; otherwise omitted.

onchainTransactions, OnchainTransaction[]

The onchain transactions associated with this void.

createdAt, string date-time

The UTC ISO 8601 timestamp at which the void was created.

updatedAt, string date-time

The UTC ISO 8601 timestamp at which the void was last updated.

Example response

{
  "voidId": "void_82c879c1-84e1-44ed-a8c2-1ac239cf09ad",
  "paymentSessionId": "paymentSession_82c879c1-84e1-44ed-a8c2-1ac239cf09ad",
  "status": "succeeded",
  "amount": "1.00",
  "onchainTransactions": [
    {
      "transactionHash": "0x789012345678901234567890abcdef1234567890abcdef1234567890abcdef12",
      "network": "base"
    }
  ],
  "metadata": {
    "customer_id": "cust_12345"
  },
  "createdAt": "2025-06-15T12:30:00.000Z",
  "updatedAt": "2025-06-15T12:31:00.000Z"
}

Changes

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    3 more changes in this revision