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:

Field

Type

Description

activated boolean

Include only active lots.
It accepts true and false

product_id string

Only show lots for this product id

warehouse_details boolean

Show warehouse details
Default: false
If accepts true and false.

sort_by string

Sort results by this field.
Accepts the name of a field in the result.

sort_order string

The direction of ordering the results
Accepts asc and desc

qstring

Search by term. It searches for that term in the fields specified underfield

fieldsstring

Fields where to search for the value inq

Pagination

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

Field

Type

Description

per_page string

Items per page
Default is 250

page string

It returns only that page

sort_by string

It sorts the response by this field

sort_order string

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