billing

Create Checkout Session

Create a Stripe checkout session for subscription or token purchase. Customer is created if not exists and cached in KV.

post/billing/create-checkout-session

Request

  • Base URL: https://api.aiapplyd.com/api/v1
  • URL: https://api.aiapplyd.com/api/v1/billing/create-checkout-session
  • Auth: HTTP bearer

Request body

cancelUrlstring uri

URL to redirect to if checkout is cancelled

interval'week' | 'month' | 'year'

Subscription billing interval. Defaults to "month". When set to "year" the handler swaps to the plan's annual Stripe price id if one is registered.

priceIdstring required

Stripe price ID for the product (monthly price id for subscription plans; the handler swaps to annual when interval="year").

successUrlstring uri

URL to redirect to after successful checkout

type'subscription' | 'token'

Type of checkout session (subscription or token purchase)

Example request

{
  "cancelUrl": "https://aiapplyd.com/pricing",
  "interval": "month",
  "priceId": "price_1234567890",
  "successUrl": "https://aiapplyd.com/billing/success",
  "type": "subscription"
}

Response

Checkout session created successfully

successtrue required

Example response

{
  "data": {
    "amountCents": 3899,
    "currency": "USD",
    "sessionId": "cs_test_1234567890",
    "url": "https://checkout.stripe.com/pay/cs_test_1234567890"
  },
  "meta": {
    "duration": 150,
    "requestId": "req_abc123",
    "timestamp": "2026-10-13T10:27:20.268Z",
    "version": "v1"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.