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