@commercengine/storefront-sdk 0.13.3 → 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 CHANGED
@@ -962,7 +962,7 @@ interface paths {
962
962
  patch?: never;
963
963
  trace?: never;
964
964
  };
965
- "/catalog/marketplace/products/{product_id_or_slug}": {
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. Supply either the unique product ID or the unique slug, and Commerce Engine will return the corresponding product information.
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. Supply the unique product ID, and Commerce Engine will return the corresponding product variants information.
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. Supply the unique product ID, and variant ID.
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/{product_id_or_slug}": {
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. Supply either the unique product ID or the unique slug, and Commerce Engine will return the corresponding product information.
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. Supply the unique product ID, and Commerce Engine will return the corresponding product variants information.
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. Supply the unique product ID, and variant ID.
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/{product_id_or_slug}": {
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. Supply either the unique product ID or the unique slug, and Commerce Engine will return the corresponding product information.
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. Supply the unique product ID, and Commerce Engine will return the corresponding product variants information.
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. Supply the unique product ID, and variant ID.
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
- slug: string;
4068
+ product_slug: string;
4069
+ variant_slug: string;
4069
4070
  product_name: string;
4070
4071
  variant_name: string | null;
4071
4072
  /**
@@ -5473,7 +5474,6 @@ interface components {
5473
5474
  count?: number;
5474
5475
  }; /** Seo */
5475
5476
  Seo: {
5476
- slug: string;
5477
5477
  title: string | null;
5478
5478
  description: string | null;
5479
5479
  keywords: string[] | null;
@@ -7915,7 +7915,7 @@ interface operations {
7915
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"];
7916
7916
  };
7917
7917
  path: {
7918
- /** @description The unique identifier of the product. Can be either the product ID or the slug. */product_id_or_slug: string;
7918
+ /** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
7919
7919
  };
7920
7920
  cookie?: never;
7921
7921
  };
@@ -8016,7 +8016,7 @@ interface operations {
8016
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"];
8017
8017
  };
8018
8018
  path: {
8019
- /** @description ID of a particular product */product_id: string;
8019
+ /** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
8020
8020
  };
8021
8021
  cookie?: never;
8022
8022
  };
@@ -8049,7 +8049,7 @@ interface operations {
8049
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"];
8050
8050
  };
8051
8051
  path: {
8052
- /** @description product id */product_id: string; /** @description variant id */
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. */
8053
8053
  variant_id: string;
8054
8054
  };
8055
8055
  cookie?: never;
@@ -8307,7 +8307,7 @@ interface operations {
8307
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"];
8308
8308
  };
8309
8309
  path: {
8310
- /** @description The unique identifier of the product. Can be either the product ID or the slug. */product_id_or_slug: string;
8310
+ /** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
8311
8311
  };
8312
8312
  cookie?: never;
8313
8313
  };
@@ -8408,7 +8408,7 @@ interface operations {
8408
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"];
8409
8409
  };
8410
8410
  path: {
8411
- /** @description ID of a particular product */product_id: string;
8411
+ /** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
8412
8412
  };
8413
8413
  cookie?: never;
8414
8414
  };
@@ -8441,7 +8441,7 @@ interface operations {
8441
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"];
8442
8442
  };
8443
8443
  path: {
8444
- /** @description product id */product_id: string; /** @description variant id */
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. */
8445
8445
  variant_id: string;
8446
8446
  };
8447
8447
  cookie?: never;
@@ -10929,7 +10929,7 @@ interface operations {
10929
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"];
10930
10930
  };
10931
10931
  path: {
10932
- /** @description The unique identifier of the product. Can be either the product ID or the slug. */product_id_or_slug: string;
10932
+ /** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
10933
10933
  };
10934
10934
  cookie?: never;
10935
10935
  };
@@ -10999,7 +10999,7 @@ interface operations {
10999
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"];
11000
11000
  };
11001
11001
  path: {
11002
- /** @description ID of a particular product */product_id: string;
11002
+ /** @description Product ID or product slug. Either is accepted in the path. */product_id: string;
11003
11003
  };
11004
11004
  cookie?: never;
11005
11005
  };
@@ -11032,7 +11032,7 @@ interface operations {
11032
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"];
11033
11033
  };
11034
11034
  path: {
11035
- /** @description product id */product_id: string; /** @description variant id */
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. */
11036
11036
  variant_id: string;
11037
11037
  };
11038
11038
  cookie?: never;
@@ -12777,11 +12777,11 @@ type ListMarketplaceUpsellProductsResponse = Readable<paths['/catalog/marketplac
12777
12777
  type ListMarketplaceUpsellProductsContent = ListMarketplaceUpsellProductsResponse['content'];
12778
12778
  type ListMarketplaceUpsellProductsQuery = paths['/catalog/marketplace/products/up-sell']['get']['parameters']['query'];
12779
12779
  type ListMarketplaceUpsellProductsHeaderParams = paths['/catalog/marketplace/products/up-sell']['get']['parameters']['header'];
12780
- type GetMarketplaceProductDetailResponse = Readable<paths['/catalog/marketplace/products/{product_id_or_slug}']['get']['responses'][200]['content']['application/json']>;
12780
+ type GetMarketplaceProductDetailResponse = Readable<paths['/catalog/marketplace/products/{product_id}']['get']['responses'][200]['content']['application/json']>;
12781
12781
  type GetMarketplaceProductDetailContent = GetMarketplaceProductDetailResponse['content'];
12782
- type GetMarketplaceProductDetailQuery = paths['/catalog/marketplace/products/{product_id_or_slug}']['get']['parameters']['query'];
12783
- type GetMarketplaceProductDetailPathParams = paths['/catalog/marketplace/products/{product_id_or_slug}']['get']['parameters']['path'];
12784
- type GetMarketplaceProductDetailHeaderParams = paths['/catalog/marketplace/products/{product_id_or_slug}']['get']['parameters']['header'];
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'];
12785
12785
  type ListMarketplaceProductReviewsResponse = Readable<paths['/catalog/marketplace/products/{product_id}/reviews']['get']['responses'][200]['content']['application/json']>;
12786
12786
  type ListMarketplaceProductReviewsContent = ListMarketplaceProductReviewsResponse['content'];
12787
12787
  type ListMarketplaceProductReviewsQuery = paths['/catalog/marketplace/products/{product_id}/reviews']['get']['parameters']['query'];
@@ -12823,11 +12823,11 @@ type ListUpsellProductsResponse = Readable<paths['/catalog/products/up-sell']['g
12823
12823
  type ListUpsellProductsContent = ListUpsellProductsResponse['content'];
12824
12824
  type ListUpsellProductsQuery = paths['/catalog/products/up-sell']['get']['parameters']['query'];
12825
12825
  type ListUpsellProductsHeaderParams = paths['/catalog/products/up-sell']['get']['parameters']['header'];
12826
- type GetProductDetailResponse = Readable<paths['/catalog/products/{product_id_or_slug}']['get']['responses'][200]['content']['application/json']>;
12826
+ type GetProductDetailResponse = Readable<paths['/catalog/products/{product_id}']['get']['responses'][200]['content']['application/json']>;
12827
12827
  type GetProductDetailContent = GetProductDetailResponse['content'];
12828
- type GetProductDetailQuery = paths['/catalog/products/{product_id_or_slug}']['get']['parameters']['query'];
12829
- type GetProductDetailPathParams = paths['/catalog/products/{product_id_or_slug}']['get']['parameters']['path'];
12830
- type GetProductDetailHeaderParams = paths['/catalog/products/{product_id_or_slug}']['get']['parameters']['header'];
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'];
12831
12831
  type ListProductReviewsResponse = Readable<paths['/catalog/products/{product_id}/reviews']['get']['responses'][200]['content']['application/json']>;
12832
12832
  type ListProductReviewsContent = ListProductReviewsResponse['content'];
12833
12833
  type ListProductReviewsQuery = paths['/catalog/products/{product_id}/reviews']['get']['parameters']['query'];
@@ -13086,11 +13086,11 @@ type PosListUpsellProductsResponse = Readable<paths['/pos/catalog/products/up-se
13086
13086
  type PosListUpsellProductsContent = PosListUpsellProductsResponse['content'];
13087
13087
  type PosListUpsellProductsQuery = paths['/pos/catalog/products/up-sell']['get']['parameters']['query'];
13088
13088
  type PosListUpsellProductsHeaderParams = paths['/pos/catalog/products/up-sell']['get']['parameters']['header'];
13089
- type PosGetProductDetailResponse = Readable<paths['/pos/catalog/products/{product_id_or_slug}']['get']['responses'][200]['content']['application/json']>;
13089
+ type PosGetProductDetailResponse = Readable<paths['/pos/catalog/products/{product_id}']['get']['responses'][200]['content']['application/json']>;
13090
13090
  type PosGetProductDetailContent = PosGetProductDetailResponse['content'];
13091
- type PosGetProductDetailQuery = paths['/pos/catalog/products/{product_id_or_slug}']['get']['parameters']['query'];
13092
- type PosGetProductDetailPathParams = paths['/pos/catalog/products/{product_id_or_slug}']['get']['parameters']['path'];
13093
- type PosGetProductDetailHeaderParams = paths['/pos/catalog/products/{product_id_or_slug}']['get']['parameters']['header'];
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'];
13094
13094
  type PosListProductReviewsResponse = Readable<paths['/pos/catalog/products/{product_id}/reviews']['get']['responses'][200]['content']['application/json']>;
13095
13095
  type PosListProductReviewsContent = PosListProductReviewsResponse['content'];
13096
13096
  type PosListProductReviewsQuery = paths['/pos/catalog/products/{product_id}/reviews']['get']['parameters']['query'];
@@ -13275,7 +13275,7 @@ declare class CatalogClient extends StorefrontAPIClient {
13275
13275
  /**
13276
13276
  * Get details for a specific product
13277
13277
  *
13278
- * @param pathParams - The path parameters (product ID or slug)
13278
+ * @param pathParams - The path parameters. Accepts product ID or product slug.
13279
13279
  * @param headers - Optional header parameters (customer_group_id, etc.)
13280
13280
  * @returns Promise with product details
13281
13281
  *
@@ -13283,7 +13283,7 @@ declare class CatalogClient extends StorefrontAPIClient {
13283
13283
  * ```typescript
13284
13284
  * // Get product by ID
13285
13285
  * const { data, error } = await sdk.catalog.getProductDetail(
13286
- * { product_id_or_slug: "prod_123" }
13286
+ * { product_id: "prod_123" }
13287
13287
  * );
13288
13288
  *
13289
13289
  * if (error) {
@@ -13295,14 +13295,15 @@ declare class CatalogClient extends StorefrontAPIClient {
13295
13295
  * console.log("Price:", data.product.pricing?.selling_price);
13296
13296
  * console.log("Description:", data.product.short_description);
13297
13297
  *
13298
- * // Get product by slug
13298
+ * // Get product by slug (also accepted in place of product_id)
13299
13299
  * const { data: slugData, error: slugError } = await sdk.catalog.getProductDetail({
13300
- * product_id_or_slug: "detox-candy"
13300
+ * product_id: "detox-candy"
13301
13301
  * });
13302
13302
  *
13303
13303
  * // Override customer group ID for this specific request
13304
13304
  * const { data: overrideData, error: overrideError } = await sdk.catalog.getProductDetail(
13305
- * { product_id_or_slug: "detox-candy" },
13305
+ * { product_id: "detox-candy" },
13306
+ * undefined,
13306
13307
  * {
13307
13308
  * "x-customer-group-id": "premium_customers" // Override default SDK config
13308
13309
  * }
@@ -13320,12 +13321,13 @@ declare class CatalogClient extends StorefrontAPIClient {
13320
13321
  /**
13321
13322
  * List all variants for a specific product
13322
13323
  *
13323
- * @param pathParams - The path parameters (product ID)
13324
+ * @param pathParams - The path parameters. Accepts product ID or product slug.
13324
13325
  * @param headers - Optional header parameters (customer_group_id, etc.)
13325
13326
  * @returns Promise with product variants and pagination info
13326
13327
  *
13327
13328
  * @example
13328
13329
  * ```typescript
13330
+ * // By product ID
13329
13331
  * const { data, error } = await sdk.catalog.listProductVariants(
13330
13332
  * { product_id: "prod_123" }
13331
13333
  * );
@@ -13341,9 +13343,15 @@ declare class CatalogClient extends StorefrontAPIClient {
13341
13343
  * console.log(`Variant: ${variant.name} - SKU: ${variant.sku} - Price: ${variant.pricing?.selling_price}`);
13342
13344
  * });
13343
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
+ *
13344
13351
  * // Override customer group ID for this specific request
13345
13352
  * const { data: overrideData, error: overrideError } = await sdk.catalog.listProductVariants(
13346
13353
  * { product_id: "prod_123" },
13354
+ * undefined,
13347
13355
  * {
13348
13356
  * "x-customer-group-id": "wholesale_customers" // Override default SDK config
13349
13357
  * }
@@ -13354,12 +13362,13 @@ declare class CatalogClient extends StorefrontAPIClient {
13354
13362
  /**
13355
13363
  * Get details for a specific product variant
13356
13364
  *
13357
- * @param pathParams - The path parameters (product ID and variant ID)
13365
+ * @param pathParams - The path parameters. Accepts product ID or slug for product_id, and variant ID or slug for variant_id.
13358
13366
  * @param headers - Optional header parameters (customer_group_id, etc.)
13359
13367
  * @returns Promise with variant details
13360
13368
  *
13361
13369
  * @example
13362
13370
  * ```typescript
13371
+ * // By product ID and variant ID
13363
13372
  * const { data, error } = await sdk.catalog.getVariantDetail(
13364
13373
  * {
13365
13374
  * product_id: "prod_123",
@@ -13376,6 +13385,14 @@ declare class CatalogClient extends StorefrontAPIClient {
13376
13385
  * console.log("SKU:", data.variant.sku);
13377
13386
  * console.log("Price:", data.variant.pricing?.selling_price);
13378
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
+ * );
13379
13396
  * ```
13380
13397
  */
13381
13398
  getVariantDetail(pathParams: GetVariantDetailPathParams, options?: GetVariantDetailQuery, headers?: GetVariantDetailHeaderParams): Promise<ApiResult<GetVariantDetailContent>>;
@@ -1501,7 +1501,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1501
1501
  /**
1502
1502
  * Get details for a specific product
1503
1503
  *
1504
- * @param pathParams - The path parameters (product ID or slug)
1504
+ * @param pathParams - The path parameters. Accepts product ID or product slug.
1505
1505
  * @param headers - Optional header parameters (customer_group_id, etc.)
1506
1506
  * @returns Promise with product details
1507
1507
  *
@@ -1509,7 +1509,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1509
1509
  * ```typescript
1510
1510
  * // Get product by ID
1511
1511
  * const { data, error } = await sdk.catalog.getProductDetail(
1512
- * { product_id_or_slug: "prod_123" }
1512
+ * { product_id: "prod_123" }
1513
1513
  * );
1514
1514
  *
1515
1515
  * if (error) {
@@ -1521,14 +1521,15 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1521
1521
  * console.log("Price:", data.product.pricing?.selling_price);
1522
1522
  * console.log("Description:", data.product.short_description);
1523
1523
  *
1524
- * // Get product by slug
1524
+ * // Get product by slug (also accepted in place of product_id)
1525
1525
  * const { data: slugData, error: slugError } = await sdk.catalog.getProductDetail({
1526
- * product_id_or_slug: "detox-candy"
1526
+ * product_id: "detox-candy"
1527
1527
  * });
1528
1528
  *
1529
1529
  * // Override customer group ID for this specific request
1530
1530
  * const { data: overrideData, error: overrideError } = await sdk.catalog.getProductDetail(
1531
- * { product_id_or_slug: "detox-candy" },
1531
+ * { product_id: "detox-candy" },
1532
+ * undefined,
1532
1533
  * {
1533
1534
  * "x-customer-group-id": "premium_customers" // Override default SDK config
1534
1535
  * }
@@ -1544,7 +1545,7 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1544
1545
  */
1545
1546
  async getProductDetail(pathParams, options, headers) {
1546
1547
  const mergedHeaders = this.mergeHeaders(headers);
1547
- return this.executeRequest(() => this.client.GET("/catalog/products/{product_id_or_slug}", { params: {
1548
+ return this.executeRequest(() => this.client.GET("/catalog/products/{product_id}", { params: {
1548
1549
  path: pathParams,
1549
1550
  query: options,
1550
1551
  header: mergedHeaders
@@ -1553,12 +1554,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1553
1554
  /**
1554
1555
  * List all variants for a specific product
1555
1556
  *
1556
- * @param pathParams - The path parameters (product ID)
1557
+ * @param pathParams - The path parameters. Accepts product ID or product slug.
1557
1558
  * @param headers - Optional header parameters (customer_group_id, etc.)
1558
1559
  * @returns Promise with product variants and pagination info
1559
1560
  *
1560
1561
  * @example
1561
1562
  * ```typescript
1563
+ * // By product ID
1562
1564
  * const { data, error } = await sdk.catalog.listProductVariants(
1563
1565
  * { product_id: "prod_123" }
1564
1566
  * );
@@ -1574,9 +1576,15 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1574
1576
  * console.log(`Variant: ${variant.name} - SKU: ${variant.sku} - Price: ${variant.pricing?.selling_price}`);
1575
1577
  * });
1576
1578
  *
1579
+ * // By product slug (also accepted in place of product_id)
1580
+ * const { data: slugData, error: slugError } = await sdk.catalog.listProductVariants(
1581
+ * { product_id: "detox-candy" }
1582
+ * );
1583
+ *
1577
1584
  * // Override customer group ID for this specific request
1578
1585
  * const { data: overrideData, error: overrideError } = await sdk.catalog.listProductVariants(
1579
1586
  * { product_id: "prod_123" },
1587
+ * undefined,
1580
1588
  * {
1581
1589
  * "x-customer-group-id": "wholesale_customers" // Override default SDK config
1582
1590
  * }
@@ -1594,12 +1602,13 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1594
1602
  /**
1595
1603
  * Get details for a specific product variant
1596
1604
  *
1597
- * @param pathParams - The path parameters (product ID and variant ID)
1605
+ * @param pathParams - The path parameters. Accepts product ID or slug for product_id, and variant ID or slug for variant_id.
1598
1606
  * @param headers - Optional header parameters (customer_group_id, etc.)
1599
1607
  * @returns Promise with variant details
1600
1608
  *
1601
1609
  * @example
1602
1610
  * ```typescript
1611
+ * // By product ID and variant ID
1603
1612
  * const { data, error } = await sdk.catalog.getVariantDetail(
1604
1613
  * {
1605
1614
  * product_id: "prod_123",
@@ -1616,6 +1625,14 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
1616
1625
  * console.log("SKU:", data.variant.sku);
1617
1626
  * console.log("Price:", data.variant.pricing?.selling_price);
1618
1627
  * console.log("Stock available:", data.variant.stock_available);
1628
+ *
1629
+ * // By product slug and variant slug (also accepted in place of IDs)
1630
+ * const { data: slugData, error: slugError } = await sdk.catalog.getVariantDetail(
1631
+ * {
1632
+ * product_id: "detox-candy",
1633
+ * variant_id: "detox-candy-100g"
1634
+ * }
1635
+ * );
1619
1636
  * ```
1620
1637
  */
1621
1638
  async getVariantDetail(pathParams, options, headers) {