Get bookings

Returns a paginated list of bookings enriched with related entites data for integration use cases.

GET/api/integration/booking

Request

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

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

Headers

NameTypeDescription
originstring

Responses

Get bookings by reference
{
  "data": [
    {
      "id": 10452,
      "reference": "ORD-2025-001",
      "status": "accepted",
      "scheduledDate": "2025-03-15T09:00:00.000Z",
      "totalDurationMinutes": 90,
      "doneDate": null,
      "createdDate": "2025-03-10T14:22:00.000Z",
      "customer": {
        "id": 2001,
        "reference": "EXT-CUSTOMER-REF-001"
      },
      "stakeholder": {
        "id": "stakeholder-uuid-01",
        "reference": "STK-REF-001"
      },
      "service": {
        "id": 10,
        "name": "Instalación"
      },
      "variant": {
        "id": 321,
        "name": "Instalación cortinas",
        "type": "execution",
        "skus": [
          "install_curtains_sku"
        ]
      },
      "category": {
        "id": 5,
        "name": "Hogar"
      },
      "address": {
        "formattedAddress": "Av. Providencia 1234, Santiago, Chile",
        "coordinates": {
          "lat": -33.43324794409109,
          "lng": -70.58645659063548
        }
      },
      "originAddress": null,
      "saleChannel": {
        "id": 1,
        "name": "Canal principal",
        "reference": "E001",
        "coordinates": null
      },
      "project": {
        "id": 88,
        "reference": "PROJ-EXT-100"
      },
      "lead": null,
      "provider": {
        "id": 42,
        "reference": "PROV-REF-42",
        "name": "María",
        "lastname": "Técnica",
        "email": "maria.tecnica@example.com",
        "phone": "+56912345678",
        "identificationNumber": "12345678-9",
        "assignedTo": null
      },
      "bookingBundle": null,
      "price": 150000,
      "cost": 80000,
      "bookingAddOns": [
        {
          "id": 501,
          "name": "Material extra",
          "reference": "ADDON-REF-01"
        }
      ],
      "products": [
        {
          "id": 300,
          "name": "Cortina roller",
          "sku": "CURTAIN-001",
          "productType": "product",
          "quantity": 2,
          "serialNumber": null
        }
      ],
      "incidents": [
        {
          "id": 77,
          "reference": "INC-REF-77"
        }
      ],
      "alerts": [
        {
          "id": 23,
          "reference": "ALRT-E23423S2"
        }
      ],
      "notes": [
        {
          "id": 12,
          "note": "Cliente solicita ventana matutina.",
          "reference": null
        }
      ],
      "dynamicFormSnapshotFields": [
        {
          "id": "field-uuid-1",
          "reference": "purchase_channel",
          "value": "online",
          "type": "text",
          "snapshotId": "snapshot-uuid-1"
        }
      ]
    }
  ],
  "metadata": {
    "count": 1,
    "pageSize": 10,
    "pageNumber": 1,
    "totalPages": 1
  }
}

Error responses for this endpoint follow the shared error reference.

Purpose

Returns a paginated list of bookings enriched with related entites data for integration use cases.


Field Definitions

🔐 Authentication

FieldTypeRequiredDescription
x-api-key (header)stringExternal integration API key provided by Sodtrack.

🔎 Query parameters

ParameterTypeRequiredDescription
idnumberFilter by Sodtrack booking id. Positive integer (minimum 1).
referencestringFilter by booking external reference.
pageSizenumberNumber of results per page. Min 1, max 50. Default 10.
pageNumbernumberPage index (1-based). Min 1. Default 1.

All filters provided are combined with AND. If neither id nor reference is sent, the endpoint returns the paginated list of all bookings ordered by id descending.


Example Request

code
GET /api/integration/booking?reference=ORD-2025-001
GET /api/integration/booking?id=10452
GET /api/integration/booking?pageSize=20&pageNumber=2

Response Example

