Customers

Create Customer

Create a new customer record. Email is required unless dangerouslyAllowCustomerWithoutEmail is true. Enforces email uniqueness unless dangerouslyAllowSameEmailForDifferentCustomers is true. Automatically links to payment provider if pspCustomerId is provided.

POST
/customers

Authorization

bearerAuth
AuthorizationBearer <token>

Use your secret API key as the bearer token

In: header

Request Body

application/json

name*string

Customer name (required)

email?string

Customer email (required unless dangerouslyAllowCustomerWithoutEmail is true)

Formatemail
phoneNumber?string

Customer phone number

externalCustomerId?string

Your application's user ID (e.g., Supabase user ID)

pspCustomerId?string

Existing payment provider customer ID to link (e.g., Stripe cus_*)

billingAddressLine1?string

Billing address line 1

billingAddressLine2?string

Billing address line 2

billingCity?string

Billing city

billingStateProvince?string

Billing state or province

billingPostalCode?string

Billing postal/ZIP code

billingCountry?string

Billing country (ISO 3166-1 alpha-2 code)

businessName?string

Business name for B2B customers

taxId?string

Tax ID / VAT number

taxExempt?boolean

Whether customer is exempt from taxes

taxExemptionReason?string

Reason for tax exemption

taxExemptionCertificate?string

URL or reference to tax exemption certificate

taxRateDefinitionId?string

Reference to merchant's manual tax rate definition

taxCalculationMethod?string

Tax calculation override: 'auto' or 'manual'

Value in"auto" | "manual"
invoicePrefix?string

Custom invoice number prefix

Lengthlength <= 20
preferredLanguage?string

ISO 639-1 language code

Default"en"
timezone?string

IANA timezone identifier

Default"UTC"
preferredCurrency?string

ISO 4217 currency code

Default"USD"
metadata?

Custom key-value metadata

dangerouslyAllowCustomerWithoutEmail?boolean

Bypass email requirement (use with caution)

Defaultfalse
dangerouslyAllowSameEmailForDifferentCustomers?boolean

Allow duplicate emails across customers (use with caution)

Defaultfalse

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.getlumen.dev/v1/customers" \  -H "Content-Type: application/json" \  -d '{    "externalCustomerId": "user_ext_abc123",    "name": "Jane Doe",    "email": "jane@example.com",    "phoneNumber": "+1234567890",    "billingAddressLine1": "123 Main St",    "billingCity": "San Francisco",    "billingStateProvince": "CA",    "billingPostalCode": "94102",    "billingCountry": "US",    "preferredCurrency": "USD",    "timezone": "America/Los_Angeles",    "metadata": {      "internalUserId": "12345"    }  }'
{
  "customer": {
    "id": "cus_01hrwzqrz4ytkwv07syv8k7g3z",
    "merchantId": "mrc_01hptv3p6xj173pfv96pxd5pke",
    "externalCustomerId": "user_ext_abc123",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "phoneNumber": "+1234567890",
    "pspCustomerId": null,
    "billingCountry": "US",
    "preferredCurrency": "USD",
    "timezone": "America/Los_Angeles",
    "createdAt": "2025-02-20T16:05:23.412Z"
  }
}
{
  "error": "Email is required"
}
{
  "error": "A customer with this email already exists"
}
{
  "error": "string",
  "details": "string"
}