Skip to main content

Customers API

List​

GET /customers/get/

Create​

POST /customers/add/

{
"name": "Ada Lovelace",
"email": "ada@example.com",
"phone": "+44 20 7946 0958",
"timezone": "Europe/London",
"language": "en_GB"
}

Use createUser=true as a query parameter to create a linked WordPress user. Alternatively pass an existing wpUserId.

Edit​

POST /customers/edit/ requires id and accepts updated profile, WordPress user, status, and timezone fields.

Remove​

POST /customers/remove/?id=c_example

The standard endpoint refuses to remove a customer who still has reservations. GDPR erasure is an administrator workflow in the WordPress interface, not a public API operation.

Response​

GET /customers/get/ returns the customers in response. The fields follow the Customer schema of the API reference; values here are examples.

{
"status": "OK",
"response": [
{
"id": "c_demo",
"name": "Ada Lovelace",
"email": "ada@example.com",
"phone": "+44 20 7946 0958",
"wp_user": 0,
"timezone": "Europe/London",
"language": "en_GB"
}
]
}

wp_user is the ID of the linked WordPress user, 0 when there is none. Creation returns the new id.

Errors​

HTTP statusWhen
400The request is not valid, for example a required field is missing.
401The token is missing or not valid.
403The token has no write scope, or the customer has reservations and cannot be removed.
404No customer has this id.