json
{
  "data": [
    {
      "id": 10452,
      "reference": "ORD-2025-001",
      "status": "accepted",
      "scheduledDate": "2025-03-15T09:00:00.000Z",
      "quantity": 1,
      "totalDurationMinutes": 90,
      "doneDate": null,
      "createdDate": "2025-03-10T14:22:00.000Z",
      "customer": {
        "id": 2001,
        "reference": "EXT-CUSTOMER-REF-001"
      },
      "stakeholder": {
        "id": "stakeholder-uuid-01",
        "reference": "STK-REF-001"
      },
      "service": {
        "id": 10,
        "name": "Instalación"
      },
      "variant": {
        "id": 321,
        "name": "Instalación cortinas",
        "type": "execution",
        "skus": ["install_curtains_sku"]
      },
      "category": {
        "id": 5,
        "name": "Hogar"
      },
      "address": {
        "formattedAddress": "Av. Providencia 1234, Santiago, Chile",
        "coordinates": {
          "lat": -33.43324794409109,
          "lng": -70.58645659063548
        }
      },
      "originAddress": null,
      "saleChannel": {
        "id": 1,
        "name": "Canal principal",
        "reference": "E001",
        "coordinates": null
      },
      "project": {
        "id": 88,
        "reference": "PROJ-EXT-100"
      },
      "lead": null,
      "provider": {
        "id": 42,
        "reference": "PROV-REF-42",
        "name": "María",
        "lastname": "Técnica",
        "email": "maria.tecnica@example.com",
        "phone": "+56912345678",
        "identificationNumber": "12345678-9",
        "assignedTo": null
      },
      "bookingBundle": null,
      "price": 150000,
      "cost": 80000,
      "bookingAddOns": [
        {
          "id": 501,
          "name": "Material extra",
          "reference": "ADDON-REF-01"
        }
      ],
      "products": [
        {
          "id": 300,
          "name": "Cortina roller",
          "sku": "CURTAIN-001",
          "productType": "product",
          "quantity": 2,
          "serialNumber": null,
          "pricing": {
            "price": 45000,
            "cost": 30000,
            "currency": {
              "id": 2,
              "name": "CLP",
              "symbol": "$"
            }
          }
        },
        {
          "id": 415,
          "name": "Soporte de pared",
          "sku": "BRACKET-010",
          "productType": "component",
          "quantity": 4,
          "serialNumber": null,
          "pricing": {
            "price": 3500,
            "cost": null,
            "currency": null
          }
        }
      ],
      "incidents": [
        {
          "id": 77,
          "reference": "INC-REF-77"
        }
      ],
      "alerts": [
        {
          "id": 23,
          "reference": "ALRT-E23423S2"
        }
      ],
      "notes": [
        {
          "id": 12,
          "note": "Cliente solicita ventana matutina.",
          "reference": null
        }
      ],
      "dynamicFormSnapshotFields": [
        {
          "id": "field-uuid-1",
          "reference": "purchase_channel",
          "value": "online",
          "type": "text",
          "snapshotId": "snapshot-uuid-1"
        }
      ]
    }
  ],
  "metadata": {
    "count": 1,
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1
  }
}

Pagination (metadata)

FieldTypeDescription
countnumberTotal number of bookings matching the filters (across all pages).
pageSizenumberPage size used for this response.
pageNumbernumberCurrent page (1-based).
totalPagesnumberTotal pages for the current filters and pageSize.

Booking item (data[])

FieldTypeDescription
idnumberSodtrack booking id.
referencestringnull
statusstringBooking status. One of: created, searching, accepted, on_my_way_to_origin, arrived_to_origin, on_my_way, 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.
scheduledDatestring (ISO 8601)null
quantitynumberBooking quantity.
totalDurationMinutesnumbernull
doneDatestring (ISO 8601)null
createdDatestring (ISO 8601)Booking creation timestamp.
customerobjectnull
stakeholderobjectnull
serviceobjectnull
variantobjectnull
categoryobjectnull
addressobjectnull
originAddressobjectnull
saleChannelobjectnull
projectobjectnull
leadobjectnull
providerobjectnull
bookingBundleobjectnull
pricenumbernull
costnumbernull
bookingAddOnsarrayAdd-ons on the booking (id, name, reference).
productsarrayProducts and components linked to the booking, with pricing (see Product).
incidentsarrayIncident references (id, reference).
alertsarrayAlert references (id, reference).
notesarrayBooking notes (id, note, reference).
dynamicFormSnapshotFieldsarrayDynamic form field values captured on the booking (see Dynamic form field).

