Skip to content

OrdersResource

Defined in: sdks/trendyol/src/resources/orders.ts:386

Trendyol order (shipment-package) endpoints.

Rate limit (per Trendyol service limits): tunable via the constructor with a generous default.

Pagination: getShipmentPackages (list) uses page-based pagination (not nextPageToken). The SDK exposes CursorPage<ShipmentPackage> so the caller can iterate with paginate() from @lonca/core; the opaque cursor encodes the page index.

2026-06-08 limit: getShipmentPackages reaches at most 10,000 records — requests past that offset return HTTP 429. For full scans, periodic syncs, or exports use OrdersResource.listStream (getShipmentPackagesStream), which paginates with an opaque cursor and is not subject to the cap. Note the stream endpoint exposes only the last 3 months of orders.

new OrdersResource(transport, limiter?): OrdersResource

Defined in: sdks/trendyol/src/resources/orders.ts:389

TrendyolTransport

TokenBucketRateLimiter

OrdersResource

cancelPackageItem(packageId, input): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:482

Notify Trendyol that one or more line items cannot be supplied (“Tedarik Edememe Bildirimi”). Marks the listed line IDs as UnSupplied. Trendyol cancels those quantities and notifies the customer.

reasonId is a numeric code Trendyol publishes separately — consult the seller panel or the “Tedarik Edememe” docs for current values.

Returns void; Trendyol responds with 200 + empty body on success.

string | number

CancelPackageItemInput

Promise<void>


changeCargoProvider(packageId, cargoProvider): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:632

Change the cargo provider on an existing shipment package. Use one of Trendyol’s documented marketplace cargo codes ('YKMP', 'ARASMP', 'SURATMP', etc.) — see TrendyolCargoProvider for the full list.

string | number

TrendyolCargoProvider

Promise<void>


extendDeliveryDate(packageId, extendedDayCount): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:504

Extend the agreed delivery date for a shipment package by 1, 2, or 3 days. Trendyol enforces the [1, 3] range server-side; the SDK validates client-side to fail fast.

Returns void; Trendyol responds with 200 + empty body on success.

string | number

1 | 2 | 3

Promise<void>


getCargoInvoiceItems(invoiceSerialNumber, params?): Promise<CursorPage<CargoInvoiceItem>>

Defined in: sdks/trendyol/src/resources/orders.ts:793

Fetch the per-parcel cargo-fee breakdown for a single cargo invoice (Trendyol’s getCargoInvoiceItems). Useful for reconciling Trendyol’s cargo deductions against your shipped packages.

invoiceSerialNumber is sourced from the Current Account Statement (“Cari Hesap Ekstresi”) with transactionType=DeductionInvoices.

Page-based pagination internally (cursor encodes the page index).

string

CursorPaginationParams = {}

Promise<CursorPage<CargoInvoiceItem>>


getCompensationTickets(params?): Promise<CursorPage<CompensationTicket>>

Defined in: sdks/trendyol/src/resources/orders.ts:894

Fetch Trendyol Express compensation tickets (claims filed when a shipment is lost or damaged in transit). Page-based pagination internally; the SDK exposes the cursor convention.

Note the different base path — /integration/tex/compensation/..., not the regular /integration/order/....

ListCompensationTicketsParams = {}

Promise<CursorPage<CompensationTicket>>

import { paginate } from '@lonca/core';
const tickets = await client.orders.getCompensationTickets({
startDate: new Date('2026-01-01'),
endDate: new Date('2026-02-01'),
});
for (const t of tickets.items) {
console.log(t.orderNumber, t.currentState, t.stateMessage);
}

list(params?): Promise<CursorPage<ShipmentPackage>>

Defined in: sdks/trendyol/src/resources/orders.ts:407

List shipment packages for the seller.

ListOrdersParams = {}

Promise<CursorPage<ShipmentPackage>>

import { paginate } from '@lonca/core';
for await (const pkg of paginate((p) => client.orders.list({ ...p, status: 'Created' }))) {
console.log(pkg.id, pkg.status, pkg.customer.firstName);
}

listStream(params?): Promise<CursorPage<ShipmentPackage>>

Defined in: sdks/trendyol/src/resources/orders.ts:750

Stream variant of list(). Trendyol’s getShipmentPackagesStream returns the same ShipmentPackage shape but paginates with an opaque cursor — useful when the dataset is large and page-based pagination would hit the 10 000-record cap.

ListOrdersStreamParams = {}

Promise<CursorPage<ShipmentPackage>>

