Skip to main content
Checkout Sessions are a way to set up a subscription for your customers. You can create a Checkout Session for a specific amount and currency, and share the Checkout Session URL with your customers. Your customers can then subscribe using their preferred payment method.

Create a customer

Before creating a Checkout Session, you need to create a customer. You can create a customer using the Customers API.
Create a customer
If the request completed successfully, the response contains the customer object.
Customer object

Create a Checkout Session

To create a Checkout Session, you need to specify the currency, customer, description, and subscription_data.
Create a Checkout Session
If the request completed successfully, the Checkout Session object contains the url parameter.
Checkout Session object

Required parameters

Subscription data parameters

The subscription_data object defines the subscription that will be created when the Checkout Session completes. Only collection_method and interval are required.

Subscription item parameters

Each item in subscription_data.items requires price_data and type.

Supported payment method types

Use payment_method_types to control which payment methods are offered to the customer.

Collect terms of service acceptance

Use consent_collection to require the customer to accept terms of service before completing the Checkout Session, and custom_text.terms_of_service.message to override the default terms text.
Checkout Session with terms of service

Share the Checkout Session URL

After creating a Checkout Session, you will receive a Checkout Session URL. Share this link with your customers so they can subscribe using their preferred payment method.
By default, Yorlet automatically emails the URL to the customer. Set send_email to false if you’d rather share the URL through your own application.

Handle the Checkout Session completion

When your customers complete the checkout process, you will receive a webhook event. You can use the Webhook Endpoints API to set up a webhook endpoint and handle the event.