API Reference
Customers
A customer represents a person or business you bill. Attach customers to checkout sessions, invoices, and payment links to reuse their details and build a payment history.
Customers are lightweight — you can pass `customer_email` on every checkout session without creating one, but doing so gives you a reusable record, unlocks the customer portal, and lets you associate multiple invoices or recurring templates with the same person.
The customer object
idstringUnique identifier, prefixed with `cus_`.
objectstringAlways `"customer"`.
livemodebooleanTrue if created with a live-mode key.
emailstringCustomer email. Used for receipts and portal magic links.
first_namestringGiven name.
last_namestringFamily name.
phonestringnullablePhone number in any format you prefer to store.
company_namestringnullableBusiness name shown on invoices.
notesstringnullableFree-form internal notes. Never shown to the customer.
metadataobjectnullableUp to 20 key/value pairs for your bookkeeping.
stripe_customer_idstringnullableThe Stripe Customer id provisioned for this record on your connected account. Managed by LuniPay — do not mutate.
createdintegerCreation timestamp (unix).
updatedintegerLast-updated timestamp (unix).
{
"id": "cus_01JRZK2Q4T9ZS0VCNA3HX7W9EY",
"object": "customer",
"livemode": false,
"email": "ada@example.com",
"first_name": "Ada",
"last_name": "Lovelace",
"phone": "+18765551234",
"company_name": "Analytical Engines Ltd.",
"notes": "VIP — priority support",
"metadata": {
"internal_id": "ACCT-42"
},
"stripe_customer_id": "cus_Pxxxxxxxxxxxx",
"created": 1713100800,
"updated": 1713100800
}Endpoints
- POST
/v1/customersCreate a customerCreates a new customer record.
- GET
/v1/customers/:idRetrieve a customerFetches a customer by id.
- PATCH
/v1/customers/:idUpdate a customerUpdates any subset of the customer fields.
- GET
/v1/customersList customersReturns a cursor-paginated list of customers, newest first.
- DELETE
/v1/customers/:idDelete a customerPermanently deletes a customer.