Skip to content

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.

new InventoryResource(transport, getBatchStatus?): InventoryResource

Defined in: sdks/trendyol/src/resources/inventory.ts:80

TrendyolTransport

Trendyol transport.

BatchStatusPoller

Batch-status poller (wired by createTrendyolClient to products.getBatchStatus). Required only for updateAndWait.

InventoryResource

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).

PriceInventoryUpdate[]

Promise<UpdatePriceInventoryResponse>

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);

when items is empty or longer than 1000.

when Trendyol accepts the request but returns no batchRequestId (an unpollable response — surfaced loudly instead of handing back an empty id).


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.

PriceInventoryUpdate[]

BatchPollOptions = {}

Promise<BatchRequestResult[]>

when items is empty.

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.