Skip to content

Search products and categories

Request

List of products and product categories

You can retrieve a list of products and product categories by providing the location ID. Use the search_term parameter to filter:

  • Product categories by name or article
  • Products by name, article, or barcode

Limit the number of results using the max_count parameter.

If search_term is not provided, the response will return a list of root categories for the specified location. In this case, the max_count parameter is ignored. If search_term is provided, the system will first search among categories. If fewer than max_count results are found, the search will continue among products to fill the remaining count.

The result is returned as an array of products tree elements.

Product tree element has the following structure:

| Field | Type | Description | | -------------| ------- | -------------------------------------------------- ----------------------------------------- | | parent_id | number | Parent element ID (0 for root elements) | | item_id | number | Item ID (0 if item is a category) | | category_id | number | Product category ID (0 if the item is a product) | | title | string | Product name or product category | | is_chain | boolean | Is the element chain-bound? true - the element is connected to the chain, false - not connected | | is_category | boolean | Is the element a category? true - category, false - product | | is_item | boolean | Is the item a product? true - product, false - category |

Security
BearerPartnerUser
Path
location_idnumberrequired

location ID

Query
termstring

Search query by name, article number or barcode

countnumber

The number of output lines per page. Maximum 100

Headers
Acceptstringrequired

e.g. application/vnd.api.v2+json

Example:application/vnd.api.v2+json
Content-Typestringrequired

application/json

Authorizationstringrequired

Bearer partner_token, User user_token

curl -i -X GET \
  'https://developer.alteg.io/_mock/en/b2b-v1/openapi/locations/{location_id}/products/search?term=string&count=0' \
  -H 'Accept: application/vnd.api.v2+json' \
  -H 'Authorization: Bearer <YOUR_Bearer {PartnerToken}, User {UserToken}_HERE>' \
  -H 'Content-Type: string'

Responses

OK

Bodyapplication/json
successboolean

Execution success status (true)

Example:true
dataArray of objects

Array with data objects

Example:
[ { "parent_id": 0, "item_id": 0, "category_id": 123, "title": "Root Category 1", "is_chain": true, "is_category": true, "is_item": false }, { "parent_id": 0, "item_id": 0, "category_id": 456, "title": "Root Category 2", "is_chain": true, "is_category": true, "is_item": false } ]
metaobject

Metadata (contains the number of categories found)

Example:
{ "count": 2 }
Response
{ "success": true, "data": [ { … }, { … } ], "meta": { "count": 2 } }