Get customers

Returns a paginated list of customers, with the core fields needed to identify and reconcile a customer against your own records.

GET/api/integration/customer

Request

cURL
curl -X GET "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/customer" \
  -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 customers
{
  "data": [
    {
      "id": 2001,
      "reference": "EXT-CUSTOMER-REF-001",
      "name": "María",
      "lastname": "García",
      "email": "maria.garcia@example.com",
      "phone": "+56912345678",
      "identificationNumber": "12345678-9",
      "identificationNumberCountry": "CL",
      "createdDate": "2024-06-01T10:00:00.000Z",
      "addresses": [
        {
          "formattedAddress": "Av. Providencia 1234, Santiago, Chile",
          "coordinates": {
            "lat": -33.43324794409109,
            "lng": -70.58645659063548
          }
        }
      ]
    }
  ],
  "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 customers, with the core fields needed to identify and reconcile a customer against your own records.

Filters can be combined freely: every filter you send is applied together, and a customer is returned only when it satisfies all of them. Customers can be looked up directly (by Sodtrack id, external reference or identification number) or indirectly through their bookings.

This endpoint is designed to resolve and identify customers. It does not return contact details, identity documents or addresses.


🔎 Query parameters

ParameterTypeRequiredDescription
idnumberFilter by Sodtrack customer id. Must be a positive integer.
referencestringFilter by customer external reference. Exact match.
identificationNumberstringFilter by customer identification number. Separators such as dots and dashes are ignored, so "12.345.678-9" and "123456789" match the same customer.
bookingIdnumberReturn the customers linked to the booking with this id. Must be a positive integer.
bookingReferencestringReturn the customers linked to bookings with this reference.
pageSizenumberNumber of results per page. Min 1, max 50. Default 10.
pageNumbernumberPage index (1-based). Default 1.

All filters are optional and can be combined. Sending none returns the paginated list of all customers, ordered by id descending.

Filters sent as empty or whitespace-only strings are ignored, exactly as if they had not been sent. Unrecognized query parameters are ignored.


Example Requests

Look up a customer by identification number:

code
GET /api/integration/customer?identificationNumber=12.345.678-9

Combine filters to confirm that a reference and an identification number belong to the same customer:

code
GET /api/integration/customer?reference=EXT-CUSTOMER-REF-001&identificationNumber=123456789

Find the customers behind a booking reference:

code
GET /api/integration/customer?bookingReference=EXT-BOOKING-REF-001

Paginate the full customer list:

code
GET /api/integration/customer?pageSize=25&pageNumber=2

Response Example

json
{
  "data": [
    {
      "id": 2001,
      "reference": "EXT-CUSTOMER-REF-001",
      "name": "María",
      "lastname": "García",
      "createdDate": "2024-06-01T10:00:00.000Z"
    },
    {
      "id": 1987,
      "reference": null,
      "name": "Comercial Andes",
      "lastname": null,
      "createdDate": "2024-05-18T08:22:41.000Z"
    }
  ],
  "metadata": {
    "count": 2,
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1
  }
}

Customer item (data[])

FieldTypeDescription
idnumberSodtrack customer id.
referencestringnull
namestringnull
lastnamestringnull
createdDatestring (ISO 8601)Customer record creation timestamp.

Pagination (metadata)

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

Error Responses

HTTP StatusErrorDescription
400 Bad RequestValidation errorA query parameter has an invalid value: id or bookingId is not a positive integer, pageSize is outside 150, or pageNumber is below 1. The response body lists the offending parameters.
401 Unauthorizedx-api-key is missing or invalid, or the request does not originate from an authorized network.
500 Internal Server ErrorUnexpected server error. Contact Sodtrack support.

When the filters match no customers, the request still succeeds: data is [] and metadata.count is 0.


Business Rules & Constraints

Combining filters

Every filter present in the request is applied together, and only customers satisfying all of them are returned.

Filters sentBehavior
(none)All customers, paginated, ordered by id descending.
One filterCustomers matching that filter.
Several filtersOnly customers matching every filter at once.

Several filters reach the same customer through different paths: id, reference and identificationNumber point at the customer directly, while bookingId and bookingReference reach it through its bookings. Combining them is a valid way to confirm that a customer matches more than one criterion.

Pointing two filters at different customers is not an error. The request succeeds and returns an empty page, because no single customer satisfies both conditions.

Identification number matching

The identification number is matched after removing separator characters from the value you send, so punctuation formatting does not affect the result.

Value sentMatches stored value
12.345.678-9123456789
12345678-9123456789
123456789123456789

Spaces are not removed. Send the identification number without internal spaces, or it will not match.

Matching is exact after this normalization: partial identification numbers return no results.

Booking-based filtering

bookingId and bookingReference select bookings first, and then return the customers those bookings belong to.

Filters sentBehavior
bookingIdCustomers of the booking with that id.
bookingReferenceDistinct customers of all bookings sharing that reference.
BothOnly bookings matching both the id and the reference are considered.

If no booking matches, or the matching bookings have no customer associated, the response is an empty page.

Pagination

  • pageNumber is 1-based: the first page is 1.

  • Default pageSize is 10, maximum is 50.

  • count reflects all customers matching the filters, not only those on the current page.

  • Results are always ordered by id descending, so the most recently created customers appear first.