import { paginate } from '@lonca/core';
for await (const pkg of paginate((p) =>
client.orders.listStream({ ...p, packageItemStatuses: 'Created,Picking' }),
)) {
console.log(pkg.id, pkg.status);
}

manualDeliverByPackageId(packageId): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:651

Mark a shipment package as manually delivered via its package ID. Used when the seller delivered the order outside Trendyol’s cargo network and needs to flip the package to Delivered after handover.

No request body; Trendyol responds with 200 + empty body on success.

string | number

Promise<void>


manualDeliverByTrackingNumber(cargoTrackingNumber): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:667

Manual-deliver variant that takes the cargo tracking number instead of the package ID. Useful when you only have the tracking number on hand (e.g., from a cargo provider webhook).

Note the path structure: tracking number sits at a sibling location, not under /shipment-packages/{id}/....

string | number

Promise<void>


manualReturnByPackageId(packageId): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:851

Notify Trendyol that a shipped package was returned to you (manual return flow, e.g. customer dropped it at your address or you got the package back without going through Trendyol’s return cargo).

No body; Trendyol responds with 200 + empty body on success.

string | number

Promise<void>


manualReturnByTrackingNumber(cargoTrackingNumber): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:866

Manual-return variant that takes the cargo tracking number instead of the package ID. Useful when the cargo provider’s webhook only carries the tracking number.

Sibling path (not under /{packageId}/...).

string | number

Promise<void>


markDeliveredByService(packageId): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:680

Mark a package as delivered through an authorized service (“yetkili servis”). For appliance / installation-required products that are delivered + installed by a third-party service partner.

string | number

Promise<void>


multiSplitPackage(packageId, splitGroups): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:590

Split a shipment package into multiple new packages by grouping line IDs. Each SplitGroup becomes one new package containing the listed line IDs.

string | number

SplitGroup[]

Promise<void>

when splitGroups is empty.


processAlternativeDelivery(packageId, input): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:526

Notify Trendyol of an alternative delivery channel — used when the seller is shipping via a non-Trendyol cargo provider. Trendyol then either SMSes the customer the tracking link (when isPhoneNumber is true) or stores the tracking URL on the package directly.

Returns void; Trendyol responds with 200 + empty body on success.

string | number

ProcessAlternativeDeliveryInput

Promise<void>


splitMultiPackagesByQuantity(packageId, splitPackages): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:610

Split a shipment package into multiple new packages, each containing a mix of line items at specific quantities. This is the most expressive split — use it when you need fine-grained control over which line IDs and how many of each end up in each new package.

string | number

SplitPackagePlan[]

Promise<void>

when splitPackages is empty.


splitPackage(packageId, orderLineIds): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:546

Split a shipment package by moving a set of line IDs into a new package. The original package keeps the remaining lines.

string | number

The package to split.

number[]

Line IDs to move into the new package (1+).

Promise<void>

when orderLineIds is empty.


splitPackageByQuantity(packageId, quantitySplit): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:566

Split a shipment package by quantity. Each QuantitySplit entry carves a single line into multiple packages — e.g. { orderLineId: 100, quantities: [2, 2, 1] } splits 5 units of line 100 into three packages of 2 + 2 + 1.

string | number

QuantitySplit[]

Promise<void>

when quantitySplit is empty.


updateBoxInfo(packageId, input): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:692

Update box / packaging metadata on a shipment package (desi value and/or number of boxes). Either field can be sent alone.

string | number

UpdateBoxInfoInput

Promise<void>


updateLaborCosts(packageId, items): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:709

Update labor costs for one or more order lines.

Wire note: Trendyol’s request body is a raw array (no envelope), not { items: [...] }. The SDK forwards items verbatim.

string | number

LaborCostInput[]

Promise<void>

when items is empty.


updatePackageStatus(packageId, input): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:459

Push a shipment-package status update.

Trendyol restricts the seller-side push to two transitions:

  • Picking — order picked up from the shelf / being prepared
  • Invoiced — invoice issued, ready for cargo handoff

Other transitions (Shipped, Delivered, etc.) are driven by Trendyol or the cargo provider — call processAlternativeDelivery or manualDeliverByPackageId if you ship outside Trendyol’s cargo network.

Returns void; Trendyol responds with 200 + empty body on success.

string | number

UpdatePackageStatusInput

Promise<void>


updateWarehouse(packageId, warehouseId): Promise<void>

Defined in: sdks/trendyol/src/resources/orders.ts:725

Reassign a shipment package to a different warehouse. warehouseId comes from client.suppliers.getAddresses() (filter by isShipmentAddress).

string | number

number

Promise<void>

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.