Update supported provider restrictions
POST /providers/edit/
What It Does
Update provider restrictions supported by the public API, such as service access.
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: object
| Field | Required | Type | Description |
|---|---|---|---|
id | Yes | integer or string | Resource identifier used by TheBooking. |
tbk_RestrictServices | No | boolean | Restrict the provider to tbk_AllowedServices. |
tbk_AllowedServices | No | array of string | The services the provider can offer when tbk_RestrictServices is on. |
tbk_Paused | No | boolean | Pause (true) or resume (false) the provider. A paused provider can't be booked; their reservations stay. |
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 |
422 | Response | tbk_Paused is not a boolean. Nothing is saved. | ErrorEnvelope |
Request Example
curl -X POST "https://example.com/wp-json/thebooking/v1/API/providers/edit/" \
-H "Authorization: Bearer $TBK_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": 123,
"tbk_RestrictServices": true,
"tbk_AllowedServices": [
"string"
],
"tbk_Paused": true
}'
JSON Body
{
"id": 123,
"tbk_RestrictServices": true,
"tbk_AllowedServices": [
"string"
],
"tbk_Paused": true
}
Success Response Example
{
"status": "OK"
}