Skip to main content

Get All CPNs

Retrieves a list of customer part numbers (CPNs) with pagination. A CPN is a company's own code for one of your products or variants. You can filter by company, search by part number and sort the results.

HTTP Request​

  • URL: /cpn
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_CUSTOMERPARTNUMBER or READ_WRITE_CUSTOMERPARTNUMBER

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of CPNs per page, from 1 to 200. Default is 50.
companyIdStringFilter by company ID.
searchStringSearch by part number (partial, case-insensitive match).
sortByStringField to sort by: createdAt, updatedAt, cpn or productId. Default is createdAt.
sortOrderStringasc for ascending or desc for descending. Default is desc.

cURL Example​

curl --location '<BASE_URL>/cpn?companyId=683808ee2b054dc60961637c&search=ACME&sortBy=cpn&sortOrder=asc&page=1&limit=50' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The list of CPNs was returned successfully.
  • 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, or a query parameter is invalid.

Sample JSON Response​

{
"success": true,
"data": [
{
"_id": "69021dec6f3d8d4a6ebf8dba",
"companyId": "683808ee2b054dc60961637c",
"productId": "687a84a7958d6a5c0d0c7a35",
"cpn": "ACME-VLV-0042",
"createdBy": {
"id": "66a0f138a8323b0b86b0f1dc",
"name": "ERP Connector",
"type": "api"
},
"createdAt": "2025-10-29T14:02:52.118Z",
"updatedAt": "2025-10-29T14:02:52.118Z"
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 50,
"pages": 1
}
}

Response Details​

CPN Data​

FieldTypeDescription
_idStringUnique identifier of the CPN.
companyIdStringID of the company the CPN belongs to.
productIdStringID of the product or variant the CPN refers to.
cpnStringThe customer part number.
createdByObjectWho created the CPN: id, name and type (for example api or admin).
createdAtStringDate and time the CPN was created (ISO 8601).
updatedAtStringDate and time the CPN was last updated (ISO 8601).

Pagination Details​

FieldTypeDescription
totalIntegerTotal number of CPNs that match the filters.
pageIntegerCurrent page number.
limitIntegerNumber of CPNs per page.
pagesIntegerTotal number of pages.

Notes​

  • Only the query parameters listed above are accepted.