@omni-commerce/sdk 0.23.0 → 0.25.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/dist/index.js CHANGED
@@ -33,7 +33,7 @@ function normalizeClientOptions(options = {}) {
33
33
  }
34
34
 
35
35
  // src/version.ts
36
- var SDK_VERSION = "0.23.0";
36
+ var SDK_VERSION = "0.25.0";
37
37
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
38
38
 
39
39
  // src/environments.ts
@@ -2497,6 +2497,8 @@ var JobsClient = class {
2497
2497
  *
2498
2498
  * Fetch shared async status for developer-platform operations, including product workflow jobs, bulk CSV import jobs, Look generation jobs, import jobs, enrichment jobs, price comparison jobs, and sync jobs.
2499
2499
 
2500
+ Marketplace-only bulk imports expose data.deferStoreSelection: true. For imports with automatic publishing enabled, inspect data.publishing for per-store results.
2501
+
2500
2502
  Price comparison jobs expose partial progress in data.results and their final batch result in data.result; completed means processing finished, so inspect data.result.success for comparison failures.
2501
2503
  *
2502
2504
  * `GET /api/v1/jobs/{jobId}`
@@ -2938,9 +2940,9 @@ var OrdersClient = class {
2938
2940
  /**
2939
2941
  * Get Order Action Options
2940
2942
  *
2941
- * Ask the marketplace which choices an action needs, such as pickup or drop-off for `ship`. Requires `orders:write`.
2943
+ * Read marketplace choices for this order, including seller cancellation reasons for `action=cancel`. Eligible orders can include orders awaiting carrier collection. Requires `orders:write`.
2942
2944
 
2943
- Send the chosen choice's `payload` with `POST /api/v1/orders/{orderId}/actions`.
2945
+ Review the selected reason or fulfillment choice and send its exact `payload` with `POST /api/v1/orders/{orderId}/actions`.
2944
2946
  *
2945
2947
  * `GET /api/v1/orders/{orderId}/action-options`
2946
2948
  */
@@ -2959,7 +2961,7 @@ var OrdersClient = class {
2959
2961
  *
2960
2962
  * The order's 20 most recent action jobs, newest first, plus its latest successful label job. Requires `orders:read`.
2961
2963
 
2962
- Poll this after queueing an action. A succeeded `labels` job lists its label files in `labels`.
2964
+ After submission, find the returned job ID here. Read its status for the marketplace outcome and `errorMessage` for failures. A succeeded `labels` job lists its label files in `labels`.
2963
2965
  *
2964
2966
  * `GET /api/v1/orders/{orderId}/actions`
2965
2967
  */
@@ -2978,7 +2980,7 @@ var OrdersClient = class {
2978
2980
  *
2979
2981
  * Ship, cancel, generate shipping labels for, or update tracking on a marketplace order. Requires `orders:write`.
2980
2982
 
2981
- The marketplace call runs in the background: the response is `202` with `jobId`; poll `GET /api/v1/orders/{orderId}/actions`. A repeated `idempotencyKey` returns `200` with the original job.
2983
+ For `cancel`, send the exact payload of a reviewed cancellation reason from the action options endpoint. The marketplace call runs in the background. The `202` response provides a `jobId`. Poll `GET /api/v1/orders/{orderId}/actions` for its outcome. A repeated `idempotencyKey` with the same request returns `200` with the original job.
2982
2984
  *
2983
2985
  * `POST /api/v1/orders/{orderId}/actions`
2984
2986
  */
@@ -3001,7 +3003,7 @@ var OrdersClient = class {
3001
3003
 
3002
3004
  ### Choices
3003
3005
 
3004
- Read current marketplace choices for ship, cancel, labels or update_tracking for 1–50 order UUIDs using repeated orderIds query parameters. The shared order service checks status, store connection and marketplace capability. Results preserve first-requested order, with explicit per-order errors. Use the exact choice payload and supply any fields marked requiresInput. An unsupported marketplace operation is an explicit failure, not a silently skipped order. Ship arranges shipment; labels generates printable files. Fulfillment behavior is identical to the existing single-order API and workspace UI.
3006
+ Read marketplace choices for `ship`, `cancel`, `labels`, or `update_tracking` for 1–50 UUIDs using repeated `orderIds` parameters. Results preserve first-requested order and report any per-order eligibility or capability errors. For `cancel`, review an available reason for each order and use its exact `payload`. Orders awaiting collection can be eligible when the marketplace permits it. For other actions, supply any fields marked `requiresInput`.
3005
3007
  *
3006
3008
  * `GET /api/v1/orders/actions`
3007
3009
  */
@@ -3024,11 +3026,9 @@ var OrdersClient = class {
3024
3026
 
3025
3027
  ### Batch submission
3026
3028
 
3027
- Queue 1–50 distinct order operations with a UUID requestId. Each operation has orderId, action (ship, cancel, labels or update_tracking), and optional payload. Use exact marketplace choices from GET /api/v1/orders/actions and supply required carrier, tracking, pickup/drop-off or cancellation details. One operation per order is allowed in a batch; later stages such as labels after shipment require another submission. All targets are authorized before any enqueue. Per-order failures are isolated; results retain request order and include every accepted jobId. data.success means all submissions were accepted, not that marketplace processing finished.
3028
-
3029
- ### Recovery and completion
3029
+ Queue 1–50 distinct orders with a UUID `requestId` and one operation per order. Each operation carries an `orderId`, `action`, and any marketplace inputs in `payload`. For `cancel`, send the reviewed reason's exact payload from GET /api/v1/orders/actions. All targets are authorized before enqueue. Per-order results preserve request order and report acceptance or errors.
3030
3030
 
3031
- Retain requestId and unchanged operations for retr
3031
+ Retain `requestId` and unchanged operations for retries. Follow `links.poll` with every returned job ID to check the marketplace outcomes. The worker rechecks permissions before each marketplace write.
3032
3032
  *
3033
3033
  * `POST /api/v1/orders/actions`
3034
3034
  */
@@ -3051,7 +3051,7 @@ var OrdersClient = class {
3051
3051
 
3052
3052
  ### Outcomes and labels
3053
3053
 
3054
- Read every requested order action job in one batch of 1–50 UUIDs using repeated jobIds parameters. Results preserve first-requested order. data.success is true only when every requested job succeeded; failedCount includes failed and not_supported, while pendingCount includes queued and running. Successful label jobs contain downloadable files in labels[]. A missing or cross-organization job returns 404; current store restrictions apply to all targets. The top-level completed status describes the lookup, not job completion. No raw provider acknowledgements are exposed.
3054
+ Read 1–50 jobs using repeated `jobIds` parameters. Results preserve first-requested order. `data.success` requires every job to succeed. `pendingCount` includes queued and running jobs. `failedCount` includes failed and unsupported jobs. Amazon cancellations can stay running while its feed is processed. Successful label jobs return download links. A missing or cross-organization job returns 404. Current store restrictions apply.
3055
3055
  *
3056
3056
  * `GET /api/v1/orders/actions/jobs`
3057
3057
  */
@@ -3579,14 +3579,11 @@ var ProductsClient = class {
3579
3579
  *
3580
3580
  * Queue a bulk product import for the authenticated organization.
3581
3581
 
3582
- Supply explicit SKU options in each row's `variationAttributes` and native marketplace attributes in `marketplaceAttributes`. Enrichment never infers SKU options. At Zalora publish time, a missing required Size defaults to One Size only when valid for the selected category and supplied size system. Supplied sizes are preserved; missing or incompatible size systems and other required options block publishing. Each row remains a standalone product; no child variants are created for the default.
3582
+ ### Destinations
3583
3583
 
3584
- ### Input options
3584
+ Supply targetMarketplaces and marketplaceStoreSelections to prepare for specific connected stores. Set deferStoreSelection=true to choose marketplaces only and assign stores later with POST /api/v1/products/marketplace-stores. Omit marketplaceStoreSelections and leave workflow.publish off when deferring. Automatic publishing requires catalog:sync in addition to catalog:write.
3585
3585
 
3586
- - Upload a CSV (2 MiB) or JSON products file (8 MiB) using `multipart/form-data`.
3587
- - Send JSON with a `products` array of 1–5,000 flat product objects (8 MiB request maximum).
3588
- - Send JSON with inline `csvText`.
3589
- - Send
3586
+ Supply explicit SKU options in each row's `variationAttributes` and native marketplace attributes in `marketplaceAttributes`. Enrichment never infers SKU options. At Zalora publish time, a missing required Size defaults to One Size only when valid for the selected category and supplied size system. Supplied sizes are preserved; missing
3590
3587
  *
3591
3588
  * `POST /api/v1/products/bulk-import`
3592
3589
  */
@@ -3649,12 +3646,14 @@ var ProductsClient = class {
3649
3646
  });
3650
3647
  }
3651
3648
  /**
3652
- * Get Bulk Product Update Options
3653
- *
3654
- * List the same active stock-file-capable sources as Omni Bulk Update, including manual warehouses and supported CSV sources. Requires catalog:read and inventory.read. Resolve a sourceId from this organization-scoped result before starting inventory/both updates; an ambiguous choice requires seller selection.
3655
- *
3656
- * `GET /api/v1/products/bulk-update`
3657
- */
3649
+ * Get Bulk Product Update Options
3650
+ *
3651
+ * List active stock-file sources used by Omni Bulk Update, including manual warehouses and supported CSV sources. Requires catalog:read and inventory.read.
3652
+
3653
+ Use an eligible sourceId before starting inventory updates. Ask the seller to choose when multiple sources are eligible.
3654
+ *
3655
+ * `GET /api/v1/products/bulk-update`
3656
+ */
3658
3657
  bulkUpdateOptions(request = {}, requestOptions) {
3659
3658
  const { organizationId } = request ?? {};
3660
3659
  return this._http.request({
@@ -3666,12 +3665,20 @@ var ProductsClient = class {
3666
3665
  });
3667
3666
  }
3668
3667
  /**
3669
- * Bulk Update Product Prices and Stock
3670
- *
3671
- * Update existing catalog SKUs from 1–10 uploaded CSV/Excel documentIds (up to 10,000 rows per file), using the same price and inventory import services as Omni Bulk Update. Requires catalog:write and the corresponding product/inventory capabilities. No product creation. Exact SKU matching rejects duplicate/ambiguous and unknown SKUs; zero values are preserved. Inventory requires an authorized manual/CSV sourceId or locationId. Explicit column names override detection. syncToMarketplaces defaults true; optional marketplaces restricts existing listing sync across supported platforms. Returns ordered per-document results and saved imports references. Updates continue through the durable file-update workflow beyond the caller lifetime; acceptance is not completion. Pass every returned reference
3672
- *
3673
- * `POST /api/v1/products/bulk-update`
3674
- */
3668
+ * Bulk Update Product Prices and Stock
3669
+ *
3670
+ * Update existing catalog SKUs from 1–10 uploaded CSV or Excel documentIds, with up to 10,000 rows per file. Requires catalog:write and the corresponding product or inventory capabilities.
3671
+
3672
+ ### File and source selection
3673
+
3674
+ Exact SKU matching preserves zero values and rejects duplicate, ambiguous, or unknown SKUs. Inventory needs an authorized manual or CSV sourceId or locationId. Explicit column names override detection. syncToMarketplaces defaults to true. Use marketplaces to limit which existing listings are synced.
3675
+
3676
+ ### Track the results
3677
+
3678
+ Pass every saved import reference to products.bulkUpdateStatus. Results preserve document order. The workflow runs after the request returns. Applied inventory means source balances were saved and listing sync was queued.
3679
+ *
3680
+ * `POST /api/v1/products/bulk-update`
3681
+ */
3675
3682
  bulkUpdate(request, requestOptions) {
3676
3683
  const { ...body } = request ?? {};
3677
3684
  return this._http.request({
@@ -3683,12 +3690,14 @@ var ProductsClient = class {
3683
3690
  });
3684
3691
  }
3685
3692
  /**
3686
- * Get Bulk Product Update Status
3687
- *
3688
- * Read up to 20 typed saved imports in requested order. Requires catalog:read and the corresponding product/inventory read capabilities. IDs are deduplicated by kind and importId. Pending imports are incomplete; invalid/unknown rows and missing organization-scoped imports remain explicit failures. Compact by default; includeRows returns at most 100 rows per import using rowOffset/rowLimit. Catalog stock apply does not certify marketplace state.
3689
- *
3690
- * `POST /api/v1/products/bulk-update/status`
3691
- */
3693
+ * Get Bulk Product Update Status
3694
+ *
3695
+ * Read up to 20 saved imports in request order. Requires catalog:read and the corresponding product or inventory read capabilities. Imports are deduplicated by kind and importId.
3696
+
3697
+ Pending imports are incomplete. Results report invalid or unknown rows and missing organization-scoped imports. Use includeRows with rowOffset and rowLimit for up to 100 rows per import. The result describes saved catalog stock.
3698
+ *
3699
+ * `POST /api/v1/products/bulk-update/status`
3700
+ */
3692
3701
  bulkUpdateStatus(request, requestOptions) {
3693
3702
  const { ...body } = request ?? {};
3694
3703
  return this._http.request({
@@ -3918,9 +3927,7 @@ var ProductsClient = class {
3918
3927
 
3919
3928
  ### Enrichment options
3920
3929
 
3921
- Fields, instructions and auto-apply settings use the canonical enrichment service. Exclude name from selectedFields to preserve titles. Weight and dimensions are always included; images are not queued here. Optional marketplaceStoreSelections maps each marketplace to an array of connected store IDs. Multiple stores on one marketplace get independent category and attribute reviews in the same review group. Set includeListingCopy=false for taxonomy only. Store countries come from the authenticated organization connections.
3922
-
3923
- autoApplyHighConfidence defaults to false.
3930
+ Fields, instructions and auto-apply settings use the canonical enrichment service. Exclude name from selectedFields to preserve titles. Weight and dimensions are always included; images are not queued here. Optional marketplaceStoreSelections maps each marketplace to an array of connected store IDs. Multiple stores on one marketplace get independent category and attribute reviews in the same review group. Set includeListingCopy=false for taxonomy only. Store countries come from the authenticated organization connections. Use deferredMarketplaces to enrich product
3924
3931
  *
3925
3932
  * `POST /api/v1/products/enrich`
3926
3933
  */
@@ -3934,6 +3941,31 @@ var ProductsClient = class {
3934
3941
  ...mergeRequestOptions(requestOptions)
3935
3942
  });
3936
3943
  }
3944
+ /**
3945
+ * Assign Product Marketplace Stores
3946
+ *
3947
+ * Requires catalog:write. Assign one or more connected stores per marketplace to 1–100 products, including marketplace-only drafts. Get exact store IDs and countries from GET /api/v1/marketplaces/connected.
3948
+
3949
+ ### Store selection
3950
+
3951
+ Each product family is updated independently. Existing listings keep their remote identities. Reusing a store ID across countries requires storeCountries to identify the connection. Each product can use only one country per store ID. Copy compatible taxonomy from an existing sourceStoreId when supplied.
3952
+
3953
+ ### Publish assigned stores
3954
+
3955
+ The response includes exact data.storeTargets for publishing the successful products. HTTP 207 means at least one product failed. Inspect each result before passing those storeTargets to POST /api/v1/products/{productId}/publish.
3956
+ *
3957
+ * `POST /api/v1/products/marketplace-stores`
3958
+ */
3959
+ assignMarketplaceStores(request, requestOptions) {
3960
+ const { ...body } = request ?? {};
3961
+ return this._http.request({
3962
+ method: "POST",
3963
+ path: "/api/v1/products/marketplace-stores",
3964
+ query: void 0,
3965
+ body,
3966
+ ...mergeRequestOptions(requestOptions)
3967
+ });
3968
+ }
3937
3969
  /** Read a bounded chunk without summary classification; persist progress to resume. */
3938
3970
  scan(request = {}, options) {
3939
3971
  return scanProducts(
@@ -4427,6 +4459,25 @@ var ReturnsClient = class {
4427
4459
  ...mergeRequestOptions(requestOptions)
4428
4460
  });
4429
4461
  }
4462
+ /**
4463
+ * Upload Return Rejection Evidence
4464
+ *
4465
+ * Requires `orders:write`. For a rejection choice with `input.evidenceUpload: true`, upload one JPEG or PNG image up to 5 MB.
4466
+
4467
+ Use the receipt and filename in `input.evidence` when submitting the reviewed rejection. A rejection can include up to six images. Each receipt is scoped to its return and expires after 24 hours.
4468
+ *
4469
+ * `POST /api/v1/returns/{returnId}/evidence`
4470
+ */
4471
+ uploadEvidence(request, requestOptions) {
4472
+ const { returnId, organizationId, ...body } = request ?? {};
4473
+ return this._http.request({
4474
+ method: "POST",
4475
+ path: `/api/v1/returns/${encodePathParam("returnId", returnId)}/evidence`,
4476
+ query: { organizationId },
4477
+ body: toMultipartBody(body),
4478
+ ...mergeRequestOptions(requestOptions)
4479
+ });
4480
+ }
4430
4481
  /**
4431
4482
  * Check Return Actions
4432
4483
  *