@commercengine/storefront-sdk 0.13.2 → 0.13.4
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.d.mts +160 -67
- package/dist/index.iife.js +64 -17
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +64 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -962,7 +962,7 @@ interface paths {
|
|
|
962
962
|
patch?: never;
|
|
963
963
|
trace?: never;
|
|
964
964
|
};
|
|
965
|
-
"/catalog/marketplace/products/{
|
|
965
|
+
"/catalog/marketplace/products/{product_id}": {
|
|
966
966
|
parameters: {
|
|
967
967
|
query?: never;
|
|
968
968
|
header?: never;
|
|
@@ -971,7 +971,7 @@ interface paths {
|
|
|
971
971
|
};
|
|
972
972
|
/**
|
|
973
973
|
* Retrieve a product detail
|
|
974
|
-
* @description Retrieves the details of an existing product.
|
|
974
|
+
* @description Retrieves the details of an existing marketplace product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product information.
|
|
975
975
|
*/
|
|
976
976
|
get: operations["get-marketplace-product-detail"];
|
|
977
977
|
put?: never;
|
|
@@ -1015,7 +1015,7 @@ interface paths {
|
|
|
1015
1015
|
};
|
|
1016
1016
|
/**
|
|
1017
1017
|
* Retrieve product variants
|
|
1018
|
-
* @description Retrieves the variants of an existing product.
|
|
1018
|
+
* @description Retrieves the variants of an existing marketplace product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product variants information.
|
|
1019
1019
|
*/
|
|
1020
1020
|
get: operations["list-marketplace-product-variants"];
|
|
1021
1021
|
put?: never;
|
|
@@ -1035,7 +1035,7 @@ interface paths {
|
|
|
1035
1035
|
};
|
|
1036
1036
|
/**
|
|
1037
1037
|
* Retrieve variant detail
|
|
1038
|
-
* @description Retrieves the details of a particular variant.
|
|
1038
|
+
* @description Retrieves the details of a particular marketplace variant. Product slug is supported in place of product ID, and variant slug in place of variant ID, in the path.
|
|
1039
1039
|
*/
|
|
1040
1040
|
get: operations["get-marketplace-variant-detail"];
|
|
1041
1041
|
put?: never;
|
|
@@ -1166,7 +1166,7 @@ interface paths {
|
|
|
1166
1166
|
patch?: never;
|
|
1167
1167
|
trace?: never;
|
|
1168
1168
|
};
|
|
1169
|
-
"/catalog/products/{
|
|
1169
|
+
"/catalog/products/{product_id}": {
|
|
1170
1170
|
parameters: {
|
|
1171
1171
|
query?: never;
|
|
1172
1172
|
header?: never;
|
|
@@ -1175,7 +1175,7 @@ interface paths {
|
|
|
1175
1175
|
};
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Retrieve a product detail
|
|
1178
|
-
* @description Retrieves the details of an existing product.
|
|
1178
|
+
* @description Retrieves the details of an existing product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product information.
|
|
1179
1179
|
*/
|
|
1180
1180
|
get: operations["get-product-detail"];
|
|
1181
1181
|
put?: never;
|
|
@@ -1219,7 +1219,7 @@ interface paths {
|
|
|
1219
1219
|
};
|
|
1220
1220
|
/**
|
|
1221
1221
|
* Retrieve product variants
|
|
1222
|
-
* @description Retrieves the variants of an existing product.
|
|
1222
|
+
* @description Retrieves the variants of an existing product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product variants information.
|
|
1223
1223
|
*/
|
|
1224
1224
|
get: operations["list-product-variants"];
|
|
1225
1225
|
put?: never;
|
|
@@ -1239,7 +1239,7 @@ interface paths {
|
|
|
1239
1239
|
};
|
|
1240
1240
|
/**
|
|
1241
1241
|
* Retrieve variant detail
|
|
1242
|
-
* @description Retrieves the details of a particular variant.
|
|
1242
|
+
* @description Retrieves the details of a particular variant. Product slug is supported in place of product ID, and variant slug in place of variant ID, in the path.
|
|
1243
1243
|
*/
|
|
1244
1244
|
get: operations["get-variant-detail"];
|
|
1245
1245
|
put?: never;
|
|
@@ -2575,7 +2575,7 @@ interface paths {
|
|
|
2575
2575
|
patch?: never;
|
|
2576
2576
|
trace?: never;
|
|
2577
2577
|
};
|
|
2578
|
-
"/pos/catalog/products/{
|
|
2578
|
+
"/pos/catalog/products/{product_id}": {
|
|
2579
2579
|
parameters: {
|
|
2580
2580
|
query?: never;
|
|
2581
2581
|
header?: never;
|
|
@@ -2584,7 +2584,7 @@ interface paths {
|
|
|
2584
2584
|
};
|
|
2585
2585
|
/**
|
|
2586
2586
|
* Retrieve a product detail
|
|
2587
|
-
* @description Retrieves the details of an existing product.
|
|
2587
|
+
* @description Retrieves the details of an existing product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product information.
|
|
2588
2588
|
*/
|
|
2589
2589
|
get: operations["pos-get-product-detail"];
|
|
2590
2590
|
put?: never;
|
|
@@ -2624,7 +2624,7 @@ interface paths {
|
|
|
2624
2624
|
};
|
|
2625
2625
|
/**
|
|
2626
2626
|
* Retrieve product variants
|
|
2627
|
-
* @description Retrieves the variants of an existing product.
|
|
2627
|
+
* @description Retrieves the variants of an existing product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product variants information.
|
|
2628
2628
|
*/
|
|
2629
2629
|
get: operations["pos-list-product-variants"];
|
|
2630
2630
|
put?: never;
|
|
@@ -2644,7 +2644,7 @@ interface paths {
|
|
|
2644
2644
|
};
|
|
2645
2645
|
/**
|
|
2646
2646
|
* Retrieve variant detail
|
|
2647
|
-
* @description Retrieves the details of a particular variant.
|
|
2647
|
+
* @description Retrieves the details of a particular variant. Product slug is supported in place of product ID, and variant slug in place of variant ID, in the path.
|
|
2648
2648
|
*/
|
|
2649
2649
|
get: operations["pos-get-variant-detail"];
|
|
2650
2650
|
put?: never;
|
|
@@ -4065,7 +4065,8 @@ interface components {
|
|
|
4065
4065
|
product_id: string;
|
|
4066
4066
|
variant_id: string | null;
|
|
4067
4067
|
sku: string;
|
|
4068
|
-
|
|
4068
|
+
product_slug: string;
|
|
4069
|
+
variant_slug: string;
|
|
4069
4070
|
product_name: string;
|
|
4070
4071
|
variant_name: string | null;
|
|
4071
4072
|
/**
|
|
@@ -4079,7 +4080,8 @@ interface components {
|
|
|
4079
4080
|
backorder?: boolean;
|
|
4080
4081
|
on_subscription: boolean;
|
|
4081
4082
|
on_promotion: boolean;
|
|
4082
|
-
category_ids: string[];
|
|
4083
|
+
category_ids: string[]; /** @description Expanded category objects. */
|
|
4084
|
+
categories?: components["schemas"]["Category"][];
|
|
4083
4085
|
tags: string[] | null;
|
|
4084
4086
|
reviews_count: number;
|
|
4085
4087
|
reviews_rating_sum: number | null;
|
|
@@ -4475,12 +4477,20 @@ interface components {
|
|
|
4475
4477
|
* @description Loyalty Point Activity
|
|
4476
4478
|
*/
|
|
4477
4479
|
LoyaltyPointActivity: {
|
|
4478
|
-
/**
|
|
4479
|
-
|
|
4480
|
-
|
|
4480
|
+
/**
|
|
4481
|
+
* @description The action that occurred.
|
|
4482
|
+
* @enum {string}
|
|
4483
|
+
*/
|
|
4484
|
+
action?: "add" | "remove";
|
|
4485
|
+
/**
|
|
4486
|
+
* @description The activity that occurred.
|
|
4487
|
+
* @enum {string}
|
|
4488
|
+
*/
|
|
4489
|
+
activity?: "order-placed" | "credit-note-issued" | "tier-upgrade" | "tier-downgrade" | "points-expired" | "points-carryforward" | "signup" | "bonus" | "other";
|
|
4490
|
+
reference_number?: string | null;
|
|
4481
4491
|
title?: string;
|
|
4482
|
-
|
|
4483
|
-
remarks?: string; /** Format: date-time */
|
|
4492
|
+
loyalty_points?: number;
|
|
4493
|
+
remarks?: string | null; /** Format: date-time */
|
|
4484
4494
|
created_at?: string; /** Format: date-time */
|
|
4485
4495
|
modified_at?: string;
|
|
4486
4496
|
}; /** ManualPaymentMethod */
|
|
@@ -5388,17 +5398,55 @@ interface components {
|
|
|
5388
5398
|
* @description Maximum number of records returned for a page.
|
|
5389
5399
|
* @default 25
|
|
5390
5400
|
*/
|
|
5391
|
-
limit: number;
|
|
5401
|
+
limit: number; /** @description provide list of attributes for specific facets or * for all facets. All attributes supported in the filter parameter are also supported here. */
|
|
5402
|
+
facets?: string[];
|
|
5392
5403
|
/**
|
|
5393
|
-
* @description
|
|
5394
|
-
*
|
|
5395
|
-
*
|
|
5396
|
-
*
|
|
5397
|
-
*
|
|
5398
|
-
*
|
|
5399
|
-
*
|
|
5404
|
+
* @description Filter expression(s) to narrow results. Omit for no filtering.
|
|
5405
|
+
*
|
|
5406
|
+
* **Syntax:** `attribute OPERATOR value`
|
|
5407
|
+
*
|
|
5408
|
+
* **Operators:**
|
|
5409
|
+
*
|
|
5410
|
+
* | Operator | Description | Example |
|
|
5411
|
+
* |---|---|---|
|
|
5412
|
+
* | `=` | Equal to | `product_type = physical` |
|
|
5413
|
+
* | `!=` | Not equal to | `product_type != bundle` |
|
|
5414
|
+
* | `>`, `>=`, `<`, `<=` | Comparison | `rating > 4` |
|
|
5415
|
+
* | `TO` | Inclusive range (`>=` AND `<=`) | `pricing.selling_price 100 TO 500` |
|
|
5416
|
+
* | `IN [...]` | Matches any value in the list | `product_type IN [physical,bundle]` |
|
|
5417
|
+
* | `NOT IN [...]` | Excludes all values in the list | `product_type NOT IN [physical,bundle]` |
|
|
5418
|
+
* | `EXISTS` | Attribute is present (even if `null` or empty) | `tags EXISTS` |
|
|
5419
|
+
* | `NOT EXISTS` | Attribute is absent | `tags NOT EXISTS` |
|
|
5420
|
+
* | `IS NULL` | Value is `null` | `variant_id IS NULL` |
|
|
5421
|
+
* | `IS NOT NULL` | Value is not `null` | `variant_id IS NOT NULL` |
|
|
5422
|
+
* | `IS EMPTY` | Value is `""`, `[]`, or `{}` | `tags IS EMPTY` |
|
|
5423
|
+
* | `IS NOT EMPTY` | Value is not empty | `tags IS NOT EMPTY` |
|
|
5424
|
+
* | `AND` | Both conditions must match | `rating > 4 AND product_type = physical` |
|
|
5425
|
+
* | `OR` | Either condition must match | `product_type = physical OR product_type = bundle` |
|
|
5426
|
+
* | `NOT` | Negates a condition | `NOT product_type = bundle` |
|
|
5427
|
+
*
|
|
5428
|
+
* **Important rules:**
|
|
5429
|
+
* - Operators are **case-sensitive** — must be uppercase (`AND`, not `and`).
|
|
5430
|
+
* - String value comparison is **case-insensitive** — `product_type = Physical` matches `physical`.
|
|
5431
|
+
* - Operator precedence: `NOT` > `AND` > `OR`. Use parentheses to override.
|
|
5432
|
+
* - String values containing whitespace must be wrapped in single quotes.
|
|
5433
|
+
* - `IN` takes comma-separated values in square brackets.
|
|
5434
|
+
* - Maximum array nesting depth is **2 levels**.
|
|
5435
|
+
*
|
|
5436
|
+
* **Supported attributes:** `product_type`, `categories.name`, `attributes.key`, `pricing.listing_price`, `pricing.selling_price`, `pricing.tax_rate`, `product_id`, `variant_id`, `product_name`, `variant_name`, `tags`, `sku`, `stock_available`, `rating`
|
|
5437
|
+
*
|
|
5438
|
+
* **Combining conditions:**
|
|
5439
|
+
* - **String:** Use `AND`/`OR` operators inline — `"rating > 4 AND product_type = physical"`
|
|
5440
|
+
* - **Array of strings:** Conditions are combined with AND — `["rating > 4", "product_type = physical"]`
|
|
5441
|
+
* - **Nested arrays:** Inner arrays express OR, outer array expresses AND — `["product_type = physical", ["product_type = bundle", "rating > 4"]]`
|
|
5400
5442
|
*/
|
|
5401
|
-
|
|
5443
|
+
filter?: string | (string | string[])[];
|
|
5444
|
+
/**
|
|
5445
|
+
* @description Sort results by attributes. Use `asc` for ascending order and `desc` for descending order.
|
|
5446
|
+
* @example product_type:desc
|
|
5447
|
+
* @example product_name:asc
|
|
5448
|
+
*/
|
|
5449
|
+
sort?: string[];
|
|
5402
5450
|
}; /** SellerDetail */
|
|
5403
5451
|
SellerDetail: components["schemas"]["SellerInfo"] & {
|
|
5404
5452
|
description?: string;
|
|
@@ -5426,7 +5474,6 @@ interface components {
|
|
|
5426
5474
|
count?: number;
|
|
5427
5475
|
}; /** Seo */
|
|
5428
5476
|
Seo: {
|
|
5429
|
-
slug: string;
|
|
5430
5477
|
title: string | null;
|
|
5431
5478
|
description: string | null;
|
|
5432
5479
|
keywords: string[] | null;
|
|
@@ -7868,7 +7915,7 @@ interface operations {
|
|
|
7868
7915
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
7869
7916
|
};
|
|
7870
7917
|
path: {
|
|
7871
|
-
/** @description
|
|
7918
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
|
|
7872
7919
|
};
|
|
7873
7920
|
cookie?: never;
|
|
7874
7921
|
};
|
|
@@ -7969,7 +8016,7 @@ interface operations {
|
|
|
7969
8016
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
7970
8017
|
};
|
|
7971
8018
|
path: {
|
|
7972
|
-
/** @description ID
|
|
8019
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
|
|
7973
8020
|
};
|
|
7974
8021
|
cookie?: never;
|
|
7975
8022
|
};
|
|
@@ -8002,7 +8049,7 @@ interface operations {
|
|
|
8002
8049
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
8003
8050
|
};
|
|
8004
8051
|
path: {
|
|
8005
|
-
/** @description product
|
|
8052
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string; /** @description Variant ID or variant slug. Either is accepted in the path. */
|
|
8006
8053
|
variant_id: string;
|
|
8007
8054
|
};
|
|
8008
8055
|
cookie?: never;
|
|
@@ -8260,7 +8307,7 @@ interface operations {
|
|
|
8260
8307
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
8261
8308
|
};
|
|
8262
8309
|
path: {
|
|
8263
|
-
/** @description
|
|
8310
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
|
|
8264
8311
|
};
|
|
8265
8312
|
cookie?: never;
|
|
8266
8313
|
};
|
|
@@ -8361,7 +8408,7 @@ interface operations {
|
|
|
8361
8408
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
8362
8409
|
};
|
|
8363
8410
|
path: {
|
|
8364
|
-
/** @description ID
|
|
8411
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
|
|
8365
8412
|
};
|
|
8366
8413
|
cookie?: never;
|
|
8367
8414
|
};
|
|
@@ -8394,7 +8441,7 @@ interface operations {
|
|
|
8394
8441
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
8395
8442
|
};
|
|
8396
8443
|
path: {
|
|
8397
|
-
/** @description product
|
|
8444
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string; /** @description Variant ID or variant slug. Either is accepted in the path. */
|
|
8398
8445
|
variant_id: string;
|
|
8399
8446
|
};
|
|
8400
8447
|
cookie?: never;
|
|
@@ -8993,7 +9040,6 @@ interface operations {
|
|
|
8993
9040
|
success?: boolean;
|
|
8994
9041
|
content?: {
|
|
8995
9042
|
loyalty?: components["schemas"]["CustomerLoyalty"];
|
|
8996
|
-
loyalty_point_balance?: number;
|
|
8997
9043
|
};
|
|
8998
9044
|
};
|
|
8999
9045
|
};
|
|
@@ -10883,7 +10929,7 @@ interface operations {
|
|
|
10883
10929
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
10884
10930
|
};
|
|
10885
10931
|
path: {
|
|
10886
|
-
/** @description
|
|
10932
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
|
|
10887
10933
|
};
|
|
10888
10934
|
cookie?: never;
|
|
10889
10935
|
};
|
|
@@ -10953,7 +10999,7 @@ interface operations {
|
|
|
10953
10999
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
10954
11000
|
};
|
|
10955
11001
|
path: {
|
|
10956
|
-
/** @description ID
|
|
11002
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
|
|
10957
11003
|
};
|
|
10958
11004
|
cookie?: never;
|
|
10959
11005
|
};
|
|
@@ -10986,7 +11032,7 @@ interface operations {
|
|
|
10986
11032
|
/** @description This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned. */"x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
|
|
10987
11033
|
};
|
|
10988
11034
|
path: {
|
|
10989
|
-
/** @description product
|
|
11035
|
+
/** @description Product ID or product slug. Either is accepted in the path. */product_id: string; /** @description Variant ID or variant slug. Either is accepted in the path. */
|
|
10990
11036
|
variant_id: string;
|
|
10991
11037
|
};
|
|
10992
11038
|
cookie?: never;
|
|
@@ -12731,11 +12777,11 @@ type ListMarketplaceUpsellProductsResponse = Readable<paths['/catalog/marketplac
|
|
|
12731
12777
|
type ListMarketplaceUpsellProductsContent = ListMarketplaceUpsellProductsResponse['content'];
|
|
12732
12778
|
type ListMarketplaceUpsellProductsQuery = paths['/catalog/marketplace/products/up-sell']['get']['parameters']['query'];
|
|
12733
12779
|
type ListMarketplaceUpsellProductsHeaderParams = paths['/catalog/marketplace/products/up-sell']['get']['parameters']['header'];
|
|
12734
|
-
type GetMarketplaceProductDetailResponse = Readable<paths['/catalog/marketplace/products/{
|
|
12780
|
+
type GetMarketplaceProductDetailResponse = Readable<paths['/catalog/marketplace/products/{product_id}']['get']['responses'][200]['content']['application/json']>;
|
|
12735
12781
|
type GetMarketplaceProductDetailContent = GetMarketplaceProductDetailResponse['content'];
|
|
12736
|
-
type GetMarketplaceProductDetailQuery = paths['/catalog/marketplace/products/{
|
|
12737
|
-
type GetMarketplaceProductDetailPathParams = paths['/catalog/marketplace/products/{
|
|
12738
|
-
type GetMarketplaceProductDetailHeaderParams = paths['/catalog/marketplace/products/{
|
|
12782
|
+
type GetMarketplaceProductDetailQuery = paths['/catalog/marketplace/products/{product_id}']['get']['parameters']['query'];
|
|
12783
|
+
type GetMarketplaceProductDetailPathParams = paths['/catalog/marketplace/products/{product_id}']['get']['parameters']['path'];
|
|
12784
|
+
type GetMarketplaceProductDetailHeaderParams = paths['/catalog/marketplace/products/{product_id}']['get']['parameters']['header'];
|
|
12739
12785
|
type ListMarketplaceProductReviewsResponse = Readable<paths['/catalog/marketplace/products/{product_id}/reviews']['get']['responses'][200]['content']['application/json']>;
|
|
12740
12786
|
type ListMarketplaceProductReviewsContent = ListMarketplaceProductReviewsResponse['content'];
|
|
12741
12787
|
type ListMarketplaceProductReviewsQuery = paths['/catalog/marketplace/products/{product_id}/reviews']['get']['parameters']['query'];
|
|
@@ -12777,11 +12823,11 @@ type ListUpsellProductsResponse = Readable<paths['/catalog/products/up-sell']['g
|
|
|
12777
12823
|
type ListUpsellProductsContent = ListUpsellProductsResponse['content'];
|
|
12778
12824
|
type ListUpsellProductsQuery = paths['/catalog/products/up-sell']['get']['parameters']['query'];
|
|
12779
12825
|
type ListUpsellProductsHeaderParams = paths['/catalog/products/up-sell']['get']['parameters']['header'];
|
|
12780
|
-
type GetProductDetailResponse = Readable<paths['/catalog/products/{
|
|
12826
|
+
type GetProductDetailResponse = Readable<paths['/catalog/products/{product_id}']['get']['responses'][200]['content']['application/json']>;
|
|
12781
12827
|
type GetProductDetailContent = GetProductDetailResponse['content'];
|
|
12782
|
-
type GetProductDetailQuery = paths['/catalog/products/{
|
|
12783
|
-
type GetProductDetailPathParams = paths['/catalog/products/{
|
|
12784
|
-
type GetProductDetailHeaderParams = paths['/catalog/products/{
|
|
12828
|
+
type GetProductDetailQuery = paths['/catalog/products/{product_id}']['get']['parameters']['query'];
|
|
12829
|
+
type GetProductDetailPathParams = paths['/catalog/products/{product_id}']['get']['parameters']['path'];
|
|
12830
|
+
type GetProductDetailHeaderParams = paths['/catalog/products/{product_id}']['get']['parameters']['header'];
|
|
12785
12831
|
type ListProductReviewsResponse = Readable<paths['/catalog/products/{product_id}/reviews']['get']['responses'][200]['content']['application/json']>;
|
|
12786
12832
|
type ListProductReviewsContent = ListProductReviewsResponse['content'];
|
|
12787
12833
|
type ListProductReviewsQuery = paths['/catalog/products/{product_id}/reviews']['get']['parameters']['query'];
|
|
@@ -13040,11 +13086,11 @@ type PosListUpsellProductsResponse = Readable<paths['/pos/catalog/products/up-se
|
|
|
13040
13086
|
type PosListUpsellProductsContent = PosListUpsellProductsResponse['content'];
|
|
13041
13087
|
type PosListUpsellProductsQuery = paths['/pos/catalog/products/up-sell']['get']['parameters']['query'];
|
|
13042
13088
|
type PosListUpsellProductsHeaderParams = paths['/pos/catalog/products/up-sell']['get']['parameters']['header'];
|
|
13043
|
-
type PosGetProductDetailResponse = Readable<paths['/pos/catalog/products/{
|
|
13089
|
+
type PosGetProductDetailResponse = Readable<paths['/pos/catalog/products/{product_id}']['get']['responses'][200]['content']['application/json']>;
|
|
13044
13090
|
type PosGetProductDetailContent = PosGetProductDetailResponse['content'];
|
|
13045
|
-
type PosGetProductDetailQuery = paths['/pos/catalog/products/{
|
|
13046
|
-
type PosGetProductDetailPathParams = paths['/pos/catalog/products/{
|
|
13047
|
-
type PosGetProductDetailHeaderParams = paths['/pos/catalog/products/{
|
|
13091
|
+
type PosGetProductDetailQuery = paths['/pos/catalog/products/{product_id}']['get']['parameters']['query'];
|
|
13092
|
+
type PosGetProductDetailPathParams = paths['/pos/catalog/products/{product_id}']['get']['parameters']['path'];
|
|
13093
|
+
type PosGetProductDetailHeaderParams = paths['/pos/catalog/products/{product_id}']['get']['parameters']['header'];
|
|
13048
13094
|
type PosListProductReviewsResponse = Readable<paths['/pos/catalog/products/{product_id}/reviews']['get']['responses'][200]['content']['application/json']>;
|
|
13049
13095
|
type PosListProductReviewsContent = PosListProductReviewsResponse['content'];
|
|
13050
13096
|
type PosListProductReviewsQuery = paths['/pos/catalog/products/{product_id}/reviews']['get']['parameters']['query'];
|
|
@@ -13229,7 +13275,7 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13229
13275
|
/**
|
|
13230
13276
|
* Get details for a specific product
|
|
13231
13277
|
*
|
|
13232
|
-
* @param pathParams - The path parameters
|
|
13278
|
+
* @param pathParams - The path parameters. Accepts product ID or product slug.
|
|
13233
13279
|
* @param headers - Optional header parameters (customer_group_id, etc.)
|
|
13234
13280
|
* @returns Promise with product details
|
|
13235
13281
|
*
|
|
@@ -13237,7 +13283,7 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13237
13283
|
* ```typescript
|
|
13238
13284
|
* // Get product by ID
|
|
13239
13285
|
* const { data, error } = await sdk.catalog.getProductDetail(
|
|
13240
|
-
* {
|
|
13286
|
+
* { product_id: "prod_123" }
|
|
13241
13287
|
* );
|
|
13242
13288
|
*
|
|
13243
13289
|
* if (error) {
|
|
@@ -13249,14 +13295,15 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13249
13295
|
* console.log("Price:", data.product.pricing?.selling_price);
|
|
13250
13296
|
* console.log("Description:", data.product.short_description);
|
|
13251
13297
|
*
|
|
13252
|
-
* // Get product by slug
|
|
13298
|
+
* // Get product by slug (also accepted in place of product_id)
|
|
13253
13299
|
* const { data: slugData, error: slugError } = await sdk.catalog.getProductDetail({
|
|
13254
|
-
*
|
|
13300
|
+
* product_id: "detox-candy"
|
|
13255
13301
|
* });
|
|
13256
13302
|
*
|
|
13257
13303
|
* // Override customer group ID for this specific request
|
|
13258
13304
|
* const { data: overrideData, error: overrideError } = await sdk.catalog.getProductDetail(
|
|
13259
|
-
* {
|
|
13305
|
+
* { product_id: "detox-candy" },
|
|
13306
|
+
* undefined,
|
|
13260
13307
|
* {
|
|
13261
13308
|
* "x-customer-group-id": "premium_customers" // Override default SDK config
|
|
13262
13309
|
* }
|
|
@@ -13274,12 +13321,13 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13274
13321
|
/**
|
|
13275
13322
|
* List all variants for a specific product
|
|
13276
13323
|
*
|
|
13277
|
-
* @param pathParams - The path parameters
|
|
13324
|
+
* @param pathParams - The path parameters. Accepts product ID or product slug.
|
|
13278
13325
|
* @param headers - Optional header parameters (customer_group_id, etc.)
|
|
13279
13326
|
* @returns Promise with product variants and pagination info
|
|
13280
13327
|
*
|
|
13281
13328
|
* @example
|
|
13282
13329
|
* ```typescript
|
|
13330
|
+
* // By product ID
|
|
13283
13331
|
* const { data, error } = await sdk.catalog.listProductVariants(
|
|
13284
13332
|
* { product_id: "prod_123" }
|
|
13285
13333
|
* );
|
|
@@ -13295,9 +13343,15 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13295
13343
|
* console.log(`Variant: ${variant.name} - SKU: ${variant.sku} - Price: ${variant.pricing?.selling_price}`);
|
|
13296
13344
|
* });
|
|
13297
13345
|
*
|
|
13346
|
+
* // By product slug (also accepted in place of product_id)
|
|
13347
|
+
* const { data: slugData, error: slugError } = await sdk.catalog.listProductVariants(
|
|
13348
|
+
* { product_id: "detox-candy" }
|
|
13349
|
+
* );
|
|
13350
|
+
*
|
|
13298
13351
|
* // Override customer group ID for this specific request
|
|
13299
13352
|
* const { data: overrideData, error: overrideError } = await sdk.catalog.listProductVariants(
|
|
13300
13353
|
* { product_id: "prod_123" },
|
|
13354
|
+
* undefined,
|
|
13301
13355
|
* {
|
|
13302
13356
|
* "x-customer-group-id": "wholesale_customers" // Override default SDK config
|
|
13303
13357
|
* }
|
|
@@ -13308,12 +13362,13 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13308
13362
|
/**
|
|
13309
13363
|
* Get details for a specific product variant
|
|
13310
13364
|
*
|
|
13311
|
-
* @param pathParams - The path parameters
|
|
13365
|
+
* @param pathParams - The path parameters. Accepts product ID or slug for product_id, and variant ID or slug for variant_id.
|
|
13312
13366
|
* @param headers - Optional header parameters (customer_group_id, etc.)
|
|
13313
13367
|
* @returns Promise with variant details
|
|
13314
13368
|
*
|
|
13315
13369
|
* @example
|
|
13316
13370
|
* ```typescript
|
|
13371
|
+
* // By product ID and variant ID
|
|
13317
13372
|
* const { data, error } = await sdk.catalog.getVariantDetail(
|
|
13318
13373
|
* {
|
|
13319
13374
|
* product_id: "prod_123",
|
|
@@ -13330,6 +13385,14 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13330
13385
|
* console.log("SKU:", data.variant.sku);
|
|
13331
13386
|
* console.log("Price:", data.variant.pricing?.selling_price);
|
|
13332
13387
|
* console.log("Stock available:", data.variant.stock_available);
|
|
13388
|
+
*
|
|
13389
|
+
* // By product slug and variant slug (also accepted in place of IDs)
|
|
13390
|
+
* const { data: slugData, error: slugError } = await sdk.catalog.getVariantDetail(
|
|
13391
|
+
* {
|
|
13392
|
+
* product_id: "detox-candy",
|
|
13393
|
+
* variant_id: "detox-candy-100g"
|
|
13394
|
+
* }
|
|
13395
|
+
* );
|
|
13333
13396
|
* ```
|
|
13334
13397
|
*/
|
|
13335
13398
|
getVariantDetail(pathParams: GetVariantDetailPathParams, options?: GetVariantDetailQuery, headers?: GetVariantDetailHeaderParams): Promise<ApiResult<GetVariantDetailContent>>;
|
|
@@ -13434,19 +13497,15 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13434
13497
|
/**
|
|
13435
13498
|
* Search for products
|
|
13436
13499
|
*
|
|
13437
|
-
* @param searchData - The search query and
|
|
13500
|
+
* @param searchData - The search query, filters, sort, and pagination options
|
|
13438
13501
|
* @param headers - Optional header parameters (customer_group_id, etc.)
|
|
13439
|
-
* @returns Promise with search results including
|
|
13502
|
+
* @returns Promise with search results including SKUs, facet distribution, facet stats, and pagination
|
|
13440
13503
|
*
|
|
13441
13504
|
* @example
|
|
13442
13505
|
* ```typescript
|
|
13506
|
+
* // Basic search
|
|
13443
13507
|
* const { data, error } = await sdk.catalog.searchProducts({
|
|
13444
13508
|
* query: "smartphone",
|
|
13445
|
-
* filters: {
|
|
13446
|
-
* category: ["electronics", "mobile"],
|
|
13447
|
-
* price_range: { min: 100, max: 1000 },
|
|
13448
|
-
* brand: ["Apple", "Samsung"] // facet names depend on product configuration
|
|
13449
|
-
* },
|
|
13450
13509
|
* page: 1,
|
|
13451
13510
|
* limit: 20
|
|
13452
13511
|
* });
|
|
@@ -13458,17 +13517,51 @@ declare class CatalogClient extends StorefrontAPIClient {
|
|
|
13458
13517
|
*
|
|
13459
13518
|
* console.log("Search results:", data.skus?.length || 0, "products found");
|
|
13460
13519
|
* console.log("Facet distribution:", data.facet_distribution);
|
|
13461
|
-
* console.log("
|
|
13520
|
+
* console.log("Facet stats:", data.facet_stats);
|
|
13521
|
+
* console.log("Pagination:", data.pagination);
|
|
13462
13522
|
*
|
|
13463
13523
|
* data.skus?.forEach(sku => {
|
|
13464
13524
|
* console.log(`Found: ${sku.product_name} - ${sku.pricing?.selling_price}`);
|
|
13465
13525
|
* });
|
|
13466
13526
|
*
|
|
13527
|
+
* // With filter (string expression — Meilisearch syntax)
|
|
13528
|
+
* const { data: filtered, error: filteredError } = await sdk.catalog.searchProducts({
|
|
13529
|
+
* query: "laptop",
|
|
13530
|
+
* filter: "pricing.selling_price 500 TO 2000 AND product_type = physical",
|
|
13531
|
+
* sort: ["pricing.selling_price:asc"],
|
|
13532
|
+
* facets: ["product_type", "categories.name", "tags"],
|
|
13533
|
+
* page: 1,
|
|
13534
|
+
* limit: 10
|
|
13535
|
+
* });
|
|
13536
|
+
*
|
|
13537
|
+
* // With filter (array of conditions — combined with AND)
|
|
13538
|
+
* const { data: arrayFiltered, error: arrayError } = await sdk.catalog.searchProducts({
|
|
13539
|
+
* query: "shoes",
|
|
13540
|
+
* filter: ["product_type = physical", "rating >= 4", "stock_available > 0"],
|
|
13541
|
+
* sort: ["rating:desc"],
|
|
13542
|
+
* facets: ["*"],
|
|
13543
|
+
* page: 1,
|
|
13544
|
+
* limit: 25
|
|
13545
|
+
* });
|
|
13546
|
+
*
|
|
13547
|
+
* // With filter (nested arrays — inner arrays use OR, outer uses AND)
|
|
13548
|
+
* const { data: nestedFiltered, error: nestedError } = await sdk.catalog.searchProducts({
|
|
13549
|
+
* query: "headphones",
|
|
13550
|
+
* filter: [
|
|
13551
|
+
* "pricing.selling_price 50 TO 300",
|
|
13552
|
+
* ["product_type = physical", "product_type = bundle"]
|
|
13553
|
+
* ],
|
|
13554
|
+
* page: 1,
|
|
13555
|
+
* limit: 25
|
|
13556
|
+
* });
|
|
13557
|
+
*
|
|
13467
13558
|
* // Override customer group ID for this specific request
|
|
13468
13559
|
* const { data: overrideData, error: overrideError } = await sdk.catalog.searchProducts(
|
|
13469
13560
|
* {
|
|
13470
13561
|
* query: "laptop",
|
|
13471
|
-
*
|
|
13562
|
+
* filter: "categories.name = computers",
|
|
13563
|
+
* page: 1,
|
|
13564
|
+
* limit: 20
|
|
13472
13565
|
* },
|
|
13473
13566
|
* {
|
|
13474
13567
|
* "x-customer-group-id": "01H9XYZ12345USERID" // Override default SDK config
|