Skip to main content
POST
Create payment

Authorizations

Authorization
string
header
required

Authorization header using the Bearer scheme. Learn more about JWT tokens in the Coinbase Developer Portal.

Headers

x-idempotency-key
string
required

Unique identifier to ensure request idempotency

Body

application/json

Request payload for creating a payment.

maxAmount
string
required

The max amount to be signed by the buyer, in USD with up to 2 decimal places.

Example:

"100.00"

networkId
integer<int32>
required

Identifier for the blockchain network.

Example:

"8453"

receiver
string
required

The receiver's wallet address (on Base).

Example:

"0xreceiver"

operator
string
required

The operator's smart account address for processing payments.

Example:

"0xoperator"

token
string

The token address used for the payment. (Default: USDC address for the specified network_id, e.g. 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 for Base Mainnet)

Example:

"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"

autoAuthorize
boolean

Whether to automatically authorize the transaction once the payer completes the checkout process. (Default: true, unless auto_capture is set). Cannot be true if auto_capture is also true.

Example:

"true"

autoCapture
boolean

Whether to auto capture the payment. (Default: false). Cannot be true if auto_authorize is also true.

Example:

"false"

minFeeBps
integer<int32>

Min Fee in basis points. (Default: 0)

Example:

"50"

maxFeeBps
integer<int32>

Max Fee in basis points. (Default: 0)

Example:

"50"

feeReceiver
string

Address that receives the fee. (Default: 0x0000000000000000000000000000000000000000)

Example:

"0xfee789"

preApprovalExpiry
string<int64>

Timestamp (in seconds) when the pre-approval expires. After this expiration, the payment can no longer be authorized or captured. Must be at least 1 minute from now. (Default: now() + 1 day)

Example:

"1843954582"

authorizationExpiry
string<int64>

Timestamp (in seconds) when the authorization expires. After this expiration, the payment can no longer be captured. Must be at least 1 minute from now. (Default: now() + 7 days)

Example:

"1843954582"

refundExpiry
string<int64>

Timestamp (in seconds) when the refund expires. Must be at least 1 minute from now. (Default: now() + 7 days)

Example:

"1843954582"

successRedirectUrl
string

URL to redirect on successful payment.

Example:

"https://example.com/success"

failRedirectUrl
string

URL to redirect on failed payment.

Example:

"https://example.com/fail"

contractAddress
string

Contract address of the Commerce protocol (PaymentEscrow.sol). (Default: PaymentEscrow address for the specified network_id, e.g. 0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff for Base Mainnet)

Example:

"0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff"

merchant
Merchant · object

Additional merchant metadata. Does not impact the actual payment transaction.

Example:
customer
Customer · object

Additional customer metadata. Does not impact the actual payment transaction.

Example:
fiat
fiat · object

Additional fiat currency metadata. Does not impact the actual payment transaction.

Example:
externalClientReferenceId
string

External reference ID provided by the client.

Example:

"ext-ref-123"

Response

A successful response.

Response containing the payment ID.

payment
Payment · object

The payment information.

Example: