Get Provider by Booking

Returns the full record of the provider assigned to a booking, identified by the booking's Sodtrack id.

GET/api/integration/booking/{bookingId}/provider

Request

cURL
curl -X GET "https://uat.integration.cl.sodtrack-shared.sodtrack.com/api/integration/booking/{bookingId}/provider" \
  -H "Authorization: Bearer $SODTRACK_TOKEN" \
  -H "origin: <your-origin>"

Base URL: https://uat.integration.cl.sodtrack-shared.sodtrack.com · other environments

Path parameters

NameTypeDescription
bookingIdrequiredstring—

Headers

NameTypeDescription
originstring—

Responses

Get Provider by Booking
{
  "id": 1543,
  "reference": "PROV-EXT-1543",
  "name": "María",
  "lastname": "Técnica",
  "email": "maria.tecnica@example.com",
  "phone": "+56912345678",
  "identificationNumber": "12345678-9",
  "identificationNumberCountry": "CL",
  "status": "accepted",
  "isCompany": false,
  "worksOnHolidays": false,
  "ownsTransportation": true,
  "isMainProviderEligible": true,
  "isLeadAssignmentEligible": true,
  "isDirectAssignment": false,
  "isRequestAutoAcceptance": false,
  "priorityGroup": 1,
  "rating": 4.5,
  "reviewsCount": 12,
  "createdDate": "2025-02-14T13:05:30.000Z",
  "addresses": [
    {
      "id": 24,
      "address": "Av. Providencia 1234",
      "formattedAddress": "Av. Providencia 1234, Providencia, Región Metropolitana, Chile",
      "extraInfo": "Office 302",
      "active": true,
      "coordinates": {
        "lat": -33.4263,
        "lng": -70.62
      }
    }
  ],
  "parent": {
    "id": 893,
    "reference": "COMPANY-EXT-893",
    "name": "Servicios del Sur",
    "lastname": "SpA"
  },
  "dynamicForms": [
    {
      "id": 7410,
      "name": "Technician registration",
      "flow": "network_worker_creation",
      "createdDate": "2025-02-14T13:06:10.000Z",
      "fields": [
        {
          "id": 52118,
          "reference": "license",
          "label": "License number",
          "type": "text",
          "value": "LIC-1234",
          "secondaryValue": null
        },
        {
          "id": 52119,
          "reference": "specialties",
          "label": "Specialties",
          "type": "checkbox",
          "value": "Electricity, Plumbing",
          "secondaryValue": null
        }
      ]
    }
  ]
}

Error responses for this endpoint follow the shared error reference.

Purpose

Returns the full record of the provider assigned to a booking, identified by the booking's Sodtrack id.

The response has the same shape as Get Provider: basic information (personal data, status, features, rating and addresses), the dynamic forms filled for the provider and, when the provider belongs to a company, the company in parent.

Unlike the provider returned by the booking endpoints, which reports a provider that belongs to a company as the company itself, this endpoint returns the provider actually assigned to the booking. The company is identified in parent, and its full record is obtained with Get Provider using parent.id.


Field Definitions

🔐 Authentication

FieldTypeRequiredDescription
x-api-key (header)string✅External integration API key provided by Sodtrack.

🔎 Path parameters

ParameterTypeRequiredDescription
bookingIdnumber✅Sodtrack booking id. Must be an integer.

Example Request

Path parameter example:

code
bookingId = 51889

Response Example

Booking assigned to a provider that belongs to a company:

json
{
  "id": 1543,
  "reference": "PROV-EXT-1543",
  "name": "María",
  "lastname": "Técnica",
  "email": "maria.tecnica@example.com",
  "phone": "+56912345678",
  "identificationNumber": "12345678-9",
  "identificationNumberCountry": "CL",
  "status": "accepted",
  "isCompany": false,
  "worksOnHolidays": false,
  "ownsTransportation": true,
  "isMainProviderEligible": true,
  "isLeadAssignmentEligible": true,
  "isDirectAssignment": false,
  "isRequestAutoAcceptance": false,
  "priorityGroup": 1,
  "rating": 4.5,
  "reviewsCount": 12,
  "createdDate": "2025-02-14T13:05:30.000Z",
  "addresses": [
    {
      "id": 24,
      "address": "Av. Providencia 1234",
      "formattedAddress": "Av. Providencia 1234, Providencia, Región Metropolitana, Chile",
      "extraInfo": "Office 302",
      "active": true,
      "coordinates": {
        "lat": -33.4263,
        "lng": -70.6200
      }
    }
  ],
  "parent": {
    "id": 893,
    "reference": "COMPANY-EXT-893",
    "name": "Servicios del Sur",
    "lastname": "SpA"
  },
  "dynamicForms": [
    {
      "id": 7410,
      "name": "Technician registration",
      "flow": "network_worker_creation",
      "createdDate": "2025-02-14T13:06:10.000Z",
      "fields": [
        {
          "id": 52118,
          "reference": "license",
          "label": "License number",
          "type": "text",
          "value": "LIC-1234",
          "secondaryValue": null
        },
        {
          "id": 52119,
          "reference": "specialties",
          "label": "Specialties",
          "type": "checkbox",
          "value": "Electricity, Plumbing",
          "secondaryValue": null
        }
      ]
    }
  ]
}

Booking assigned to an independent provider, without addresses or forms:

json
{
  "id": 622,
  "reference": "PROV-EXT-622",
  "name": "Juan",
  "lastname": "Pérez",
  "email": "juan.perez@example.com",
  "phone": "+56933334444",
  "identificationNumber": "11222333-4",
  "identificationNumberCountry": "CL",
  "status": "accepted",
  "isCompany": false,
  "worksOnHolidays": true,
  "ownsTransportation": true,
  "isMainProviderEligible": true,
  "isLeadAssignmentEligible": false,
  "isDirectAssignment": false,
  "isRequestAutoAcceptance": true,
  "priorityGroup": 2,
  "rating": 0,
  "reviewsCount": 0,
  "createdDate": "2024-11-03T09:30:00.000Z",
  "addresses": [],
  "parent": null,
  "dynamicForms": []
}

Response Fields

FieldTypeDescription
idnumberSodtrack id of the provider assigned to the booking.
referencestringnull
namestringnull
lastnamestringnull
emailstringProvider email.
phonestringnull
identificationNumberstringnull
identificationNumberCountrystringnull
statusstringProvider status. One of: "created", "accepted", "rejected".
isCompanybooleantrue when the provider is a company.
worksOnHolidaysbooleantrue when the provider works on holidays.
ownsTransportationbooleantrue when the provider owns transportation.
isMainProviderEligiblebooleantrue when the provider can be assigned as main provider of a service.
isLeadAssignmentEligiblebooleantrue when the provider can be assigned leads.
isDirectAssignmentbooleanCompanies only: true when bookings and requests are assigned directly to the providers that belong to the company.
isRequestAutoAcceptancebooleantrue when requests sent to the provider are accepted automatically.
priorityGroupnumbernull
ratingnumberAverage review rating, from 0 to 5. 0 when the provider has no reviews.
reviewsCountnumberNumber of reviews received.
createdDatestringProvider creation timestamp.
addressesarrayProvider addresses (see Address). Empty when the provider has none.
parentobjectnull
dynamicFormsarrayDynamic forms filled for the provider (see Dynamic form). Empty when none was filled.

Address (addresses[])

FieldTypeDescription
idnumberSodtrack address id.
addressstringnull
formattedAddressstringnull
extraInfostringnull
activebooleanfalse when the address is no longer in use.
coordinatesobjectnull

Company (parent)

FieldTypeDescription
idnumberSodtrack provider id of the company. Use it with Get Provider to get the company's full record.
referencestringnull
namestringnull
lastnamestringnull

Only these fields are returned for the company.

Dynamic form (dynamicForms[])

FieldTypeDescription
idnumberId of this form submission.
namestringForm name.
flowstringnull
createdDatestringTimestamp of the submission.
fieldsarrayFields of the form (see Dynamic form field).

Dynamic form field (dynamicForms[].fields[])

FieldTypeDescription
idnumberField id within this submission.
referencestringnull
labelstringField label.
typestringField type, for example "text", "short_text", "numeric", "currency", "date", "hour", "boolean", "select", "checkbox", "attachment" or "signature".
valuestringnull
secondaryValuestringnull

Error Responses

HTTP StatusErrorDescription
400 Bad RequestValidation failed (numeric string is expected)bookingId is not an integer.
401 Unauthorized—API key missing or invalid, or the request does not come from an authorized network.
403 Forbidden—The request origin is not allowed.
404 Not FoundBOOKING_NOT_FOUND: {bookingId}No booking matches bookingId, or the booking was deleted.
404 Not FoundBOOKING_PROVIDER_NOT_ASSIGNED: {bookingId}The booking has no provider assigned yet.
500 Internal Server Error—Unexpected server error. Contact Sodtrack support.

Business Rules & Constraints

Assigned provider and company

The booking endpoints report a provider that belongs to a company as the company, with the person actually assigned in assignedTo. This endpoint returns the assigned provider itself:

Assigned providerResponse
Belongs to a companyThe assigned provider, with the company in parent.
Independent providerThe provider, with parent set to null.
CompanyThe company, with parent set to null.

To get the company's full record (addresses, features, dynamic forms), use Get Provider with parent.id.

Bookings without a provider

A booking that has no provider assigned yet responds 404 Not Found with BOOKING_PROVIDER_NOT_ASSIGNED. Request it again once a provider is assigned.

Addresses

  • addresses lists the addresses registered for the provider. Other addresses of the same Sodtrack user are not included.
  • Addresses that are no longer in use are still returned, with active set to false.
  • Deleted addresses are not returned.

Dynamic forms

Each entry in dynamicForms is one form submission. The same form can appear more than once if it was filled more than once. flow indicates when the form was filled:

flowWhen it is filled
"provider_creation"Registration of an independent provider.
"network_creation"Registration of a company.
"network_worker_creation"Registration of a provider that belongs to a company.

Only forms visible to Sodtrack administrators are returned.

Dynamic form values

  • Option fields ("select", "boolean", "checkbox"): value is the selected option. For "checkbox", all selected options are returned in a single string, separated by ", ".
  • Conditional fields: when a field is shown only for a specific option of another field, it is returned only if that option was selected.
  • Attachment and signature fields: value is a temporary signed URL to download the file, valid for 24 hours. Request the provider again to get a new URL.
  • An option field with no option selected, or any field without a stored answer, is returned with value set to null.

Data and format

  • Timestamps use ISO 8601 (UTC).