v1

latestOpenAPI 3.0.32026-07-264469137.7 KB
Checkout Sessions

Create a checkout session

Create a product-based checkout session

post/v1/checkout-sessions

Request body

OR

Example request

{
  "billing_currency": "USD",
  "cancel_url": "https://shop.example.com/cart",
  "return_url": "https://shop.example.com/thanks",
  "success_url": "https://shop.example.com/success",
  "customer": {
    "customer_id": "cust_1a2b3c4d5e6f"
  },
  "product_cart": [
    {
      "product_id": "prod_abc123",
      "quantity": 1,
      "amount": "29.00"
    }
  ],
  "product_collection_id": "pgrp_1a2b3c4d5e",
  "reference": "order_9876",
  "expires_in_minutes": 60
}

Response

Success - Checkout session created successfully

checkout_idstring

Unique identifier for the underlying checkout.

checkout_urlstring uri

Hosted checkout URL where your customer can complete payment.

status'OPEN' | 'COMPLETED' | 'EXPIRED' | 'CANCELLED'

Current checkout status. New sessions start in OPEN. OPEN: Awaiting customer payment. New sessions start here. COMPLETED: Payment succeeded. This is a terminal state. EXPIRED: The session window elapsed before payment. This is a terminal state. CANCELLED: Canceled before completion. This is a terminal state.

expires_atstring date-time

ISO 8601 timestamp indicating when the checkout will expire. After this time, customers cannot complete payment through this checkout.

created_atstring date-time

ISO 8601 timestamp indicating when the checkout was created.

Example response

{
  "checkout_id": "5d7ab015-5886-4a1e-89bb-abe499d0b8ee",
  "checkout_url": "https://checkout.bachs.io/c/chk_1a2b3c4d5e6f",
  "status": "OPEN",
  "expires_at": "2026-01-24T15:30:00.000Z",
  "created_at": "2026-01-24T14:30:00.000Z"
}