Nested reference objects

Objects such as customer, stakeholder, project, lead, incidents[], alerts[] and bookingBundle.bundleHead use:

FieldTypeDescription
idnumberstring
referencestringnull

Variant (variant)

FieldTypeDescription
idnumberVariant id.
namestringVariant name.
typestring"budget" or "execution".
skusarray[string]SKUs linked to the variant.

Address (****address / originAddress****)

FieldTypeDescription
formattedAddressstringHuman-readable address.
coordinatesobjectnull

Sales channel (saleChannel)

FieldTypeDescription
idnumberSales channel id.
namestringSales channel name.
referencestringnull
coordinatesobjectnull

Provider (provider)

FieldTypeDescription
idnumberProvider id. When the assignee belongs to a company, this is the company.
referencestringnull
namestringProvider first name.
lastnamestringProvider last name.
emailstringProvider email.
phonestringnull
identificationNumberstringnull
assignedToobjectnull

Bundle (bookingBundle)

FieldTypeDescription
bundleHeadobjectBundle head booking (id, reference).
bundledBookingsarrayOther bookings in the same bundle (id, reference), excluding the current one.

Product (products[])

FieldTypeDescription
idnumberProduct id.
namestringProduct name.
skustringProduct SKU.
productTypestring"product" or "component".
quantitynumberQuantity linked to the booking. 1 per entry when the product is expanded by physical unit.
serialNumberstringnull
pricingobjectUnit pricing of the product for this booking (see Product pricing).

Product pricing (products[].pricing)

FieldTypeDescription
pricenumbernull
costnumbernull
currencyobjectnull

Dynamic form field (dynamicFormSnapshotFields[])

FieldTypeDescription
idstringField instance id.
referencestringField reference in the form definition.
valuestringSubmitted value.
typestringField type.
snapshotIdstringParent snapshot id.

Error Responses

HTTP StatusErrorDescription
400 Bad Requestid must be an integer number / id must not be less than 1id is not a positive integer.
400 Bad RequestpageSize must not be greater than 50 / pageSize must not be less than 1pageSize out of range.
400 Bad RequestpageNumber must not be less than 1pageNumber out of range.
401 UnauthorizedAPI key missing or invalid, or the request does not come from an authorized network.
403 ForbiddenThe request origin is not allowed.
500 Internal Server ErrorUnexpected server error. Contact Sodtrack support.

When the filters match no booking, data is an empty array and metadata.count is 0.


Business Rules & Constraints

Filters

  • id and reference are combined with AND. Sending both returns the booking only if it matches both values; if they point at different bookings the result is an empty page, not an error.

  • With no id or reference, the endpoint returns all bookings (paginated), ordered by id descending (newest first).

  • Unknown query parameters are ignored.

Pagination

  • pageNumber is 1-based (first page = 1).

  • Default pageSize is 10; maximum allowed is 50. Out-of-range values are rejected with 400 Bad Request.

  • metadata.count is the total of matching bookings; use it with pageSize to iterate pages.

Product pricing resolution

For each entry in products[], Sodtrack resolves pricing as follows:

Scenariopricecostcurrency
The product (or component) has an active area pricing that covers the area of the booking addressArea pricing priceArea pricing cost (null if not configured)Currency of that area
No area pricing applies, and the product has a catalog priceCatalog pricenullnull
No area pricing applies and no catalog price is loadednullnullnull
  • The area is determined from the booking address. A booking without an address, or whose address is not inside any area, never uses area pricing.

  • Inactive area pricing configurations and configurations without a price are ignored.

  • A catalog price of 0 is treated as "no price loaded" and returned as null.

  • Prices are per unit; multiply by quantity to obtain totals.

  • Products and components are priced by the same rules; the pricing configuration is looked up according to productType.

Enriched payload

Each booking in data is built with related data loaded. A null nested object means that relation is not set on the booking.

Dynamic forms included

Snapshot fields are returned for every booking-related dynamic form flow configured for the booking entity and answered for that particular booking.

Data and format

  • Timestamps use ISO 8601 (UTC).

  • Query parameter values are passed as strings in the URL; id, pageSize and pageNumber are coerced to integers before validation.