> For the complete documentation index, see [llms.txt](https://docs.p4.software/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p4.software/p4-warehouse-spanish/api-rest/product-master/retrieve-a-list-of-products.md).

# Retrieve a list of products

## OData

P4W utilizes OData when querying database through API calls. Following example retrieves first 20 products, including assigned clients if applicable.

<mark style="color:blue;">`GET`</mark> `https://{tenant_name}.p4warehouse.com/odata/Product`

Retrieves a list of first 20 products and product assigned clients when possible.

#### Query Parameters

| Name                                       | Type    | Description                                            |
| ------------------------------------------ | ------- | ------------------------------------------------------ |
| $expand<mark style="color:red;">\*</mark>  | String  | Client base                                            |
| $orderby<mark style="color:red;">\*</mark> | String  | SKU                                                    |
| $top<mark style="color:red;">\*</mark>     | Integer | Number of products to retrieve                         |
| $count<mark style="color:red;">\*</mark>   | Boolean | Whether to displays total number of products available |

#### Headers

| Name                                     | Type   | Description    |
| ---------------------------------------- | ------ | -------------- |
| ApiKey<mark style="color:red;">\*</mark> | String | System API key |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "@odata.context": "https://doc1.p4warehouse.com/odata/$metadata#Product(Client(Id,Name))",
    "@odata.count": 21,
    "value": [
        {
            "Sku": "1234",
            "Upc": null,
            "BarcodeValue": null,
            "BarcodeType": null,
            "Category": null,
            "Description": null,
            "SubstituteGroup": null,
            "HtsCode": null,
            "CountryOfOrigin": null,
            "ReferenceNumber": null,
            "Reference1": null,
            "Reference2": null,
            "Reference3": null,
            "ClientId": null,
            "BomWorkflowId": null,
            "Height": null,
            "Width": null,
            "Length": null,
            "DimsLengthUnitOfMeasure": "M",
            "Weight": null,
            "FreightClass": null,
            "IsHazMat": false,
            "Nmfc": null,
            "CommodityDescription": null,
            "DimsWeightUnitOfMeasure": "Kg",
            "Cube": null,
            "IsBillOfMaterial": false,
            "IsLotControlled": false,
            "LotPattern": null,
            "IsSerialControlled": false,
            "SerialPattern": null,
            "IsExpiryControlled": false,
            "IsDecimalControlled": false,
            "IsPacksizeControlled": false,
            "IsDiscontinued": false,
            "UnitOfMeasure": null,
            "CartonizationBehaviour": "Inherit",
            "Info1": null,
            "Info2": null,
            "Info3": null,
            "Info4": null,
            "Info5": null,
            "Info6": null,
            "Info7": null,
            "Info8": null,
            "Info9": null,
            "Info10": null,
            "Id": "935bfda9-e615-4966-8606-ac037dfcc3fb",
            "DateCreated": "2023-08-15T18:36:06.3294549Z",
            "Client": null
        },
        {
            "Sku": "PRODUCT_A",
            "Upc": "1153453189306",
            "BarcodeValue": "1153453189306",
            "BarcodeType": "Code128",
            "Category": null,
            ...
```

{% endtab %}
{% endtabs %}

Use OData syntax (<https://www.odata.org/documentation/>) to personalize queries through API calls.

### Example of OData query&#x20;

```json
https://{tenant_name}.p4warehouse.com/odata/Product
$expand=Client($select=Id,Name)&$orderby=Sku&$top=20&$count=true
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.p4.software/p4-warehouse-spanish/api-rest/product-master/retrieve-a-list-of-products.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
