Skip to main content

Overview

Checkout sessions are how customers pay for products on Pandabase. A session is a temporary, stateful object that holds the customer’s cart, billing info, and payment details. Sessions expire after 6 hours.

Checkout flow

1

Create a session

Create a checkout session with one or more items. Items can be existing products from your catalog (by product ID) or dynamic items (by name and amount).
2

Customer fills in details

The customer provides their name, email, and billing address. Tax is calculated automatically once billing info is provided.
3

Apply coupons (optional)

Customers can apply a coupon code for a discount. Both percentage and fixed amount coupons are supported.
4

Pay

The customer submits payment. On success, an order is created and fulfillment begins automatically.

Items

Checkout sessions support two types of items: Catalog items — reference a product by ID. Price, name, and stock are resolved from your product catalog. Supports variant selection. Dynamic items — specify a name and amount directly. Useful for one-off charges, tips, or custom pricing. Minimum 0.01perunit,butthetotalcheckoutamountmustbeatleast0.01 per unit, but the total checkout amount must be at least 1.00.

Custom fields

You can add custom fields to collect additional information during checkout.
TypeDescription
TextFree-form text input
NumericNumber input
DropdownSelect from predefined options
Custom fields are included in the order data and forwarded in webhook payloads.

Metadata

Attach arbitrary key-value pairs to a checkout session. Metadata is set at creation and cannot be changed after. It flows through to the order, webhook payloads, and fulfillment webhooks. Limits: max 20 keys, key max 40 characters, value max 500 characters.

Pricing

The checkout total is calculated as:
subtotal = sum of (item price × quantity)
discount = coupon discount (if applied)
tax = calculated on (subtotal - discount) based on billing address
total = subtotal - discount + tax

Local currency

When a customer provides a billing address in a supported country, the checkout total is automatically converted to their local currency. This enables region-specific payment methods like PIX, iDEAL, and SEPA Debit. The exchange rate is locked when billing info is provided and does not change during the session. Products remain priced in USD — the conversion only affects what the customer is charged. The checkout session response includes a presentment object when local currency is active:
{
  "presentment": {
    "currency": "EUR",
    "amount": 2569,
    "rate": 0.86348
  }
}
No authentication is required to create or pay for a checkout session. Customers are created automatically during checkout if they don’t already exist.