InventoryResource
Defined in: sdks/trendyol/src/resources/inventory.ts:74
Trendyol stock & price update endpoint (a.k.a. updatePriceAndInventory).
Rate limit: none — Trendyol explicitly lists this endpoint as
NO LIMIT in its service limits table. The 15-minute duplicate suppression rule still applies on Trendyol’s side, but that’s a
server-side concern.
The endpoint is asynchronous. InventoryResource.update returns the
batchRequestId; poll it yourself with products.getBatchStatus, or let
InventoryResource.updateAndWait chunk, submit, and poll for you.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InventoryResource(
transport,getBatchStatus?):InventoryResource
Defined in: sdks/trendyol/src/resources/inventory.ts:80
Parameters
Section titled “Parameters”transport
Section titled “transport”TrendyolTransport
Trendyol transport.
getBatchStatus?
Section titled “getBatchStatus?”BatchStatusPoller
Batch-status poller (wired by createTrendyolClient
to products.getBatchStatus). Required only for updateAndWait.
Returns
Section titled “Returns”InventoryResource
Methods
Section titled “Methods”update()
Section titled “update()”update(
items):Promise<UpdatePriceInventoryResponse>
Defined in: sdks/trendyol/src/resources/inventory.ts:102
Update price and/or stock for one or more SKUs (by barcode).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<UpdatePriceInventoryResponse>
Example
Section titled “Example”const { batchRequestId } = await client.inventory.update([ { barcode: 'ABC123', quantity: 42, salePrice: 199.9, listPrice: 249.9 }, { barcode: 'XYZ789', quantity: 0 },]);const status = await client.products.getBatchStatus(batchRequestId);Throws
Section titled “Throws”when items is empty or longer than 1000.
Throws
Section titled “Throws”when Trendyol accepts the request but returns no
batchRequestId (an unpollable response — surfaced loudly instead of
handing back an empty id).
updateAndWait()
Section titled “updateAndWait()”updateAndWait(
items,opts?):Promise<BatchRequestResult[]>
Defined in: sdks/trendyol/src/resources/inventory.ts:141
Submit price/stock updates and wait for them to settle.
Splits items into chunks of ≤1000, submits each via update, and
polls each batchRequestId to a terminal state. Returns one
BatchRequestResult per chunk (read failedItemCount / items[] for
per-barcode outcomes). Compose @lonca/core’s retry around this for
transient-error resilience.
Parameters
Section titled “Parameters”BatchPollOptions = {}
Returns
Section titled “Returns”Promise<BatchRequestResult[]>
Throws
Section titled “Throws”when items is empty.
Throws
Section titled “Throws”when any chunk does not settle within timeoutMs;
error.data.batchRequestId identifies the stuck chunk.
Unofficial. Lonca is an independent, community-maintained project — not affiliated with, endorsed by, or supported by Trendyol, Hepsiburada, or any other marketplace. All marketplace names and trademarks belong to their respective owners.