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>",
    "outputMetadata": {},
    "outputName": "<string>",
    "type": "<string>",
    "priceId": "<string>",
    "quantity": 123,
    "anonymous": true,
    "preserveBillingCycleAnchor": true
  }
}'
{
  "checkoutSession": {
    "id": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "livemode": true,
    "status": "open",
    "billingAddress": {
      "name": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "email": "jsmith@example.com",
      "address": {
        "name": "<string>",
        "line1": "<string>",
        "line2": "<string>",
        "city": "<string>",
        "state": "<string>",
        "postal_code": "<string>",
        "country": "<string>"
      },
      "phone": "<string>"
    },
    "priceId": "<string>",
    "purchaseId": "<string>",
    "invoiceId": "<string>",
    "quantity": -1,
    "organizationId": "<string>",
    "customerName": "<string>",
    "customerEmail": "<string>",
    "customerId": "<string>",
    "paymentMethodType": "card",
    "discountId": "<string>",
    "successUrl": "<string>",
    "cancelUrl": "<string>",
    "type": "<string>",
    "preserveBillingCycleAnchor": true,
    "outputMetadata": {},
    "outputName": "<string>",
    "targetSubscriptionId": "<any>",
    "automaticallyUpdateSubscriptions": "<any>"
  },
  "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