Endpoint
Update a customer
PATCH
/v1/customers/{id}Changes the fields you send of a customer and leaves the others as they are; sending null clears an optional field. Returns the customer object as it is after the change.
- Scope a restricted key needs
customers:write- Publishable key
- Not allowed: secret or restricted key only
- Idempotency-Key
- Not used. A PATCH is already safe to repeat.
Parameters
| Parameter | Type and place | Meaning |
|---|---|---|
idrequired | stringpath | The id of the customer. |
Orrerie-Version | stringheader | API version date. Default: the version the key was created with. Example 2026-10-11. |
Request body
A JSON object. The body may be left out. A field the call does not list is refused with parameter_unknown.
| Field | Type | Meaning |
|---|---|---|
name | string | Up to 200 characters. |
email | string | Needed for invoices, subscriptions and receipts. |
description | string | Your own note about the customer; null clears it. |
billing_address | object | {line1, line2, city, region, postal_; country is ISO 3166-1 alpha-2. |
locale | string | en. |
metadata | object | Your own key-value data (rules in Metadata). |
Example request
curl
curl -X PATCH https://api.orrerie.com/v1/customers/cus_8ea07c40qsvv19f7rgmeb8ha \
-H "Authorization: Bearer $ORRERIE_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Wholesale buyer, net 14"
}'JavaScript
const response = await fetch("https://api.orrerie.com/v1/customers/cus_8ea07c40qsvv19f7rgmeb8ha", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.ORRERIE_SECRET_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"description": "Wholesale buyer, net 14"
}),
});
const result = await response.json();
if (!response.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
console.log(result);Python
import os
import requests
response = requests.patch(
"https://api.orrerie.com/v1/customers/cus_8ea07c40qsvv19f7rgmeb8ha",
headers={"Authorization": f"Bearer {os.environ['ORRERIE_SECRET_KEY']}"},
json={
"description": "Wholesale buyer, net 14",
},
timeout=30,
)
result = response.json()
if not response.ok:
raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)PHP
<?php
$request = curl_init('https://api.orrerie.com/v1/customers/cus_8ea07c40qsvv19f7rgmeb8ha');
curl_setopt_array($request, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ORRERIE_SECRET_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Wholesale buyer, net 14',
]),
]);
$body = curl_exec($request);
if ($body === false) {
throw new RuntimeException(curl_error($request));
}
$result = json_decode($body, true);
if (curl_getinfo($request, CURLINFO_HTTP_CODE) >= 400) {
throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);Responses
200 OK
The answer is the customer object. Headers: Orrerie-Request-Id.
Example response, 200
{
"id": "cus_8ea07c40qsvv19f7rgmeb8ha",
"object": "customer",
"livemode": true,
"created": "2026-10-01T08:00:00.000Z",
"updated": "2026-10-12T08:00:00.000Z",
"name": "Jane Doe",
"email": "jane@example.com",
"description": "Wholesale buyer, net 14",
"billing_address": {
"line1": "12 Market Street",
"line2": null,
"city": "Portland",
"region": "OR",
"postal_code": "97201",
"country": "US"
},
"refund_addresses": [
{
"asset": "ethereum:usdc",
"address": "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB",
"added": "2026-10-01T08:00:00.000Z"
}
],
"credit_balance": {
"amount": "0.00",
"currency": "USD"
},
"locale": "en",
"metadata": {
"crm_id": "88213"
}
}Any other status: an error
A status of 400 or above answers with the error object. Branch on its code, never on its message.
Errors
This call has no error of its own. It answers with the errors every call can answer with: a bad key, a missing scope, an object that does not exist, the rate limit. Every error code has its own entry.