@lonca/trendyol 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2637 @@
1
+ import { Logger, TokenBucketRateLimiter, CursorPaginationParams, CursorPage, OffsetPaginationParams } from '@lonca/core';
2
+
3
+ declare const BASE_URLS: {
4
+ readonly prod: "https://apigw.trendyol.com";
5
+ readonly stage: "https://stageapigw.trendyol.com";
6
+ };
7
+ type TrendyolEnvironment = keyof typeof BASE_URLS;
8
+ interface TransportConfig {
9
+ sellerId: number;
10
+ apiKey: string;
11
+ apiSecret: string;
12
+ env: TrendyolEnvironment;
13
+ integratorName: string;
14
+ clientIp?: string;
15
+ logger?: Logger;
16
+ /** Request timeout in ms. Default: 30_000. */
17
+ timeoutMs?: number;
18
+ /** Override the underlying `fetch` (tests inject a mock). */
19
+ fetch?: typeof fetch;
20
+ }
21
+ interface RequestOptions {
22
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
23
+ /** Path beginning with `/` (e.g., `/sapigw/brands`). */
24
+ path: string;
25
+ query?: Record<string, string | number | boolean | undefined>;
26
+ body?: unknown;
27
+ signal?: AbortSignal;
28
+ /**
29
+ * Extra per-request headers merged over the default header set (caller
30
+ * headers win). Used for endpoint-specific headers like `storeFrontCode`.
31
+ */
32
+ headers?: Record<string, string>;
33
+ /** Per-endpoint rate limiter; acquire one token before each attempt. */
34
+ rateLimiter?: TokenBucketRateLimiter;
35
+ }
36
+ declare class TrendyolTransport {
37
+ private readonly config;
38
+ private readonly baseUrl;
39
+ private readonly logger;
40
+ private readonly timeoutMs;
41
+ private readonly fetchImpl;
42
+ constructor(config: TransportConfig);
43
+ /** Seller ID this transport is configured with. Resources read it for path-building. */
44
+ get sellerId(): number;
45
+ request<T>(opts: RequestOptions): Promise<T>;
46
+ private buildUrl;
47
+ private buildHeaders;
48
+ private composeSignal;
49
+ }
50
+
51
+ /**
52
+ * A Trendyol marketplace brand.
53
+ *
54
+ * Trendyol returns numeric IDs; we normalize to `string` to match the
55
+ * `@lonca/core` convention (string IDs across all Lonca SDKs).
56
+ */
57
+ interface Brand {
58
+ id: string;
59
+ name: string;
60
+ }
61
+
62
+ /**
63
+ * Trendyol brand-list endpoint group.
64
+ *
65
+ * Rate limit: 50 req/min (per Trendyol service limits).
66
+ *
67
+ * Trendyol uses page-based pagination internally; we expose the cursor-based
68
+ * `CursorPage` shape from `@lonca/core` so callers can drive everything with
69
+ * `paginate()` and stay consistent across Lonca SDKs.
70
+ */
71
+ declare class BrandsResource {
72
+ private readonly transport;
73
+ private readonly limiter;
74
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
75
+ /**
76
+ * List Trendyol brands, one page at a time.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * import { paginate } from '@lonca/core';
81
+ * for await (const brand of paginate((p) => client.brands.list(p))) {
82
+ * console.log(brand.id, brand.name);
83
+ * }
84
+ * ```
85
+ */
86
+ list(params?: CursorPaginationParams): Promise<CursorPage<Brand>>;
87
+ /**
88
+ * Search brands by name. Useful when you need a brand's numeric ID for
89
+ * `createProducts` and don't want to page through the full `list()`
90
+ * (1000 brands per page).
91
+ *
92
+ * **Discovery-first wire fact (verified STAGE 2026-05-25):** Trendyol's
93
+ * doc claims this is a case-sensitive *exact* match, but live behaviour
94
+ * is **substring + case-insensitive** — `search('Trendyol')` returns
95
+ * 17 hits including `TRENDYOLMILLA`, `trendyol vavist`, `Trendyol Üyelik`.
96
+ * Plan for ranking your results client-side if you need an exact match.
97
+ * The endpoint returns an empty array when nothing matches (no 404).
98
+ *
99
+ * @param name The brand name to search for.
100
+ */
101
+ search(name: string): Promise<Brand[]>;
102
+ }
103
+
104
+ /**
105
+ * A node in the Trendyol category tree.
106
+ *
107
+ * Trendyol exposes categories as a deeply nested structure where each node
108
+ * can have child categories under `subCategories`. We normalize numeric IDs
109
+ * to strings to match the `@lonca/core` convention.
110
+ */
111
+ interface Category {
112
+ id: string;
113
+ name: string;
114
+ /** `null` when this is a root category. */
115
+ parentId: string | null;
116
+ subCategories: Category[];
117
+ }
118
+ /** A single allowed value for a category attribute. */
119
+ interface CategoryAttributeValue {
120
+ id: string;
121
+ name: string;
122
+ }
123
+ /**
124
+ * Result of `categories.getByBarcodes` — a barcode → category mapping
125
+ * sourced from Trendyol's Export Center (AutoFT) lookup endpoint.
126
+ */
127
+ interface BarcodeCategoryLookup {
128
+ /** Successful matches. */
129
+ matches: Array<{
130
+ barcode: string;
131
+ category: {
132
+ id: string;
133
+ name: string;
134
+ };
135
+ }>;
136
+ /** Barcodes Trendyol could not resolve to a category. */
137
+ notFound: string[];
138
+ }
139
+ /**
140
+ * A required or optional attribute for products in a given category.
141
+ * Use these when constructing a `createProduct V2` payload — the API rejects
142
+ * products that omit `required` attributes.
143
+ */
144
+ interface CategoryAttribute {
145
+ id: string;
146
+ name: string;
147
+ /** The category this attribute belongs to (echoed back by Trendyol). */
148
+ categoryId?: string;
149
+ required: boolean;
150
+ /** Whether the attribute accepts custom text values in addition to the listed ones. */
151
+ allowCustom: boolean;
152
+ /** Whether the attribute participates in product variants (e.g. color, size). */
153
+ varianter: boolean;
154
+ /** Whether the attribute is used as a price slicer (e.g. size for shoes). */
155
+ slicer: boolean;
156
+ /**
157
+ * V2-only: whether the attribute accepts multiple values at once.
158
+ * Present on responses from the V2 `getCategoryAttributes` endpoint; absent on V1.
159
+ */
160
+ allowMultipleAttributeValues?: boolean;
161
+ /**
162
+ * Allowed values for this attribute.
163
+ *
164
+ * NOTE: Trendyol's live API often omits this field on the `getCategoryAttributes`
165
+ * response — the endpoint returns attribute metadata + flags, not the full value
166
+ * catalog. In that case `values` is an empty array. If `allowCustom` is `true`,
167
+ * any custom text is accepted; otherwise use `client.categories.getAttributeValues(categoryId, attributeId)`
168
+ * to fetch the catalog from the dedicated V2 endpoint.
169
+ */
170
+ values: CategoryAttributeValue[];
171
+ }
172
+
173
+ type ListCategoryAttributeValuesParams = CursorPaginationParams;
174
+ /**
175
+ * Trendyol category-tree and category-attribute endpoints.
176
+ *
177
+ * Rate limits (per Trendyol service limits):
178
+ * - Category list: 50 req/min
179
+ * - Category attributes: 50 req/min
180
+ * - Category attribute values: 50 req/min (same service tier)
181
+ *
182
+ * All three counters live on the same Trendyol service, so we share one
183
+ * limiter across the endpoints.
184
+ */
185
+ declare class CategoriesResource {
186
+ private readonly transport;
187
+ private readonly limiter;
188
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
189
+ /**
190
+ * Fetch the full Trendyol category tree.
191
+ *
192
+ * Trendyol returns the entire tree in one response — there is no pagination.
193
+ * Cache the result aggressively in your application; the tree changes rarely.
194
+ */
195
+ list(): Promise<Category[]>;
196
+ /**
197
+ * Fetch the attributes (required and optional) for a single category.
198
+ *
199
+ * Call this before `createProduct V2` so you know which attributes are
200
+ * mandatory — the API rejects products that omit any `required` attribute.
201
+ *
202
+ * @param categoryId Trendyol numeric category ID; accepts `string` or `number`.
203
+ */
204
+ getAttributes(categoryId: string | number): Promise<CategoryAttribute[]>;
205
+ /**
206
+ * Fetch the allowed values for a single category attribute (paginated).
207
+ *
208
+ * `getCategoryAttributes` returns attribute metadata + flags but typically
209
+ * omits the value catalog. Use this method to fetch the catalog for an
210
+ * attribute when `allowCustom` is `false` and you need to map your data
211
+ * onto Trendyol's accepted values.
212
+ *
213
+ * @param categoryId Trendyol numeric category ID; accepts `string` or `number`.
214
+ * @param attributeId Attribute ID returned by `getAttributes`.
215
+ * @param params Cursor pagination (max page size 1000; default 100).
216
+ *
217
+ * @example
218
+ * ```ts
219
+ * import { paginate } from '@lonca/core';
220
+ * for await (const value of paginate((p) =>
221
+ * client.categories.getAttributeValues(catId, attrId, p),
222
+ * )) {
223
+ * console.log(value.id, value.name);
224
+ * }
225
+ * ```
226
+ */
227
+ getAttributeValues(categoryId: string | number, attributeId: string | number, params?: ListCategoryAttributeValuesParams): Promise<CursorPage<CategoryAttributeValue>>;
228
+ /**
229
+ * Look up category info for a list of barcodes (Trendyol Export Center
230
+ * / AutoFT endpoint).
231
+ *
232
+ * **Requires Export Center enrollment.** Sellers who have not joined
233
+ * Trendyol's "İhracat Merkezi" program will get an auth error on this
234
+ * endpoint even though their regular Marketplace credentials are valid.
235
+ *
236
+ * @param barcodes 1–N barcodes to look up.
237
+ * @throws {ValidationError} when `barcodes` is empty.
238
+ */
239
+ getByBarcodes(barcodes: string[]): Promise<BarcodeCategoryLookup>;
240
+ }
241
+
242
+ /**
243
+ * Trendyol claim ("iade" / return-claim) types.
244
+ *
245
+ * A claim is a customer-initiated return on a delivered order. The
246
+ * seller can also open a `createClaimIssue` (a rejection) against a
247
+ * customer-filed claim, and either party can have line items approved
248
+ * via `approveClaimLineItems`.
249
+ */
250
+
251
+ /** One item inside `claims.create()`. */
252
+ interface CreateClaimItemInput {
253
+ /** Barcode of the ordered SKU. */
254
+ barcode: string;
255
+ /** Number of units being returned. */
256
+ quantity: number;
257
+ /**
258
+ * Numeric reason code customers select on trendyol.com.
259
+ * Trendyol's docs note `401` ("Vazgectim" — changed my mind) as a
260
+ * safe default when you don't have a more specific code.
261
+ */
262
+ reasonId: number;
263
+ /** Free-text note from the customer. */
264
+ customerNote?: string;
265
+ }
266
+ /** Payload for `claims.create()`. */
267
+ interface CreateClaimInput {
268
+ /** The order to file the claim against. */
269
+ orderNumber: string;
270
+ claimItems: CreateClaimItemInput[];
271
+ /** Trendyol customer ID (the one who placed the order). */
272
+ customerId?: number;
273
+ /** Suppress this claim from listing pages. */
274
+ excludeListing?: boolean;
275
+ /** Force a new shipment package to be created for the return. */
276
+ forcePackageCreation?: boolean;
277
+ }
278
+ /**
279
+ * Payload for `claims.createIssue()` — file a seller-side rejection
280
+ * ("ret talebi") against a customer claim. Wire format is
281
+ * `multipart/form-data` because optional `files` are PDF / JPEG
282
+ * supporting documents.
283
+ */
284
+ interface CreateClaimIssueInput {
285
+ /** Numeric reason ID from `claims.getIssueReasons()`. */
286
+ claimIssueReasonId: number;
287
+ /** Per-line claim item IDs being rejected. SDK joins with commas. */
288
+ claimItemIdList: string[];
289
+ /** Free-text explanation (≤500 chars). */
290
+ description: string;
291
+ /** Optional supporting documents (Blob / File). */
292
+ files?: Blob[];
293
+ }
294
+ /** Payload for `claims.approveLineItems()`. */
295
+ interface ApproveClaimLineItemsInput {
296
+ /** Claim line-item IDs to approve. */
297
+ claimLineItemIdList: string[];
298
+ /** Optional extra params Trendyol forwards verbatim. */
299
+ params?: Record<string, string>;
300
+ }
301
+ /**
302
+ * Claim item lifecycle state. Open enum — Trendyol can add new states
303
+ * without breaking callers.
304
+ */
305
+ type ClaimItemStatus = 'Created' | 'WaitingInAction' | 'WaitingFraudCheck' | 'Accepted' | 'Unresolved' | 'Rejected' | (string & {});
306
+ /** Filter / pagination for `claims.list()`. */
307
+ interface ListClaimsParams extends CursorPaginationParams {
308
+ startDate?: Date;
309
+ endDate?: Date;
310
+ /** Filter claims by item-level status. */
311
+ claimItemStatus?: ClaimItemStatus;
312
+ }
313
+ /**
314
+ * A return claim. Trendyol returns ~20 fields; the SDK surfaces the
315
+ * stable subset and keeps everything else on `raw`.
316
+ */
317
+ interface Claim {
318
+ /** Claim ID (Trendyol returns it under both `id` and `claimId` — same value). */
319
+ id: string;
320
+ orderNumber: string;
321
+ /** ISO 8601 UTC (from ms-epoch `orderDate`). */
322
+ orderDate?: string;
323
+ /** ISO 8601 UTC (from ms-epoch `claimDate`). */
324
+ claimDate?: string;
325
+ customerFirstName?: string;
326
+ customerLastName?: string;
327
+ /** Untouched raw claim — pull undocumented fields from here. */
328
+ raw: Record<string, unknown>;
329
+ }
330
+ /** Rejection-reason catalog row from `claims.getIssueReasons()`. */
331
+ interface ClaimIssueReason {
332
+ id: number;
333
+ name: string;
334
+ }
335
+ /**
336
+ * Audit entry for a single claim item, returned by `claims.getItemAudits()`.
337
+ * Trendyol's response shape varies; only `raw` is guaranteed.
338
+ */
339
+ interface ClaimItemAudit {
340
+ /** Untouched raw audit row. */
341
+ raw: Record<string, unknown>;
342
+ }
343
+
344
+ /**
345
+ * Trendyol claims (return / iade) endpoints.
346
+ *
347
+ * Rate limit (per Trendyol service limits): shares the order service bucket;
348
+ * the SDK provisions its own 1000 req/min limiter that the caller can override.
349
+ */
350
+ declare class ClaimsResource {
351
+ private readonly transport;
352
+ private readonly limiter;
353
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
354
+ /**
355
+ * Create a return claim against an order. Use this to file a return on
356
+ * behalf of a customer (e.g. when they called your CS line). For
357
+ * customer-initiated returns coming from trendyol.com, you receive them
358
+ * via `claims.list()` — no need to call `create`.
359
+ *
360
+ * Returns whatever Trendyol returns (typically the new claim's identifier).
361
+ *
362
+ * @throws {ValidationError} when `claimItems` is empty.
363
+ */
364
+ create(input: CreateClaimInput): Promise<unknown>;
365
+ /**
366
+ * File a seller-side rejection ("ret talebi") against a customer claim.
367
+ *
368
+ * **Wire format: `multipart/form-data`** — the SDK builds the FormData
369
+ * internally from the typed input. `claimItemIdList` is joined with
370
+ * commas (Trendyol expects a single comma-separated string field).
371
+ * Attach supporting docs (PDF / JPEG) via `files: [Blob, ...]`.
372
+ */
373
+ createIssue(claimId: string, input: CreateClaimIssueInput): Promise<unknown>;
374
+ /**
375
+ * Approve specific claim line items. After approval, Trendyol moves
376
+ * those line items into the post-approval refund / return-shipping flow.
377
+ *
378
+ * @throws {ValidationError} when `claimLineItemIdList` is empty.
379
+ */
380
+ approveLineItems(claimId: string, input: ApproveClaimLineItemsInput): Promise<unknown>;
381
+ /**
382
+ * List claims (page-based; SDK exposes opaque cursor convention).
383
+ *
384
+ * @example
385
+ * ```ts
386
+ * import { paginate } from '@lonca/core';
387
+ * for await (const c of paginate((p) =>
388
+ * client.claims.list({ ...p, claimItemStatus: 'WaitingInAction' }),
389
+ * )) {
390
+ * console.log(c.id, c.orderNumber, c.claimDate);
391
+ * }
392
+ * ```
393
+ */
394
+ list(params?: ListClaimsParams): Promise<CursorPage<Claim>>;
395
+ /**
396
+ * Fetch the catalog of rejection-reason IDs the seller can use on
397
+ * `claims.createIssue()`. Cache the result — it changes rarely.
398
+ *
399
+ * Note: this endpoint is **not seller-scoped** (no `sellerId` in path).
400
+ */
401
+ getIssueReasons(): Promise<ClaimIssueReason[]>;
402
+ /**
403
+ * Fetch the audit log for a single claim item (state transitions,
404
+ * actor, timestamp). Trendyol's response shape varies — the SDK
405
+ * surfaces each row as `{ raw }` and leaves field extraction to the
406
+ * caller until we observe a stable shape on the wire.
407
+ */
408
+ getItemAudits(claimItemId: string): Promise<ClaimItemAudit[]>;
409
+ }
410
+
411
+ /**
412
+ * Trendyol Export Center (İhracat Merkezi / AutoFT) types.
413
+ *
414
+ * Source: developers.trendyol.com — `autoft-*` documentation pages.
415
+ *
416
+ * The Export Center is Trendyol's program for sellers exporting from
417
+ * Türkiye to Trendyol's international platforms. It shares the same API
418
+ * gateway (`apigw.trendyol.com`) and HMAC auth as the main marketplace
419
+ * surface — the distinguishing factor is the path prefix:
420
+ * `/integration/ecgw/v{N}/{sellerId}/…`
421
+ *
422
+ * Per-endpoint shapes are loosely typed (`Record<string, unknown>`)
423
+ * because Trendyol's docs document fields in HTML tables; the SDK keeps
424
+ * payloads loose and surfaces the raw response. Operations that need
425
+ * stronger typing in practice should consult the portal pages.
426
+ */
427
+
428
+ /** Query parameters for `exportCenter.listProducts()`. */
429
+ interface ListExportProductsParams {
430
+ /** Optional list of barcodes to filter to. */
431
+ barcodes?: string[];
432
+ /**
433
+ * Page cursor — empty for the first request, then use the `x-paging-key`
434
+ * value from the previous response's headers for subsequent pages.
435
+ */
436
+ pageKey?: string;
437
+ /** Page size. Default: 20, max: 100. */
438
+ size?: number;
439
+ }
440
+ /** One product row returned by `listProducts()`. Loose; consult portal for the documented field set. */
441
+ interface ExportProduct {
442
+ /** Untouched raw row. */
443
+ raw: Record<string, unknown>;
444
+ }
445
+ /**
446
+ * Payload for `exportCenter.createProducts()` — see "Ürün Oluşturma V2"
447
+ * on the developer portal for the documented field set per product.
448
+ * Max 5000 items per call.
449
+ */
450
+ type ExportProductInput = Record<string, unknown>;
451
+ /** Payload for `exportCenter.updatePrices()` — `{ barcode, salePrice, listPrice, ... }` per docs. */
452
+ type ExportPriceUpdateInput = Record<string, unknown>;
453
+ /** Payload for `exportCenter.updateStocks()` — `{ barcode, quantity, ... }` per docs. */
454
+ type ExportStockUpdateInput = Record<string, unknown>;
455
+ /** Returned by every async batch endpoint — poll status via `getBatchStatus(batchId)`. */
456
+ interface ExportBatchAcceptedResponse {
457
+ /** UUID returned by Trendyol. Surfaces in the response body or `Location` header. */
458
+ batchId: string;
459
+ /** Untouched raw response. */
460
+ raw: Record<string, unknown>;
461
+ }
462
+ /** Status of a previously-submitted batch. */
463
+ interface ExportBatchStatus {
464
+ batchId?: string;
465
+ status?: string;
466
+ itemCount?: number;
467
+ failedItemCount?: number;
468
+ items?: Array<Record<string, unknown>>;
469
+ /** Untouched raw row. */
470
+ raw: Record<string, unknown>;
471
+ }
472
+ /** Status enum for Export Center packages — `new | pending | completed | cancelled`. */
473
+ type ExportPackageStatus = 'new' | 'pending' | 'completed' | 'cancelled';
474
+ /** Query parameters for `exportCenter.listPackagesV2()`. */
475
+ interface ListExportPackagesV2Params {
476
+ /** Cargo tracking number filter. */
477
+ trackingNumber?: string;
478
+ /** Status filter. */
479
+ status?: ExportPackageStatus;
480
+ /** UTC milliseconds. */
481
+ creationStartDate?: number;
482
+ /** UTC milliseconds. */
483
+ creationEndDate?: number;
484
+ /** Page size; max 100. */
485
+ size?: number;
486
+ /** Boutique-specific filter (when used by partner businesses). */
487
+ boutiqueId?: number;
488
+ }
489
+ /** Query parameters for `exportCenter.listPackagesV3()`. Uses page-based pagination. */
490
+ interface ListExportPackagesV3Params extends OffsetPaginationParams {
491
+ status?: ExportPackageStatus;
492
+ creationStartDate?: number;
493
+ creationEndDate?: number;
494
+ }
495
+ /** Query parameters for `exportCenter.getPackageItems()`. */
496
+ interface GetExportPackageItemsParams extends OffsetPaginationParams {
497
+ /** Required. */
498
+ packageId: string;
499
+ status?: ExportPackageStatus;
500
+ }
501
+ /** One package row returned by the list endpoints. */
502
+ interface ExportPackage {
503
+ packageNumber?: string;
504
+ status?: ExportPackageStatus;
505
+ /** Untouched raw row. */
506
+ raw: Record<string, unknown>;
507
+ }
508
+ /** One package-item row returned by `getPackageItems()`. */
509
+ interface ExportPackageItem {
510
+ /** Untouched raw row. */
511
+ raw: Record<string, unknown>;
512
+ }
513
+ /** Attribute definition for a leaf Export Center category. */
514
+ interface ExportCategoryAttribute {
515
+ attributeId?: number | string;
516
+ attributeName?: string;
517
+ required?: boolean;
518
+ /** Allowed values (for enum-style attributes). */
519
+ values?: unknown[];
520
+ /** Untouched raw row. */
521
+ raw: Record<string, unknown>;
522
+ }
523
+ /** One care-instruction lookup row. */
524
+ interface CareInstruction {
525
+ id?: number | string;
526
+ name?: string;
527
+ /** Untouched raw row. */
528
+ raw: Record<string, unknown>;
529
+ }
530
+ /** One material-composition lookup row. */
531
+ interface ProductComposition {
532
+ id?: number | string;
533
+ name?: string;
534
+ /** Untouched raw row. */
535
+ raw: Record<string, unknown>;
536
+ }
537
+ /** One country-of-origin lookup row. */
538
+ interface ProductOrigin {
539
+ id?: number | string;
540
+ name?: string;
541
+ countryCode?: string;
542
+ /** Untouched raw row. */
543
+ raw: Record<string, unknown>;
544
+ }
545
+
546
+ /**
547
+ * Trendyol Export Center (İhracat Merkezi / AutoFT) — Türkiye-based
548
+ * sellers exporting to Trendyol's international platforms.
549
+ *
550
+ * **Service base URL**: same `apigw.trendyol.com` as the main marketplace,
551
+ * with a distinct path prefix `/integration/ecgw/v{N}/{sellerId}/…`.
552
+ *
553
+ * The Export Center requires sellers to first complete Trendyol's "İhracat
554
+ * Merkezi" application; the same `apiKey`/`apiSecret` then authorize
555
+ * these paths. Calls from non-enrolled sellers return `401`.
556
+ *
557
+ * 12 endpoints across four surfaces — products (list/create/price/stock),
558
+ * batch status, packages (V2/V3 list + item detail), and lookup
559
+ * (categories, care instructions, compositions, origins).
560
+ *
561
+ * NOTE: per-endpoint body / response shapes are documented in HTML tables
562
+ * on developers.trendyol.com — the SDK accepts `Record<string, unknown>`
563
+ * bodies and surfaces row-level `raw` accessors so undocumented fields
564
+ * stay reachable.
565
+ */
566
+ declare class ExportCenterResource {
567
+ private readonly transport;
568
+ private readonly limiter;
569
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
570
+ /**
571
+ * List Export Center-approved products. Uses Trendyol's `pageKey`
572
+ * pagination — the first call leaves `pageKey` empty; subsequent
573
+ * calls pass the `x-paging-key` value from the previous response.
574
+ */
575
+ listProducts(params?: ListExportProductsParams): Promise<ExportProduct[]>;
576
+ /**
577
+ * Create Export Center products. Maximum 5000 per call. Returns a
578
+ * `batchId` you can poll via `getBatchStatus(batchId)`.
579
+ *
580
+ * @throws {ValidationError} when `products` is empty / oversized.
581
+ */
582
+ createProducts(products: ExportProductInput[]): Promise<ExportBatchAcceptedResponse>;
583
+ /**
584
+ * Update Export Center prices. **Trendyol allows one price update per
585
+ * barcode per day.** Returns a `batchId`.
586
+ *
587
+ * @throws {ValidationError} when `priceInfos` is empty / oversized.
588
+ */
589
+ updatePrices(priceInfos: ExportPriceUpdateInput[]): Promise<ExportBatchAcceptedResponse>;
590
+ /**
591
+ * Update Export Center stocks. Returns a `batchId`. Sellers using
592
+ * Trendyol's shared inventory cannot use this endpoint (per portal docs).
593
+ *
594
+ * @throws {ValidationError} when `items` is empty / oversized.
595
+ */
596
+ updateStocks(items: ExportStockUpdateInput[]): Promise<ExportBatchAcceptedResponse>;
597
+ /**
598
+ * Look up the status of a previously-submitted batch. Trendyol retains
599
+ * batch records for **24 hours** only — older `batchId`s return `404`.
600
+ */
601
+ getBatchStatus(batchId: string): Promise<ExportBatchStatus>;
602
+ /** List daily Export Center packages (V2 — query-based filters). */
603
+ listPackagesV2(params?: ListExportPackagesV2Params): Promise<ExportPackage[]>;
604
+ /** List Export Center packages (V3 — consolidated, page-based). */
605
+ listPackagesV3(params?: ListExportPackagesV3Params): Promise<ExportPackage[]>;
606
+ /** Get the line items inside an Export Center package. */
607
+ getPackageItems(params: GetExportPackageItemsParams): Promise<ExportPackageItem[]>;
608
+ /** Get the required attributes for an Export Center category. */
609
+ getCategoryAttributes(categoryId: number | string): Promise<ExportCategoryAttribute[]>;
610
+ /** Get the care-instruction lookup values used by `createProducts`. */
611
+ getCareInstructions(): Promise<CareInstruction[]>;
612
+ /** Get the material-composition lookup values used by `createProducts`. */
613
+ getCompositions(): Promise<ProductComposition[]>;
614
+ /** Get the country-of-origin lookup values used by `createProducts`. */
615
+ getOrigins(): Promise<ProductOrigin[]>;
616
+ private assertBatch;
617
+ }
618
+
619
+ /**
620
+ * Misc types for Trendyol's smaller surfaces — invoices, finance,
621
+ * common labels, test orders, and location lookups. Most shapes are
622
+ * loosely typed (`Record<string, unknown>`) because the Trendyol response
623
+ * shapes here are wide and seldom-evolved; callers drill into `raw` for
624
+ * fields beyond the stable surface.
625
+ */
626
+
627
+ interface UploadInvoiceFileInput {
628
+ /** Trendyol shipment package ID (required). */
629
+ shipmentPackageId: number;
630
+ /** Invoice file (PDF / JPEG / PNG, max 10 MB). */
631
+ file: Blob;
632
+ /** ms-epoch — mandatory for micro-export orders, optional otherwise. */
633
+ invoiceDateTime?: number;
634
+ /**
635
+ * Invoice number — mandatory for micro-export orders. Format:
636
+ * `[A-Za-z0-9]{3}(20[2-9][0-9])\d{9}`.
637
+ */
638
+ invoiceNumber?: string;
639
+ }
640
+ interface SendInvoiceLinkInput {
641
+ invoiceLink: string;
642
+ shipmentPackageId: number;
643
+ invoiceDateTime?: number;
644
+ invoiceNumber?: string;
645
+ }
646
+ interface DeleteInvoiceLinkInput {
647
+ serviceSourceId?: number;
648
+ channelId?: number;
649
+ customerId?: number;
650
+ /** Forward-compatible: pass any extra fields Trendyol may add. */
651
+ [key: string]: unknown;
652
+ }
653
+ /**
654
+ * One row from Trendyol's current-account statement — returned by both
655
+ * `finance.getSettlements()` and `finance.getOtherFinancials()` (both
656
+ * endpoints share the `FinancialTransaction` wire schema).
657
+ *
658
+ * Field set verified against the spec on 2026-05-25. The SDK exposes the
659
+ * stable subset; anything Trendyol adds later remains accessible via `raw`.
660
+ */
661
+ interface FinancialTransaction {
662
+ /** Transaction ID (string per Trendyol). */
663
+ id: string;
664
+ /** ISO 8601 UTC (from ms-epoch `transactionDate`). */
665
+ transactionDate?: string;
666
+ /** Product barcode when the transaction is tied to a SKU. */
667
+ barcode?: string | null;
668
+ /** Transaction category (e.g. `'Satış'`, `'Ödeme'`). */
669
+ transactionType?: string;
670
+ /** Receipt ID ("dekont no") when applicable. */
671
+ receiptId?: number | null;
672
+ description?: string | null;
673
+ /** Debit amount on the seller's account. */
674
+ debt?: number;
675
+ /** Credit amount on the seller's account. */
676
+ credit?: number;
677
+ paymentPeriod?: number | null;
678
+ commissionRate?: number | null;
679
+ commissionAmount?: number | null;
680
+ commissionInvoiceSerialNumber?: string | null;
681
+ /** Net seller revenue after Trendyol's cut. */
682
+ sellerRevenue?: number | null;
683
+ orderNumber?: string | null;
684
+ paymentOrderId?: number | null;
685
+ /** ISO 8601 UTC (from ms-epoch `paymentDate`). */
686
+ paymentDate?: string;
687
+ sellerId?: number;
688
+ storeId?: number | null;
689
+ storeName?: string | null;
690
+ storeAddress?: string | null;
691
+ country?: string | null;
692
+ /** Untouched raw row — pull any undocumented fields from here. */
693
+ raw: Record<string, unknown>;
694
+ }
695
+ /**
696
+ * Aliases preserved for source-compatibility with `0.5.0`. Both legacy
697
+ * names now resolve to the unified `FinancialTransaction`.
698
+ *
699
+ * @deprecated since `0.5.1` — use `FinancialTransaction`.
700
+ */
701
+ type SettlementRow = FinancialTransaction;
702
+ /** @deprecated since `0.5.1` — use `FinancialTransaction`. */
703
+ type OtherFinancialRow = FinancialTransaction;
704
+ /**
705
+ * Shared filter shape for both finance endpoints.
706
+ * `transactionType` lets you scope to one settlement category.
707
+ */
708
+ interface ListFinanceParams extends CursorPaginationParams {
709
+ startDate?: Date;
710
+ endDate?: Date;
711
+ transactionType?: string;
712
+ }
713
+ interface CreateCommonLabelInput {
714
+ /** Currently the only documented format Trendyol accepts. */
715
+ format: 'ZPL' | (string & {});
716
+ boxQuantity?: number;
717
+ /** Volumetric height (height × width × depth / 3000 → desi). */
718
+ volumetricHeight?: number;
719
+ }
720
+ /** One label entry inside a `CommonLabel` response. */
721
+ interface CommonLabelEntry {
722
+ /** Encoded label payload (e.g. ZPL string `^XA...^XZ`). */
723
+ label: string;
724
+ format: 'ZPL' | (string & {});
725
+ }
726
+ /**
727
+ * Response from `labels.getCommon()` — Trendyol's wire shape is
728
+ * `{ data: [{ label, format }] }`. SDK surfaces the array directly via
729
+ * `labels` for ergonomic access; `raw` is the untouched response.
730
+ */
731
+ interface CommonLabel {
732
+ labels: CommonLabelEntry[];
733
+ raw: Record<string, unknown>;
734
+ }
735
+ /**
736
+ * Payload for `testOrders.create()`. Top-level requireds are
737
+ * `customer`, `invoiceAddress`, `lines`, `seller`, `shippingAddress`;
738
+ * each sub-object has its own field rules (see Trendyol's
739
+ * `createTestOrder` reference). Kept loose because the inner schema is
740
+ * deep and used only in STAGE.
741
+ */
742
+ interface CreateTestOrderInput {
743
+ customer: Record<string, unknown>;
744
+ invoiceAddress: Record<string, unknown>;
745
+ shippingAddress: Record<string, unknown>;
746
+ seller: Record<string, unknown>;
747
+ lines: Array<Record<string, unknown>>;
748
+ [key: string]: unknown;
749
+ }
750
+ type TestOrderStatus = 'Created' | 'Picking' | 'Invoiced' | 'Shipped' | 'Delivered' | 'Cancelled' | 'Returned' | 'UnDelivered' | (string & {});
751
+ interface Country {
752
+ /** ISO country code (e.g. `'TR'`, `'AZ'`). */
753
+ code: string;
754
+ name?: string;
755
+ raw: Record<string, unknown>;
756
+ }
757
+ interface City {
758
+ code: string;
759
+ name?: string;
760
+ countryCode?: string;
761
+ raw: Record<string, unknown>;
762
+ }
763
+ interface District {
764
+ code: string;
765
+ name?: string;
766
+ cityCode?: string;
767
+ raw: Record<string, unknown>;
768
+ }
769
+ interface Neighborhood {
770
+ code: string;
771
+ name?: string;
772
+ districtCode?: string;
773
+ raw: Record<string, unknown>;
774
+ }
775
+
776
+ /**
777
+ * Trendyol finance endpoints — current-account-statement settlements and
778
+ * "other financials" (cargo invoices, labor cost adjustments, etc.).
779
+ *
780
+ * Both endpoints return the same `FinancialTransaction` shape on the wire,
781
+ * so the SDK exposes one typed surface for them.
782
+ */
783
+ declare class FinanceResource {
784
+ private readonly transport;
785
+ private readonly limiter;
786
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
787
+ getSettlements(params?: ListFinanceParams): Promise<CursorPage<FinancialTransaction>>;
788
+ getOtherFinancials(params?: ListFinanceParams): Promise<CursorPage<FinancialTransaction>>;
789
+ private queryPage;
790
+ }
791
+
792
+ /**
793
+ * A single price / stock update entry.
794
+ *
795
+ * `barcode` is the only required field. Include any combination of:
796
+ * - `quantity` to update stock (max 20 000 per product)
797
+ * - `salePrice` to update the sale price
798
+ * - `listPrice` to update the list (strikethrough) price
799
+ *
800
+ * `listPrice` must be greater than or equal to `salePrice`.
801
+ */
802
+ interface PriceInventoryUpdate {
803
+ barcode: string;
804
+ quantity?: number;
805
+ salePrice?: number;
806
+ listPrice?: number;
807
+ }
808
+ /** Response from `updatePriceAndInventory` — poll with `products.getBatchStatus`. */
809
+ interface UpdatePriceInventoryResponse {
810
+ batchRequestId: string;
811
+ }
812
+
813
+ /** A `{ id, name }` reference object used in product/category/brand wire types. */
814
+ interface NamedRef {
815
+ id: string;
816
+ name: string;
817
+ }
818
+ /**
819
+ * A single attribute on a Trendyol product or variant.
820
+ *
821
+ * `attributeValueId` and `attributeValue` are mutually exclusive in createProduct
822
+ * payloads but can both be present in filter responses.
823
+ */
824
+ interface ProductAttribute {
825
+ attributeId: string;
826
+ attributeName?: string;
827
+ attributeValueId?: string;
828
+ attributeValue?: string;
829
+ }
830
+ /**
831
+ * A variant of a Trendyol product — the actual purchasable SKU.
832
+ *
833
+ * Trendyol scopes barcode + stock + commission to the variant level even for
834
+ * products that only have a single variant. To read a product's barcode use
835
+ * `product.variants[0].barcode`.
836
+ */
837
+ interface ProductVariant {
838
+ variantId: string;
839
+ barcode: string;
840
+ commission?: number;
841
+ attributes: ProductAttribute[];
842
+ productUrl?: string;
843
+ onSale?: boolean;
844
+ /** Stock quantity (when the response includes stock data). */
845
+ stock?: number;
846
+ /** Untouched raw response for fields not modeled yet. */
847
+ raw: Record<string, unknown>;
848
+ }
849
+ /**
850
+ * A Trendyol marketplace product (approved variant).
851
+ *
852
+ * Lonca surfaces the stable fields we have verified against live Trendyol
853
+ * responses. Everything else stays accessible via `raw`.
854
+ */
855
+ interface Product {
856
+ contentId: string;
857
+ productMainId: string;
858
+ title: string;
859
+ description?: string;
860
+ brand: NamedRef;
861
+ category: NamedRef;
862
+ /** Image URLs in display order. */
863
+ images: string[];
864
+ attributes: ProductAttribute[];
865
+ variants: ProductVariant[];
866
+ /** ISO 8601 UTC string (converted from Trendyol's ms-epoch). */
867
+ createdAt: string;
868
+ /** ISO 8601 UTC string. */
869
+ updatedAt: string;
870
+ lastModifiedBy?: string;
871
+ /** Untouched raw response — read fields we have not modeled yet. */
872
+ raw: Record<string, unknown>;
873
+ }
874
+ /**
875
+ * Lifecycle status of an unapproved (draft) product on Trendyol.
876
+ *
877
+ * Verified values seen on STAGE/PROD as of 2026-05-25:
878
+ * - `pendingApproval` — submitted; Trendyol content review in progress.
879
+ * - `rejected` — review failed; `rejectReasonDetails` is populated.
880
+ *
881
+ * Older docs also mention `waiting`. Treat as open-enum (`(string & {})`)
882
+ * since Trendyol can add new statuses without notice.
883
+ */
884
+ type UnapprovedProductStatus = 'pendingApproval' | 'waiting' | 'rejected' | (string & {});
885
+ interface UnapprovedProductRejectReason {
886
+ /** Short title (e.g. "Kategori Bilgisi Eksik veya Yanlış"). */
887
+ rejectReason?: string;
888
+ /** Full explanation of the rejection. */
889
+ rejectReasonDetail?: string;
890
+ }
891
+ /**
892
+ * An unapproved (draft) product as returned by `filterUnapprovedProducts`.
893
+ *
894
+ * Important: the wire shape is **flatter** than the approved-product shape
895
+ * exposed by `Product` — `barcode`, `quantity`, `salePrice`, etc. live at the
896
+ * root (no `variants[]` array). Each draft is one barcode/SKU.
897
+ *
898
+ * Verified against Trendyol STAGE on 2026-05-25. The official OpenAPI spec
899
+ * calls the image-list field `media`, but the live API returns it as
900
+ * `images`. SDK normalizes to `images`.
901
+ */
902
+ interface UnapprovedProduct {
903
+ /** Seller (supplier) ID echoed back by Trendyol. */
904
+ supplierId?: string;
905
+ productMainId: string;
906
+ /** Lifecycle status — see `UnapprovedProductStatus`. */
907
+ status?: UnapprovedProductStatus;
908
+ brand: NamedRef;
909
+ category: NamedRef;
910
+ barcode: string;
911
+ title: string;
912
+ description?: string;
913
+ /** Stock quantity at the moment of the query. */
914
+ quantity?: number;
915
+ listPrice?: number;
916
+ salePrice?: number;
917
+ /** VAT rate as a percentage (e.g. `20` for 20%). */
918
+ vatRate?: number;
919
+ dimensionalWeight?: number;
920
+ stockCode?: string;
921
+ /** Image URLs in display order (Trendyol's `images` field, spec says `media`). */
922
+ images: string[];
923
+ attributes: ProductAttribute[];
924
+ /** Populated when `status === 'rejected'`. */
925
+ rejectReasonDetails: UnapprovedProductRejectReason[];
926
+ /** Returned by Trendyol; null when the seller has not configured this. */
927
+ origin?: string | null;
928
+ locationBasedDelivery?: 'ENABLED' | 'DISABLED' | null;
929
+ lotNumber?: string | null;
930
+ /** Special consumption tax (ÖTV) where applicable. */
931
+ specialConsumptionTax?: number | null;
932
+ /** Suggested governance retail price (Suggested Government Retail price). */
933
+ sgrPrice?: number | null;
934
+ /** ISO 8601 UTC string (from `createDateTime` ms-epoch). */
935
+ createdAt?: string;
936
+ /** ISO 8601 UTC string (from `lastUpdateDate`). */
937
+ updatedAt?: string;
938
+ /** ISO 8601 UTC string (from `lastPriceChangeDate`). */
939
+ lastPriceChangedAt?: string;
940
+ /** ISO 8601 UTC string (from `lastStockChangeDate`). */
941
+ lastStockChangedAt?: string;
942
+ /** Untouched raw response. */
943
+ raw: Record<string, unknown>;
944
+ }
945
+ /**
946
+ * Listing-status filter accepted by `filterProducts` inventory-and-price.
947
+ *
948
+ * Trendyol documents `archived`, `blacklisted`, `locked`, `onSale`, and
949
+ * `notOnSale`. Open (`string & {}`) so a value Trendyol adds later still
950
+ * type-checks.
951
+ */
952
+ type ApprovedProductStatus = 'archived' | 'blacklisted' | 'locked' | 'onSale' | 'notOnSale' | (string & {});
953
+ /**
954
+ * A single variant's stock + price, returned by
955
+ * `products.listInventoryAndPrice` (Trendyol's lightweight
956
+ * `inventory-and-price` filter). Intentionally narrow: this endpoint returns
957
+ * only pricing + stock, not the full product/variant shape exposed by
958
+ * {@link ProductVariant}.
959
+ */
960
+ interface ProductStockPriceVariant {
961
+ variantId: string;
962
+ barcode: string;
963
+ /** Sale price (price the customer pays). */
964
+ salePrice?: number;
965
+ /** List price (pre-discount reference price). */
966
+ listPrice?: number;
967
+ /** Stock quantity. */
968
+ quantity?: number;
969
+ stockCode?: string;
970
+ /**
971
+ * ISO 8601 UTC string (from `stockLastModifiedDate` ms-epoch). Absent when
972
+ * the variant's stock has never been updated (Trendyol returns `null`).
973
+ */
974
+ stockLastModifiedAt?: string;
975
+ /** Untouched raw response. */
976
+ raw: Record<string, unknown>;
977
+ }
978
+ /**
979
+ * An approved product's stock + price, returned by
980
+ * `products.listInventoryAndPrice`. Slimmer than {@link Product} — it carries
981
+ * only the identifiers and the per-variant stock/price.
982
+ */
983
+ interface ProductStockPrice {
984
+ contentId: string;
985
+ productMainId: string;
986
+ variants: ProductStockPriceVariant[];
987
+ /** Untouched raw response. */
988
+ raw: Record<string, unknown>;
989
+ }
990
+ /**
991
+ * Basic lifecycle info for a single product, returned by `getProductBase`.
992
+ *
993
+ * Cheap to call (no body — just barcode in path) and useful as a polling
994
+ * primitive after `createProducts` to detect `approved: true`.
995
+ */
996
+ interface ProductBase {
997
+ barcode: string;
998
+ approved: boolean;
999
+ archived: boolean;
1000
+ /** ISO 8601 UTC string (from `approvedDate` ms-epoch); `undefined` until approved. */
1001
+ approvedAt?: string;
1002
+ /** Stable listing ID assigned after approval. */
1003
+ listingId?: string;
1004
+ /** Trendyol's content ID — the same field on `Product.contentId`. */
1005
+ contentId?: string;
1006
+ /** Untouched raw response. */
1007
+ raw: Record<string, unknown>;
1008
+ }
1009
+ /**
1010
+ * Buybox status for a single barcode, returned by `getBuyboxInformation`.
1011
+ *
1012
+ * `buyboxOrder === 1` means you currently hold the buybox.
1013
+ * `secondBuyboxPrice` / `thirdBuyboxPrice` are surfaced from live wire (not
1014
+ * in the spec) so you can see what other sellers are charging.
1015
+ */
1016
+ interface BuyboxInfo {
1017
+ barcode: string;
1018
+ /** Position in the buybox ranking (1 = you hold it). */
1019
+ buyboxOrder?: number;
1020
+ /** Current buybox-winning price. */
1021
+ buyboxPrice?: number;
1022
+ hasMultipleSeller?: boolean;
1023
+ /** Second-best price (when multiple sellers compete). */
1024
+ secondBuyboxPrice?: number | null;
1025
+ /** Third-best price. */
1026
+ thirdBuyboxPrice?: number | null;
1027
+ /** Untouched raw response. */
1028
+ raw: Record<string, unknown>;
1029
+ }
1030
+ /**
1031
+ * Status of an async batch request returned by `createProducts`,
1032
+ * `updatePriceAndInventory`, and other Trendyol bulk endpoints.
1033
+ */
1034
+ type BatchRequestStatus = 'PROCESSING' | 'COMPLETED' | 'FAILED' | (string & {});
1035
+ interface BatchRequestItemResult {
1036
+ requestItem?: unknown;
1037
+ status?: string;
1038
+ failureReasons?: string[];
1039
+ }
1040
+ /**
1041
+ * Result of polling `getBatchRequestResult` for a previously-submitted batch.
1042
+ *
1043
+ * Trendyol retains batch results for **4 hours** after the originating request.
1044
+ */
1045
+ interface BatchRequestResult {
1046
+ batchRequestId: string;
1047
+ status: BatchRequestStatus;
1048
+ itemCount?: number;
1049
+ failedItemCount?: number;
1050
+ items: BatchRequestItemResult[];
1051
+ /** ISO 8601 UTC string (converted from Trendyol's ms-epoch). */
1052
+ createdAt?: string;
1053
+ /** ISO 8601 UTC string. */
1054
+ lastModifiedAt?: string;
1055
+ /** Trendyol category of submission (e.g. `MarketPlace`). */
1056
+ sourceType?: string;
1057
+ /** Operation type (e.g. `CreateProducts`, `PriceUpdate`). */
1058
+ batchRequestType?: string;
1059
+ notes?: string;
1060
+ /** Storage object key Trendyol uses internally for the batch payload. */
1061
+ objectKey?: string;
1062
+ storeFrontCode?: string;
1063
+ /** Untouched raw response. */
1064
+ raw: Record<string, unknown>;
1065
+ }
1066
+
1067
+ /** Function that resolves a batch request's current status (i.e. `products.getBatchStatus`). */
1068
+ type BatchStatusPoller = (batchRequestId: string) => Promise<BatchRequestResult>;
1069
+ /** Options controlling how {@link InventoryResource.updateAndWait} / {@link pollBatchStatus} poll. */
1070
+ interface BatchPollOptions {
1071
+ /** Delay between status polls, in ms. Default: `2000`. */
1072
+ pollIntervalMs?: number;
1073
+ /** Total time to wait for a batch to settle before throwing `TimeoutError`, in ms. Default: `120000`. */
1074
+ timeoutMs?: number;
1075
+ /** Abort the wait early. The rejection carries the signal's reason. */
1076
+ signal?: AbortSignal;
1077
+ }
1078
+ /**
1079
+ * Poll a Trendyol batch request until it reaches a terminal state
1080
+ * (`COMPLETED` / `FAILED`) or the timeout elapses.
1081
+ *
1082
+ * Standalone so callers can poll an id obtained elsewhere (e.g. a persisted
1083
+ * `batchRequestId` from a previous process) without going through
1084
+ * {@link InventoryResource.updateAndWait}.
1085
+ *
1086
+ * @throws {TimeoutError} when the batch does not settle within `timeoutMs`;
1087
+ * `error.data` carries `{ batchRequestId, lastStatus, lastResult }`.
1088
+ */
1089
+ declare function pollBatchStatus(getStatus: BatchStatusPoller, batchRequestId: string, opts?: BatchPollOptions): Promise<BatchRequestResult>;
1090
+ /**
1091
+ * Trendyol stock & price update endpoint (a.k.a. `updatePriceAndInventory`).
1092
+ *
1093
+ * Rate limit: **none** — Trendyol explicitly lists this endpoint as
1094
+ * `NO LIMIT` in its service limits table. The `15-minute duplicate
1095
+ * suppression` rule still applies on Trendyol's side, but that's a
1096
+ * server-side concern.
1097
+ *
1098
+ * The endpoint is asynchronous. {@link InventoryResource.update} returns the
1099
+ * `batchRequestId`; poll it yourself with `products.getBatchStatus`, or let
1100
+ * {@link InventoryResource.updateAndWait} chunk, submit, and poll for you.
1101
+ */
1102
+ declare class InventoryResource {
1103
+ private readonly transport;
1104
+ private readonly getBatchStatus?;
1105
+ /**
1106
+ * @param transport Trendyol transport.
1107
+ * @param getBatchStatus Batch-status poller (wired by `createTrendyolClient`
1108
+ * to `products.getBatchStatus`). Required only for `updateAndWait`.
1109
+ */
1110
+ constructor(transport: TrendyolTransport, getBatchStatus?: BatchStatusPoller | undefined);
1111
+ /**
1112
+ * Update price and/or stock for one or more SKUs (by barcode).
1113
+ *
1114
+ * @example
1115
+ * ```ts
1116
+ * const { batchRequestId } = await client.inventory.update([
1117
+ * { barcode: 'ABC123', quantity: 42, salePrice: 199.9, listPrice: 249.9 },
1118
+ * { barcode: 'XYZ789', quantity: 0 },
1119
+ * ]);
1120
+ * const status = await client.products.getBatchStatus(batchRequestId);
1121
+ * ```
1122
+ *
1123
+ * @throws {ValidationError} when `items` is empty or longer than 1000.
1124
+ * @throws {ServerError} when Trendyol accepts the request but returns no
1125
+ * `batchRequestId` (an unpollable response — surfaced loudly instead of
1126
+ * handing back an empty id).
1127
+ */
1128
+ update(items: PriceInventoryUpdate[]): Promise<UpdatePriceInventoryResponse>;
1129
+ /**
1130
+ * Submit price/stock updates and wait for them to settle.
1131
+ *
1132
+ * Splits `items` into chunks of ≤1000, submits each via {@link update}, and
1133
+ * polls each `batchRequestId` to a terminal state. Returns one
1134
+ * `BatchRequestResult` per chunk (read `failedItemCount` / `items[]` for
1135
+ * per-barcode outcomes). Compose `@lonca/core`'s `retry` around this for
1136
+ * transient-error resilience.
1137
+ *
1138
+ * @throws {ValidationError} when `items` is empty.
1139
+ * @throws {TimeoutError} when any chunk does not settle within `timeoutMs`;
1140
+ * `error.data.batchRequestId` identifies the stuck chunk.
1141
+ */
1142
+ updateAndWait(items: PriceInventoryUpdate[], opts?: BatchPollOptions): Promise<BatchRequestResult[]>;
1143
+ }
1144
+
1145
+ /**
1146
+ * Trendyol invoice endpoints — upload PDF/JPEG/PNG invoice files or
1147
+ * register/delete invoice links. Pair these with `orders.updatePackageStatus(_, { status: 'Invoiced' })`
1148
+ * after invoice issuance.
1149
+ */
1150
+ declare class InvoicesResource {
1151
+ private readonly transport;
1152
+ private readonly limiter;
1153
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
1154
+ /**
1155
+ * Upload an invoice file for a shipment package. **Multipart**: the
1156
+ * SDK builds the FormData internally from the typed input.
1157
+ *
1158
+ * Max 10 MB. Accepted formats: PDF, JPEG, PNG.
1159
+ */
1160
+ uploadFile(input: UploadInvoiceFileInput): Promise<unknown>;
1161
+ /** Register an invoice URL with Trendyol (alternative to uploading the file). */
1162
+ sendLink(input: SendInvoiceLinkInput): Promise<unknown>;
1163
+ /** Remove a previously-registered invoice link. */
1164
+ deleteLink(input: DeleteInvoiceLinkInput): Promise<unknown>;
1165
+ }
1166
+
1167
+ /**
1168
+ * Common-label (ortak etiket) endpoints — request and retrieve a
1169
+ * combined ZPL shipping label for a cargo tracking number.
1170
+ */
1171
+ declare class LabelsResource {
1172
+ private readonly transport;
1173
+ private readonly limiter;
1174
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
1175
+ /**
1176
+ * Request a common ZPL label for a cargo tracking number. After this
1177
+ * returns, call `getCommon()` with the same `cargoTrackingNumber` to
1178
+ * retrieve the generated label.
1179
+ *
1180
+ * @throws {ValidationError} when `format` is missing.
1181
+ */
1182
+ createCommon(cargoTrackingNumber: string | number, input: CreateCommonLabelInput): Promise<unknown>;
1183
+ /**
1184
+ * Retrieve the previously-created common label. Trendyol returns
1185
+ * `{ data: [{ label, format }] }`; the SDK surfaces the array as
1186
+ * `labels[]` for ergonomic access.
1187
+ *
1188
+ * Typically `labels.length === 1` per tracking number, but kept as an
1189
+ * array to match the wire shape.
1190
+ */
1191
+ getCommon(cargoTrackingNumber: string | number): Promise<CommonLabel>;
1192
+ }
1193
+
1194
+ /**
1195
+ * Trendyol location lookups for building shipment / invoice addresses
1196
+ * with the correct city / district / neighborhood codes.
1197
+ *
1198
+ * Trendyol exposes these under a different prefix (`/integration/member/`)
1199
+ * — not under `/integration/order/` or `/integration/product/`.
1200
+ */
1201
+ declare class LocationsResource {
1202
+ private readonly transport;
1203
+ private readonly limiter;
1204
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
1205
+ /** List all supported countries (Türkiye + AZ + GULF + CEE). */
1206
+ getCountries(): Promise<Country[]>;
1207
+ getTurkeyCities(): Promise<City[]>;
1208
+ getTurkeyDistricts(cityCode: string | number): Promise<District[]>;
1209
+ getTurkeyNeighborhoods(cityCode: string | number, districtCode: string | number): Promise<Neighborhood[]>;
1210
+ getAzerbaijanCities(): Promise<City[]>;
1211
+ getAzerbaijanDistricts(cityCode: string | number): Promise<District[]>;
1212
+ getCitiesByCountry(countryCode: string): Promise<City[]>;
1213
+ getDistrictsByCity(countryCode: string, cityId: string | number): Promise<District[]>;
1214
+ private cities;
1215
+ private districts;
1216
+ private neighborhoods;
1217
+ }
1218
+
1219
+ /**
1220
+ * The closed set of Trendyol shipment-package statuses the SDK maps
1221
+ * exhaustively (see `statusMap` / `normalizeStatus`). Kept separate from the
1222
+ * open wire type {@link ShipmentPackageStatus} so the status map stays
1223
+ * exhaustive at compile time while unknown wire values stay representable.
1224
+ */
1225
+ type KnownShipmentPackageStatus = 'Created' | 'Picking' | 'Invoiced' | 'Shipped' | 'Cancelled' | 'Delivered' | 'UnDelivered' | 'Returned' | 'UnSupplied' | 'Awaiting' | 'UnPacked' | 'AtCollectionPoint' | 'Verified';
1226
+ /**
1227
+ * Trendyol shipment-package status as it appears on the wire.
1228
+ *
1229
+ * Trendyol uses ~13 distinct values (see {@link KnownShipmentPackageStatus}).
1230
+ * Open (`string & {}`) so a status Trendyol adds later still type-checks; fold
1231
+ * it into the closed `NormalizedOrderStatus` vocab with `normalizeStatus`.
1232
+ */
1233
+ type ShipmentPackageStatus = KnownShipmentPackageStatus | (string & {});
1234
+ interface OrderAddressLines {
1235
+ addressLine1?: string;
1236
+ addressLine2?: string;
1237
+ }
1238
+ /**
1239
+ * A customer or invoice/shipment address returned alongside a shipment package.
1240
+ * Field set is conservative — Trendyol returns many optional locality fields
1241
+ * and we surface them as-is.
1242
+ */
1243
+ interface OrderAddress {
1244
+ id?: string;
1245
+ firstName?: string;
1246
+ lastName?: string;
1247
+ fullName?: string;
1248
+ company?: string;
1249
+ address1?: string;
1250
+ address2?: string;
1251
+ fullAddress?: string;
1252
+ shortAddress?: string;
1253
+ city?: string;
1254
+ cityCode?: number;
1255
+ district?: string;
1256
+ districtId?: number;
1257
+ neighborhoodId?: number;
1258
+ countyId?: number;
1259
+ countyName?: string;
1260
+ stateName?: string;
1261
+ postalCode?: string;
1262
+ countryCode?: string;
1263
+ phone?: string;
1264
+ addressLines?: OrderAddressLines;
1265
+ }
1266
+ /** Customer details on a shipment package (a subset of what Trendyol exposes). */
1267
+ interface OrderCustomer {
1268
+ id?: string;
1269
+ firstName: string;
1270
+ lastName: string;
1271
+ email?: string;
1272
+ taxNumber?: string;
1273
+ identityNumber?: string;
1274
+ }
1275
+ interface OrderLineDiscountDetail {
1276
+ lineItemPrice?: number;
1277
+ lineItemSellerDiscount?: number;
1278
+ lineItemTyDiscount?: number;
1279
+ }
1280
+ /** A single item line inside a shipment package. */
1281
+ interface OrderLine {
1282
+ /** Trendyol's `lineId`. */
1283
+ id: string;
1284
+ quantity: number;
1285
+ productName: string;
1286
+ barcode: string;
1287
+ productSize?: string;
1288
+ productColor?: string;
1289
+ stockCode?: string;
1290
+ contentId?: string;
1291
+ sellerId?: string;
1292
+ productCategoryId?: string;
1293
+ salesCampaignId?: string;
1294
+ currencyCode?: string;
1295
+ lineUnitPrice: number;
1296
+ lineGrossAmount: number;
1297
+ lineSellerDiscount?: number;
1298
+ lineTyDiscount?: number;
1299
+ lineTotalDiscount?: number;
1300
+ vatRate?: number;
1301
+ commission?: number;
1302
+ orderLineItemStatusName?: string;
1303
+ businessUnit?: string;
1304
+ fastDeliveryOptions?: unknown[];
1305
+ discountDetails?: OrderLineDiscountDetail[];
1306
+ /** Untouched raw line response. */
1307
+ raw: Record<string, unknown>;
1308
+ }
1309
+ /** A status transition entry in `packageHistories`. */
1310
+ interface PackageHistoryEntry {
1311
+ status?: ShipmentPackageStatus;
1312
+ /** ISO 8601 UTC string (converted from Trendyol's ms-epoch). */
1313
+ createdAt?: string;
1314
+ raw: Record<string, unknown>;
1315
+ }
1316
+ /**
1317
+ * A package line update tuple used by `updatePackageStatus` and
1318
+ * `cancelPackageItem`. `lineId` is the per-line ID from `ShipmentPackage.lines[].lineId`.
1319
+ */
1320
+ interface PackageLineUpdate {
1321
+ lineId: number;
1322
+ quantity: number;
1323
+ }
1324
+ /**
1325
+ * Input for `orders.updatePackageStatus`. Trendyol restricts the seller-side
1326
+ * status push to `Picking` (mark as being prepared) and `Invoiced`
1327
+ * (invoice issued); other transitions are driven by Trendyol / the cargo
1328
+ * provider. `lines` is optional and only used when transitioning subset of
1329
+ * line items.
1330
+ */
1331
+ interface UpdatePackageStatusInput {
1332
+ status: 'Picking' | 'Invoiced';
1333
+ lines?: PackageLineUpdate[];
1334
+ }
1335
+ /**
1336
+ * Input for `orders.cancelPackageItem` — Trendyol's "supply failure" notification.
1337
+ * Marks specific line items as un-suppliable. `reasonId` is a numeric code
1338
+ * Trendyol publishes separately (e.g. `577` = "tedarik edemiyorum"); consult
1339
+ * Trendyol's seller panel or the "Tedarik Edememe" docs for current values.
1340
+ */
1341
+ interface CancelPackageItemInput {
1342
+ lines: PackageLineUpdate[];
1343
+ reasonId: number;
1344
+ }
1345
+ /**
1346
+ * One row from `orders.getCargoInvoiceItems` — a cargo invoice line item
1347
+ * that ties a parcel ID to its cargo fee. Useful for reconciling Trendyol's
1348
+ * cargo deductions against your shipped packages.
1349
+ */
1350
+ interface CargoInvoiceItem {
1351
+ /** e.g. "Gönderi Kargo Bedeli" (outbound) or "İade Kargo Bedeli" (return). */
1352
+ shipmentPackageType?: string;
1353
+ /** Cargo parcel unique ID. */
1354
+ parcelUniqueId?: number | string;
1355
+ orderNumber?: string;
1356
+ /** Fee charged in this row. */
1357
+ amount?: number;
1358
+ /** Desi value used to compute the fee. */
1359
+ desi?: number;
1360
+ /** Untouched raw row. */
1361
+ raw: Record<string, unknown>;
1362
+ }
1363
+ /**
1364
+ * Filter params for `orders.listStream` — the streaming alternative to
1365
+ * `orders.list`. Uses Trendyol's opaque `nextCursor` (forwarded as the
1366
+ * `@lonca/core` `CursorPaginationParams.cursor`) instead of page-index
1367
+ * pagination.
1368
+ */
1369
+ interface ListOrdersStreamParams {
1370
+ cursor?: string;
1371
+ limit?: number;
1372
+ /**
1373
+ * CSV of package-item statuses to filter by (e.g.
1374
+ * `'Created,Picking,Invoiced'`). Trendyol accepts the same status
1375
+ * vocabulary as `ShipmentPackageStatus`.
1376
+ */
1377
+ packageItemStatuses?: string;
1378
+ /** Lower bound for `lastModified` (Trendyol expects ms-epoch). */
1379
+ lastModifiedStartDate?: Date;
1380
+ /** Upper bound for `lastModified`. */
1381
+ lastModifiedEndDate?: Date;
1382
+ }
1383
+ /**
1384
+ * Box / packaging metadata for `orders.updateBoxInfo`. Both fields are
1385
+ * optional but at least one should be set for the call to be meaningful.
1386
+ */
1387
+ interface UpdateBoxInfoInput {
1388
+ /** Desi value (volumetric weight used by Trendyol for shipping cost). */
1389
+ deci?: number;
1390
+ /** Number of physical boxes in the shipment. */
1391
+ boxQuantity?: number;
1392
+ }
1393
+ /**
1394
+ * Per-line labor cost for `orders.updateLaborCosts`. The Trendyol API
1395
+ * accepts a raw array of these (no envelope) — the SDK forwards as-is.
1396
+ */
1397
+ interface LaborCostInput {
1398
+ orderLineId: number;
1399
+ /** Labor cost charged per single unit of this line. */
1400
+ laborCostPerItem: number;
1401
+ }
1402
+ /**
1403
+ * Trendyol cargo provider codes accepted by `orders.changeCargoProvider`.
1404
+ * Use the string union for autocomplete; `(string & {})` keeps unknown
1405
+ * codes type-compatible so Trendyol can add providers without breaking
1406
+ * callers.
1407
+ */
1408
+ type TrendyolCargoProvider = 'YKMP' | 'ARASMP' | 'SURATMP' | 'HOROZMP' | 'DHLECOMMP' | 'PTTMP' | 'CEVAMP' | 'TEXMP' | 'KOLAYGELSINMP' | 'CEVATEDARIK' | (string & {});
1409
+ /**
1410
+ * Per-line quantity split for `orders.splitPackageByQuantity`. Each item
1411
+ * in `quantities` becomes its own new package containing that many units
1412
+ * of `orderLineId`.
1413
+ *
1414
+ * @example
1415
+ * // splits 5 units of line 100 into 3 packages: 2 + 2 + 1
1416
+ * { orderLineId: 100, quantities: [2, 2, 1] }
1417
+ */
1418
+ interface QuantitySplit {
1419
+ orderLineId: number;
1420
+ quantities: number[];
1421
+ }
1422
+ /**
1423
+ * A group of line IDs that should become a new package together,
1424
+ * for `orders.multiSplitPackage`.
1425
+ */
1426
+ interface SplitGroup {
1427
+ orderLineIds: number[];
1428
+ }
1429
+ /**
1430
+ * One package's contents for `orders.splitMultiPackagesByQuantity`. Each
1431
+ * element of the outer array becomes a new package; each `packageDetails`
1432
+ * entry carries an `orderLineId` and the **single** quantity assigned to
1433
+ * that package (note: singular `quantities`, despite the field name).
1434
+ */
1435
+ interface PackageDetail {
1436
+ orderLineId: number;
1437
+ /** Quantity of this line to include in this package (singular integer). */
1438
+ quantities: number;
1439
+ }
1440
+ interface SplitPackagePlan {
1441
+ packageDetails: PackageDetail[];
1442
+ }
1443
+ /**
1444
+ * Input for `orders.processAlternativeDelivery`. Used when the seller is
1445
+ * shipping via a non-Trendyol cargo provider — provide either a phone number
1446
+ * (which Trendyol SMSes the tracking link to) or a direct tracking URL.
1447
+ */
1448
+ interface ProcessAlternativeDeliveryInput {
1449
+ /** When true, `trackingInfo` is a phone number; when false, a tracking URL. */
1450
+ isPhoneNumber: boolean;
1451
+ trackingInfo: string;
1452
+ /** Provider-specific extra parameters (Trendyol forwards verbatim). */
1453
+ params: Record<string, string>;
1454
+ }
1455
+ /**
1456
+ * A Trendyol order — Trendyol models orders as "shipment packages". A single
1457
+ * customer order may produce multiple shipment packages (one per warehouse,
1458
+ * one per cancellation, etc.).
1459
+ *
1460
+ * `id` is the `shipmentPackageId` (the operational unit); `orderNumber`
1461
+ * groups packages that came from the same customer order.
1462
+ */
1463
+ interface ShipmentPackage {
1464
+ /** `shipmentPackageId` — the operational identifier for this package. */
1465
+ id: string;
1466
+ orderNumber: string;
1467
+ shipmentNumber?: string;
1468
+ originPackageIds?: string[] | null;
1469
+ warehouseId?: string;
1470
+ supplierId?: string;
1471
+ status: ShipmentPackageStatus;
1472
+ /** Usually identical to `status`; surfaced for completeness. */
1473
+ shipmentPackageStatus?: ShipmentPackageStatus;
1474
+ customer: OrderCustomer;
1475
+ orderDate: string;
1476
+ lastModifiedDate: string;
1477
+ agreedDeliveryDate?: string;
1478
+ estimatedDeliveryStartDate?: string;
1479
+ estimatedDeliveryEndDate?: string;
1480
+ originShipmentDate?: string;
1481
+ currencyCode: string;
1482
+ packageTotalPrice: number;
1483
+ packageGrossAmount: number;
1484
+ packageSellerDiscount: number;
1485
+ packageTyDiscount: number;
1486
+ packageTotalDiscount: number;
1487
+ invoiceAddress?: OrderAddress;
1488
+ shipmentAddress?: OrderAddress;
1489
+ deliveryAddressType?: string;
1490
+ cargoTrackingNumber?: string;
1491
+ cargoProviderName?: string;
1492
+ cargoProviderId?: string;
1493
+ cargoSenderNumber?: string;
1494
+ deliveryType?: string;
1495
+ whoPays?: number;
1496
+ timeSlotId?: number;
1497
+ fastDelivery?: boolean;
1498
+ fastDeliveryType?: string;
1499
+ deliveredByService?: boolean;
1500
+ commercial?: boolean;
1501
+ micro?: boolean;
1502
+ giftBoxRequested?: boolean;
1503
+ /** Renamed from Trendyol's wire field `3pByTrendyol` (identifier cannot start with a digit). */
1504
+ threePByTrendyol?: boolean;
1505
+ containsDangerousProduct?: boolean;
1506
+ isCod?: boolean;
1507
+ is4P?: boolean;
1508
+ invoiceLink?: string;
1509
+ createdBy?: string;
1510
+ lines: OrderLine[];
1511
+ packageHistories: PackageHistoryEntry[];
1512
+ /** Untouched raw response for fields not modeled yet. */
1513
+ raw: Record<string, unknown>;
1514
+ }
1515
+
1516
+ /**
1517
+ * Returns + compensation types for Trendyol orders.
1518
+ *
1519
+ * Trendyol distinguishes two separate concepts:
1520
+ * - **Manual return** — seller-side notification that a package was
1521
+ * received back (no body, just a state flip on the package).
1522
+ * - **Compensation ticket** — Trendyol Express-specific dispute filed
1523
+ * when a shipment is lost or damaged. Multi-state lifecycle with up to
1524
+ * ~18 documented states.
1525
+ */
1526
+
1527
+ /**
1528
+ * Lifecycle state of a Trendyol Express compensation ticket. Trendyol
1529
+ * documents 18 distinct states (`Empty`, `MarkInCompensation`,
1530
+ * `CompensationApproved`, etc.) — kept as an open enum so unknown future
1531
+ * values still type-check.
1532
+ *
1533
+ * Verified against the official spec on 2026-05-25.
1534
+ */
1535
+ type CompensationTicketState = 'Empty' | 'MarkInCompensation' | 'OpenedForRefund' | 'StartCompensationFinanceProgress' | 'StartCompensationInApprovalProgress' | 'CompensationApproved' | 'CompensationRejected' | 'FoundAfterCompensationComplete' | 'NotCompensationCase' | 'FoundInCompensation' | 'FoundInvestigationProgress' | 'MarkCompensationCancel' | 'CreateCompensationTicket' | 'FinalizeCompensation' | 'CloseCompensationTicket' | 'FoundInvestigationProgressDeliveredToCustomer' | 'FoundInCompensationDeliveredToCustomer' | 'FoundAfterCompensationCompleteDeliveredToCustomer' | (string & {});
1536
+ /** One line item under a compensation ticket. */
1537
+ interface CompensationItemDetail {
1538
+ /** Amount (e.g. unit price). */
1539
+ itemAmount?: number;
1540
+ itemCode?: string;
1541
+ /** Item count (number of units claimed). */
1542
+ itemCount?: number;
1543
+ itemName?: string;
1544
+ }
1545
+ /**
1546
+ * A Trendyol Express compensation ticket — filed when a shipment is lost
1547
+ * or damaged in transit. Returned by `orders.getCompensationTickets()`.
1548
+ */
1549
+ interface CompensationTicket {
1550
+ cargoProvider?: string;
1551
+ compensateReason?: string;
1552
+ /** ISO 8601 UTC string (converted from `createDate` ms-epoch). */
1553
+ createdAt?: string;
1554
+ currentState?: CompensationTicketState;
1555
+ deliveryNumber?: string;
1556
+ itemDetails: CompensationItemDetail[];
1557
+ orderNumber?: string;
1558
+ requestedBy?: string;
1559
+ stateMessage?: string;
1560
+ /** Total amount across items — Trendyol returns this as a string. */
1561
+ totalItemsAmount?: string;
1562
+ /** Untouched raw ticket response. */
1563
+ raw: Record<string, unknown>;
1564
+ }
1565
+ /** Filter / pagination params for `orders.getCompensationTickets()`. */
1566
+ interface ListCompensationTicketsParams extends CursorPaginationParams {
1567
+ /** Lower bound on `createDate` (Trendyol expects ms-epoch). */
1568
+ startDate?: Date;
1569
+ /** Upper bound on `createDate`. */
1570
+ endDate?: Date;
1571
+ }
1572
+
1573
+ interface ListOrdersParams extends CursorPaginationParams {
1574
+ status?: ShipmentPackageStatus;
1575
+ orderNumber?: string;
1576
+ /** Filter packages updated on or after this date (Trendyol expects ms-epoch). */
1577
+ startDate?: Date;
1578
+ /** Filter packages updated on or before this date. */
1579
+ endDate?: Date;
1580
+ }
1581
+ /**
1582
+ * Normalize one raw Trendyol shipment-package node into the public
1583
+ * `ShipmentPackage` shape. Exported so consumers handling Trendyol
1584
+ * webhooks can reuse the SDK's normalization logic on the event body
1585
+ * (Trendyol POSTs the same shape it returns from `getShipmentPackages`).
1586
+ *
1587
+ * For full-webhook parsing use `parseWebhookEvent(rawBody)` from the
1588
+ * top-level package, which calls this internally per item.
1589
+ */
1590
+ declare function normalizeShipmentPackage(rawNode: unknown): ShipmentPackage;
1591
+ /**
1592
+ * Trendyol order (shipment-package) endpoints.
1593
+ *
1594
+ * Rate limit (per Trendyol service limits): tunable via the constructor with a
1595
+ * generous default.
1596
+ *
1597
+ * Pagination: `getShipmentPackages` (`list`) uses page-based pagination (not
1598
+ * nextPageToken). The SDK exposes `CursorPage<ShipmentPackage>` so the caller
1599
+ * can iterate with `paginate()` from `@lonca/core`; the opaque cursor encodes
1600
+ * the page index.
1601
+ *
1602
+ * **2026-06-08 limit:** `getShipmentPackages` reaches at most 10,000 records —
1603
+ * requests past that offset return HTTP 429. For full scans, periodic syncs, or
1604
+ * exports use {@link OrdersResource.listStream} (`getShipmentPackagesStream`),
1605
+ * which paginates with an opaque cursor and is not subject to the cap. Note the
1606
+ * stream endpoint exposes only the last 3 months of orders.
1607
+ */
1608
+ declare class OrdersResource {
1609
+ private readonly transport;
1610
+ private readonly limiter;
1611
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
1612
+ /**
1613
+ * List shipment packages for the seller.
1614
+ *
1615
+ * @example
1616
+ * ```ts
1617
+ * import { paginate } from '@lonca/core';
1618
+ * for await (const pkg of paginate((p) => client.orders.list({ ...p, status: 'Created' }))) {
1619
+ * console.log(pkg.id, pkg.status, pkg.customer.firstName);
1620
+ * }
1621
+ * ```
1622
+ */
1623
+ list(params?: ListOrdersParams): Promise<CursorPage<ShipmentPackage>>;
1624
+ /**
1625
+ * Push a shipment-package status update.
1626
+ *
1627
+ * Trendyol restricts the seller-side push to two transitions:
1628
+ * - `Picking` — order picked up from the shelf / being prepared
1629
+ * - `Invoiced` — invoice issued, ready for cargo handoff
1630
+ *
1631
+ * Other transitions (`Shipped`, `Delivered`, etc.) are driven by Trendyol
1632
+ * or the cargo provider — call `processAlternativeDelivery` or
1633
+ * `manualDeliverByPackageId` if you ship outside Trendyol's cargo
1634
+ * network.
1635
+ *
1636
+ * Returns void; Trendyol responds with 200 + empty body on success.
1637
+ */
1638
+ updatePackageStatus(packageId: string | number, input: UpdatePackageStatusInput): Promise<void>;
1639
+ /**
1640
+ * Notify Trendyol that one or more line items cannot be supplied
1641
+ * ("Tedarik Edememe Bildirimi"). Marks the listed line IDs as
1642
+ * `UnSupplied`. Trendyol cancels those quantities and notifies the
1643
+ * customer.
1644
+ *
1645
+ * `reasonId` is a numeric code Trendyol publishes separately — consult
1646
+ * the seller panel or the "Tedarik Edememe" docs for current values.
1647
+ *
1648
+ * Returns void; Trendyol responds with 200 + empty body on success.
1649
+ */
1650
+ cancelPackageItem(packageId: string | number, input: CancelPackageItemInput): Promise<void>;
1651
+ /**
1652
+ * Extend the agreed delivery date for a shipment package by 1, 2, or 3 days.
1653
+ * Trendyol enforces the [1, 3] range server-side; the SDK validates client-side
1654
+ * to fail fast.
1655
+ *
1656
+ * Returns void; Trendyol responds with 200 + empty body on success.
1657
+ */
1658
+ extendDeliveryDate(packageId: string | number, extendedDayCount: 1 | 2 | 3): Promise<void>;
1659
+ /**
1660
+ * Notify Trendyol of an alternative delivery channel — used when the
1661
+ * seller is shipping via a non-Trendyol cargo provider. Trendyol then
1662
+ * either SMSes the customer the tracking link (when `isPhoneNumber` is
1663
+ * `true`) or stores the tracking URL on the package directly.
1664
+ *
1665
+ * Returns void; Trendyol responds with 200 + empty body on success.
1666
+ */
1667
+ processAlternativeDelivery(packageId: string | number, input: ProcessAlternativeDeliveryInput): Promise<void>;
1668
+ /**
1669
+ * Split a shipment package by moving a set of line IDs into a new
1670
+ * package. The original package keeps the remaining lines.
1671
+ *
1672
+ * @param packageId The package to split.
1673
+ * @param orderLineIds Line IDs to move into the new package (1+).
1674
+ * @throws {ValidationError} when `orderLineIds` is empty.
1675
+ */
1676
+ splitPackage(packageId: string | number, orderLineIds: number[]): Promise<void>;
1677
+ /**
1678
+ * Split a shipment package by quantity. Each `QuantitySplit` entry
1679
+ * carves a single line into multiple packages — e.g. `{ orderLineId: 100,
1680
+ * quantities: [2, 2, 1] }` splits 5 units of line 100 into three packages
1681
+ * of 2 + 2 + 1.
1682
+ *
1683
+ * @throws {ValidationError} when `quantitySplit` is empty.
1684
+ */
1685
+ splitPackageByQuantity(packageId: string | number, quantitySplit: QuantitySplit[]): Promise<void>;
1686
+ /**
1687
+ * Split a shipment package into multiple new packages by grouping line
1688
+ * IDs. Each `SplitGroup` becomes one new package containing the listed
1689
+ * line IDs.
1690
+ *
1691
+ * @throws {ValidationError} when `splitGroups` is empty.
1692
+ */
1693
+ multiSplitPackage(packageId: string | number, splitGroups: SplitGroup[]): Promise<void>;
1694
+ /**
1695
+ * Split a shipment package into multiple new packages, each containing a
1696
+ * mix of line items at specific quantities. This is the most expressive
1697
+ * split — use it when you need fine-grained control over which line IDs
1698
+ * and how many of each end up in each new package.
1699
+ *
1700
+ * @throws {ValidationError} when `splitPackages` is empty.
1701
+ */
1702
+ splitMultiPackagesByQuantity(packageId: string | number, splitPackages: SplitPackagePlan[]): Promise<void>;
1703
+ /**
1704
+ * Change the cargo provider on an existing shipment package. Use one of
1705
+ * Trendyol's documented marketplace cargo codes (`'YKMP'`, `'ARASMP'`,
1706
+ * `'SURATMP'`, etc.) — see `TrendyolCargoProvider` for the full list.
1707
+ */
1708
+ changeCargoProvider(packageId: string | number, cargoProvider: TrendyolCargoProvider): Promise<void>;
1709
+ /**
1710
+ * Mark a shipment package as manually delivered via its package ID.
1711
+ * Used when the seller delivered the order outside Trendyol's cargo
1712
+ * network and needs to flip the package to `Delivered` after handover.
1713
+ *
1714
+ * No request body; Trendyol responds with 200 + empty body on success.
1715
+ */
1716
+ manualDeliverByPackageId(packageId: string | number): Promise<void>;
1717
+ /**
1718
+ * Manual-deliver variant that takes the cargo tracking number instead
1719
+ * of the package ID. Useful when you only have the tracking number on
1720
+ * hand (e.g., from a cargo provider webhook).
1721
+ *
1722
+ * Note the path structure: tracking number sits at a sibling location,
1723
+ * not under `/shipment-packages/{id}/...`.
1724
+ */
1725
+ manualDeliverByTrackingNumber(cargoTrackingNumber: string | number): Promise<void>;
1726
+ /**
1727
+ * Mark a package as delivered through an authorized service ("yetkili
1728
+ * servis"). For appliance / installation-required products that are
1729
+ * delivered + installed by a third-party service partner.
1730
+ */
1731
+ markDeliveredByService(packageId: string | number): Promise<void>;
1732
+ /**
1733
+ * Update box / packaging metadata on a shipment package (desi value
1734
+ * and/or number of boxes). Either field can be sent alone.
1735
+ */
1736
+ updateBoxInfo(packageId: string | number, input: UpdateBoxInfoInput): Promise<void>;
1737
+ /**
1738
+ * Update labor costs for one or more order lines.
1739
+ *
1740
+ * **Wire note:** Trendyol's request body is a raw array (no envelope),
1741
+ * not `{ items: [...] }`. The SDK forwards `items` verbatim.
1742
+ *
1743
+ * @throws {ValidationError} when `items` is empty.
1744
+ */
1745
+ updateLaborCosts(packageId: string | number, items: LaborCostInput[]): Promise<void>;
1746
+ /**
1747
+ * Reassign a shipment package to a different warehouse. `warehouseId`
1748
+ * comes from `client.suppliers.getAddresses()` (filter by `isShipmentAddress`).
1749
+ */
1750
+ updateWarehouse(packageId: string | number, warehouseId: number): Promise<void>;
1751
+ /**
1752
+ * Stream variant of `list()`. Trendyol's `getShipmentPackagesStream`
1753
+ * returns the same `ShipmentPackage` shape but paginates with an opaque
1754
+ * cursor — useful when the dataset is large and page-based pagination
1755
+ * would hit the 10 000-record cap.
1756
+ *
1757
+ * @example
1758
+ * ```ts
1759
+ * import { paginate } from '@lonca/core';
1760
+ * for await (const pkg of paginate((p) =>
1761
+ * client.orders.listStream({ ...p, packageItemStatuses: 'Created,Picking' }),
1762
+ * )) {
1763
+ * console.log(pkg.id, pkg.status);
1764
+ * }
1765
+ * ```
1766
+ */
1767
+ listStream(params?: ListOrdersStreamParams): Promise<CursorPage<ShipmentPackage>>;
1768
+ /**
1769
+ * Fetch the per-parcel cargo-fee breakdown for a single cargo invoice
1770
+ * (Trendyol's `getCargoInvoiceItems`). Useful for reconciling Trendyol's
1771
+ * cargo deductions against your shipped packages.
1772
+ *
1773
+ * `invoiceSerialNumber` is sourced from the Current Account Statement
1774
+ * ("Cari Hesap Ekstresi") with `transactionType=DeductionInvoices`.
1775
+ *
1776
+ * Page-based pagination internally (cursor encodes the page index).
1777
+ */
1778
+ getCargoInvoiceItems(invoiceSerialNumber: string, params?: CursorPaginationParams): Promise<CursorPage<CargoInvoiceItem>>;
1779
+ /**
1780
+ * Notify Trendyol that a shipped package was returned to you (manual
1781
+ * return flow, e.g. customer dropped it at your address or you got the
1782
+ * package back without going through Trendyol's return cargo).
1783
+ *
1784
+ * No body; Trendyol responds with 200 + empty body on success.
1785
+ */
1786
+ manualReturnByPackageId(packageId: string | number): Promise<void>;
1787
+ /**
1788
+ * Manual-return variant that takes the cargo tracking number instead of
1789
+ * the package ID. Useful when the cargo provider's webhook only carries
1790
+ * the tracking number.
1791
+ *
1792
+ * Sibling path (not under `/{packageId}/...`).
1793
+ */
1794
+ manualReturnByTrackingNumber(cargoTrackingNumber: string | number): Promise<void>;
1795
+ /**
1796
+ * Fetch Trendyol Express compensation tickets (claims filed when a
1797
+ * shipment is lost or damaged in transit). Page-based pagination
1798
+ * internally; the SDK exposes the cursor convention.
1799
+ *
1800
+ * Note the different base path — `/integration/tex/compensation/...`,
1801
+ * not the regular `/integration/order/...`.
1802
+ *
1803
+ * @example
1804
+ * ```ts
1805
+ * import { paginate } from '@lonca/core';
1806
+ * const tickets = await client.orders.getCompensationTickets({
1807
+ * startDate: new Date('2026-01-01'),
1808
+ * endDate: new Date('2026-02-01'),
1809
+ * });
1810
+ * for (const t of tickets.items) {
1811
+ * console.log(t.orderNumber, t.currentState, t.stateMessage);
1812
+ * }
1813
+ * ```
1814
+ */
1815
+ getCompensationTickets(params?: ListCompensationTicketsParams): Promise<CursorPage<CompensationTicket>>;
1816
+ private packagePath;
1817
+ }
1818
+
1819
+ /**
1820
+ * Input types for Trendyol product write endpoints (V2).
1821
+ *
1822
+ * All five write endpoints (`createProducts`, `updateContentBulk`,
1823
+ * `updateVariantBulk`, `updateUnapproved`, `updateDeliveryInfoBulk`) are
1824
+ * async batch operations: SDK accepts the typed payload, Trendyol returns
1825
+ * `{ batchRequestId }`, and the caller polls via `products.getBatchStatus`.
1826
+ */
1827
+ /** Response shape for every async write endpoint in the product API. */
1828
+ interface BatchAcceptedResponse {
1829
+ /** Opaque ID — pass to `products.getBatchStatus(...)` to track. */
1830
+ batchRequestId: string;
1831
+ }
1832
+ /** A V2 product attribute payload. Mutually-exclusive value selectors. */
1833
+ interface ProductAttributeV2Input {
1834
+ attributeId: number;
1835
+ /**
1836
+ * One or more attribute value IDs (V2 supports multi-value when the
1837
+ * attribute's `allowMultipleAttributeValues` flag is true).
1838
+ */
1839
+ attributeValueIds?: number[];
1840
+ /** Free-text value (only when the attribute's `allowCustom` flag is true). */
1841
+ attributeValue?: string;
1842
+ }
1843
+ /** Image entry: just a URL (Trendyol fetches the image asynchronously). */
1844
+ interface ProductImageInput {
1845
+ /** https URL; Trendyol recommends 1200×1800, 96 DPI. */
1846
+ url: string;
1847
+ }
1848
+ /** Per-variant delivery option (used by `create` + `updateUnapproved`). */
1849
+ interface DeliveryOptionInput {
1850
+ deliveryDuration?: number;
1851
+ fastDeliveryType?: 'SAME_DAY_SHIPPING' | 'FAST_DELIVERY';
1852
+ }
1853
+ /**
1854
+ * Payload for one item in `createProducts` (V2).
1855
+ *
1856
+ * Trendyol requires all 14 fields listed in the spec — the type makes them
1857
+ * non-optional so missing required fields fail at compile time, not at
1858
+ * runtime after a failed batch.
1859
+ */
1860
+ interface CreateProductV2Input {
1861
+ /** Barcode (≤40 chars, allows `.`, `-`, `_`). */
1862
+ barcode: string;
1863
+ /** Title (≤100 chars). */
1864
+ title: string;
1865
+ /** Parent product ID for variant grouping (≤40 chars). */
1866
+ productMainId: string;
1867
+ /** Trendyol numeric brand ID (from `brands.list`). */
1868
+ brandId: number;
1869
+ /** Trendyol numeric category ID (from `categories.list`). */
1870
+ categoryId: number;
1871
+ /** Initial stock quantity. */
1872
+ quantity: number;
1873
+ /** Seller-side stock code (≤100 chars). */
1874
+ stockCode: string;
1875
+ /** Desi value used for shipping cost calculation. */
1876
+ dimensionalWeight: number;
1877
+ /** HTML-friendly product description (≤30 000 chars). */
1878
+ description: string;
1879
+ /** List price (PSF). Must be ≥ `salePrice`. */
1880
+ listPrice: number;
1881
+ /** Sale price (TSF). */
1882
+ salePrice: number;
1883
+ /** 1–8 image URLs. */
1884
+ images: ProductImageInput[];
1885
+ /** VAT rate as integer percent (0, 1, 10, 20). */
1886
+ vatRate: number;
1887
+ /** Required attributes for the category — fetch via `categories.getAttributes`. */
1888
+ attributes: ProductAttributeV2Input[];
1889
+ /** Delivery duration / fast-delivery type. */
1890
+ deliveryOption?: DeliveryOptionInput;
1891
+ /** Lot/SKT info (≤100 chars). */
1892
+ lotNumber?: string | null;
1893
+ /** Shipment warehouse ID (from `suppliers.getAddresses`). */
1894
+ shipmentAddressId?: number;
1895
+ /** Returning warehouse ID. */
1896
+ returningAddressId?: number;
1897
+ }
1898
+ /** Payload for one item in `updateContentBulk` (only `contentId` is required). */
1899
+ interface UpdateContentInput {
1900
+ /** From `Product.contentId` on `products.list` results. */
1901
+ contentId: number;
1902
+ title?: string;
1903
+ description?: string;
1904
+ images?: ProductImageInput[];
1905
+ /**
1906
+ * If you update ANY attribute, you must send ALL attributes — partial
1907
+ * attribute updates are not supported by Trendyol on this endpoint.
1908
+ */
1909
+ attributes?: ProductAttributeV2Input[];
1910
+ }
1911
+ /**
1912
+ * Payload for one item in `updateVariantBulk`. `barcode` is the identifier;
1913
+ * Trendyol does not allow updating the barcode itself via this endpoint.
1914
+ */
1915
+ interface UpdateVariantInput {
1916
+ barcode: string;
1917
+ stockCode?: string;
1918
+ vatRate?: number;
1919
+ shipmentAddressId?: number;
1920
+ returningAddressId?: number;
1921
+ dimensionalWeight?: number;
1922
+ lotNumber?: string | null;
1923
+ locationBasedDelivery?: 'ENABLED' | 'DISABLED' | null;
1924
+ }
1925
+ /** Payload for one item in `updateUnapprovedProducts` — all optional except `barcode`. */
1926
+ interface UpdateUnapprovedInput {
1927
+ barcode: string;
1928
+ title?: string;
1929
+ description?: string;
1930
+ productMainId?: string;
1931
+ brandId?: number;
1932
+ categoryId?: number;
1933
+ stockCode?: string;
1934
+ dimensionalWeight?: number;
1935
+ vatRate?: number;
1936
+ deliveryOption?: DeliveryOptionInput;
1937
+ locationBasedDelivery?: 'ENABLED' | 'DISABLED' | null;
1938
+ lotNumber?: string | null;
1939
+ shipmentAddressId?: number;
1940
+ returningAddressId?: number;
1941
+ images?: ProductImageInput[];
1942
+ attributes?: ProductAttributeV2Input[];
1943
+ }
1944
+ /** Payload for one item in `updateDeliveryInfoBulk`. */
1945
+ interface UpdateDeliveryInfoInput {
1946
+ barcode: string;
1947
+ deliveryOptions?: {
1948
+ deliveryDuration?: number;
1949
+ fastDeliveryType?: 'SAME_DAY_SHIPPING' | 'FAST_DELIVERY';
1950
+ };
1951
+ }
1952
+
1953
+ interface ListProductsParams extends CursorPaginationParams {
1954
+ /** Filter by a single barcode. */
1955
+ barcode?: string;
1956
+ /** Filter products updated on or after this date (Trendyol expects ms-epoch). */
1957
+ startDate?: Date;
1958
+ /** Filter products updated on or before this date. */
1959
+ endDate?: Date;
1960
+ }
1961
+ /**
1962
+ * Filters for `products.listInventoryAndPrice` (Trendyol's lightweight
1963
+ * `inventory-and-price` approved-product filter). All filters are optional;
1964
+ * pass none to page through every approved product's stock + price.
1965
+ */
1966
+ interface ListInventoryAndPriceParams extends CursorPaginationParams {
1967
+ /** Filter by a single barcode. */
1968
+ barcode?: string;
1969
+ /** Filter by a single contentId. */
1970
+ contentId?: string;
1971
+ /** Filter by the seller's stock code. */
1972
+ stockCode?: string;
1973
+ /** Filter by the seller's productMainId. */
1974
+ productMainId?: string;
1975
+ /** Filter by listing status (archived / blacklisted / locked / onSale / notOnSale). */
1976
+ status?: ApprovedProductStatus;
1977
+ /**
1978
+ * Sort by `SellerCreatedDate`. `ASC` = oldest→newest, `DESC` = newest→oldest.
1979
+ */
1980
+ orderByDirection?: 'ASC' | 'DESC';
1981
+ /**
1982
+ * Storefront code sent as the `storeFrontCode` header. Required on the
1983
+ * International marketplace; optional on the Türkiye marketplace.
1984
+ */
1985
+ storeFrontCode?: string;
1986
+ }
1987
+ /** Date field to filter against on `listUnapproved` (default: server choice). */
1988
+ type UnapprovedDateQueryType = 'CREATED_DATE' | 'LAST_MODIFIED_DATE';
1989
+ interface ListUnapprovedProductsParams extends CursorPaginationParams {
1990
+ barcode?: string;
1991
+ startDate?: Date;
1992
+ endDate?: Date;
1993
+ /** Choose which date `startDate`/`endDate` apply to. */
1994
+ dateQueryType?: UnapprovedDateQueryType;
1995
+ /**
1996
+ * Optional override of the seller-scoped query (rare; defaults to the
1997
+ * client's `sellerId`).
1998
+ */
1999
+ supplierId?: number;
2000
+ }
2001
+ /**
2002
+ * Trendyol product read + write + lifecycle + batch-result endpoints.
2003
+ *
2004
+ * Rate limits (per Trendyol service limits):
2005
+ * - filterProducts (approved + unapproved + getProductBase): 2000 req/min
2006
+ * - getBatchRequestResult: 1000 req/min
2007
+ * - getBuyboxInformation: 1000 req/min
2008
+ * - create/update/archive/unlock product writes: 1000 req/min (shared bucket)
2009
+ * - delete: 100 req/min (separate bucket)
2010
+ */
2011
+ declare class ProductsResource {
2012
+ private readonly transport;
2013
+ private readonly filterLimiter;
2014
+ private readonly batchLimiter;
2015
+ private readonly buyboxLimiter;
2016
+ private readonly writeLimiter;
2017
+ private readonly deleteLimiter;
2018
+ constructor(transport: TrendyolTransport, options?: {
2019
+ filterLimiter?: TokenBucketRateLimiter;
2020
+ batchLimiter?: TokenBucketRateLimiter;
2021
+ buyboxLimiter?: TokenBucketRateLimiter;
2022
+ writeLimiter?: TokenBucketRateLimiter;
2023
+ deleteLimiter?: TokenBucketRateLimiter;
2024
+ });
2025
+ private validateBarcodes;
2026
+ private submitWrite;
2027
+ /**
2028
+ * List approved products. Use `paginate()` from `@lonca/core` to iterate
2029
+ * lazily across pages.
2030
+ *
2031
+ * Trendyol exposes both page-based and `nextPageToken`-based pagination
2032
+ * (the latter required when the dataset exceeds 10,000 items). The SDK
2033
+ * picks the right strategy automatically — pass our opaque `cursor` from
2034
+ * the previous response and we forward it as `nextPageToken`.
2035
+ *
2036
+ * @example
2037
+ * ```ts
2038
+ * import { paginate } from '@lonca/core';
2039
+ * for await (const product of paginate((p) => client.products.list(p))) {
2040
+ * for (const variant of product.variants) {
2041
+ * console.log(variant.barcode, product.title);
2042
+ * }
2043
+ * }
2044
+ * ```
2045
+ */
2046
+ list(params?: ListProductsParams): Promise<CursorPage<Product>>;
2047
+ /**
2048
+ * List **stock and price** for approved products — Trendyol's lightweight
2049
+ * `inventory-and-price` filter. A slim alternative to {@link list} when you
2050
+ * only need pricing + stock: the response carries `contentId`,
2051
+ * `productMainId`, and a `variants[]` array with `barcode`, `salePrice`,
2052
+ * `listPrice`, `quantity`, `stockCode`, and `stockLastModifiedAt` — nothing
2053
+ * else.
2054
+ *
2055
+ * Filter by `barcode`, `contentId`, `stockCode`, `productMainId`, or listing
2056
+ * `status`. Sort with `orderByDirection` (`SellerCreatedDate`). `size` caps
2057
+ * at **100** here (tighter than `list`'s 1000).
2058
+ *
2059
+ * Pagination follows the same convention as {@link list}: pass our opaque
2060
+ * `cursor` from the previous response and we forward it as `nextPageToken`
2061
+ * (required once the dataset exceeds 10,000 items).
2062
+ *
2063
+ * @example
2064
+ * ```ts
2065
+ * import { paginate } from '@lonca/core';
2066
+ * for await (const p of paginate((q) =>
2067
+ * client.products.listInventoryAndPrice({ ...q, status: 'onSale' }),
2068
+ * )) {
2069
+ * for (const v of p.variants) {
2070
+ * console.log(v.barcode, v.quantity, v.salePrice);
2071
+ * }
2072
+ * }
2073
+ * ```
2074
+ */
2075
+ listInventoryAndPrice(params?: ListInventoryAndPriceParams): Promise<CursorPage<ProductStockPrice>>;
2076
+ /**
2077
+ * Poll a batch request returned by an async write (e.g. `createProducts`,
2078
+ * `updatePriceAndInventory`).
2079
+ *
2080
+ * Trendyol retains batch results for **4 hours** after the originating
2081
+ * request — poll within that window.
2082
+ *
2083
+ * @param batchRequestId The opaque ID returned by the originating call.
2084
+ */
2085
+ getBatchStatus(batchRequestId: string): Promise<BatchRequestResult>;
2086
+ /**
2087
+ * List **unapproved** (draft / rejected / pending-review) products.
2088
+ *
2089
+ * Wire shape is intentionally flatter than the approved-product shape:
2090
+ * each barcode is one top-level item with `barcode`, `quantity`, `salePrice`
2091
+ * etc. at the root. Rejected drafts carry `rejectReasonDetails` so you can
2092
+ * surface why Trendyol's content team turned them down.
2093
+ *
2094
+ * Pagination follows the same convention as `list()`: `cursor` from the
2095
+ * previous response forwards as `nextPageToken`.
2096
+ *
2097
+ * @example
2098
+ * ```ts
2099
+ * const page = await client.products.listUnapproved({ limit: 50 });
2100
+ * for (const draft of page.items) {
2101
+ * if (draft.status === 'rejected') {
2102
+ * console.warn(draft.barcode, draft.rejectReasonDetails);
2103
+ * }
2104
+ * }
2105
+ * ```
2106
+ */
2107
+ listUnapproved(params?: ListUnapprovedProductsParams): Promise<CursorPage<UnapprovedProduct>>;
2108
+ /**
2109
+ * Fetch the basic lifecycle status of a single product by barcode.
2110
+ *
2111
+ * Cheap and useful as a polling primitive after `createProducts`: poll
2112
+ * this endpoint until `approved` flips to `true` (or use
2113
+ * `client.products.getBatchStatus()` to track the originating batch).
2114
+ *
2115
+ * @param barcode The product barcode to look up.
2116
+ */
2117
+ getBase(barcode: string): Promise<ProductBase>;
2118
+ /**
2119
+ * Fetch buybox information for up to 10 barcodes in one call.
2120
+ *
2121
+ * Returns rank (`buyboxOrder === 1` means you hold the buybox), the
2122
+ * current buybox price, and — beyond the spec — the second and third
2123
+ * competing prices when other sellers are present.
2124
+ *
2125
+ * @param barcodes 1–10 product barcodes.
2126
+ * @throws {ValidationError} when `barcodes` is empty or longer than 10.
2127
+ */
2128
+ getBuyboxInfo(barcodes: string[]): Promise<BuyboxInfo[]>;
2129
+ /**
2130
+ * Create products (V2). Async batch — returns a `batchRequestId` you can
2131
+ * poll with `getBatchStatus`. Max 1000 items per call.
2132
+ *
2133
+ * Trendyol requires the full V2 attribute payload — fetch via
2134
+ * `categories.getAttributes` (and `categories.getAttributeValues` for
2135
+ * values when `allowCustom === false`). Shipment / returning warehouse
2136
+ * IDs come from `suppliers.getAddresses`.
2137
+ *
2138
+ * @throws {ValidationError} when `items` is empty or longer than 1000.
2139
+ */
2140
+ create(items: CreateProductV2Input[]): Promise<BatchAcceptedResponse>;
2141
+ /**
2142
+ * Update **content** of approved products (title, description, images,
2143
+ * attributes). Identified by `contentId`. Partial update is supported
2144
+ * except for attributes — if you update ANY attribute, send ALL of them.
2145
+ *
2146
+ * @throws {ValidationError} when `items` is empty or longer than 1000.
2147
+ */
2148
+ updateContent(items: UpdateContentInput[]): Promise<BatchAcceptedResponse>;
2149
+ /**
2150
+ * Update **variant** fields of approved products (stockCode, vatRate,
2151
+ * dimensionalWeight, warehouse IDs, location-based delivery, lot). Identified
2152
+ * by `barcode`. The barcode itself cannot be changed via this endpoint.
2153
+ *
2154
+ * @throws {ValidationError} when `items` is empty or longer than 1000.
2155
+ */
2156
+ updateVariants(items: UpdateVariantInput[]): Promise<BatchAcceptedResponse>;
2157
+ /**
2158
+ * Update **unapproved** (draft) products. Identified by `barcode`. All
2159
+ * other fields are optional partial updates. Use this to fix drafts that
2160
+ * Trendyol rejected — `client.products.listUnapproved` surfaces the
2161
+ * `rejectReasonDetails` you need to act on.
2162
+ *
2163
+ * **Gotcha (verified live STAGE 2026-05-25):** Trendyol's V2 spec claims
2164
+ * only `barcode` is required, but the endpoint returns HTTP 500
2165
+ * (`TrendyolSystemException` / `TypeError`) when too many optional fields
2166
+ * are omitted. In practice, send at least `title`, `description`,
2167
+ * `productMainId`, `brandId`, `categoryId`, `stockCode`,
2168
+ * `dimensionalWeight`, `vatRate`, `images[]`, and `attributes[]` (an
2169
+ * empty array is OK for the latter). The SDK forwards your payload
2170
+ * as-is; trim fields only if you have verified the server accepts it.
2171
+ *
2172
+ * @throws {ValidationError} when `items` is empty or longer than 1000.
2173
+ */
2174
+ updateUnapproved(items: UpdateUnapprovedInput[]): Promise<BatchAcceptedResponse>;
2175
+ /**
2176
+ * Update product **delivery information** (deliveryDuration,
2177
+ * fastDeliveryType). Identified by `barcode`.
2178
+ *
2179
+ * @throws {ValidationError} when `items` is empty or longer than 1000.
2180
+ */
2181
+ updateDeliveryInfo(items: UpdateDeliveryInfoInput[]): Promise<BatchAcceptedResponse>;
2182
+ /**
2183
+ * Delete products by barcode. Trendyol allows deletion of unapproved
2184
+ * products and approved products that have been archived for more than a
2185
+ * day (and have not been sales-stopped by Trendyol).
2186
+ *
2187
+ * Async batch — returns `{ batchRequestId }` to poll via `getBatchStatus`.
2188
+ * Separately rate-limited at **100 req/min** (much tighter than create/update).
2189
+ *
2190
+ * @param barcodes 1–1000 barcodes.
2191
+ * @throws {ValidationError} when `barcodes` is empty or longer than 1000.
2192
+ */
2193
+ delete(barcodes: string[]): Promise<BatchAcceptedResponse>;
2194
+ /**
2195
+ * Archive products by barcode (Trendyol's `archived=true` state).
2196
+ * Archived products are not visible to customers; pair with `delete`
2197
+ * after the 24-hour archive cool-down to remove them entirely.
2198
+ *
2199
+ * Async batch — returns `{ batchRequestId }`.
2200
+ *
2201
+ * @throws {ValidationError} when `barcodes` is empty or longer than 1000.
2202
+ */
2203
+ archive(barcodes: string[]): Promise<BatchAcceptedResponse>;
2204
+ /**
2205
+ * Unarchive products by barcode (Trendyol's `archived=false` state).
2206
+ * Restores visibility for previously-archived products.
2207
+ *
2208
+ * @throws {ValidationError} when `barcodes` is empty or longer than 1000.
2209
+ */
2210
+ unarchive(barcodes: string[]): Promise<BatchAcceptedResponse>;
2211
+ private setArchivedState;
2212
+ /**
2213
+ * Unlock products whose sale was paused by Trendyol due to pricing
2214
+ * issues (under/over-pricing, critical price error, supplier issues).
2215
+ * Restores selling status for the listed barcodes.
2216
+ *
2217
+ * Async batch — returns `{ batchRequestId }`.
2218
+ *
2219
+ * @throws {ValidationError} when `barcodes` is empty or longer than 1000.
2220
+ */
2221
+ unlock(barcodes: string[]): Promise<BatchAcceptedResponse>;
2222
+ }
2223
+
2224
+ /**
2225
+ * Trendyol customer Q&A types.
2226
+ *
2227
+ * Customers can post product questions on Trendyol; sellers reply via
2228
+ * `questions.answer()`. Status lifecycle:
2229
+ * `WAITING_FOR_ANSWER` → seller replies → `ANSWERED`
2230
+ * → reported by another seller / Trendyol → `REPORTED`
2231
+ * → rejected by Trendyol moderation → `REJECTED`
2232
+ */
2233
+
2234
+ type QuestionStatus = 'WAITING_FOR_ANSWER' | 'ANSWERED' | 'REJECTED' | 'REPORTED' | (string & {});
2235
+ interface QuestionAnswer {
2236
+ text?: string;
2237
+ /** ISO 8601 UTC (converted from `creationDate` ms-epoch). */
2238
+ createdAt?: string;
2239
+ status?: string;
2240
+ }
2241
+ interface Question {
2242
+ id: string;
2243
+ text?: string;
2244
+ customerId?: string;
2245
+ /** Masked customer display name. */
2246
+ userName?: string;
2247
+ showUserName?: boolean;
2248
+ status?: QuestionStatus;
2249
+ /** Whether the question is visible publicly. */
2250
+ public?: boolean;
2251
+ productMainId?: string;
2252
+ productName?: string;
2253
+ imageUrl?: string;
2254
+ webUrl?: string;
2255
+ /** ISO 8601 UTC (from ms-epoch). */
2256
+ createdAt?: string;
2257
+ /** Trendyol's pre-formatted "answered on ..." message (Turkish). */
2258
+ answeredDateMessage?: string;
2259
+ answer?: QuestionAnswer;
2260
+ rejectedAnswer?: QuestionAnswer;
2261
+ /** ISO 8601 UTC if the question was rejected. */
2262
+ rejectedAt?: string;
2263
+ reason?: string;
2264
+ reportReason?: string;
2265
+ /** ISO 8601 UTC if the question was reported. */
2266
+ reportedAt?: string;
2267
+ /** Untouched raw response. */
2268
+ raw: Record<string, unknown>;
2269
+ }
2270
+ interface ListQuestionsParams extends CursorPaginationParams {
2271
+ /** Filter to questions about a specific product barcode. */
2272
+ barcode?: string;
2273
+ startDate?: Date;
2274
+ endDate?: Date;
2275
+ /** Filter by current status. */
2276
+ status?: QuestionStatus;
2277
+ }
2278
+
2279
+ /**
2280
+ * Trendyol customer Q&A management. Customers post product questions on
2281
+ * Trendyol; sellers reply with `questions.answer()`.
2282
+ */
2283
+ declare class QuestionsResource {
2284
+ private readonly transport;
2285
+ private readonly limiter;
2286
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
2287
+ /** Fetch a single question by its numeric ID. */
2288
+ get(questionId: string | number): Promise<Question>;
2289
+ /**
2290
+ * Filter questions by barcode / date range / status. Page-based
2291
+ * pagination internally; SDK exposes the opaque-cursor convention.
2292
+ */
2293
+ list(params?: ListQuestionsParams): Promise<CursorPage<Question>>;
2294
+ /**
2295
+ * Reply to a question. Trendyol enforces 10–2000 characters on the
2296
+ * answer text; the SDK pre-validates client-side.
2297
+ *
2298
+ * @throws {ValidationError} when `text` is outside the 10–2000 char range.
2299
+ */
2300
+ answer(questionId: string | number, text: string): Promise<unknown>;
2301
+ }
2302
+
2303
+ /**
2304
+ * The role an address plays in the seller's logistics flow.
2305
+ *
2306
+ * Trendyol allows a single physical address to play more than one role
2307
+ * (e.g., shipment + invoice), so always check the boolean flags rather than
2308
+ * relying solely on `addressType`.
2309
+ */
2310
+ type SupplierAddressType = 'SHIPMENT' | 'RETURNING' | 'INVOICE' | 'WAREHOUSE';
2311
+ /**
2312
+ * A supplier address registered in the Trendyol Partner Panel.
2313
+ *
2314
+ * Used by `createProduct V2` for `shipmentAddressId` / `returningAddressId`.
2315
+ *
2316
+ * NOTE: The exact field set is best-effort; some optional fields may differ
2317
+ * once verified against real STAGE responses. Bumped fields land in a follow-up
2318
+ * minor release if needed.
2319
+ */
2320
+ interface SupplierAddress {
2321
+ id: string;
2322
+ /** Free-form label set by the seller. */
2323
+ name?: string;
2324
+ /** Primary role declared by Trendyol. */
2325
+ addressType: SupplierAddressType;
2326
+ isShipmentAddress: boolean;
2327
+ isReturningAddress: boolean;
2328
+ isInvoiceAddress: boolean;
2329
+ isDefault: boolean;
2330
+ /** Multi-line address string as registered in the Partner Panel. */
2331
+ address?: string;
2332
+ city?: string;
2333
+ district?: string;
2334
+ postCode?: string;
2335
+ fullName?: string;
2336
+ }
2337
+
2338
+ interface SuppliersResourceOptions {
2339
+ /** Override the in-memory cache TTL. Defaults to 1 hour. */
2340
+ cacheTtlMs?: number;
2341
+ }
2342
+ /**
2343
+ * Trendyol supplier address endpoints.
2344
+ *
2345
+ * **Critical:** Trendyol rate-limits `getSuppliersAddresses` to **1 request
2346
+ * per hour per seller**. This resource therefore wraps the endpoint with an
2347
+ * in-memory cache (default TTL: 1 hour) so callers can request addresses
2348
+ * as often as needed without tripping the limit.
2349
+ *
2350
+ * Use `{ forceRefresh: true }` or `invalidateCache()` only when you know the
2351
+ * address list changed in the Partner Panel.
2352
+ */
2353
+ declare class SuppliersResource {
2354
+ private readonly transport;
2355
+ private cache;
2356
+ private readonly cacheTtlMs;
2357
+ private readonly limiter;
2358
+ private inflight;
2359
+ constructor(transport: TrendyolTransport, options?: SuppliersResourceOptions);
2360
+ /**
2361
+ * List the seller's registered addresses (shipment, returning, invoice, warehouse).
2362
+ *
2363
+ * Returns the cached value if it is still fresh. Concurrent calls share a
2364
+ * single in-flight request.
2365
+ */
2366
+ getAddresses(options?: {
2367
+ forceRefresh?: boolean;
2368
+ }): Promise<SupplierAddress[]>;
2369
+ /** Drop the cache; the next `getAddresses()` call hits the API. */
2370
+ invalidateCache(): void;
2371
+ private fetchFresh;
2372
+ }
2373
+
2374
+ /**
2375
+ * STAGE-only helper endpoints for creating + driving test orders /
2376
+ * test claims through their state machine. **Do not use in PROD** —
2377
+ * Trendyol's test endpoints are scoped to the test environment.
2378
+ */
2379
+ declare class TestOrdersResource {
2380
+ private readonly transport;
2381
+ private readonly limiter;
2382
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
2383
+ /**
2384
+ * Create a test order with the given customer / addresses / lines. The
2385
+ * SDK forwards the typed payload verbatim — drill into Trendyol's
2386
+ * `createTestOrder` doc for inner field rules.
2387
+ *
2388
+ * @throws {ValidationError} when required top-level fields are missing.
2389
+ */
2390
+ create(input: CreateTestOrderInput): Promise<unknown>;
2391
+ /** Push a test shipment package to the given status. */
2392
+ updateStatus(packageId: string | number, status: TestOrderStatus): Promise<unknown>;
2393
+ /** Move test claims to the `WaitingInAction` state. */
2394
+ setClaimsWaitingInAction(): Promise<unknown>;
2395
+ }
2396
+
2397
+ /**
2398
+ * Trendyol Video API types — product video upload + listing.
2399
+ *
2400
+ * Source: developers.trendyol.com / `seller-integration-video-api`.
2401
+ *
2402
+ * Endpoints under `/integration/video/sellers/{sellerId}/videos`.
2403
+ */
2404
+
2405
+ /**
2406
+ * Status of a seller integration video as Trendyol processes it. Open
2407
+ * union — Trendyol may add new statuses without an SDK release.
2408
+ */
2409
+ type SellerIntegrationStatus = 'WAITING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | (string & {});
2410
+ /** Body for `videos.create()` — initiates an async download + processing. */
2411
+ type CreateVideoInput = Record<string, unknown>;
2412
+ /** Query parameters for `videos.list()`. */
2413
+ interface ListVideosParams extends OffsetPaginationParams {
2414
+ /** Filter by a single video id. */
2415
+ id?: string;
2416
+ /** Filter by processing status. */
2417
+ sellerIntegrationStatus?: SellerIntegrationStatus;
2418
+ }
2419
+ /** One video row returned by `videos.list()`. */
2420
+ interface SellerVideo {
2421
+ id?: string;
2422
+ status?: SellerIntegrationStatus;
2423
+ /** Untouched raw row. */
2424
+ raw: Record<string, unknown>;
2425
+ }
2426
+
2427
+ /**
2428
+ * Trendyol Video API (`seller-integration-video-api`) — product video
2429
+ * uploads. Upload happens server-side from a URL the seller provides;
2430
+ * the SDK exposes the create + list endpoints.
2431
+ *
2432
+ * Base path: `/integration/video/sellers/{sellerId}/videos`.
2433
+ * Trendyol publishes per-endpoint rate limits — `create` at 200 req/min,
2434
+ * `list` at 1000 req/min — which the SDK provisions as two separate
2435
+ * token buckets so listing doesn't exhaust the create budget.
2436
+ */
2437
+ declare class VideosResource {
2438
+ private readonly transport;
2439
+ private readonly createLimiter;
2440
+ private readonly listLimiter;
2441
+ constructor(transport: TrendyolTransport, options?: {
2442
+ createLimiter?: TokenBucketRateLimiter;
2443
+ listLimiter?: TokenBucketRateLimiter;
2444
+ });
2445
+ /**
2446
+ * Queue a video for upload. Trendyol downloads from the URL in the
2447
+ * body asynchronously; poll `list()` (filtered by id) for status.
2448
+ *
2449
+ * @throws {ValidationError} when `input` is empty / not an object.
2450
+ */
2451
+ create(input: CreateVideoInput): Promise<unknown>;
2452
+ /** List the seller's integration videos (optionally filtered by id / status). */
2453
+ list(params?: ListVideosParams): Promise<SellerVideo[]>;
2454
+ }
2455
+
2456
+ /**
2457
+ * Trendyol webhook subscription types.
2458
+ *
2459
+ * Webhooks let Trendyol push shipment-package status events to a URL you
2460
+ * own instead of polling. Max 15 active webhooks per seller. Trendyol
2461
+ * itself authenticates against your endpoint (you don't sign Trendyol's
2462
+ * request) — pick `BASIC_AUTHENTICATION` (username+password) or `API_KEY`
2463
+ * (rotatable; recommended).
2464
+ */
2465
+
2466
+ /** Auth method Trendyol uses when calling your webhook URL. */
2467
+ type WebhookAuthenticationType = 'BASIC_AUTHENTICATION' | 'API_KEY';
2468
+ /**
2469
+ * Payload for `webhooks.create` / `webhooks.update`. Same shape for both.
2470
+ */
2471
+ interface WebhookInput {
2472
+ /** Your endpoint URL (must accept POST JSON from Trendyol). */
2473
+ url: string;
2474
+ /** Auth scheme Trendyol will use to call your endpoint. */
2475
+ authenticationType: WebhookAuthenticationType;
2476
+ /** Username (only when `authenticationType === 'BASIC_AUTHENTICATION'`). */
2477
+ username?: string;
2478
+ /** Password (only when `authenticationType === 'BASIC_AUTHENTICATION'`). */
2479
+ password?: string;
2480
+ /** API key (only when `authenticationType === 'API_KEY'`). */
2481
+ apiKey?: string;
2482
+ /**
2483
+ * Order statuses you want events for. Empty/omitted = all statuses.
2484
+ * Trendyol accepts the same vocabulary as `ShipmentPackageStatus`
2485
+ * (the upper-snake-case variants — `'CREATED'`, `'PICKING'`, etc. — see
2486
+ * Trendyol docs for the exact wire spelling, which sometimes differs
2487
+ * from the read-side `'Created'`/`'Picking'`).
2488
+ */
2489
+ subscribedStatuses?: string[];
2490
+ }
2491
+ /** A registered webhook subscription as returned by `webhooks.list`. */
2492
+ interface Webhook {
2493
+ id: string;
2494
+ url?: string;
2495
+ authenticationType?: WebhookAuthenticationType;
2496
+ username?: string;
2497
+ apiKey?: string;
2498
+ subscribedStatuses?: string[];
2499
+ /** Active vs deactivated. */
2500
+ active?: boolean;
2501
+ /** Untouched raw webhook entry. */
2502
+ raw: Record<string, unknown>;
2503
+ }
2504
+
2505
+ /**
2506
+ * Trendyol webhook subscription management.
2507
+ *
2508
+ * Max **15 active webhooks per seller** (Trendyol-enforced). Webhooks
2509
+ * fire on shipment-package status events only — there is no webhook
2510
+ * support for product / stock changes.
2511
+ *
2512
+ * Trendyol's gateway authenticates **against your endpoint** with the
2513
+ * `authenticationType` you configure. Pick `API_KEY` over
2514
+ * `BASIC_AUTHENTICATION` so you can rotate the secret without redeploying.
2515
+ *
2516
+ * No HMAC signature — security relies entirely on the auth method you
2517
+ * pick + the secret you store with Trendyol.
2518
+ */
2519
+ declare class WebhooksResource {
2520
+ private readonly transport;
2521
+ private readonly limiter;
2522
+ constructor(transport: TrendyolTransport, limiter?: TokenBucketRateLimiter);
2523
+ /**
2524
+ * Create a new webhook subscription. Trendyol caps subscriptions at 15
2525
+ * per seller — the SDK does NOT pre-check (you'd need to call `list()`
2526
+ * first), but Trendyol returns 400 when the cap is exceeded.
2527
+ *
2528
+ * @throws {ValidationError} when `url` or `authenticationType` is missing.
2529
+ */
2530
+ create(input: WebhookInput): Promise<unknown>;
2531
+ /** List all registered webhook subscriptions. */
2532
+ list(): Promise<Webhook[]>;
2533
+ /**
2534
+ * Update a webhook subscription. Same input shape as `create`; replaces
2535
+ * the whole subscription (Trendyol does NOT partially update).
2536
+ */
2537
+ update(webhookId: string | number, input: WebhookInput): Promise<unknown>;
2538
+ /** Permanently delete a webhook subscription. */
2539
+ delete(webhookId: string | number): Promise<unknown>;
2540
+ /** Re-activate a previously-deactivated webhook subscription. */
2541
+ activate(webhookId: string | number): Promise<unknown>;
2542
+ /**
2543
+ * Deactivate a webhook subscription. Trendyol automatically deactivates
2544
+ * a subscription after persistent delivery failures (and sends 2 emails);
2545
+ * use `activate()` to bring it back online once your endpoint is healthy.
2546
+ */
2547
+ deactivate(webhookId: string | number): Promise<unknown>;
2548
+ private validateInput;
2549
+ private webhookPath;
2550
+ }
2551
+
2552
+ /**
2553
+ * Static feature-capability flags for the Trendyol marketplace, so consumers
2554
+ * can feature-detect instead of hard-coding marketplace quirks.
2555
+ *
2556
+ * Intentionally a per-SDK literal constant (not a shared `@lonca/core` type):
2557
+ * the flags are marketplace-specific and the set is still small. Read them off
2558
+ * a client as `client.capabilities`.
2559
+ */
2560
+ declare const trendyolCapabilities: {
2561
+ /** Trendyol has no time-bounded / scheduled pricing (`pricings[]`). */
2562
+ readonly scheduledPricing: false;
2563
+ /** `inventory.update` accepts stock-only items (`quantity` with no price). */
2564
+ readonly stockOnlyBatch: true;
2565
+ /** Products expose `updatedAt`, so last-write-wins guards are supported. */
2566
+ readonly listingUpdatedAt: true;
2567
+ };
2568
+ /** Shape of {@link trendyolCapabilities}. */
2569
+ type TrendyolCapabilities = typeof trendyolCapabilities;
2570
+
2571
+ interface CreateClientOptions {
2572
+ /** Trendyol seller (supplier) ID — visible in Partner Panel → Account Info. */
2573
+ sellerId: number;
2574
+ /** Trendyol API key. */
2575
+ apiKey: string;
2576
+ /** Trendyol API secret. */
2577
+ apiSecret: string;
2578
+ /** Which Trendyol environment to target. */
2579
+ env: TrendyolEnvironment;
2580
+ /**
2581
+ * Integrator company name to send in `User-Agent` / `x-agentname`. Required —
2582
+ * Trendyol uses this to attribute API traffic. Use `'SelfIntegration'` if
2583
+ * the seller owns the integration code, otherwise your company / product name.
2584
+ * Trendyol caps this at 30 alphanumeric characters.
2585
+ */
2586
+ integratorName: string;
2587
+ /**
2588
+ * IPv4 address to send in `x-clientip`.
2589
+ * Defaults to `'127.0.0.1'` — Trendyol does not validate this against the
2590
+ * request origin, the header just has to be present and IPv4-shaped.
2591
+ */
2592
+ clientIp?: string;
2593
+ /** Optional structured logger (`@lonca/core` `Logger`). Defaults to no-op. */
2594
+ logger?: Logger;
2595
+ /** Request timeout in ms. Default: 30_000. */
2596
+ timeoutMs?: number;
2597
+ }
2598
+ interface TrendyolClient {
2599
+ brands: BrandsResource;
2600
+ categories: CategoriesResource;
2601
+ suppliers: SuppliersResource;
2602
+ products: ProductsResource;
2603
+ inventory: InventoryResource;
2604
+ orders: OrdersResource;
2605
+ claims: ClaimsResource;
2606
+ webhooks: WebhooksResource;
2607
+ questions: QuestionsResource;
2608
+ invoices: InvoicesResource;
2609
+ finance: FinanceResource;
2610
+ labels: LabelsResource;
2611
+ testOrders: TestOrdersResource;
2612
+ locations: LocationsResource;
2613
+ exportCenter: ExportCenterResource;
2614
+ videos: VideosResource;
2615
+ /** Static feature-capability flags for feature detection. */
2616
+ capabilities: TrendyolCapabilities;
2617
+ }
2618
+ /**
2619
+ * Create a Trendyol Marketplace SDK client.
2620
+ *
2621
+ * @example
2622
+ * ```ts
2623
+ * import { createTrendyolClient } from '@lonca/trendyol';
2624
+ *
2625
+ * const client = createTrendyolClient({
2626
+ * sellerId: 12345,
2627
+ * apiKey: process.env.TRENDYOL_API_KEY!,
2628
+ * apiSecret: process.env.TRENDYOL_API_SECRET!,
2629
+ * env: 'stage',
2630
+ * });
2631
+ *
2632
+ * const page = await client.brands.list({ limit: 100 });
2633
+ * ```
2634
+ */
2635
+ declare function createTrendyolClient(opts: CreateClientOptions): TrendyolClient;
2636
+
2637
+ export { type FinancialTransaction as $, type ApproveClaimLineItemsInput as A, type BarcodeCategoryLookup as B, type CancelPackageItemInput as C, type Country as D, type CreateClaimInput as E, type CreateClaimIssueInput as F, type CreateClaimItemInput as G, type CreateClientOptions as H, type CreateCommonLabelInput as I, type CreateProductV2Input as J, type CreateTestOrderInput as K, type CreateVideoInput as L, type DeleteInvoiceLinkInput as M, type DeliveryOptionInput as N, type District as O, type ExportBatchAcceptedResponse as P, type ExportBatchStatus as Q, type ExportCategoryAttribute as R, ExportCenterResource as S, type ExportPackage as T, type ExportPackageItem as U, type ExportPackageStatus as V, type ExportPriceUpdateInput as W, type ExportProduct as X, type ExportProductInput as Y, type ExportStockUpdateInput as Z, FinanceResource as _, type ApprovedProductStatus as a, type TestOrderStatus as a$, type GetExportPackageItemsParams as a0, InventoryResource as a1, InvoicesResource as a2, type KnownShipmentPackageStatus as a3, LabelsResource as a4, type LaborCostInput as a5, type ListCategoryAttributeValuesParams as a6, type ListClaimsParams as a7, type ListCompensationTicketsParams as a8, type ListExportPackagesV2Params as a9, type ProductAttribute as aA, type ProductAttributeV2Input as aB, type ProductBase as aC, type ProductComposition as aD, type ProductImageInput as aE, type ProductOrigin as aF, type ProductStockPrice as aG, type ProductStockPriceVariant as aH, type ProductVariant as aI, ProductsResource as aJ, type QuantitySplit as aK, type Question as aL, type QuestionAnswer as aM, type QuestionStatus as aN, QuestionsResource as aO, type SellerIntegrationStatus as aP, type SellerVideo as aQ, type SendInvoiceLinkInput as aR, type SettlementRow as aS, type ShipmentPackage as aT, type ShipmentPackageStatus as aU, type SplitGroup as aV, type SplitPackagePlan as aW, type SupplierAddress as aX, type SupplierAddressType as aY, SuppliersResource as aZ, type SuppliersResourceOptions as a_, type ListExportPackagesV3Params as aa, type ListExportProductsParams as ab, type ListFinanceParams as ac, type ListInventoryAndPriceParams as ad, type ListOrdersParams as ae, type ListOrdersStreamParams as af, type ListProductsParams as ag, type ListQuestionsParams as ah, type ListUnapprovedProductsParams as ai, type ListVideosParams as aj, LocationsResource as ak, type NamedRef as al, type Neighborhood as am, type OrderAddress as an, type OrderAddressLines as ao, type OrderCustomer as ap, type OrderLine as aq, type OrderLineDiscountDetail as ar, OrdersResource as as, type OtherFinancialRow as at, type PackageDetail as au, type PackageHistoryEntry as av, type PackageLineUpdate as aw, type PriceInventoryUpdate as ax, type ProcessAlternativeDeliveryInput as ay, type Product as az, type BatchAcceptedResponse as b, TestOrdersResource as b0, type TrendyolCapabilities as b1, type TrendyolCargoProvider as b2, type TrendyolClient as b3, type TrendyolEnvironment as b4, type UnapprovedDateQueryType as b5, type UnapprovedProduct as b6, type UnapprovedProductRejectReason as b7, type UnapprovedProductStatus as b8, type UpdateBoxInfoInput as b9, type UpdateContentInput as ba, type UpdateDeliveryInfoInput as bb, type UpdatePackageStatusInput as bc, type UpdatePriceInventoryResponse as bd, type UpdateUnapprovedInput as be, type UpdateVariantInput as bf, type UploadInvoiceFileInput as bg, VideosResource as bh, type Webhook as bi, type WebhookAuthenticationType as bj, type WebhookInput as bk, WebhooksResource as bl, createTrendyolClient as bm, normalizeShipmentPackage as bn, pollBatchStatus as bo, trendyolCapabilities as bp, type BatchPollOptions as c, type BatchRequestItemResult as d, type BatchRequestResult as e, type BatchRequestStatus as f, type Brand as g, BrandsResource as h, type BuyboxInfo as i, type CareInstruction as j, type CargoInvoiceItem as k, CategoriesResource as l, type Category as m, type CategoryAttribute as n, type CategoryAttributeValue as o, type City as p, type Claim as q, type ClaimIssueReason as r, type ClaimItemAudit as s, type ClaimItemStatus as t, ClaimsResource as u, type CommonLabel as v, type CommonLabelEntry as w, type CompensationItemDetail as x, type CompensationTicket as y, type CompensationTicketState as z };