Update a customer
POST /customers/edit/
What It Does
Update the supported customer profile fields without touching reservation history.
Authentication
Requires an API token with the write scope. Send it as a bearer token or with the configured API key header.
Parameters
This endpoint does not define query or path parameters.
Request Body
Content type: application/json
Required: Yes
Schema: CustomerEdit
| Field | Required | Type | Description |
|---|---|---|---|
id | Yes | string | Resource identifier used by TheBooking. |
name | No | string | Display name shown in the administration panel and booking flows. |
email | No | string (email) | Customer or provider email address. |
phone | No | string | Customer phone number. |
wpUserId | No | integer | Linked WordPress user ID. |
status | No | integer | Current reservation status. |
timezone | No | string or null | IANA timezone for customer-facing date and time handling. |
Responses
| Status | Meaning | Description | Body |
|---|---|---|---|
200 | Success | Operation completed | OkEnvelope |
400 | Invalid request | Invalid request or application rule failure | ErrorEnvelope |
401 | Authentication required | Missing or invalid API token | WpRestError |
403 | Forbidden | Token lacks write scope or the operation is forbidden | WpRestError or ErrorEnvelope |
404 | Not found | Resource not found | ErrorEnvelope |
Request Example
curl -X POST "https://example.com/wp-json/thebooking/v1/API/customers/edit/" \
-H "Authorization: Bearer $TBK_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "resource_123",
"name": "Example name",
"email": "customer@example.com",
"phone": "+1 555 0100",
"wpUserId": 123,
"status": 1,
"timezone": "Europe/Rome"
}'
JSON Body
{
"id": "resource_123",
"name": "Example name",
"email": "customer@example.com",
"phone": "+1 555 0100",
"wpUserId": 123,
"status": 1,
"timezone": "Europe/Rome"
}
Success Response Example
{
"status": "OK"
}