@lonca/trendyol 0.13.0 → 0.15.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.
package/README.md CHANGED
@@ -38,7 +38,7 @@ Each entry is a method on the client.
38
38
  | `invoices` | `uploadFile({shipmentPackageId, file, ...})` (multipart), `sendLink({...})`, `deleteLink({...})` |
39
39
  | `finance` | `getSettlements({...})`, `getOtherFinancials({...})` — both return typed `FinancialTransaction[]` |
40
40
  | `labels` | `createCommon(trackingNumber, {format: 'ZPL', ...})`, `getCommon(trackingNumber)` |
41
- | `testOrders` | `create({...})`, `updateStatus(id, status)`, `setClaimsWaitingInAction()` — **STAGE-only utility** |
41
+ | `testOrders` | `create({...})`, `updateStatus(id, status, { lines?, params? })`, `setClaimsWaitingInAction()` — **STAGE-only utility** |
42
42
  | `locations` | `getCountries()`, `getTurkeyCities()`, `getTurkeyDistricts(cityCode)`, `getTurkeyNeighborhoods(cityCode, districtCode)`, `getAzerbaijanCities()`, `getAzerbaijanDistricts(...)`, `getCitiesByCountry/getDistrictsByCity(...)` |
43
43
  | `exportCenter` | `listProducts({...})`, `createProducts(items)`, `updatePrices(items)`, `updateStocks(items)`, `getBatchStatus(batchId)`, `listPackagesV2/V3({...})`, `getPackageItems({packageId, ...})`, `getCategoryAttributes(id)`, `getCareInstructions()`, `getCompositions()`, `getOrigins()` — **Trendyol Export Center / İhracat Merkezi** |
44
44
  | `videos` | `create({contentId, url, ...})`, `list({id?, sellerIntegrationStatus?, ...})` — product-page video upload + status |
@@ -326,14 +326,15 @@ const reasons = await client.claims.getIssueReasons();
326
326
  const audits = await client.claims.getItemAudits(claimItemId);
327
327
 
328
328
  // webhooks
