Get Product Units by Customer

Returns the product units currently held by a customer, as a paginated list.

GET/api/integration/customer/{customerId}/product-units

Request

cURL
curl -X GET "https://dev.integration.cl.sodtrack-shared.sodtrack.com/api/integration/customer/{customerId}/product-units" \
  -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": 85,
      "serialNumber": "SN-0001-C",
      "status": "in_use",
      "type": "component",
      "entryDate": "2026-08-09T00:19:48.993Z",
      "cost": null,
      "product": {
        "id": 28310,
        "name": "Thermostat",
        "sku": "TH-01"
      },
      "lastMovement": {
        "id": 77,
        "createdDate": "2026-08-29T00:19:48.994Z",
        "fromLocationType": "warehouse",
        "fromId": "1",
        "fromName": "Central warehouse",
        "fromAddress": null,
        "toLocationType": "customer",
        "toId": "32841",
        "toName": "María González",
        "toAddress": {
          "id": 13,
          "formattedAddress": "Av. Corrientes 1234, Buenos Aires",
          "extraInfo": "Floor 3, Apt B"
        }
      }
    },
    {
      "id": 83,
      "serialNumber": "SN-0001-A",
      "status": "in_use",
      "type": "product",
      "entryDate": "2026-08-09T00:19:48.979Z",
      "cost": null,
      "product": {
        "id": 990001,
        "name": "Water heater 80L",
        "sku": "WH-80L"
      },
      "lastMovement": {
        "id": 75,
        "createdDate": "2026-08-29T00:19:48.984Z",
        "fromLocationType": "warehouse",
        "fromId": "1",
        "fromName": "Central warehouse",
        "fromAddress": null,
        "toLocationType": "customer",
        "toId": "32841",
        "toName": "María González",
        "toAddress": {
          "id": 13,
          "formattedAddress": "Av. Corrientes 1234, Buenos Aires",
          "extraInfo": "Floor 3, Apt B"
        }
      }
    }
  ],
  "metadata": {
    "count": 2,
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1
  }
}

Error responses for this endpoint follow the shared error reference.

Purpose

Returns the product units currently held by 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 product unit whose current physical location is that customer, newest first. Each unit comes with its parent product, its type (product or component), its status, and the movement that brought it to the customer, including the delivery address.


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}/product-units


Field Definitions

🧍 Path parameters

FieldTypeRequiredDescription
customerIdnumberSodtrack customer id. Must be an integer.

📄 Pagination (query parameters)

FieldTypeRequiredDescription
pageNumbernumber1-based page number. Defaults to 1.
pageSizenumberProduct units 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/product-units

Second page of 5 units:

code
GET /api/integration/customer/32841/product-units?pageNumber=2&pageSize=5

Response Example

json
{
  "data": [
    {
      "id": 85,
      "serialNumber": "SN-0001-C",
      "status": "in_use",
      "type": "component",
      "entryDate": "2026-08-09T00:19:48.993Z",
      "cost": null,
      "product": {
        "id": 28310,
        "name": "Thermostat",
        "sku": "TH-01"
      },
      "lastMovement": {
        "id": 77,
        "createdDate": "2026-08-29T00:19:48.994Z",
        "fromLocationType": "warehouse",
        "fromId": "1",
        "fromName": "Central warehouse",
        "fromAddress": null,
        "toLocationType": "customer",
        "toId": "32841",
        "toName": "María González",
        "toAddress": {
          "id": 13,
          "formattedAddress": "Av. Corrientes 1234, Buenos Aires",
          "extraInfo": "Floor 3, Apt B"
        }
      }
    },
    {
      "id": 83,
      "serialNumber": "SN-0001-A",
      "status": "in_use",
      "type": "product",
      "entryDate": "2026-08-09T00:19:48.979Z",
      "cost": null,
      "product": {
        "id": 990001,
        "name": "Water heater 80L",
        "sku": "WH-80L"
      },
      "lastMovement": {
        "id": 75,
        "createdDate": "2026-08-29T00:19:48.984Z",
        "fromLocationType": "warehouse",
        "fromId": "1",
        "fromName": "Central warehouse",
        "fromAddress": null,
        "toLocationType": "customer",
        "toId": "32841",
        "toName": "María González",
        "toAddress": {
          "id": 13,
          "formattedAddress": "Av. Corrientes 1234, Buenos Aires",
          "extraInfo": "Floor 3, Apt B"
        }
      }
    }
  ],
  "metadata": {
    "count": 2,
    "pageNumber": 1,
    "pageSize": 10,
    "totalPages": 1
  }
}

Response Fields

FieldTypeDescription
data[]arrayProduct units in the page, newest first. Empty when the customer holds none.
data[].idnumberSodtrack product unit id. Use it with the product unit detail endpoint.
data[].serialNumber`stringnull`
data[].statusstringOne of: "available", "not_available", "committed", "in_use", "potential_conflict", "movement_request".
data[].typestring"product" or "component".
data[].entryDate`string (datetime)null`
data[].cost`numbernull`
data[].productobjectParent product.
data[].product.idnumberSodtrack product id.
data[].product.namestringProduct name.
data[].product.skustringProduct SKU.
data[].lastMovement`objectnull`
data[].lastMovement.idnumberMovement id.
data[].lastMovement.createdDate`string (datetime)null`
data[].lastMovement.fromLocationType`stringnull`
data[].lastMovement.fromId`stringnull`
data[].lastMovement.fromName`stringnull`
data[].lastMovement.fromAddress`objectnull`
data[].lastMovement.toLocationTypestringDestination type: "warehouse", "customer" or "provider".
data[].lastMovement.toIdstringId of the destination warehouse or customer, according to toLocationType.
data[].lastMovement.toName`stringnull`
data[].lastMovement.toAddress`objectnull`
data[].lastMovement.toAddress.idnumberSodtrack address id.
data[].lastMovement.toAddress.formattedAddressstringFull formatted address.
data[].lastMovement.toAddress.extraInfo`stringnull`
metadata.countnumberTotal product units held 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.
503 Service UnavailablePRODUCT_MODULE_UNAVAILABLESodtrack's product inventory service could not be reached. Retry later.
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 holds no product unit is answered with 200 OK and an empty data.

Product units are the ones currently at the customer

data contains only the units whose current physical location is that customer. Units that were delivered and later returned to a warehouse, or moved to another customer, are not included. To see the full history of a unit use the product unit detail endpoint with data[].id.

Location names and addresses are resolved when possible

fromName, toName, fromAddress and toAddress in lastMovement are resolved from the warehouse or customer referenced by the movement. If that warehouse or customer no longer exists, the name or address comes back as null while the raw fromId / toId is still returned.

Ordering

Product units 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.