Skip to main content
POST
/
customers
Create a customer
curl --request POST \
  --url https://api.billing.io/v1/customers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "user@example.com",
  "name": "Jane Doe",
  "external_id": "usr_12345",
  "metadata": {}
}
'
{
  "id": "cus_1a2b3c4d5e",
  "org_id": "<string>",
  "email": "jsmith@example.com",
  "name": "<string>",
  "external_id": "<string>",
  "metadata": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
Create a new customer record.
curl -X POST https://api.billing.io/v1/customers \
  -H "Authorization: Bearer $BILLING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "alice@example.com",
    "name": "Alice Johnson",
    "external_id": "usr_12345",
    "metadata": { "plan": "pro" }
  }'
Response
{
  "id": "cus_a1b2c3d4e5f6a7b8c9d0e1f2",
  "email": "alice@example.com",
  "name": "Alice Johnson",
  "external_id": "usr_12345",
  "metadata": { "plan": "pro" },
  "environment": "live",
  "created_at": "2025-01-15T12:00:00Z"
}

Authorizations

Authorization
string
header
required

Use your secret API key as a Bearer token. Keys are prefixed: sk_live_ (production) or sk_test_ (sandbox).

Body

application/json
email
string<email>
required

Customer email address

Example:

"user@example.com"

name
string

Customer display name

Maximum string length: 256
Example:

"Jane Doe"

external_id
string

External identifier from your system

Maximum string length: 256
Example:

"usr_12345"

metadata
object

Arbitrary key-value metadata

Response

Customer created

id
string

Unique identifier (prefixed cus_)

Example:

"cus_1a2b3c4d5e"

org_id
string

Organization identifier

email
string<email>

Customer email address

name
string | null

Customer display name

external_id
string | null

External identifier from your system

metadata
object

Arbitrary key-value metadata

environment
enum<string>
Available options:
live,
sandbox
created_at
string<date-time>
updated_at
string<date-time>