Listing products lots

API reference LotListAPI

Overview

This endpoint can be used to get a list of the lots that are created in byrd. The response will include different lot details like the lot number and expiry date

📘

Getting Stock Information

This endpoint will return the stocks per lot rather than per product. This means the same product can appear multiple times in the result. To get the stock levels of products please follow those guides: Listing products and Getting the details of a product

Method access
      GET https://api.getbyrd.com/v2/warehouse/lots
Request Headers
      Authorization: Bearer token-from >Authentication
      Content-Type: application/json
      User-Agent: your user-agent >How to call the APIs

Query params

You can filter the list by different fields combining them depending on your needs. The most frequent are:

FieldTypeDescription
activated booleanInclude only active lots.
It accepts true and false
product_id stringOnly show lots for this product id
warehouse_details booleanShow warehouse details
Default: false
It accepts true and false.
sort_by stringSort results by this field.
Accepts the name of a field in the result.
sort_order stringThe direction of ordering the results
Accepts asc and desc
qstringSearch by term. It searches for that term in the fields specified under field
fieldsstringFields where to search for the value in q

Pagination

This endpoint is not paginated: it returns all the lots that match your filters in a single response, so page and per_page have no effect. Use the query params above, such as product_id, to narrow down the result.

Getting stock per warehouse

If the parameter warehouse_details is set to true, the response contains a child Element per lot called warehouses.
It lists every warehouse that holds or reserves units of the lot, most stock first, in the following way.
If warehouse_details is not set to true, warehouses is null.

"warehouses": [
  {
    "reservedStock": 0,
    "physicalStock": 0,
    "name": "Test Warehouse DE",
    "displayName": "DE - Demo",
    "legalName": "Test Warehouse DE",
    "code": "TST",
    "id": "<warehouse-1-id>",
    "countryCode": "DE"
  },
  {
    "reservedStock": 0,
    "physicalStock": 0,
    "name": "Test Warehouse ES",
    "displayName": "ES - Demo",
    "legalName": "Test Warehouse ES",
    "code": "TES",
    "id": "<warehouse-2-id>",
    "countryCode": "ES"
  }
]

Successful response example

"data": [
  {
    "physicalStock": 0,
    "lotNumber": "abc-123",
    "notBefore": "2022-11-24T00:00:00+00:00",
    "notAfter": null,
    "updatedAt": "2023-09-14T12:06:54.843089+00:00",
    "createdAt": "2023-09-14T12:06:54.843079+00:00",
    "id": "<lot-id>",
    "expiryDate": "2025-11-25",
    "reservedStock": 0,
    "activated": true,
    "warehouses": [
      {
        "reservedStock": 0,
        "physicalStock": 0,
        "name": "Test Warehouse DE",
        "displayName": "DE - Demo",
        "legalName": "Test Warehouse DE",
        "code": "TST",
        "id": "<warehouse-1-id>",
        "countryCode": "DE"
      }
    ],
    "productID": "<product_id>"
  },
]