Skip to main content
POST
/
stores
/
{storeId}
/
checkouts
Create checkout session
curl --request POST \
  --url https://api.pandabase.io/v2/stores/{storeId}/checkouts \
  --header 'Content-Type: application/json' \
  --data '
{
  "items": [
    {
      "product_id": "<string>",
      "quantity": 500,
      "variant_id": "<string>"
    }
  ],
  "amount": 500050,
  "customer": {
    "name": "<string>",
    "email": "jsmith@example.com",
    "billing": {
      "line1": "<string>",
      "city": "<string>",
      "state": "<string>",
      "postal_code": "<string>",
      "country": "<string>",
      "line2": "<string>"
    }
  },
  "coupon_code": "<string>",
  "tax_id": "<string>",
  "display": {
    "fields": [
      {
        "key": "<string>",
        "label": {
          "type": "<string>",
          "custom": "<string>"
        },
        "type": "text",
        "optional": false,
        "text": {
          "default_value": "<string>",
          "minimum_length": 1,
          "maximum_length": 123
        },
        "numeric": {
          "default_value": "<string>",
          "minimum_length": 1,
          "maximum_length": 123
        },
        "dropdown": {
          "default_value": "<string>",
          "options": [
            {
              "label": "<string>",
              "value": "<string>"
            }
          ]
        }
      }
    ]
  },
  "metadata": {},
  "return_url": "<string>",
  "cancel_url": "<string>"
}
'
{
  "ok": true,
  "data": {
    "id": "<string>",
    "checkout_url": "<string>",
    "pay_redirect_url": "<string>",
    "merchant": {
      "id": "<string>",
      "name": "<string>",
      "handle": "<string>",
      "slug": "<string>",
      "logo": "<string>",
      "favicon": "<string>",
      "accentColor": "<string>",
      "primaryColor": "<string>",
      "statementDescriptor": "<string>",
      "supportEmail": "<string>"
    },
    "amount": 123,
    "discount_amount": 123,
    "tax_amount": 123,
    "total_amount": 123,
    "items": [
      {
        "name": "<string>",
        "amount": 123,
        "quantity": 123,
        "image": "<string>"
      }
    ],
    "expires_at": 123,
    "coupon": {
      "code": "<string>",
      "discount_amount": 123
    },
    "display": {},
    "metadata": {},
    "return_url": "<string>",
    "cancel_url": "<string>"
  }
}

Path Parameters

storeId
string
required

Store ID (shp_ prefix)

Body

application/json
items
object[]
required

Line items — use product_id for catalog products or name + amount for dynamic items

Required array length: 1 - 10 elements

Reference an existing product from your catalog

amount
integer

Expected total in cents. If provided, must match the computed item total (validation safeguard).

Required range: 100 <= x <= 1000000
customer
object
coupon_code
string

Coupon code to apply

Maximum string length: 64
tax_id
string

Tax ID (VAT number)

Maximum string length: 32
display
object

Checkout UI configuration

metadata
object

Key-value pairs attached to the session. Flows through to the order and webhook payloads. Max 20 keys, key max 40 chars, value max 500 chars.

return_url
string<uri>

URL to redirect after successful payment. Must use HTTPS.

cancel_url
string<uri>

URL to redirect if the customer cancels. Must use HTTPS.

Response

Checkout session created

ok
boolean
required
data
object
required