Skip to main content
POST
/
checkout
import { Autumn as autumn } from 'autumn-js'

const response = await autumn.checkout({
customer_id: 'user_123',
product_id: 'pro'
})
{}
If the customer_id you send doesn’t already exist, Autumn will automatically create a new customer. You can optionally set the properties of this new customer through the customer_data field.

Authorizations

Authorization
string
header
required

Use your Autumn Secret Key as the Bearer token.

Body

application/json
customer_id
string
required

Your unique identifier for the customer

product_id
string
required

Product ID, set when creating the product in the Autumn dashboard

product_ids
string[]

List of product IDs to attach to the customer in the same subscription or transaction

success_url
string

URL to redirect to after the purchase is successful

options
object[]

Pass in quantities for prepaid features.

reward
string

An Autumn promo_code or reward_id to apply at checkout.

entity_id
string

If using entities, the entity to attach the product to.

customer_data
object

Additional customer properties. These will be used if the customer's properties are not already set.

checkout_session_params
object

Additional parameters to pass onto Stripe when creating the checkout session.

Response

200 - application/json

The response is of type object.