@omni-commerce/sdk 0.23.0 → 0.24.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
@@ -1,5 +1,7 @@
1
1
  # @omni-commerce/sdk
2
2
 
3
+ SDK 0.24.0 adds typed refund and rejection inputs, return evidence uploads, and separate order refund and physical receipt status.
4
+
3
5
  SDK 0.23.0 adds `products.bulkUpdate` and `bulkUpdateStatus` for durable price and stock file updates using the same services as Omni Bulk Update. Up to 10 uploaded documents, 10,000 rows each; pass every returned import reference to the batch status method.
4
6
 
5
7
  SDK 0.22.0 adds duplicate discovery, master eligibility and server-side merge dry runs. Use `products.scanDuplicates`, `getDuplicateScan`,
package/dist/index.cjs CHANGED
@@ -35,7 +35,7 @@ function normalizeClientOptions(options = {}) {
35
35
  }
36
36
 
37
37
  // src/version.ts
38
- var SDK_VERSION = "0.23.0";
38
+ var SDK_VERSION = "0.24.0";
39
39
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
40
40
 
41
41
  // src/environments.ts
@@ -2940,9 +2940,9 @@ var OrdersClient = class {
2940
2940
  /**
2941
2941
  * Get Order Action Options
2942
2942
  *
2943
- * 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`.
2944
2944
 
2945
- 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`.
2946
2946
  *
2947
2947
  * `GET /api/v1/orders/{orderId}/action-options`
2948
2948
  */
@@ -2961,7 +2961,7 @@ var OrdersClient = class {
2961
2961
  *
2962
2962
  * The order's 20 most recent action jobs, newest first, plus its latest successful label job. Requires `orders:read`.
2963
2963
 
2964
- 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`.
2965
2965
  *
2966
2966
  * `GET /api/v1/orders/{orderId}/actions`
2967
2967
  */
@@ -2980,7 +2980,7 @@ var OrdersClient = class {
2980
2980
  *
2981
2981
  * Ship, cancel, generate shipping labels for, or update tracking on a marketplace order. Requires `orders:write`.
2982
2982
 
2983
- 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.
2984
2984
  *
2985
2985
  * `POST /api/v1/orders/{orderId}/actions`
2986
2986
  */
@@ -3003,7 +3003,7 @@ var OrdersClient = class {
3003
3003
 
3004
3004
  ### Choices
3005
3005
 
3006
- 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`.
3007
3007
  *
3008
3008
  * `GET /api/v1/orders/actions`
3009
3009
  */
@@ -3026,11 +3026,9 @@ var OrdersClient = class {
3026
3026
 
3027
3027
  ### Batch submission
3028
3028
 
3029
- 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.
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
- ### Recovery and completion
3032
-
3033
- 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.
3034
3032
  *
3035
3033
  * `POST /api/v1/orders/actions`
3036
3034
  */
@@ -3053,7 +3051,7 @@ var OrdersClient = class {
3053
3051
 
3054
3052
  ### Outcomes and labels
3055
3053
 
3056
- 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.
3057
3055
  *
3058
3056
  * `GET /api/v1/orders/actions/jobs`
3059
3057
  */
@@ -3651,12 +3649,14 @@ var ProductsClient = class {
3651
3649
  });
3652
3650
  }
3653
3651
  /**
3654
- * Get Bulk Product Update Options
3655
- *
3656
- * 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.
3657
- *
3658
- * `GET /api/v1/products/bulk-update`
3659
- */
3652
+ * Get Bulk Product Update Options
3653
+ *
3654
+ * List active stock-file sources used by Omni Bulk Update, including manual warehouses and supported CSV sources. Requires catalog:read and inventory.read.
3655
+
3656
+ Use an eligible sourceId before starting inventory updates. Ask the seller to choose when multiple sources are eligible.
3657
+ *
3658
+ * `GET /api/v1/products/bulk-update`
3659
+ */
3660
3660
  bulkUpdateOptions(request = {}, requestOptions) {
3661
3661
  const { organizationId } = request ?? {};
3662
3662
  return this._http.request({
@@ -3668,12 +3668,20 @@ var ProductsClient = class {
3668
3668
  });
3669
3669
  }
3670
3670
  /**
3671
- * Bulk Update Product Prices and Stock
3672
- *
3673
- * 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
3674
- *
3675
- * `POST /api/v1/products/bulk-update`
3676
- */
3671
+ * Bulk Update Product Prices and Stock
3672
+ *
3673
+ * 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.
3674
+
3675
+ ### File and source selection
3676
+
3677
+ 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.
3678
+
3679
+ ### Track the results
3680
+
3681
+ 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.
3682
+ *
3683
+ * `POST /api/v1/products/bulk-update`
3684
+ */
3677
3685
  bulkUpdate(request, requestOptions) {
3678
3686
  const { ...body } = request ?? {};
3679
3687
  return this._http.request({
@@ -3685,12 +3693,14 @@ var ProductsClient = class {
3685
3693
  });
3686
3694
  }
3687
3695
  /**
3688
- * Get Bulk Product Update Status
3689
- *
3690
- * 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.
3691
- *
3692
- * `POST /api/v1/products/bulk-update/status`
3693
- */
3696
+ * Get Bulk Product Update Status
3697
+ *
3698
+ * 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.
3699
+
3700
+ 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.
3701
+ *
3702
+ * `POST /api/v1/products/bulk-update/status`
3703
+ */
3694
3704
  bulkUpdateStatus(request, requestOptions) {
3695
3705
  const { ...body } = request ?? {};
3696
3706
  return this._http.request({
@@ -4429,6 +4439,25 @@ var ReturnsClient = class {
4429
4439
  ...mergeRequestOptions(requestOptions)
4430
4440
  });
4431
4441
  }
4442
+ /**
4443
+ * Upload Return Rejection Evidence
4444
+ *
4445
+ * Requires `orders:write`. For a rejection choice with `input.evidenceUpload: true`, upload one JPEG or PNG image up to 5 MB.
4446
+
4447
+ 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.
4448
+ *
4449
+ * `POST /api/v1/returns/{returnId}/evidence`
4450
+ */
4451
+ uploadEvidence(request, requestOptions) {
4452
+ const { returnId, organizationId, ...body } = request ?? {};
4453
+ return this._http.request({
4454
+ method: "POST",
4455
+ path: `/api/v1/returns/${encodePathParam("returnId", returnId)}/evidence`,
4456
+ query: { organizationId },
4457
+ body: toMultipartBody(body),
4458
+ ...mergeRequestOptions(requestOptions)
4459
+ });
4460
+ }
4432
4461
  /**
4433
4462
  * Check Return Actions
4434
4463
  *