Update a customer
Changes a customer's name, email, phone number or metadata. Fields you leave out keep their values, and `metadata` replaces what was stored rather than merging into it. The new email must be free in this merchant and mode (`409 CUSTOMER_EXISTS`). Payments and subscriptions already taken keep the name, email and phone number they were paid with; they are not rewritten.
Changes a customer's name, email, phone number or metadata. Fields you leave out keep their values, and metadata replaces what was stored rather than merging into it. The new email must be free in this merchant and mode (409 CUSTOMER_EXISTS). Payments and subscriptions already taken keep the name, email and phone number they were paid with; they are not rewritten.
Authorization
secretKey Your secret key: sk_live_… or sk_test_….
In: header
Path Parameters
The customer's id, which starts with cus_.
^cus_[0-9a-f]{32}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PATCH "https://example.com/customers/cus_3f2b8c1e9a4d4e7b8c2a1d5e6f7a8b9c" \ -H "Content-Type: application/json" \ -d '{}'{ "object": "customer", "customer_id": "cus_3f2b8c1e9a4d4e7b8c2a1d5e6f7a8b9c", "name": "string", "email": "user@example.com", "phone_number": "string", "metadata": { "property1": "string", "property2": "string" }, "created_at": "2019-08-24T14:15:22Z"}List customers GET
Lists customers, newest first, or finds one by `email`. One page carries `items`, `has_more` and `next_cursor`; pass `next_cursor` back as `cursor` for the next page. Only customers belonging to the key's merchant and mode are listed.
Create a webhook endpoint POST
The response includes the endpoint's signing `secret`. Registers a URL that receives signed events. The URL must be `https://` on a public host and carry no credentials; private, loopback, link-local and internal addresses are refused with `INVALID_REQUEST_BODY`, including hosts whose DNS answers with one. An endpoint created without `event_types` receives every event type. Each mode allows 16 endpoints (`409 LIMIT_REACHED`). Store the `secret` when you read it here: no other response repeats it except `GET /webhooks/{id}/secret`. Send `Idempotency-Key` so a retried request does not add a second endpoint — a replayed response has the secret stripped out, since a stored response must not keep it.