Skip to main content
PATCH
/
customers
/
{customer_id}
Update a customer
curl --request PATCH \
  --url https://api.billing.io/v1/customers/{customer_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "jsmith@example.com",
  "name": "<string>",
  "external_id": "<string>",
  "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"
}
Update a customer’s name, email, external_id, or metadata.
curl -X PATCH https://api.billing.io/v1/customers/cus_a1b2c3d4e5f6a7b8c9d0e1f2 \
  -H "Authorization: Bearer $BILLING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Alice Smith", "metadata": { "plan": "enterprise" } }'

Authorizations

Authorization
string
header
required

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

Path Parameters

customer_id
string
required

The customer identifier (prefixed cus_)

Body

application/json
email
string<email>

Customer email address

name
string | null

Customer display name

Maximum string length: 256
external_id
string | null

External identifier from your system

Maximum string length: 256
metadata
object

Arbitrary key-value metadata

Response

Customer updated

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>