Get customers
Returns a paginated list of customers, with the core fields needed to identify and reconcile a customer against your own records.
/api/integration/customerRequest
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
| Name | Type | Description |
|---|---|---|
origin | string | — |
Responses
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | number | ❌ | Filter by Sodtrack customer id. Must be a positive integer. |
reference | string | ❌ | Filter by customer external reference. Exact match. |
identificationNumber | string | ❌ | Filter by customer identification number. Separators such as dots and dashes are ignored, so "12.345.678-9" and "123456789" match the same customer. |
bookingId | number | ❌ | Return the customers linked to the booking with this id. Must be a positive integer. |
bookingReference | string | ❌ | Return the customers linked to bookings with this reference. |
pageSize | number | ❌ | Number of results per page. Min 1, max 50. Default 10. |
pageNumber | number | ❌ | Page index (1-based). Default 1. |
All filters are optional and can be combined. Sending none returns the paginated list of all customers, ordered by
iddescending.
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:
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:
GET /api/integration/customer?reference=EXT-CUSTOMER-REF-001&identificationNumber=123456789
Find the customers behind a booking reference:
GET /api/integration/customer?bookingReference=EXT-BOOKING-REF-001
Paginate the full customer list:
GET /api/integration/customer?pageSize=25&pageNumber=2
Response Example
{
"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[])
| Field | Type | Description |
|---|---|---|
id | number | Sodtrack customer id. |
reference | string | null |
name | string | null |
lastname | string | null |
createdDate | string (ISO 8601) | Customer record creation timestamp. |
Pagination (metadata)
| Field | Type | Description |
|---|---|---|
count | number | Total number of customers matching the filters, across all pages. |
pageNumber | number | Current page (1-based). |
pageSize | number | Page size used for this response. |
totalPages | number | Total pages for the current filters and pageSize. |
Error Responses
| HTTP Status | Error | Description |
|---|---|---|
400 Bad Request | Validation error | A query parameter has an invalid value: id or bookingId is not a positive integer, pageSize is outside 1–50, or pageNumber is below 1. The response body lists the offending parameters. |
401 Unauthorized | — | x-api-key is missing or invalid, or the request does not originate from an authorized network. |
500 Internal Server Error | — | Unexpected 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 sent | Behavior |
|---|---|
| (none) | All customers, paginated, ordered by id descending. |
| One filter | Customers matching that filter. |
| Several filters | Only 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 sent | Matches stored value |
|---|---|
12.345.678-9 | 123456789 |
12345678-9 | 123456789 |
123456789 | 123456789 |
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 sent | Behavior |
|---|---|
bookingId | Customers of the booking with that id. |
bookingReference | Distinct customers of all bookings sharing that reference. |
| Both | Only 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
-
pageNumberis 1-based: the first page is1. -
Default
pageSizeis 10, maximum is 50. -
countreflects all customers matching the filters, not only those on the current page. -
Results are always ordered by
iddescending, so the most recently created customers appear first.