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
If 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

By sending these parameters you can get the result in different pages:

FieldTypeDescription
per_page stringItems per page
Default is 250
page stringIt returns only that page
sort_by stringIt sorts the response by this field
sort_order stringIt sorts the response ascending or descending depending on this value
It accepts asc and desc

Getting stock per warehouse

If the parameter warehouse_details is set to true, the response contains a child Element per lot called warehouses.
If multiple warehouses are connected with a user account the lot by warehouse
will be shown in the following way. Otherwise the result will be empty ({}).

"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>"
  },
]