Lots

class ab.api.endpoints.lots.LotsEndpoint(client)[source]

Operations on lots (Catalog API).

Parameters:

client (HttpClient)

create(*, data)[source]

POST /Lot.

Parameters:

data (AddLotRequest | dict) – Lot creation payload with customer_item_id, image_links, initial_data (a LotDataDto with the measurements), catalogs (list of LotCatalogDto), and overriden_data. Accepts an AddLotRequest instance or a dict.

Return type:

LotDto

Request model: AddLotRequest

Docs: https://ab-sdk.readthedocs.io/en/latest/api/lots/create.html Request model: AddLotRequest Response model: LotDto

list(*, id=None, customer_item_id=None, lot_number=None, page_size=25, page_number=1)[source]

List lots with optional filters.

Parameters:
  • id (int | None) – Filter by lot ID.

  • customer_item_id (str | None) – Filter by customer item ID.

  • lot_number (str | None) – Filter by lot number.

  • page_size (int) – Number of items per page.

  • page_number (int) – Page number (1-based).

Returns:

Paginated lot results.

Return type:

PaginatedList[LotDto]

get(lot_id)[source]

Retrieve a single lot by ID.

Parameters:

lot_id (int) – Lot identifier.

Returns:

Lot details.

Return type:

LotDto

Docs: https://ab-sdk.readthedocs.io/en/latest/api/lots/get.html Response model: LotDto

update(lot_id, *, data)[source]

PUT /Lot/{id}.

Parameters:
  • lot_id (int) – Lot identifier.

  • data (UpdateLotRequest | dict) – Lot update payload with customer_item_id, image_links, overriden_data, and catalogs. (initial_data is create-only — it cannot be updated via PUT.) Accepts an UpdateLotRequest instance or a dict.

Return type:

LotDto

Request model: UpdateLotRequest

Docs: https://ab-sdk.readthedocs.io/en/latest/api/lots/update.html Request model: UpdateLotRequest Response model: LotDto

delete(lot_id)[source]

Delete a lot.

Parameters:

lot_id (int) – Lot identifier.

Return type:

None

Docs: https://ab-sdk.readthedocs.io/en/latest/api/lots/delete.html

get_overrides(customer_item_ids)[source]

Retrieve lot overrides for the given customer item IDs.

Parameters:

customer_item_ids (List[str]) – List of customer item ID strings.

Returns:

Override data for matched lots.

Return type:

list[LotOverrideDto]

Docs: https://ab-sdk.readthedocs.io/en/latest/api/lots/get_overrides.html Response model: List[LotOverrideDto]

Per-endpoint reference

Each route-backed method has its own page rendering the HTTP route, the Python and CLI call signatures, and the request/response model field tables. This is the page help(api.lots.<method>) links to via its Docs: footer. These pages are generated by scripts/generate_endpoint_docs.py and kept current by a CI freshness gate.

Methods

create

POST /Lot — Create a new lot.

from ab import ABConnectAPI

api = ABConnectAPI(env="staging")
api.lots.create({"catalogId": 1, "name": "New Lot"})

list

GET /Lot — List lots with optional filters (paginated).

Returns: PaginatedList[LotDto]

# List all lots
lots = api.lots.list(page_number=1, page_size=25)

# Filter by lot number
lots = api.lots.list(lot_number="L001")

get

GET /Lot/{id} — Get a lot by ID.

Returns: LotDto

lot = api.lots.get(100)

update

PUT /Lot/{id} — Update a lot.

api.lots.update(100, {"name": "Updated Lot"})

delete

DELETE /Lot/{id} — Delete a lot.

api.lots.delete(100)

get_overrides

POST /Lot/overrides — Get lot overrides for customer items.

Returns: list[LotOverrideDto]`

overrides = api.lots.get_overrides(["item-id-1", "item-id-2"])