@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/README.md +4 -0
- package/dist/index.cjs +89 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +677 -48
- package/dist/index.d.ts +677 -48
- package/dist/index.js +89 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @omni-commerce/sdk
|
|
2
2
|
|
|
3
|
+
SDK 0.25.0 supports marketplace-only bulk import and enrichment, later store assignment with `products.assignMarketplaceStores`, and publishing to those exact stores.
|
|
4
|
+
|
|
5
|
+
SDK 0.24.0 adds typed refund and rejection inputs, return evidence uploads, and separate order refund and physical receipt status.
|
|
6
|
+
|
|
3
7
|
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
8
|
|
|
5
9
|
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.
|
|
38
|
+
var SDK_VERSION = "0.25.0";
|
|
39
39
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
40
40
|
|
|
41
41
|
// src/environments.ts
|
|
@@ -2499,6 +2499,8 @@ var JobsClient = class {
|
|
|
2499
2499
|
*
|
|
2500
2500
|
* 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.
|
|
2501
2501
|
|
|
2502
|
+
Marketplace-only bulk imports expose data.deferStoreSelection: true. For imports with automatic publishing enabled, inspect data.publishing for per-store results.
|
|
2503
|
+
|
|
2502
2504
|
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.
|
|
2503
2505
|
*
|
|
2504
2506
|
* `GET /api/v1/jobs/{jobId}`
|
|
@@ -2940,9 +2942,9 @@ var OrdersClient = class {
|
|
|
2940
2942
|
/**
|
|
2941
2943
|
* Get Order Action Options
|
|
2942
2944
|
*
|
|
2943
|
-
*
|
|
2945
|
+
* 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
2946
|
|
|
2945
|
-
|
|
2947
|
+
Review the selected reason or fulfillment choice and send its exact `payload` with `POST /api/v1/orders/{orderId}/actions`.
|
|
2946
2948
|
*
|
|
2947
2949
|
* `GET /api/v1/orders/{orderId}/action-options`
|
|
2948
2950
|
*/
|
|
@@ -2961,7 +2963,7 @@ var OrdersClient = class {
|
|
|
2961
2963
|
*
|
|
2962
2964
|
* The order's 20 most recent action jobs, newest first, plus its latest successful label job. Requires `orders:read`.
|
|
2963
2965
|
|
|
2964
|
-
|
|
2966
|
+
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
2967
|
*
|
|
2966
2968
|
* `GET /api/v1/orders/{orderId}/actions`
|
|
2967
2969
|
*/
|
|
@@ -2980,7 +2982,7 @@ var OrdersClient = class {
|
|
|
2980
2982
|
*
|
|
2981
2983
|
* Ship, cancel, generate shipping labels for, or update tracking on a marketplace order. Requires `orders:write`.
|
|
2982
2984
|
|
|
2983
|
-
The marketplace call runs in the background
|
|
2985
|
+
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
2986
|
*
|
|
2985
2987
|
* `POST /api/v1/orders/{orderId}/actions`
|
|
2986
2988
|
*/
|
|
@@ -3003,7 +3005,7 @@ var OrdersClient = class {
|
|
|
3003
3005
|
|
|
3004
3006
|
### Choices
|
|
3005
3007
|
|
|
3006
|
-
Read
|
|
3008
|
+
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
3009
|
*
|
|
3008
3010
|
* `GET /api/v1/orders/actions`
|
|
3009
3011
|
*/
|
|
@@ -3026,11 +3028,9 @@ var OrdersClient = class {
|
|
|
3026
3028
|
|
|
3027
3029
|
### Batch submission
|
|
3028
3030
|
|
|
3029
|
-
Queue 1–50 distinct
|
|
3030
|
-
|
|
3031
|
-
### Recovery and completion
|
|
3031
|
+
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.
|
|
3032
3032
|
|
|
3033
|
-
Retain requestId and unchanged operations for
|
|
3033
|
+
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
3034
|
*
|
|
3035
3035
|
* `POST /api/v1/orders/actions`
|
|
3036
3036
|
*/
|
|
@@ -3053,7 +3053,7 @@ var OrdersClient = class {
|
|
|
3053
3053
|
|
|
3054
3054
|
### Outcomes and labels
|
|
3055
3055
|
|
|
3056
|
-
Read
|
|
3056
|
+
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
3057
|
*
|
|
3058
3058
|
* `GET /api/v1/orders/actions/jobs`
|
|
3059
3059
|
*/
|
|
@@ -3581,14 +3581,11 @@ var ProductsClient = class {
|
|
|
3581
3581
|
*
|
|
3582
3582
|
* Queue a bulk product import for the authenticated organization.
|
|
3583
3583
|
|
|
3584
|
-
|
|
3584
|
+
### Destinations
|
|
3585
3585
|
|
|
3586
|
-
|
|
3586
|
+
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.
|
|
3587
3587
|
|
|
3588
|
-
|
|
3589
|
-
- Send JSON with a `products` array of 1–5,000 flat product objects (8 MiB request maximum).
|
|
3590
|
-
- Send JSON with inline `csvText`.
|
|
3591
|
-
- Send
|
|
3588
|
+
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
|
|
3592
3589
|
*
|
|
3593
3590
|
* `POST /api/v1/products/bulk-import`
|
|
3594
3591
|
*/
|
|
@@ -3651,12 +3648,14 @@ var ProductsClient = class {
|
|
|
3651
3648
|
});
|
|
3652
3649
|
}
|
|
3653
3650
|
/**
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3651
|
+
* Get Bulk Product Update Options
|
|
3652
|
+
*
|
|
3653
|
+
* List active stock-file sources used by Omni Bulk Update, including manual warehouses and supported CSV sources. Requires catalog:read and inventory.read.
|
|
3654
|
+
|
|
3655
|
+
Use an eligible sourceId before starting inventory updates. Ask the seller to choose when multiple sources are eligible.
|
|
3656
|
+
*
|
|
3657
|
+
* `GET /api/v1/products/bulk-update`
|
|
3658
|
+
*/
|
|
3660
3659
|
bulkUpdateOptions(request = {}, requestOptions) {
|
|
3661
3660
|
const { organizationId } = request ?? {};
|
|
3662
3661
|
return this._http.request({
|
|
@@ -3668,12 +3667,20 @@ var ProductsClient = class {
|
|
|
3668
3667
|
});
|
|
3669
3668
|
}
|
|
3670
3669
|
/**
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3670
|
+
* Bulk Update Product Prices and Stock
|
|
3671
|
+
*
|
|
3672
|
+
* 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.
|
|
3673
|
+
|
|
3674
|
+
### File and source selection
|
|
3675
|
+
|
|
3676
|
+
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.
|
|
3677
|
+
|
|
3678
|
+
### Track the results
|
|
3679
|
+
|
|
3680
|
+
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.
|
|
3681
|
+
*
|
|
3682
|
+
* `POST /api/v1/products/bulk-update`
|
|
3683
|
+
*/
|
|
3677
3684
|
bulkUpdate(request, requestOptions) {
|
|
3678
3685
|
const { ...body } = request ?? {};
|
|
3679
3686
|
return this._http.request({
|
|
@@ -3685,12 +3692,14 @@ var ProductsClient = class {
|
|
|
3685
3692
|
});
|
|
3686
3693
|
}
|
|
3687
3694
|
/**
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3695
|
+
* Get Bulk Product Update Status
|
|
3696
|
+
*
|
|
3697
|
+
* 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.
|
|
3698
|
+
|
|
3699
|
+
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.
|
|
3700
|
+
*
|
|
3701
|
+
* `POST /api/v1/products/bulk-update/status`
|
|
3702
|
+
*/
|
|
3694
3703
|
bulkUpdateStatus(request, requestOptions) {
|
|
3695
3704
|
const { ...body } = request ?? {};
|
|
3696
3705
|
return this._http.request({
|
|
@@ -3920,9 +3929,7 @@ var ProductsClient = class {
|
|
|
3920
3929
|
|
|
3921
3930
|
### Enrichment options
|
|
3922
3931
|
|
|
3923
|
-
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.
|
|
3924
|
-
|
|
3925
|
-
autoApplyHighConfidence defaults to false.
|
|
3932
|
+
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
|
|
3926
3933
|
*
|
|
3927
3934
|
* `POST /api/v1/products/enrich`
|
|
3928
3935
|
*/
|
|
@@ -3936,6 +3943,31 @@ var ProductsClient = class {
|
|
|
3936
3943
|
...mergeRequestOptions(requestOptions)
|
|
3937
3944
|
});
|
|
3938
3945
|
}
|
|
3946
|
+
/**
|
|
3947
|
+
* Assign Product Marketplace Stores
|
|
3948
|
+
*
|
|
3949
|
+
* 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.
|
|
3950
|
+
|
|
3951
|
+
### Store selection
|
|
3952
|
+
|
|
3953
|
+
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.
|
|
3954
|
+
|
|
3955
|
+
### Publish assigned stores
|
|
3956
|
+
|
|
3957
|
+
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.
|
|
3958
|
+
*
|
|
3959
|
+
* `POST /api/v1/products/marketplace-stores`
|
|
3960
|
+
*/
|
|
3961
|
+
assignMarketplaceStores(request, requestOptions) {
|
|
3962
|
+
const { ...body } = request ?? {};
|
|
3963
|
+
return this._http.request({
|
|
3964
|
+
method: "POST",
|
|
3965
|
+
path: "/api/v1/products/marketplace-stores",
|
|
3966
|
+
query: void 0,
|
|
3967
|
+
body,
|
|
3968
|
+
...mergeRequestOptions(requestOptions)
|
|
3969
|
+
});
|
|
3970
|
+
}
|
|
3939
3971
|
/** Read a bounded chunk without summary classification; persist progress to resume. */
|
|
3940
3972
|
scan(request = {}, options) {
|
|
3941
3973
|
return scanProducts(
|
|
@@ -4429,6 +4461,25 @@ var ReturnsClient = class {
|
|
|
4429
4461
|
...mergeRequestOptions(requestOptions)
|
|
4430
4462
|
});
|
|
4431
4463
|
}
|
|
4464
|
+
/**
|
|
4465
|
+
* Upload Return Rejection Evidence
|
|
4466
|
+
*
|
|
4467
|
+
* Requires `orders:write`. For a rejection choice with `input.evidenceUpload: true`, upload one JPEG or PNG image up to 5 MB.
|
|
4468
|
+
|
|
4469
|
+
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.
|
|
4470
|
+
*
|
|
4471
|
+
* `POST /api/v1/returns/{returnId}/evidence`
|
|
4472
|
+
*/
|
|
4473
|
+
uploadEvidence(request, requestOptions) {
|
|
4474
|
+
const { returnId, organizationId, ...body } = request ?? {};
|
|
4475
|
+
return this._http.request({
|
|
4476
|
+
method: "POST",
|
|
4477
|
+
path: `/api/v1/returns/${encodePathParam("returnId", returnId)}/evidence`,
|
|
4478
|
+
query: { organizationId },
|
|
4479
|
+
body: toMultipartBody(body),
|
|
4480
|
+
...mergeRequestOptions(requestOptions)
|
|
4481
|
+
});
|
|
4482
|
+
}
|
|
4432
4483
|
/**
|
|
4433
4484
|
* Check Return Actions
|
|
4434
4485
|
*
|