329
- await client.webhooks.create({
329
+ const { id } = await client.webhooks.create({
330
+ // CreateWebhookResult — `id` is the documented `{ id }`; `raw` is the untouched body
330
331
  url: 'https://my-app/hook',
331
332
  authenticationType: 'API_KEY',
332
333
  apiKey: 'rotatable-secret',
333
334
  subscribedStatuses: ['CREATED', 'SHIPPED'],
334
335
  });
335
336
  const subs = await client.webhooks.list();
336
- await client.webhooks.update(id, { ...updated });
337
+ await client.webhooks.update(id, { ...updated }); // MutationResult ({ raw }) — Trendyol answers 200 OK
337
338
  await client.webhooks.delete(id);
338
339
  await client.webhooks.activate(id);
339
340
  await client.webhooks.deactivate(id);
@@ -341,7 +342,7 @@ await client.webhooks.deactivate(id);
341
342
  // questions
342
343
  const q = await client.questions.get(questionId);
343
344
  const pending = await client.questions.list({ status: 'WAITING_FOR_ANSWER' });
344
- await client.questions.answer(questionId, 'Cevap metni (10–2000 chars).');
345
+ const { answerId } = await client.questions.answer(questionId, 'Cevap metni (10–2000 chars).'); // AnswerQuestionResult
345
346
 
346
347
  // invoices
347
348
  await client.invoices.uploadFile({ shipmentPackageId: 100, file: pdfBlob });
@@ -353,16 +354,23 @@ await client.finance.getSettlements({ startDate, endDate, transactionType: 'Sale
353
354
  await client.finance.getOtherFinancials({ transactionType: 'DeductionInvoices' });
354
355
 
355
356
  // labels
356
- await client.labels.createCommon(trackingNumber, { format: 'ZPL', boxQuantity: 2 });
357
+ await client.labels.createCommon(trackingNumber, { format: 'ZPL', boxQuantity: 2 }); // MutationResult (200 OK, no body)
357
358
  const label = await client.labels.getCommon(trackingNumber);
358
359
  console.log(label.labels[0]?.label); // ZPL string
359
360
 
360
361
  // test orders (STAGE-only)
361
- await client.testOrders.create({
362
+ const { orderNumber } = await client.testOrders.create({
362
363
  /* CreateTestOrderInput */
364
+ }); // CreateTestOrderResult — documented `{ orderNumber }`
365
+ await client.testOrders.updateStatus(pkgId, 'Shipped'); // MutationResult
366
+ await client.testOrders.updateStatus(pkgId, 'Delivered', {
367
+ lines: [{ lineId, quantity: 1 }], // optional — the doc shows { lines, params, status }
368
+ params: {},
363
369
  });
364
- await client.testOrders.updateStatus(pkgId, 'Shipped');
365
- await client.testOrders.setClaimsWaitingInAction();
370
+ await client.testOrders.setClaimsWaitingInAction({ shipmentPackageId }); // MutationResult; body optional
371
+
372
+ // videos
373
+ const { videoId } = await client.videos.create({ title, videoUrl, productContentIds }); // CreateVideoResult — documented `{ videoId }`
366
374
 
367
375
  // locations (no sellerId — utility lookup)
368
376
  const countries = await client.locations.getCountries();
@@ -371,6 +379,15 @@ const districts = await client.locations.getTurkeyDistricts(cityCode);
371
379
  const neighborhoods = await client.locations.getTurkeyNeighborhoods(cityCode, districtCode);
372
380
  ```
373
381
 
382
+ ## Mutation results
383
+
384
+ No method returns a bare `unknown`. Every write / action call resolves to one of:
385
+
386
+ - a **documented typed shape** when Trendyol publishes a response body — `BatchAcceptedResponse` (`{ batchRequestId }`) for the async product writes, `CreateWebhookResult` (`{ id }`), `AnswerQuestionResult` (`{ answerId }`), `CreateVideoResult` (`{ videoId }`), `CreateTestOrderResult` (`{ orderNumber }`);
387
+ - a **`MutationResult`** (`{ raw: unknown }`, from `@lonca/core`) when the endpoint is documented as a bare `200 OK` or the body is undocumented — `webhooks.update/delete/activate/deactivate`, `labels.createCommon`, `testOrders.updateStatus/setClaimsWaitingInAction`, the claim/invoice mutations.
388
+
389
+ The typed results also extend `MutationResult`, so `.raw` is always the untouched body and the documented fields are optional (Trendyol occasionally answers `200 OK` with an empty body).
390
+
374
391
  ## Async batch + polling
375
392
 
376
393
  Every write endpoint (`products.create`, `updateContent`, `updateVariants`, `updateUnapproved`, `updateDeliveryInfo`, `delete`, `archive`, `unarchive`, `unlock`, `inventory.update`) is **asynchronous**: Trendyol accepts the batch and returns a `{ batchRequestId }`. Poll the result with:
@@ -402,6 +419,7 @@ Trendyol uses HTTP Basic Auth. Get your `sellerId`, `apiKey`, and `apiSecret` fr
402
419
  - **Per-endpoint rate limiting** (token bucket) sized to Trendyol's documented limits — see defaults below; override per resource
403
420
  - **Per-request correlation ID** — every call gets a UUID surfaced in log messages and the `x-correlationid` header for Trendyol-side log tracing
404
421
  - **Structured errors** via `@lonca/core` (`AuthError`, `RateLimitError`, `NotFoundError`, `ServerError`, `ValidationError`, `NetworkError`, `TimeoutError`)
422
+ - **Edge-block detection**: a `401`/`403` answered with a non-JSON (HTML/text) body — e.g. Cloudflare's stage IP-allowlist block page — maps to `AuthError` ("check IP allowlisting / credentials / User-Agent"); the raw HTML is never attached to the error, only a `{ bodyKind, bodyLength }` hint on `error.data`
405
423
  - **Client-side validation** before the network: empty batches, oversized batches (>1000 items), >10 buybox barcodes, ≤500-char claim descriptions, 10–2000-char Q&A answers — all throw `ValidationError`
406
424
  - **Multipart upload support** — `claims.createIssue` and `invoices.uploadFile` build `FormData` internally and the transport handles `Content-Type` correctly
407
425
  - **`AbortSignal` support** throughout
@@ -1,4 +1,4 @@
1
- import { Logger, BaseRequestOptions, TokenBucketRateLimiter, CursorPaginationParams, CursorPage, OffsetPaginationParams } from '@lonca/core';
1
+ import { Logger, BaseRequestOptions, TokenBucketRateLimiter, CursorPaginationParams, CursorPage, MutationResult, OffsetPaginationParams } from '@lonca/core';
2
2
 
3
3
  declare const BASE_URLS: {
4
4
  readonly prod: "https://apigw.trendyol.com";
@@ -349,7 +349,7 @@ declare class ClaimsResource {
349
349
  *
350
350
  * @throws {ValidationError} when `claimItems` is empty.
351
351
  */
352
- create(input: CreateClaimInput): Promise<unknown>;
352
+ create(input: CreateClaimInput): Promise<MutationResult>;
353
353
  /**
354
354
  * File a seller-side rejection ("ret talebi") against a customer claim.
355
355
  *
@@ -358,14 +358,14 @@ declare class ClaimsResource {
358
358
  * commas (Trendyol expects a single comma-separated string field).
359
359
  * Attach supporting docs (PDF / JPEG) via `files: [Blob, ...]`.
360
360
  */
361
- createIssue(claimId: string, input: CreateClaimIssueInput): Promise<unknown>;
361
+ createIssue(claimId: string, input: CreateClaimIssueInput): Promise<MutationResult>;
362
362
  /**
363
363
  * Approve specific claim line items. After approval, Trendyol moves
364
364
  * those line items into the post-approval refund / return-shipping flow.
365
365
  *
366
366
  * @throws {ValidationError} when `claimLineItemIdList` is empty.
367
367
  */
368
- approveLineItems(claimId: string, input: ApproveClaimLineItemsInput): Promise<unknown>;
368
+ approveLineItems(claimId: string, input: ApproveClaimLineItemsInput): Promise<MutationResult>;
369
369
  /**
370
370
  * List claims (page-based; SDK exposes opaque cursor convention).
371
371
  *
@@ -745,7 +745,43 @@ interface CreateTestOrderInput {
745
745
  lines: Array<Record<string, unknown>>;
746
746
  [key: string]: unknown;
747
747
  }
748
- type TestOrderStatus = 'Created' | 'Picking' | 'Invoiced' | 'Shipped' | 'Delivered' | 'Cancelled' | 'Returned' | 'UnDelivered' | (string & {});
748
+ /**
749
+ * Result of `testOrders.create()`. Trendyol's `createTestOrder` reference
750
+ * documents the response as `{ orderNumber: string }`; `raw` keeps the
751
+ * untouched body.
752
+ */
753
+ interface CreateTestOrderResult extends MutationResult {
754
+ /** Order number of the created test order (absent when the body had none). */
755
+ orderNumber?: string;
756
+ }
757
+ /**
758
+ * Optional body for `testOrders.setClaimsWaitingInAction()`. Trendyol's
759
+ * `updateTestOrderStatus` doc shows `{ shipmentPackageId }` — the
760
+ * `orderShipmentPackageId` returned by `claims.list`.
761
+ */
762
+ interface SetClaimsWaitingInActionInput {
763
+ shipmentPackageId: string | number;
764
+ }
765
+ /** One order line targeted by `testOrders.updateStatus()`. */
766
+ interface TestOrderStatusLine {
767
+ /** Line id from the test order (doc example: `4944785`). */
768
+ lineId: string | number;
769
+ /** Quantity of the line to move. */
770
+ quantity: number;
771
+ [key: string]: unknown;
772
+ }
773
+ /**
774
+ * Optional extras for `testOrders.updateStatus()`. Trendyol's
775
+ * `status-updates-on-test-orders` doc shows a `{ lines, params, status }`
776
+ * body; omitted, the SDK keeps sending `{ status }` alone as before.
777
+ */
778
+ interface UpdateTestOrderStatusOptions {
779
+ /** Order lines to move to the target status. */
780
+ lines?: TestOrderStatusLine[];
781
+ /** Doc-level `params` object (the doc's example sends `{}`). */
782
+ params?: Record<string, unknown>;
783
+ }
784
+ type TestOrderStatus = 'Created' | 'Picking' | 'Invoiced' | 'Shipped' | 'AtCollectionPoint' | 'Delivered' | 'Cancelled' | 'Returned' | 'UnDelivered' | (string & {});
749
785
  interface Country {
750
786
  /** ISO country code (e.g. `'TR'`, `'AZ'`). */
751
787
  code: string;
@@ -855,13 +891,16 @@ interface ProductVariant {
855
891
  raw: Record<string, unknown>;
856
892
  }
857
893
  /**
858
- * A Trendyol marketplace product (approved variant).
894
+ * The content fields shared by an approved {@link Product} and an unapproved
895
+ * (draft) {@link UnapprovedProduct} — so callers can read title / brand /
896
+ * category / images from either shape without branching.
859
897
  *
860
- * Lonca surfaces the stable fields we have verified against live Trendyol
861
- * responses. Everything else stays accessible via `raw`.
898
+ * Intentionally just the common surface: the two diverge structurally beyond
899
+ * this (`Product` carries `variants[]`; `UnapprovedProduct` is flat with a root
900
+ * `barcode`), and their timestamp fields differ in optionality, so those stay on
901
+ * the concrete types.
862
902
  */
863
- interface Product {
864
- contentId: string;
903
+ interface ProductContentBase {
865
904
  productMainId: string;
866
905
  title: string;
867
906
  description?: string;
@@ -870,6 +909,15 @@ interface Product {
870
909
  /** Image URLs in display order. */
871
910
  images: string[];
872
911
  attributes: ProductAttribute[];
912
+ }
913
+ /**
914
+ * A Trendyol marketplace product (approved variant).
915
+ *
916
+ * Lonca surfaces the stable fields we have verified against live Trendyol
917
+ * responses. Everything else stays accessible via `raw`.
918
+ */
919
+ interface Product extends ProductContentBase {
920
+ contentId: string;
873
921
  variants: ProductVariant[];
874
922
  /** ISO 8601 UTC string (converted from Trendyol's ms-epoch). */
875
923
  createdAt: string;
@@ -907,17 +955,12 @@ interface UnapprovedProductRejectReason {
907
955
  * calls the image-list field `media`, but the live API returns it as
908
956
  * `images`. SDK normalizes to `images`.
909
957
  */
910
- interface UnapprovedProduct {
958
+ interface UnapprovedProduct extends ProductContentBase {
911
959
  /** Seller (supplier) ID echoed back by Trendyol. */
912
960
  supplierId?: string;
913
- productMainId: string;
914
961
  /** Lifecycle status — see `UnapprovedProductStatus`. */
915
962
  status?: UnapprovedProductStatus;
916
- brand: NamedRef;
917
- category: NamedRef;
918
963
  barcode: string;
919
- title: string;
920
- description?: string;
921
964
  /** Stock quantity at the moment of the query. */
922
965
  quantity?: number;
923
966
  listPrice?: number;
@@ -926,9 +969,6 @@ interface UnapprovedProduct {
926
969
  vatRate?: number;
927
970
  dimensionalWeight?: number;
928
971
  stockCode?: string;
929
- /** Image URLs in display order (Trendyol's `images` field, spec says `media`). */
930
- images: string[];
931
- attributes: ProductAttribute[];
932
972
  /** Populated when `status === 'rejected'`. */
933
973
  rejectReasonDetails: UnapprovedProductRejectReason[];
934
974
  /** Returned by Trendyol; null when the seller has not configured this. */
@@ -1165,11 +1205,11 @@ declare class InvoicesResource {
1165
1205
  *
1166
1206
  * Max 10 MB. Accepted formats: PDF, JPEG, PNG.
1167
1207
  */
1168
- uploadFile(input: UploadInvoiceFileInput): Promise<unknown>;
1208
+ uploadFile(input: UploadInvoiceFileInput): Promise<MutationResult>;
1169
1209
  /** Register an invoice URL with Trendyol (alternative to uploading the file). */
1170
- sendLink(input: SendInvoiceLinkInput): Promise<unknown>;
1210
+ sendLink(input: SendInvoiceLinkInput): Promise<MutationResult>;
1171
1211
  /** Remove a previously-registered invoice link. */
1172
- deleteLink(input: DeleteInvoiceLinkInput): Promise<unknown>;
1212
+ deleteLink(input: DeleteInvoiceLinkInput): Promise<MutationResult>;
1173
1213
  }
1174
1214
 
1175
1215
  /**
@@ -1185,9 +1225,13 @@ declare class LabelsResource {
1185
1225
  * returns, call `getCommon()` with the same `cargoTrackingNumber` to
1186
1226
  * retrieve the generated label.
1187
1227
  *
1228
+ * Trendyol documents this endpoint (`createCommonLabel`) as a bare
1229
+ * `200 OK` with no response body, so the SDK returns a `MutationResult`
1230
+ * whose `raw` is whatever the gateway sent (normally `undefined`).
1231
+ *
1188
1232
  * @throws {ValidationError} when `format` is missing.
1189
1233
  */
1190
- createCommon(cargoTrackingNumber: string | number, input: CreateCommonLabelInput): Promise<unknown>;
1234
+ createCommon(cargoTrackingNumber: string | number, input: CreateCommonLabelInput): Promise<MutationResult>;
1191
1235
  /**
1192
1236
  * Retrieve the previously-created common label. Trendyol returns
1193
1237
  * `{ data: [{ label, format }] }`; the SDK surfaces the array as
@@ -2046,6 +2090,11 @@ declare class ProductsResource {
2046
2090
  * List approved products. Use `paginate()` from `@lonca/core` to iterate
2047
2091
  * lazily across pages.
2048
2092
  *
2093
+ * **Approved only:** this endpoint silently excludes products still in review
2094
+ * or rejected — use {@link listUnapproved} for those. Date fields on the
2095
+ * returned {@link Product} (`createdAt` / `updatedAt`) are ISO 8601 UTC
2096
+ * **strings**, not `Date` objects.
2097
+ *
2049
2098
  * Trendyol exposes both page-based and `nextPageToken`-based pagination
2050
2099
  * (the latter required when the dataset exceeds 10,000 items). The SDK
2051
2100
  * picks the right strategy automatically — pass our opaque `cursor` from
@@ -2256,6 +2305,15 @@ interface QuestionAnswer {
2256
2305
  createdAt?: string;
2257
2306
  status?: string;
2258
2307
  }
2308
+ /**
2309
+ * Result of `questions.answer()`. Trendyol's `answerQuestion` reference
2310
+ * documents the response as `{ answerId: number }`; `raw` keeps the
2311
+ * untouched body in case the gateway returns more (or nothing).
2312
+ */
2313
+ interface AnswerQuestionResult extends MutationResult {
2314
+ /** ID of the answer Trendyol created (absent when the body had none). */
2315
+ answerId?: number;
2316
+ }
2259
2317
  interface Question {
2260
2318
  id: string;
2261
2319
  text?: string;
@@ -2313,9 +2371,12 @@ declare class QuestionsResource {
2313
2371
  * Reply to a question. Trendyol enforces 10–2000 characters on the
2314
2372
  * answer text; the SDK pre-validates client-side.
2315
2373
  *
2374
+ * Trendyol documents the response as `{ answerId: number }`; the SDK
2375
+ * surfaces it as `answerId` and keeps the untouched body on `raw`.
2376
+ *
2316
2377
  * @throws {ValidationError} when `text` is outside the 10–2000 char range.
2317
2378
  */
2318
- answer(questionId: string | number, text: string): Promise<unknown>;
2379
+ answer(questionId: string | number, text: string): Promise<AnswerQuestionResult>;
2319
2380
  }
2320
2381
 
2321
2382
  /**
@@ -2403,13 +2464,28 @@ declare class TestOrdersResource {
2403
2464
  * SDK forwards the typed payload verbatim — drill into Trendyol's
2404
2465
  * `createTestOrder` doc for inner field rules.
2405
2466
  *
2467
+ * Trendyol documents the response as `{ orderNumber: string }`; the SDK
2468
+ * surfaces it as `orderNumber` and keeps the untouched body on `raw`.
2469
+ *
2406
2470
  * @throws {ValidationError} when required top-level fields are missing.
2407
2471
  */
2408
- create(input: CreateTestOrderInput): Promise<unknown>;
2409
- /** Push a test shipment package to the given status. */
2410
- updateStatus(packageId: string | number, status: TestOrderStatus): Promise<unknown>;
2411
- /** Move test claims to the `WaitingInAction` state. */
2412
- setClaimsWaitingInAction(): Promise<unknown>;
2472
+ create(input: CreateTestOrderInput): Promise<CreateTestOrderResult>;
2473
+ /**
2474
+ * Push a test shipment package to the given status. Trendyol's
2475
+ * `status-updates-on-test-orders` doc shows a `{ lines, params, status }`
2476
+ * body — pass `options` to send the documented `lines` / `params`;
2477
+ * omitted, the body stays `{ status }` alone as before. Documented
2478
+ * response is a bare `200 OK` (no body), hence `MutationResult`.
2479
+ */
2480
+ updateStatus(packageId: string | number, status: TestOrderStatus, options?: UpdateTestOrderStatusOptions): Promise<MutationResult>;
2481
+ /**
2482
+ * Move test claims to the `WaitingInAction` state. Trendyol's
2483
+ * `updateTestOrderStatus` doc shows a `{ shipmentPackageId }` body (the
2484
+ * `orderShipmentPackageId` from `claims.list`); pass `input` to send it —
2485
+ * omitted, the request goes out body-less as before. Documented response
2486
+ * is a bare `200 OK` (no body), hence `MutationResult`.
2487
+ */
2488
+ setClaimsWaitingInAction(input?: SetClaimsWaitingInActionInput): Promise<MutationResult>;
2413
2489
  }
2414
2490
 
2415
2491
  /**
@@ -2425,8 +2501,38 @@ declare class TestOrdersResource {
2425
2501
  * union — Trendyol may add new statuses without an SDK release.
2426
2502
  */
2427
2503
  type SellerIntegrationStatus = 'WAITING' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED' | (string & {});
2428
- /** Body for `videos.create()` — initiates an async download + processing. */
2429
- type CreateVideoInput = Record<string, unknown>;
2504
+ /**
2505
+ * Documented `videoContentType` values for `videos.create()`. Open union —
2506
+ * Trendyol may add new types without an SDK release. Omitted, Trendyol
2507
+ * defaults to `PRODUCT_PROMOTION`.
2508
+ */
2509
+ type VideoContentType = 'PRODUCT_PROMOTION' | 'ASSEMBLY_AND_INSTALLATION' | 'PACKAGING' | 'STORE_PROMOTION' | 'ADVERTISEMENT' | 'PRODUCT_USAGE_AND_EXPERIENCE' | (string & {});
2510
+ /**
2511
+ * Body for `videos.create()` — initiates an async download + processing.
2512
+ * The documented fields are typed as optional hints; every extra key passes
2513
+ * through to Trendyol untouched (the SDK never strips unknown fields).
2514
+ */
2515
+ type CreateVideoInput = {
2516
+ /** Video title, 3–50 chars — documented as required. */
2517
+ title?: string;
2518
+ /** Video description, ≤500 chars. */
2519
+ description?: string;
2520
+ /** Public http(s) URL Trendyol downloads the video from — documented as required. */
2521
+ videoUrl?: string;
2522
+ /** Product content ids to attach (≤100; the doc's example sends strings). */
2523
+ productContentIds?: Array<string | number>;
2524
+ /** Video content type — defaults to `PRODUCT_PROMOTION` when omitted. */
2525
+ videoContentType?: VideoContentType;
2526
+ } & Record<string, unknown>;
2527
+ /**
2528
+ * Result of `videos.create()`. Trendyol documents the response as
2529
+ * `{ videoId: string }` (a UUID you can pass to `videos.list({ id })`);
2530
+ * `raw` keeps the untouched body.
2531
+ */
2532
+ interface CreateVideoResult extends MutationResult {
2533
+ /** ID of the queued video (absent when the body had none). */
2534
+ videoId?: string;
2535
+ }
2430
2536
  /** Query parameters for `videos.list()`. */
2431
2537
  interface ListVideosParams extends OffsetPaginationParams {
2432
2538
  /** Filter by a single video id. */
@@ -2464,9 +2570,13 @@ declare class VideosResource {
2464
2570
  * Queue a video for upload. Trendyol downloads from the URL in the
2465
2571
  * body asynchronously; poll `list()` (filtered by id) for status.
2466
2572
  *
2573
+ * Trendyol documents the response as `{ videoId: string }`; the SDK
2574
+ * surfaces it as `videoId` (pass it to `list({ id })`) and keeps the
2575
+ * untouched body on `raw`.
2576
+ *
2467
2577
  * @throws {ValidationError} when `input` is empty / not an object.
2468
2578
  */
2469
- create(input: CreateVideoInput): Promise<unknown>;
2579
+ create(input: CreateVideoInput): Promise<CreateVideoResult>;
2470
2580
  /** List the seller's integration videos (optionally filtered by id / status). */
2471
2581
  list(params?: ListVideosParams): Promise<SellerVideo[]>;
2472
2582
  }
@@ -2506,6 +2616,15 @@ interface WebhookInput {
2506
2616
  */
2507
2617
  subscribedStatuses?: string[];
2508
2618
  }
2619
+ /**
2620
+ * Result of `webhooks.create()`. Trendyol's `createWebhook` reference
2621
+ * documents the response as `{ id: string }` — keep it for `update` /
2622
+ * `delete` / `activate` / `deactivate`. `raw` keeps the untouched body.
2623
+ */
2624
+ interface CreateWebhookResult extends MutationResult {
2625
+ /** ID of the created subscription (absent when the body had none). */
2626
+ id?: string;
2627
+ }
2509
2628
  /** A registered webhook subscription as returned by `webhooks.list`. */
2510
2629
  interface Webhook {
2511
2630
  id: string;
@@ -2543,26 +2662,40 @@ declare class WebhooksResource {
2543
2662
  * per seller — the SDK does NOT pre-check (you'd need to call `list()`
2544
2663
  * first), but Trendyol returns 400 when the cap is exceeded.
2545
2664
  *
2665
+ * Trendyol documents the response as `{ id: string }` — the webhook ID
2666
+ * you need for `update` / `delete` / `activate` / `deactivate`. The SDK
2667
+ * surfaces it as `id` and keeps the untouched body on `raw`.
2668
+ *
2546
2669
  * @throws {ValidationError} when `url` or `authenticationType` is missing.
2547
2670
  */
2548
- create(input: WebhookInput): Promise<unknown>;
2671
+ create(input: WebhookInput): Promise<CreateWebhookResult>;
2549
2672
  /** List all registered webhook subscriptions. */
2550
2673
  list(): Promise<Webhook[]>;
2551
2674
  /**
2552
2675
  * Update a webhook subscription. Same input shape as `create`; replaces
2553
2676
  * the whole subscription (Trendyol does NOT partially update).
2677
+ *
2678
+ * Documented response is a bare `200 OK` (no body), hence `MutationResult`.
2679
+ */
2680
+ update(webhookId: string | number, input: WebhookInput): Promise<MutationResult>;
2681
+ /**
2682
+ * Permanently delete a webhook subscription. Documented response is a
2683
+ * bare `200 OK` (no body), hence `MutationResult`.
2554
2684
  */
2555
- update(webhookId: string | number, input: WebhookInput): Promise<unknown>;
2556
- /** Permanently delete a webhook subscription. */
2557
- delete(webhookId: string | number): Promise<unknown>;
2558
- /** Re-activate a previously-deactivated webhook subscription. */
2559
- activate(webhookId: string | number): Promise<unknown>;
2685
+ delete(webhookId: string | number): Promise<MutationResult>;
2686
+ /**
2687
+ * Re-activate a previously-deactivated webhook subscription. Documented
2688
+ * response is a bare `200 OK` (no body), hence `MutationResult`.
2689
+ */
2690
+ activate(webhookId: string | number): Promise<MutationResult>;
2560
2691
  /**
2561
2692
  * Deactivate a webhook subscription. Trendyol automatically deactivates
2562
2693
  * a subscription after persistent delivery failures (and sends 2 emails);
2563
2694
  * use `activate()` to bring it back online once your endpoint is healthy.
2695
+ *
2696
+ * Documented response is a bare `200 OK` (no body), hence `MutationResult`.
2564
2697
  */
2565
- deactivate(webhookId: string | number): Promise<unknown>;
2698
+ deactivate(webhookId: string | number): Promise<MutationResult>;
2566
2699
  private validateInput;
2567
2700
  private webhookPath;
2568
2701
  }
@@ -2654,4 +2787,4 @@ interface TrendyolClient {
2654
2787
  */
2655
2788
  declare function createTrendyolClient(opts: CreateClientOptions): TrendyolClient;
2656
2789
 
2657
- export { type FinancialTransaction as $, type ApproveClaimLineItemsInput as A, type BarcodeCategoryLookup as B, type CancelPackageItemInput as C, type Country as D, type CreateClaimInput as E, type CreateClaimIssueInput as F, type CreateClaimItemInput as G, type CreateClientOptions as H, type CreateCommonLabelInput as I, type CreateProductV2Input as J, type CreateTestOrderInput as K, type CreateVideoInput as L, type DeleteInvoiceLinkInput as M, type DeliveryOptionInput as N, type District as O, type ExportBatchAcceptedResponse as P, type ExportBatchStatus as Q, type ExportCategoryAttribute as R, ExportCenterResource as S, type ExportPackage as T, type ExportPackageItem as U, type ExportPackageStatus as V, type ExportPriceUpdateInput as W, type ExportProduct as X, type ExportProductInput as Y, type ExportStockUpdateInput as Z, FinanceResource as _, type ApprovedProductStatus as a, type TestOrderStatus as a$, type GetExportPackageItemsParams as a0, InventoryResource as a1, InvoicesResource as a2, type KnownShipmentPackageStatus as a3, LabelsResource as a4, type LaborCostInput as a5, type ListCategoryAttributeValuesParams as a6, type ListClaimsParams as a7, type ListCompensationTicketsParams as a8, type ListExportPackagesV2Params as a9, type ProductAttribute as aA, type ProductAttributeV2Input as aB, type ProductBase as aC, type ProductComposition as aD, type ProductImageInput as aE, type ProductOrigin as aF, type ProductStockPrice as aG, type ProductStockPriceVariant as aH, type ProductVariant as aI, ProductsResource as aJ, type QuantitySplit as aK, type Question as aL, type QuestionAnswer as aM, type QuestionStatus as aN, QuestionsResource as aO, type SellerIntegrationStatus as aP, type SellerVideo as aQ, type SendInvoiceLinkInput as aR, type SettlementRow as aS, type ShipmentPackage as aT, type ShipmentPackageStatus as aU, type SplitGroup as aV, type SplitPackagePlan as aW, type SupplierAddress as aX, type SupplierAddressType as aY, SuppliersResource as aZ, type SuppliersResourceOptions as a_, type ListExportPackagesV3Params as aa, type ListExportProductsParams as ab, type ListFinanceParams as ac, type ListInventoryAndPriceParams as ad, type ListOrdersParams as ae, type ListOrdersStreamParams as af, type ListProductsParams as ag, type ListQuestionsParams as ah, type ListUnapprovedProductsParams as ai, type ListVideosParams as aj, LocationsResource as ak, type NamedRef as al, type Neighborhood as am, type OrderAddress as an, type OrderAddressLines as ao, type OrderCustomer as ap, type OrderLine as aq, type OrderLineDiscountDetail as ar, OrdersResource as as, type OtherFinancialRow as at, type PackageDetail as au, type PackageHistoryEntry as av, type PackageLineUpdate as aw, type PriceInventoryUpdate as ax, type ProcessAlternativeDeliveryInput as ay, type Product as az, type BatchAcceptedResponse as b, TestOrdersResource as b0, type TrendyolCapabilities as b1, type TrendyolCargoProvider as b2, type TrendyolClient as b3, type TrendyolEnvironment as b4, type UnapprovedDateQueryType as b5, type UnapprovedProduct as b6, type UnapprovedProductRejectReason as b7, type UnapprovedProductStatus as b8, type UpdateBoxInfoInput as b9, type UpdateContentInput as ba, type UpdateDeliveryInfoInput as bb, type UpdatePackageStatusInput as bc, type UpdatePriceInventoryResponse as bd, type UpdateUnapprovedInput as be, type UpdateVariantInput as bf, type UploadInvoiceFileInput as bg, VideosResource as bh, type Webhook as bi, type WebhookAuthenticationType as bj, type WebhookInput as bk, WebhooksResource as bl, createTrendyolClient as bm, normalizeShipmentPackage as bn, pollBatchStatus as bo, trendyolCapabilities as bp, type BatchPollOptions as c, type BatchRequestItemResult as d, type BatchRequestResult as e, type BatchRequestStatus as f, type Brand as g, BrandsResource as h, type BuyboxInfo as i, type CareInstruction as j, type CargoInvoiceItem as k, CategoriesResource as l, type Category as m, type CategoryAttribute as n, type CategoryAttributeValue as o, type City as p, type Claim as q, type ClaimIssueReason as r, type ClaimItemAudit as s, type ClaimItemStatus as t, ClaimsResource as u, type CommonLabel as v, type CommonLabelEntry as w, type CompensationItemDetail as x, type CompensationTicket as y, type CompensationTicketState as z };
2790
+ export { type ExportProduct as $, type AnswerQuestionResult as A, type BarcodeCategoryLookup as B, type CancelPackageItemInput as C, type CompensationTicketState as D, type Country as E, type CreateClaimInput as F, type CreateClaimIssueInput as G, type CreateClaimItemInput as H, type CreateClientOptions as I, type CreateCommonLabelInput as J, type CreateProductV2Input as K, type CreateTestOrderInput as L, type CreateTestOrderResult as M, type CreateVideoInput as N, type CreateVideoResult as O, type CreateWebhookResult as P, type DeleteInvoiceLinkInput as Q, type DeliveryOptionInput as R, type District as S, type ExportBatchAcceptedResponse as T, type ExportBatchStatus as U, type ExportCategoryAttribute as V, ExportCenterResource as W, type ExportPackage as X, type ExportPackageItem as Y, type ExportPackageStatus as Z, type ExportPriceUpdateInput as _, type ApproveClaimLineItemsInput as a, type SplitGroup as a$, type ExportProductInput as a0, type ExportStockUpdateInput as a1, FinanceResource as a2, type FinancialTransaction as a3, type GetExportPackageItemsParams as a4, InventoryResource as a5, InvoicesResource as a6, type KnownShipmentPackageStatus as a7, LabelsResource as a8, type LaborCostInput as a9, type PackageLineUpdate as aA, type PriceInventoryUpdate as aB, type ProcessAlternativeDeliveryInput as aC, type Product as aD, type ProductAttribute as aE, type ProductAttributeV2Input as aF, type ProductBase as aG, type ProductComposition as aH, type ProductContentBase as aI, type ProductImageInput as aJ, type ProductOrigin as aK, type ProductStockPrice as aL, type ProductStockPriceVariant as aM, type ProductVariant as aN, ProductsResource as aO, type QuantitySplit as aP, type Question as aQ, type QuestionAnswer as aR, type QuestionStatus as aS, QuestionsResource as aT, type SellerIntegrationStatus as aU, type SellerVideo as aV, type SendInvoiceLinkInput as aW, type SetClaimsWaitingInActionInput as aX, type SettlementRow as aY, type ShipmentPackage as aZ, type ShipmentPackageStatus as a_, type ListCategoryAttributeValuesParams as aa, type ListClaimsParams as ab, type ListCompensationTicketsParams as ac, type ListExportPackagesV2Params as ad, type ListExportPackagesV3Params as ae, type ListExportProductsParams as af, type ListFinanceParams as ag, type ListInventoryAndPriceParams as ah, type ListOrdersParams as ai, type ListOrdersStreamParams as aj, type ListProductsParams as ak, type ListQuestionsParams as al, type ListUnapprovedProductsParams as am, type ListVideosParams as an, LocationsResource as ao, type NamedRef as ap, type Neighborhood as aq, type OrderAddress as ar, type OrderAddressLines as as, type OrderCustomer as at, type OrderLine as au, type OrderLineDiscountDetail as av, OrdersResource as aw, type OtherFinancialRow as ax, type PackageDetail as ay, type PackageHistoryEntry as az, type ApprovedProductStatus as b, type SplitPackagePlan as b0, type SupplierAddress as b1, type SupplierAddressType as b2, SuppliersResource as b3, type SuppliersResourceOptions as b4, type TestOrderStatus as b5, type TestOrderStatusLine as b6, TestOrdersResource as b7, type TrendyolCapabilities as b8, type TrendyolCargoProvider as b9, type TrendyolClient as ba, type TrendyolEnvironment as bb, type UnapprovedDateQueryType as bc, type UnapprovedProduct as bd, type UnapprovedProductRejectReason as be, type UnapprovedProductStatus as bf, type UpdateBoxInfoInput as bg, type UpdateContentInput as bh, type UpdateDeliveryInfoInput as bi, type UpdatePackageStatusInput as bj, type UpdatePriceInventoryResponse as bk, type UpdateTestOrderStatusOptions as bl, type UpdateUnapprovedInput as bm, type UpdateVariantInput as bn, type UploadInvoiceFileInput as bo, type VideoContentType as bp, VideosResource as bq, type Webhook as br, type WebhookAuthenticationType as bs, type WebhookInput as bt, WebhooksResource as bu, createTrendyolClient as bv, normalizeShipmentPackage as bw, pollBatchStatus as bx, trendyolCapabilities as by, type BatchAcceptedResponse as c, type BatchPollOptions as d, type BatchRequestItemResult as e, type BatchRequestResult as f, type BatchRequestStatus as g, type Brand as h, BrandsResource as i, type BuyboxInfo as j, type CareInstruction as k, type CargoInvoiceItem as l, CategoriesResource as m, type Category as n, type CategoryAttribute as o, type CategoryAttributeValue as p, type City as q, type Claim as r, type ClaimIssueReason as s, type ClaimItemAudit as t, type ClaimItemStatus as u, ClaimsResource as v, type CommonLabel as w, type CommonLabelEntry as x, type CompensationItemDetail as y, type CompensationTicket as z };