Skip to main content
POST
Create a checkout session

Authorizations

Authorization
string
header
required

Your project secret key: sk_test_... (testnet) or sk_live_... (mainnet). Use it only on your server.

Body

application/json
amount_usd
number
required

Amount to charge in USD. Greater than 0, at most 2 decimal places.

Required range: x >= 0.01Must be a multiple of 0.01
Example:

49.99

description
string

Shown to the customer on the checkout page.

metadata
object

Your own key-value data, returned on the session and in webhooks. Keys starting with _warp_ are reserved and rejected.

return_url
string<uri>

Where the "Back to merchant" button on the payment success page sends the customer.

cancel_url
string<uri>

Where the "Cancel and return" link on the checkout page sends the customer.

Response

Session created

id
string
Example:

"ps_8f14e45fceea167a5a36dedd4bea2543"

object
enum<string>
Available options:
checkout.session
amount_usd
string

Amount in USD as a decimal string.

Example:

"49.99"

currency
enum<string>
Available options:
USD
description
string | null
metadata
object | null
status
enum<string>

pending: waiting for payment. processing: a transaction was submitted and is being verified. completed: payment verified. failed: verification failed. expired: no payment within 30 minutes.

Available options:
pending,
processing,
completed,
failed,
expired
network
enum<string>

Determined by the secret key used to create the session.

Available options:
mainnet,
testnet
return_url
string | null
cancel_url
string | null
expires_at
string<date-time>

30 minutes after creation.

created_at
string<date-time>
checkout_url
string<uri>

Hosted checkout page to redirect the customer to.

Example:

"https://checkout.usewarp.net/session/ps_8f14e45fceea167a5a36dedd4bea2543"

payment
object | null

Present on retrieve once a payment has been detected.