Before you start
- A sandbox API key (
sk_sandbox_...) with thecustomers:read/customers:writescopes. See Permissions.
Steps
1
Create a customer
Call
POST /v1/customers with at least an email. Attach your own data with metadata.billing_address is optional. Omit it and the customer has none, shown as null. line1 and country are required whenever you do supply one, and country must be a real ISO-3166-1 alpha-2 code (for example NG, FR).Keep the customer_id (prefixed cust_). You’ll use it to attach the customer to a checkout or subscription.2
Find a customer
Retrieve one by ID, or list and search by email or name.The list response returns
{ items, pagination }. Page through with limit and the cursor. See Pagination.3
Update a customer
Send only the fields you want to change with
PATCH. Everything else stays as it was.Attach a customer to a checkout
Once you have acustomer_id, pass it when creating a checkout so the payment ties to that record. See Accept a payment.
When a checkout creates a customer
You don’t have to pass acustomer at all. Omit it on a standard hosted checkout and Bachs collects the buyer’s email and name on the checkout page. By default they do not join your directory: you get the identity on customer_details instead. Send customer_creation: "always" to add them, matched by email so a buyer you already hold attaches to their existing record rather than a second one.
customer stays required for a subscription checkout, where recurring billing needs a durable record. See Guest checkout for the full flow.
Putting hosted-checkout buyers in your directory
The default,customer_creation: "if_required", keeps a one-time buyer out of your directory. Their email and name still reach you, on customer_details on the checkout object and on checkout.completed, and their purchases group together in your dashboard so you can look them up when they write in. What you do not get is a customer you can reach through this API: customer is null on every response and webhook for that checkout, and no customer.created or customer.updated event fires.
Pass customer_creation: "always" when you create the checkout and the buyer is added to your directory like any other customer, matched by email to one you already hold. See customer_creation.
From the dashboard
You can also create and manage customers without code. Open Customers to view a record’s payments, subscriptions, and refunds in one place, or add a customer manually. Records created in the dashboard and via the API are the same customers.Next steps
- The customer object: every field the API returns.
- Accept a payment: attach the customer to a checkout.
- Sell a subscription: bill the customer on a recurring plan.
- Customer portal lets the customer manage their own subscriptions, invoices, and cards.

