Reschedule Booking
Gives an existing booking a new date, identified by its Sodtrack id.
/api/integration/booking/{bookingId}/rescheduleRequest
curl -X PATCH "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/booking/{bookingId}/reschedule" \
-H "Authorization: Bearer $SODTRACK_TOKEN"Base URL: https://dev.integration.cl.sodtrack-shared.sodtrack.com · other environments
Path parameters
| Name | Type | Description |
|---|---|---|
bookingIdrequired | string | — |
Responses
{
"id": 13,
"reference": "BK-2026-0456",
"status": "accepted",
"scheduledDate": "2026-10-15T09:00:00.000Z",
"quantity": 1,
"totalDurationMinutes": 60,
"doneDate": null,
"createdDate": "2026-08-26T04:22:29.911Z",
"customer": {
"id": 32841,
"reference": "CUST-00123"
},
"stakeholder": null,
"service": {
"id": 1,
"name": "Water heater installation"
},
"variant": {
"id": 1,
"name": "Standard installation",
"type": "execution",
"skus": []
},
"category": {
"id": 1,
"name": "Installations"
},
"address": {
"formattedAddress": "Av. Corrientes 1234, Buenos Aires",
"coordinates": null
},
"originAddress": null,
"saleChannel": null,
"project": null,
"lead": null,
"provider": {
"id": 19,
"reference": null,
"name": "Carlos",
"lastname": "Muñoz",
"email": "carlos.munoz@example.com",
"phone": "+56972345678",
"identificationNumber": null,
"assignedTo": null
},
"bookingBundle": null,
"price": 0,
"cost": 0,
"bookingAddOns": [],
"products": [],
"incidents": [],
"alerts": [],
"notes": [],
"dynamicFormSnapshotFields": []
}Error responses for this endpoint follow the shared error reference.
Purpose
Gives an existing booking a new date, identified by its Sodtrack id.
The request carries the same dateAssignment object used when creating bookings, with the same meaning for each type: direct schedules the booking to a specific date and time, userScheduling removes the date and hands the choice back to the customer, providerScheduling removes the date and asks the provider to propose one, and onDemand turns the booking into an on-demand service to be executed as soon as possible.
This endpoint does not validate coverage or agenda availability. It writes the date as sent. Verify beforehand that the booking's address is covered and that the provider has the requested slot, using the coverage and availability endpoints, so that this call stays cheap and predictable.
Authentication
| Header | Required | Description |
|---|---|---|
x-api-key | ✅ | Sodtrack inbound integration API key. |
The endpoint is restricted to Sodtrack's private integration network. Requests from unauthorized origins are rejected.
Endpoint
PATCH /api/integration/booking/{bookingId}/reschedule
Field Definitions
🧩 Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
bookingId | number | ✅ | Sodtrack booking id. Must be an integer. |
🕒 Date assignment (dateAssignment)
| Field | Type | Required | Description |
|---|---|---|---|
dateAssignment | object | ✅ | The new scheduling. Same shape as in booking creation. |
dateAssignment.type | string | ✅ | One of: "direct", "userScheduling", "providerScheduling", "onDemand". |
dateAssignment.date | string (datetime) | ✅ when type is "direct" | New date and time of the booking, ISO 8601 with timezone (for example 2026-10-15T09:00:00.000Z or 2026-10-15T06:00:00-03:00). With an offset or Z the instant is kept exactly; a value without timezone is read in your account's default timezone. Ignored for the other types. |
dateAssignment.timeRange | object | ❌ | Only with "direct". Time slot to record on the booking as its period window. Does not change the time of day, which always comes from date. |
dateAssignment.timeRange.type | string | ✅ when object sent | One of: "timeRangeId", "timeRangeIndex". |
dateAssignment.timeRange.value | number | ✅ when object sent | The time range id, or its 0-based position in the list of time ranges ordered by start time. An unknown id or an index past the last range is rejected. |
Example Request
Reschedule to a specific date and time:
{
"dateAssignment": {
"type": "direct",
"date": "2026-10-15T09:00:00.000Z"
}
}Hand the date back to the customer:
{
"dateAssignment": {
"type": "userScheduling"
}
}Turn the booking into an on-demand service:
{
"dateAssignment": {
"type": "onDemand"
}
}Ask the provider to propose a date:
{
"dateAssignment": {
"type": "providerScheduling"
}
}Reschedule to a date within a time range:
{
"dateAssignment": {
"type": "direct",
"date": "2026-10-15T09:00:00.000Z",
"timeRange": {
"type": "timeRangeId",
"value": 5
}
}
}Response Example
The updated booking, in the same shape as the booking search and detail endpoints.
{
"id": 13,
"reference": "BK-2026-0456",
"status": "accepted",
"scheduledDate": "2026-10-15T09:00:00.000Z",
"quantity": 1,
"totalDurationMinutes": 60,
"doneDate": null,
"createdDate": "2026-08-26T04:22:29.911Z",
"customer": {
"id": 32841,
"reference": "CUST-00123"
},
"stakeholder": null,
"service": {
"id": 1,
"name": "Water heater installation"
},
"variant": {
"id": 1,
"name": "Standard installation",
"type": "execution",
"skus": []
},
"category": {
"id": 1,
"name": "Installations"
},
"address": {
"formattedAddress": "Av. Corrientes 1234, Buenos Aires",
"coordinates": null
},
"originAddress": null,
"saleChannel": null,
"project": null,
"lead": null,
"provider": {
"id": 19,
"reference": null,
"name": "Carlos",
"lastname": "Muñoz",
"email": "carlos.munoz@example.com",
"phone": "+56972345678",
"identificationNumber": null,
"assignedTo": null
},
"bookingBundle": null,
"price": 0,
"cost": 0,
"bookingAddOns": [],
"products": [],
"incidents": [],
"alerts": [],
"notes": [],
"dynamicFormSnapshotFields": []
}Response Fields
| Field | Type | Description |
|---|---|---|
id | number | Sodtrack booking id. |
reference | `string | null` |
status | string | Booking status after the reschedule. One of: "created", "searching", "accepted", "on_my_way_to_origin", "arrived_to_origin", "on_my_way_to_destination", "arrived_to_destination", "left_destination", "done", "cancelled", "waiting_customer_to_set_date", "waiting_scheduling_mechanism", "waiting_assignment_mechanism", "waiting_provider_to_propose_date", "waiting_customer_to_accept_proposed_date". |
scheduledDate | `string (datetime) | null` |
quantity | number | Quantity booked. |
totalDurationMinutes | `number | null` |
doneDate | `string (datetime) | null` |
createdDate | string (datetime) | When the booking was created. |
customer | `object | null` |
stakeholder | `object | null` |
service | `object | null` |
variant | `object | null` |
category | `object | null` |
address | `object | null` |
originAddress | `object | null` |
saleChannel | `object | null` |
project | `object | null` |
lead | `object | null` |
provider | `object | null` |
bookingBundle | `object | null` |
price | `number | null` |
cost | `number | null` |
bookingAddOns[] | array | Add-ons: id, name, reference. |
products[] | array | Products in the booking: id, name, sku, productType, quantity, serialNumber and pricing. |
incidents[] | array | Incidents: id and reference. |
alerts[] | array | Alerts: id and reference. |
notes[] | array | Notes: id, note, reference. |
dynamicFormSnapshotFields[] | array | Dynamic form answers captured during the booking: id, reference, value, secondaryValue, type, snapshotId. |
Error Responses
| HTTP Status | Error | Description |
|---|---|---|
400 Bad Request | Validation failed (numeric string is expected) | bookingId is not an integer. |
400 Bad Request | — | dateAssignment is missing or malformed (type not one of the accepted values, timeRange without type or numeric value). |
400 Bad Request | Date is required when type is DIRECT | dateAssignment.date is missing. |
400 Bad Request | INVALID_DATE: expected ISO 8601 | dateAssignment.date is not a valid ISO 8601 date. |
400 Bad Request | TIME_RANGE_NOT_FOUND: {type} {value} | No time range matches the id or index sent. |
400 Bad Request | BOOKING_CANNOT_BE_RESCHEDULED: status {status} | The booking is in execution, done or cancelled. |
401 Unauthorized | — | Missing or invalid x-api-key, or the request does not come from an authorized origin. |
404 Not Found | BOOKING_NOT_FOUND: {bookingId} | No booking exists with that id. |
500 Internal Server Error | — | Unexpected server error. Contact Sodtrack support. |
Business Rules & Constraints
No coverage or availability validation
Sodtrack does not check that the booking address is covered, nor that the assigned provider is available at the requested date, time or time range. The date is written as sent. Run those checks first with the coverage and availability endpoints; this endpoint is meant to be the final, cheap write once a valid slot is known.
What each type does
type | Effect on the booking |
|---|---|
direct | Sets the date and time sent (and the period window when timeRange is given). |
userScheduling | Clears the date and any period window and marks the booking as customer-managed: the customer picks the date later from the web or the app. No effect if the booking is already customer-managed. |
providerScheduling | Clears the date and any period window and asks the assigned provider to propose a date. No effect if the booking is already waiting for a provider proposal. |
onDemand | Clears the date and any period window and marks the booking as on demand. With automatic provider assignment, Sodtrack starts searching a provider right away; with an assigned provider, the booking is scheduled from that provider's estimated arrival time. |
Date, time and time range
The day and the time of day are both taken from dateAssignment.date, kept as the exact instant sent: 2026-10-15T09:00:00.000Z and 2026-10-15T06:00:00-03:00 schedule the same moment. When timeRange is sent, the matching time range is recorded as the booking's period window; the time of day is not moved into the range. When timeRange is omitted, any period previously recorded on the booking is cleared.
| Request | Result |
|---|---|
date only | Booking scheduled at that date and time, no period window. |
date + timeRange | Booking scheduled at that date and time, period window set to the time range. |
timeRange only | 400 Bad Request, date is required. |
Which bookings can be rescheduled
Bookings with status on_my_way_to_origin, arrived_to_origin, on_my_way_to_destination, arrived_to_destination, left_destination, done or cancelled are rejected. Any other status is accepted, including bookings that never had a date.
Status after the reschedule
type | Booking before | Status after |
|---|---|---|
direct | Has an assigned provider | accepted |
direct | No provider, with an assignment mechanism configured | searching; Sodtrack starts looking for a provider for the new date. |
direct | No provider and no assignment mechanism | waiting_assignment_mechanism |
userScheduling | Has an assignment mechanism configured | waiting_customer_to_set_date |
userScheduling | No assignment mechanism | waiting_assignment_mechanism |
providerScheduling | Any | waiting_provider_to_propose_date |
onDemand | Automatic provider assignment | searching |
onDemand | Assigned provider, or no assignment mechanism | accepted |
If the booking was waiting for a provider-proposed date, the pending proposals are cancelled.
Bundled bookings
Rescheduling a booking that belongs to a bundle reschedules the whole bundle: the new date is applied through the bundle head, and every booking in the bundle follows it.
Side effects
The reschedule is logged on the booking, the reminder cycle restarts, the provider's agenda is updated when one is assigned, and the usual booking-scheduled and status-change notifications are sent to your configured webhooks.