Skip to main content
POST
/
api
/
v1
/
checkout-sessions
Create Checkout Session
curl --request POST \
  --url https://app.flowglad.com/api/v1/checkout-sessions \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "checkoutSession": {
    "customerExternalId": "<string>",
    "successUrl": "<string>",
    "cancelUrl": "<string>",
    "type": "<string>",
    "outputMetadata": {},
    "outputName": "<string>",
    "priceId": "<string>",
    "priceSlug": "<string>",
    "quantity": 123,
    "anonymous": true,
    "preserveBillingCycleAnchor": true
  }
}
'
{
  "checkoutSession": {
    "id": "<string>",
    "createdAt": 0,
    "updatedAt": 0,
    "livemode": true,
    "status": "open",
    "priceId": "<string>",
    "purchaseId": "<string>",
    "invoiceId": "<string>",
    "quantity": -1,
    "organizationId": "<string>",
    "customerName": "<string>",
    "customerEmail": "<string>",
    "customerId": "<string>",
    "discountId": "<string>",
    "type": "<string>",
    "outputName": "<string>",
    "expires": 0,
    "billingAddress": {
      "address": {
        "country": "<string>",
        "name": "<string>",
        "line1": "<string>",
        "line2": "<string>",
        "city": "<string>",
        "state": "<string>",
        "postal_code": "<string>"
      },
      "name": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "email": "[email protected]",
      "phone": "<string>"
    },
    "paymentMethodType": "card",
    "successUrl": "<string>",
    "cancelUrl": "<string>",
    "preserveBillingCycleAnchor": true,
    "outputMetadata": {},
    "targetSubscriptionId": "<unknown>",
    "automaticallyUpdateSubscriptions": "<unknown>"
  },
  "url": "<string>"
}

Authorizations

Authorization
string
header
required

Body

application/json

Use this schema for new checkout sessions.

checkoutSession
object
required

Response

Successful response

checkoutSession
object
required

A time-limited checkout session, which captures the payment details needed to create a subscription, or purchase, or pay a standalone invoice.

url
string
required

The URL to redirect to complete the purchase