Get Bookings By Customer

Returns the bookings of a customer, as a paginated list.

GET/api/integration/customer/{customerId}/bookings

Request

cURL
curl -X GET "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/customer/{customerId}/bookings" \
  -H "Authorization: Bearer $SODTRACK_TOKEN"

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

Path parameters

NameTypeDescription
customerIdrequiredstring

Responses

Get Product Units by Customer
{
  "data": [
    {
      "id": 13,
      "reference": "BK-2026-0456",
      "status": "accepted",
      "scheduledDate": "2026-08-26T04:22:29.911Z",
      "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": [
        {
          "id": 5,
          "name": "Water heater 80L",
          "sku": "WH-80L",
          "productType": "product",
          "quantity": 1,
          "serialNumber": "SN-0001-A",
          "pricing": {
            "price": 39999,
            "cost": 25000,
            "currency": {
              "id": 3,
              "name": "MXN",
              "symbol": "$"
            }
          }
        }
      ],
      "incidents": [],
      "alerts": [],
      "notes": [],
      "dynamicFormSnapshotFields": []
    },
    {
      "id": 12,
      "reference": "BK-2026-0455",
      "status": "waiting_customer_to_set_date",
      "scheduledDate": null,
      "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": "Calle Falsa 123, Buenos Aires",
        "coordinates": null
      },
      "originAddress": null,
      "saleChannel": null,
      "project": null,
      "lead": null,
      "provider": null,
      "bookingBundle": null,
      "price": 0,
      "cost": 0,
      "bookingAddOns": [],
      "products": [],
      "incidents": [],
      "alerts": [],
      "notes": [],
      "dynamicFormSnapshotFields": []
    }
  ],
  "metadata": {
    "count": 2,
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1
  }
}

Error responses for this endpoint follow the shared error reference.

Purpose

Returns the bookings of a customer, as a paginated list.

The customer is identified by its Sodtrack id in the path. To resolve that id from your own data, search the customer first with GET /api/integration/customer/v2 (by reference, phoneNumber, identificationNumber or a booking) and take id from the result.

Sodtrack returns every booking the customer owns, newest first. Each booking is returned in full, in the same shape as the booking search and detail endpoints: status, dates, service, variant, category, addresses, provider, products, add-ons, incidents, alerts, notes and dynamic form answers.


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

GET /api/integration/customer/{customerId}/bookings


Field Definitions

🧍 Path parameters

FieldTypeRequiredDescription
customerIdnumberSodtrack customer id. Must be an integer.

📄 Pagination (query parameters)

FieldTypeRequiredDescription
pageNumbernumber1-based page number. Defaults to 1.
pageSizenumberBookings per page. Between 1 and 50. Defaults to 10.

No other parameter is accepted; any other query parameter is ignored.


Example Request

code
GET /api/integration/customer/32841/bookings

Second page of 5 bookings:

code
GET /api/integration/customer/32841/bookings?pageNumber=2&pageSize=5

Response Example

json
{
  "data": [
    {
      "id": 13,
      "reference": "BK-2026-0456",
      "status": "accepted",
      "scheduledDate": "2026-08-26T04:22:29.911Z",
      "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": [
        {
          "id": 5,
          "name": "Water heater 80L",
          "sku": "WH-80L",
          "productType": "product",
          "quantity": 1,
          "serialNumber": "SN-0001-A",
          "pricing": {
            "price": 39999,
            "cost": 25000,
            "currency": {
              "id": 3,
              "name": "MXN",
              "symbol": "$"
            }
          }
        }
      ],
      "incidents": [],
      "alerts": [],
      "notes": [],
      "dynamicFormSnapshotFields": []
    },
    {
      "id": 12,
      "reference": "BK-2026-0455",
      "status": "waiting_customer_to_set_date",
      "scheduledDate": null,
      "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": "Calle Falsa 123, Buenos Aires",
        "coordinates": null
      },
      "originAddress": null,
      "saleChannel": null,
      "project": null,
      "lead": null,
      "provider": null,
      "bookingBundle": null,
      "price": 0,
      "cost": 0,
      "bookingAddOns": [],
      "products": [],
      "incidents": [],
      "alerts": [],
      "notes": [],
      "dynamicFormSnapshotFields": []
    }
  ],
  "metadata": {
    "count": 2,
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1
  }
}

Response Fields

FieldTypeDescription
data[]arrayBookings in the page, newest first. Empty when the customer has none.
data[].idnumberSodtrack booking id.
data[].reference`stringnull`
data[].statusstringOne 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".
data[].scheduledDate`string (datetime)null`
data[].quantitynumberQuantity booked.
data[].totalDurationMinutes`numbernull`
data[].doneDate`string (datetime)null`
data[].createdDatestring (datetime)When the booking was created.
data[].customer`objectnull`
data[].stakeholder`objectnull`
data[].service`objectnull`
data[].variant`objectnull`
data[].category`objectnull`
data[].address`objectnull`
data[].originAddress`objectnull`
data[].saleChannel`objectnull`
data[].project`objectnull`
data[].lead`objectnull`
data[].provider`objectnull`
data[].bookingBundle`objectnull`
data[].price`numbernull`
data[].cost`numbernull`
data[].bookingAddOns[]arrayAdd-ons: id, name, reference.
data[].products[]arrayProducts in the booking: id, name, sku, productType ("product" or "component"), quantity, serialNumber and pricing (price, cost, currency with id, name, symbol).
data[].incidents[]arrayIncidents: id and reference.
data[].alerts[]arrayAlerts: id and reference.
data[].notes[]arrayNotes: id, note, reference.
data[].dynamicFormSnapshotFields[]arrayDynamic form answers captured during the booking: id, reference, value, secondaryValue, type, snapshotId.
metadata.countnumberTotal bookings owned by the customer, across all pages.
metadata.pageNumbernumberPage returned.
metadata.pageSizenumberPage size applied.
metadata.totalPagesnumberTotal number of pages.

Error Responses

HTTP StatusErrorDescription
400 Bad RequestValidation failed (numeric string is expected)customerId is not an integer.
400 Bad RequestA pagination parameter has the wrong type or is out of range (for example pageSize above 50).
401 UnauthorizedMissing or invalid x-api-key, or the request does not come from an authorized origin.
404 Not FoundCUSTOMER_NOT_FOUND: {customerId}No customer exists with that id.
500 Internal Server ErrorUnexpected server error. Contact Sodtrack support.

Business Rules & Constraints

The customer must exist

customerId must be the id of a Sodtrack customer. Unknown ids, and ids of providers, network users or other account types, are answered with 404 Not Found. A customer that exists but has no booking is answered with 200 OK and an empty data.

Bookings are the ones the customer owns

data contains every booking whose customer is that user, in any status, including cancelled and completed ones. Bookings where the customer only appears as a requesting party for someone else are not included.

Provider of a bundled booking

When a booking is part of a bundle and has no provider of its own, provider shows the provider assigned to the head of the bundle, which is who executes the work.

Ordering

Bookings are ordered by id, newest first.

Page boundaries

A pageNumber beyond the last page is not an error: it returns an empty data with the same metadata.count and metadata.totalPages.