Payment (x402)

Poll (or long-poll) a payment session

get/api/payment-status/{sessionId}

Path parameters

sessionIdstring required

Query parameters

waitboolean

When true, the server blocks up to 60 seconds waiting for the session to transition to a terminal state (completed, failed, expired). Useful to avoid tight-loop polling.

Response

Payment session state

session_idstring required
status'pending' | 'completed' | 'failed' | 'expired' required
amountstring required

Amount as string to avoid float precision

assetstring required
networkstring required
pay_tostring required

Wallet address to pay

created_atstring date-time required
expires_atstring date-time
capture_urlstring uri

Human-facing payment URL

payerstring

Payer wallet address, set on completion.

tx_hashstring

On-chain transaction hash (when status = completed).

completed_atstring date-time

Example response

{
  "asset": "USDC",
  "network": "base-sepolia"
}

Changes

Changed in 1 of the 12 revisions of this API.427

  • 8a22dc180044427See the full diff
    • the response's body type/format changed from object/ to / for status 200

      response-body-type-changed

    • removed the media type application/json for the response with the status 404

      response-media-type-removed

    • removed the required property sessionId from the response with the 200 status

      response-required-property-removed

    • removed the required property status from the response with the 200 status

      response-required-property-removed

    • removed the optional property timestamp from the response with the 200 status

      response-optional-property-removed

    • removed the optional property transactionHash from the response with the 200 status

      response-optional-property-removed

    • api operation id getPaymentStatus removed and replaced with

      api-operation-id-removed

    • the endpoint scheme security BearerAuth was removed from the API

      api-security-removed

    • api tag Payment (x402) added

      api-tag-added

    • api tag Payment removed

      api-tag-removed

    • added the new optional query request parameter wait

      new-optional-request-parameter

    • added PaymentSession subschema #2 to the response body allOf list for the response status 200

      response-body-all-of-added

    • removed the non-success response with the status 401

      response-non-success-status-removed

    This revision also has 21 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog