Reschedule Booking

Gives an existing booking a new date, identified by its Sodtrack id.

PATCH/api/integration/booking/{bookingId}/reschedule

Request

cURL
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

NameTypeDescription
bookingIdrequiredstring

Responses

Reschedule to a date within a time range:
{
  "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

HeaderRequiredDescription
x-api-keySodtrack 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

FieldTypeRequiredDescription
bookingIdnumberSodtrack booking id. Must be an integer.

🕒 Date assignment (dateAssignment)

FieldTypeRequiredDescription
dateAssignmentobjectThe new scheduling. Same shape as in booking creation.
dateAssignment.typestringOne of: "direct", "userScheduling", "providerScheduling", "onDemand".
dateAssignment.datestring (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.timeRangeobjectOnly 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.typestring✅ when object sentOne of: "timeRangeId", "timeRangeIndex".
dateAssignment.timeRange.valuenumber✅ when object sentThe 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:

json
{
  "dateAssignment": {
    "type": "direct",
    "date": "2026-10-15T09:00:00.000Z"
  }
}

Hand the date back to the customer:

json
{
  "dateAssignment": {
    "type": "userScheduling"
  }
}

Turn the booking into an on-demand service:

json
{
  "dateAssignment": {
    "type": "onDemand"
  }
}

Ask the provider to propose a date:

json
{
  "dateAssignment": {
    "type": "providerScheduling"
  }
}

Reschedule to a date within a time range:

json
{
  "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.

json
{
  "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

FieldTypeDescription
idnumberSodtrack booking id.
reference`stringnull`
statusstringBooking 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`
quantitynumberQuantity booked.
totalDurationMinutes`numbernull`
doneDate`string (datetime)null`
createdDatestring (datetime)When the booking was created.
customer`objectnull`
stakeholder`objectnull`
service`objectnull`
variant`objectnull`
category`objectnull`
address`objectnull`
originAddress`objectnull`
saleChannel`objectnull`
project`objectnull`
lead`objectnull`
provider`objectnull`
bookingBundle`objectnull`
price`numbernull`
cost`numbernull`
bookingAddOns[]arrayAdd-ons: id, name, reference.
products[]arrayProducts in the booking: id, name, sku, productType, quantity, serialNumber and pricing.
incidents[]arrayIncidents: id and reference.
alerts[]arrayAlerts: id and reference.
notes[]arrayNotes: id, note, reference.
dynamicFormSnapshotFields[]arrayDynamic form answers captured during the booking: id, reference, value, secondaryValue, type, snapshotId.

Error Responses

HTTP StatusErrorDescription
400 Bad RequestValidation failed (numeric string is expected)bookingId is not an integer.
400 Bad RequestdateAssignment is missing or malformed (type not one of the accepted values, timeRange without type or numeric value).
400 Bad RequestDate is required when type is DIRECTdateAssignment.date is missing.
400 Bad RequestINVALID_DATE: expected ISO 8601dateAssignment.date is not a valid ISO 8601 date.
400 Bad RequestTIME_RANGE_NOT_FOUND: {type} {value}No time range matches the id or index sent.
400 Bad RequestBOOKING_CANNOT_BE_RESCHEDULED: status {status}The booking is in execution, done or cancelled.
401 UnauthorizedMissing or invalid x-api-key, or the request does not come from an authorized origin.
404 Not FoundBOOKING_NOT_FOUND: {bookingId}No booking exists with that id.
500 Internal Server ErrorUnexpected 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

typeEffect on the booking
directSets the date and time sent (and the period window when timeRange is given).
userSchedulingClears 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.
providerSchedulingClears 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.
onDemandClears 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.

RequestResult
date onlyBooking scheduled at that date and time, no period window.
date + timeRangeBooking scheduled at that date and time, period window set to the time range.
timeRange only400 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

typeBooking beforeStatus after
directHas an assigned provideraccepted
directNo provider, with an assignment mechanism configuredsearching; Sodtrack starts looking for a provider for the new date.
directNo provider and no assignment mechanismwaiting_assignment_mechanism
userSchedulingHas an assignment mechanism configuredwaiting_customer_to_set_date
userSchedulingNo assignment mechanismwaiting_assignment_mechanism
providerSchedulingAnywaiting_provider_to_propose_date
onDemandAutomatic provider assignmentsearching
onDemandAssigned provider, or no assignment mechanismaccepted

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.