Skip to main content
POST
/
checkout
/
sessions
Create checkout session
curl --request POST \
  --url https://api.pocketsflow.com/checkout/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "productId": "<string>",
  "successUrl": "<string>",
  "cancelUrl": "<string>",
  "customerEmail": "jsmith@example.com",
  "discountCode": "<string>",
  "metadata": {}
}
'
{
  "id": "<string>",
  "url": "<string>"
}

Authorizations

Authorization
string
header
required

Enter your Pocketsflow API key (format: pk_live_... or pk_test_...)

Body

application/json
productId
string
required

Product ID to purchase

successUrl
string<uri>
required

Redirect URL after successful payment

cancelUrl
string<uri>
required

Redirect URL if payment is canceled

customerEmail
string<email>

Pre-fill customer email

discountCode
string

Discount code to apply

metadata
object

Custom metadata for the checkout

Response

201 - application/json

Checkout session created

id
string

Checkout session ID

url
string

Checkout URL