Overview
By passing eithercustomer_id or external_customer_id when creating a checkout session, Spaire will:
- Pre-fill the customer’s information in the checkout form
- Disable the email field so it cannot be edited
- Link the resulting order to the specified customer
Using Customer ID
If you’ve already created a customer in Spaire and have their Spaire customer ID, you can use it directly.Get the Customer ID
Retrieve the customer ID from your Spaire dashboard or through the Customers API.The customer ID is a UUID format like:
992fae2a-2a17-4b7a-8d9e-e287cf90131bCreate Checkout Session with customer_id
Pass the
customer_id parameter when creating the checkout session.Using External Customer ID
If you have your own user management system, you can use your internal customer ID. This is the recommended approach as it makes reconciliation between your system and Spaire easier.Use Your Internal Customer ID
When creating a checkout session, pass your application’s user ID as the
external_customer_id.Spaire will:- Look for an existing customer with this external ID
- If found, link to that customer and pre-fill their data

