Skip to main content

Checkout a product or subscription

Checkout a product to buy it one time or start a subscription plan on a billing account.

Path Parameters
    org_id string required
    billing_id string required

    ID of the billing account to update the subscription for

Request Body required
    success_url string
    cancel_url string
    subscription_body object
    plan string
    skip_trial boolean
    cancel_after_trial boolean
    provider_coupon_id provider_coupon_id is the coupon code that will be applied to the subscription generated by the billing provider, this will be deprecated once coupons are managed by the platform
    product_body object
    product string
    quantity int64
    setup_body object
    payment_method boolean
    customer_portal boolean
Responses

A successful response.


Schema
    checkout_session object
    id string
    checkout_url string
    success_url string
    cancel_url string
    state string
    plan string
    product string
    metadata object
    created_at date-time
    updated_at date-time
    expire_at date-time
POST /v1beta1/organizations/:org_id/billing/:billing_id/checkouts

Authorization

name: Basic type: httpdescription: use Client ID as username and Client Secret as passwordin: headerscheme: basic

Request

Base URL
http://127.0.0.1:7400
Security Scheme
Username
Password
org_id — path required
billing_id — path required
Body required
{
"success_url": "string",
"cancel_url": "string",
"subscription_body": {
"plan": "string",
"skip_trial": true,
"cancel_after_trial": true,
"provider_coupon_id": "string"
},
"product_body": {
"product": "string",
"quantity": "string"
},
"setup_body": {
"payment_method": true,
"customer_portal": true
}
}
curl / cURL
curl -L -X POST 'http://127.0.0.1:7400/v1beta1/organizations/:org_id/billing/:billing_id/checkouts' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"success_url": "string",
"cancel_url": "string",
"subscription_body": {
"plan": "string",
"skip_trial": true,
"cancel_after_trial": true,
"provider_coupon_id": "string"
},
"product_body": {
"product": "string",
"quantity": "string"
},
"setup_body": {
"payment_method": true,
"customer_portal": true
}
}'