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>"
}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>"
}Use this schema for new checkout sessions.
Show child attributes
The id of the Customer for this purchase session, as defined in your system
The URL to redirect to after the purchase is successful
The URL to redirect to after the purchase is canceled or fails
"product"The name of the purchase or subscription created when this checkout session succeeds. Ignored if the checkout session is of type invoice.
The ID of the price the customer shall purchase. If not provided, priceSlug is required.
The slug of the price the customer shall purchase. If not provided, priceId is required.
The quantity of the purchase or subscription created when this checkout session succeeds. Ignored if the checkout session is of type invoice.
Whether to preserve the billing cycle anchor date in the case that the customer already has an active subscription that renews. If not provided, defaults to false.
Successful response
A time-limited checkout session, which captures the payment details needed to create a subscription, or purchase, or pay a standalone invoice.
Show child attributes
Epoch milliseconds.
-9007199254740991 <= x <= 9007199254740991Epoch milliseconds.
-9007199254740991 <= x <= 9007199254740991open, pending, succeeded, failed, expired -2147483648 <= x <= 2147483647"purchase"Epoch milliseconds.
-9007199254740991 <= x <= 9007199254740991Show child attributes
Show child attributes
card, link, us_bank_account, sepa_debit Omitted.
Omitted.
The URL to redirect to complete the purchase
Was this page helpful?