@commercelayer/sdk 5.27.3 → 5.29.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.
Files changed (61) hide show
  1. package/lib/cjs/commercelayer.d.ts +2 -2
  2. package/lib/cjs/commercelayer.js +1 -1
  3. package/lib/cjs/query.d.ts +1 -1
  4. package/lib/cjs/query.js +1 -1
  5. package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
  6. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +8 -0
  7. package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -0
  8. package/lib/cjs/resources/external_promotions.d.ts +8 -0
  9. package/lib/cjs/resources/external_promotions.js +4 -0
  10. package/lib/cjs/resources/fixed_amount_promotions.d.ts +8 -0
  11. package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
  12. package/lib/cjs/resources/fixed_price_promotions.d.ts +8 -0
  13. package/lib/cjs/resources/fixed_price_promotions.js +4 -0
  14. package/lib/cjs/resources/free_gift_promotions.d.ts +8 -0
  15. package/lib/cjs/resources/free_gift_promotions.js +4 -0
  16. package/lib/cjs/resources/free_shipping_promotions.d.ts +8 -0
  17. package/lib/cjs/resources/free_shipping_promotions.js +4 -0
  18. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  19. package/lib/cjs/resources/line_items.d.ts +3 -0
  20. package/lib/cjs/resources/line_items.js +4 -0
  21. package/lib/cjs/resources/orders.d.ts +2 -0
  22. package/lib/cjs/resources/orders.js +4 -0
  23. package/lib/cjs/resources/percentage_discount_promotions.d.ts +8 -0
  24. package/lib/cjs/resources/percentage_discount_promotions.js +4 -0
  25. package/lib/cjs/resources/promotions.d.ts +3 -0
  26. package/lib/cjs/resources/promotions.js +4 -0
  27. package/lib/cjs/resources/stock_line_items.d.ts +6 -0
  28. package/lib/cjs/resources/stock_line_items.js +9 -0
  29. package/lib/cjs/resources/stock_reservations.d.ts +0 -1
  30. package/lib/esm/commercelayer.d.ts +2 -2
  31. package/lib/esm/commercelayer.js +1 -1
  32. package/lib/esm/query.d.ts +1 -1
  33. package/lib/esm/query.js +1 -1
  34. package/lib/esm/resources/avalara_accounts.d.ts +6 -6
  35. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +8 -0
  36. package/lib/esm/resources/buy_x_pay_y_promotions.js +4 -0
  37. package/lib/esm/resources/external_promotions.d.ts +8 -0
  38. package/lib/esm/resources/external_promotions.js +4 -0
  39. package/lib/esm/resources/fixed_amount_promotions.d.ts +8 -0
  40. package/lib/esm/resources/fixed_amount_promotions.js +4 -0
  41. package/lib/esm/resources/fixed_price_promotions.d.ts +8 -0
  42. package/lib/esm/resources/fixed_price_promotions.js +4 -0
  43. package/lib/esm/resources/free_gift_promotions.d.ts +8 -0
  44. package/lib/esm/resources/free_gift_promotions.js +4 -0
  45. package/lib/esm/resources/free_shipping_promotions.d.ts +8 -0
  46. package/lib/esm/resources/free_shipping_promotions.js +4 -0
  47. package/lib/esm/resources/inventory_models.d.ts +3 -0
  48. package/lib/esm/resources/line_items.d.ts +3 -0
  49. package/lib/esm/resources/line_items.js +4 -0
  50. package/lib/esm/resources/orders.d.ts +2 -0
  51. package/lib/esm/resources/orders.js +4 -0
  52. package/lib/esm/resources/percentage_discount_promotions.d.ts +8 -0
  53. package/lib/esm/resources/percentage_discount_promotions.js +4 -0
  54. package/lib/esm/resources/promotions.d.ts +3 -0
  55. package/lib/esm/resources/promotions.js +4 -0
  56. package/lib/esm/resources/stock_line_items.d.ts +6 -0
  57. package/lib/esm/resources/stock_line_items.js +9 -0
  58. package/lib/esm/resources/stock_reservations.d.ts +0 -1
  59. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  60. package/lib/tsconfig.tsbuildinfo +1 -1
  61. package/package.json +2 -2
@@ -2,14 +2,14 @@ import * as api from './api';
2
2
  import type { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { type ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.23.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.24.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
9
9
  type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
- readonly openApiSchemaVersion = "4.23.0";
12
+ readonly openApiSchemaVersion = "4.24.0";
13
13
  addresses: api.Addresses;
14
14
  adjustments: api.Adjustments;
15
15
  adyen_gateways: api.AdyenGateways;
@@ -45,7 +45,7 @@ const resource_1 = __importDefault(require("./resource"));
45
45
  const debug_1 = __importDefault(require("./debug"));
46
46
  const debug = (0, debug_1.default)('commercelayer');
47
47
  // Autogenerated schema version number, do not remove this line
48
- const OPEN_API_SCHEMA_VERSION = '4.23.0';
48
+ const OPEN_API_SCHEMA_VERSION = '4.24.0';
49
49
  exports.OPEN_API_SCHEMA_VERSION = OPEN_API_SCHEMA_VERSION;
50
50
  class CommerceLayerClient {
51
51
  // ##__CL_RESOURCES_DEF_STOP__##
@@ -1,5 +1,5 @@
1
1
  import type { ResourceType } from "./resource";
2
- type QueryFilter = Record<string, string | number | boolean>;
2
+ type QueryFilter = Record<string, string | number | boolean | object>;
3
3
  interface QueryParamsRetrieve {
4
4
  include?: string[];
5
5
  fields?: string[] | Record<string, string[]>;
package/lib/cjs/query.js CHANGED
@@ -42,7 +42,7 @@ const generateQueryStringParams = (params, res) => {
42
42
  // Filters
43
43
  if (params.filters) {
44
44
  Object.entries(params.filters).forEach(([p, v]) => {
45
- qp[`filter[q][${p}]`] = String(v);
45
+ qp[`filter[q][${p}]`] = (typeof v === 'object') ? JSON.stringify(v) : String(v);
46
46
  });
47
47
  }
48
48
  }
@@ -17,8 +17,8 @@ interface AvalaraAccount extends Resource {
17
17
  name: string;
18
18
  username: string;
19
19
  company_code: string;
20
- commit_invoice?: string | null;
21
- ddp?: string | null;
20
+ commit_invoice?: boolean | null;
21
+ ddp?: boolean | null;
22
22
  markets?: Market[] | null;
23
23
  attachments?: Attachment[] | null;
24
24
  versions?: Version[] | null;
@@ -29,8 +29,8 @@ interface AvalaraAccountCreate extends ResourceCreate {
29
29
  username: string;
30
30
  password: string;
31
31
  company_code: string;
32
- commit_invoice?: string | null;
33
- ddp?: string | null;
32
+ commit_invoice?: boolean | null;
33
+ ddp?: boolean | null;
34
34
  tax_categories?: TaxCategoryRel[] | null;
35
35
  }
36
36
  interface AvalaraAccountUpdate extends ResourceUpdate {
@@ -38,8 +38,8 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
38
38
  username?: string | null;
39
39
  password?: string | null;
40
40
  company_code?: string | null;
41
- commit_invoice?: string | null;
42
- ddp?: string | null;
41
+ commit_invoice?: boolean | null;
42
+ ddp?: boolean | null;
43
43
  tax_categories?: TaxCategoryRel[] | null;
44
44
  }
45
45
  declare class AvalaraAccounts extends ApiResource<AvalaraAccount> {
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
9
10
  import type { Coupon, CouponType } from './coupons';
10
11
  import type { SkuList, SkuListType } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -32,6 +33,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
33
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
34
  type: CouponCodesPromotionRuleType;
34
35
  };
36
+ type CustomPromotionRuleRel = ResourceRel & {
37
+ type: CustomPromotionRuleType;
38
+ };
35
39
  type CouponRel = ResourceRel & {
36
40
  type: CouponType;
37
41
  };
@@ -61,6 +65,7 @@ interface BuyXPayYPromotion extends Resource {
61
65
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
62
66
  sku_list_promotion_rule?: SkuListPromotionRule | null;
63
67
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
68
+ custom_promotion_rule?: CustomPromotionRule | null;
64
69
  coupons?: Coupon[] | null;
65
70
  sku_list?: SkuList | null;
66
71
  attachments?: Attachment[] | null;
@@ -87,6 +92,7 @@ interface BuyXPayYPromotionCreate extends ResourceCreate {
87
92
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
88
93
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
89
94
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
95
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
90
96
  coupons?: CouponRel[] | null;
91
97
  sku_list: SkuListRel;
92
98
  tags?: TagRel[] | null;
@@ -109,6 +115,7 @@ interface BuyXPayYPromotionUpdate extends ResourceUpdate {
109
115
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
110
116
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
111
117
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
118
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
112
119
  coupons?: CouponRel[] | null;
113
120
  sku_list?: SkuListRel | null;
114
121
  tags?: TagRel[] | null;
@@ -122,6 +129,7 @@ declare class BuyXPayYPromotions extends ApiResource<BuyXPayYPromotion> {
122
129
  order_amount_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
123
130
  sku_list_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
124
131
  coupon_codes_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
132
+ custom_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
125
133
  coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
126
134
  sku_list(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
127
135
  attachments(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -27,6 +27,10 @@ class BuyXPayYPromotions extends resource_1.ApiResource {
27
27
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
28
28
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupon_codes_promotion_rule`, params, options);
29
29
  }
30
+ async custom_promotion_rule(buyXPayYPromotionId, params, options) {
31
+ const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
32
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/custom_promotion_rule`, params, options);
33
+ }
30
34
  async coupons(buyXPayYPromotionId, params, options) {
31
35
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
32
36
  return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
9
10
  import type { Coupon, CouponType } from './coupons';
10
11
  import type { SkuList, SkuListType } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -32,6 +33,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
33
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
34
  type: CouponCodesPromotionRuleType;
34
35
  };
36
+ type CustomPromotionRuleRel = ResourceRel & {
37
+ type: CustomPromotionRuleType;
38
+ };
35
39
  type CouponRel = ResourceRel & {
36
40
  type: CouponType;
37
41
  };
@@ -60,6 +64,7 @@ interface ExternalPromotion extends Resource {
60
64
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
61
65
  sku_list_promotion_rule?: SkuListPromotionRule | null;
62
66
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
67
+ custom_promotion_rule?: CustomPromotionRule | null;
63
68
  coupons?: Coupon[] | null;
64
69
  sku_list?: SkuList | null;
65
70
  attachments?: Attachment[] | null;
@@ -84,6 +89,7 @@ interface ExternalPromotionCreate extends ResourceCreate {
84
89
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
85
90
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
86
91
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
92
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
87
93
  coupons?: CouponRel[] | null;
88
94
  sku_list?: SkuListRel | null;
89
95
  tags?: TagRel[] | null;
@@ -104,6 +110,7 @@ interface ExternalPromotionUpdate extends ResourceUpdate {
104
110
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
105
111
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
106
112
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
113
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
107
114
  coupons?: CouponRel[] | null;
108
115
  sku_list?: SkuListRel | null;
109
116
  tags?: TagRel[] | null;
@@ -117,6 +124,7 @@ declare class ExternalPromotions extends ApiResource<ExternalPromotion> {
117
124
  order_amount_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
118
125
  sku_list_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
119
126
  coupon_codes_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
127
+ custom_promotion_rule(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
120
128
  coupons(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
121
129
  sku_list(externalPromotionId: string | ExternalPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
122
130
  attachments(externalPromotionId: string | ExternalPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -27,6 +27,10 @@ class ExternalPromotions extends resource_1.ApiResource {
27
27
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
28
28
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `external_promotions/${_externalPromotionId}/coupon_codes_promotion_rule`, params, options);
29
29
  }
30
+ async custom_promotion_rule(externalPromotionId, params, options) {
31
+ const _externalPromotionId = externalPromotionId.id || externalPromotionId;
32
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `external_promotions/${_externalPromotionId}/custom_promotion_rule`, params, options);
33
+ }
30
34
  async coupons(externalPromotionId, params, options) {
31
35
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
32
36
  return this.resources.fetch({ type: 'coupons' }, `external_promotions/${_externalPromotionId}/coupons`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
9
10
  import type { Coupon, CouponType } from './coupons';
10
11
  import type { SkuList, SkuListType } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -32,6 +33,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
33
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
34
  type: CouponCodesPromotionRuleType;
34
35
  };
36
+ type CustomPromotionRuleRel = ResourceRel & {
37
+ type: CustomPromotionRuleType;
38
+ };
35
39
  type CouponRel = ResourceRel & {
36
40
  type: CouponType;
37
41
  };
@@ -61,6 +65,7 @@ interface FixedAmountPromotion extends Resource {
61
65
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
62
66
  sku_list_promotion_rule?: SkuListPromotionRule | null;
63
67
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
68
+ custom_promotion_rule?: CustomPromotionRule | null;
64
69
  coupons?: Coupon[] | null;
65
70
  sku_list?: SkuList | null;
66
71
  attachments?: Attachment[] | null;
@@ -85,6 +90,7 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
85
90
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
86
91
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
87
92
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
93
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
88
94
  coupons?: CouponRel[] | null;
89
95
  sku_list?: SkuListRel | null;
90
96
  tags?: TagRel[] | null;
@@ -105,6 +111,7 @@ interface FixedAmountPromotionUpdate extends ResourceUpdate {
105
111
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
106
112
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
107
113
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
114
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
108
115
  coupons?: CouponRel[] | null;
109
116
  sku_list?: SkuListRel | null;
110
117
  tags?: TagRel[] | null;
@@ -118,6 +125,7 @@ declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
118
125
  order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
119
126
  sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
120
127
  coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
128
+ custom_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
121
129
  coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
122
130
  sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
123
131
  attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -27,6 +27,10 @@ class FixedAmountPromotions extends resource_1.ApiResource {
27
27
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
28
28
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
29
29
  }
30
+ async custom_promotion_rule(fixedAmountPromotionId, params, options) {
31
+ const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
32
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
33
+ }
30
34
  async coupons(fixedAmountPromotionId, params, options) {
31
35
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
32
36
  return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
9
10
  import type { Coupon, CouponType } from './coupons';
10
11
  import type { SkuList, SkuListType } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -32,6 +33,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
33
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
34
  type: CouponCodesPromotionRuleType;
34
35
  };
36
+ type CustomPromotionRuleRel = ResourceRel & {
37
+ type: CustomPromotionRuleType;
38
+ };
35
39
  type CouponRel = ResourceRel & {
36
40
  type: CouponType;
37
41
  };
@@ -61,6 +65,7 @@ interface FixedPricePromotion extends Resource {
61
65
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
62
66
  sku_list_promotion_rule?: SkuListPromotionRule | null;
63
67
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
68
+ custom_promotion_rule?: CustomPromotionRule | null;
64
69
  coupons?: Coupon[] | null;
65
70
  sku_list?: SkuList | null;
66
71
  attachments?: Attachment[] | null;
@@ -85,6 +90,7 @@ interface FixedPricePromotionCreate extends ResourceCreate {
85
90
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
86
91
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
87
92
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
93
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
88
94
  coupons?: CouponRel[] | null;
89
95
  sku_list: SkuListRel;
90
96
  tags?: TagRel[] | null;
@@ -105,6 +111,7 @@ interface FixedPricePromotionUpdate extends ResourceUpdate {
105
111
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
106
112
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
107
113
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
114
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
108
115
  coupons?: CouponRel[] | null;
109
116
  sku_list?: SkuListRel | null;
110
117
  tags?: TagRel[] | null;
@@ -118,6 +125,7 @@ declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
118
125
  order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
119
126
  sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
120
127
  coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
128
+ custom_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
121
129
  coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
122
130
  sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
123
131
  attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -27,6 +27,10 @@ class FixedPricePromotions extends resource_1.ApiResource {
27
27
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
28
28
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
29
29
  }
30
+ async custom_promotion_rule(fixedPricePromotionId, params, options) {
31
+ const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
32
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/custom_promotion_rule`, params, options);
33
+ }
30
34
  async coupons(fixedPricePromotionId, params, options) {
31
35
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
32
36
  return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
9
10
  import type { Coupon, CouponType } from './coupons';
10
11
  import type { SkuList, SkuListType } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -32,6 +33,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
33
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
34
  type: CouponCodesPromotionRuleType;
34
35
  };
36
+ type CustomPromotionRuleRel = ResourceRel & {
37
+ type: CustomPromotionRuleType;
38
+ };
35
39
  type CouponRel = ResourceRel & {
36
40
  type: CouponType;
37
41
  };
@@ -59,6 +63,7 @@ interface FreeGiftPromotion extends Resource {
59
63
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
60
64
  sku_list_promotion_rule?: SkuListPromotionRule | null;
61
65
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
66
+ custom_promotion_rule?: CustomPromotionRule | null;
62
67
  coupons?: Coupon[] | null;
63
68
  sku_list?: SkuList | null;
64
69
  attachments?: Attachment[] | null;
@@ -83,6 +88,7 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
83
88
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
84
89
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
85
90
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
91
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
86
92
  coupons?: CouponRel[] | null;
87
93
  sku_list: SkuListRel;
88
94
  tags?: TagRel[] | null;
@@ -103,6 +109,7 @@ interface FreeGiftPromotionUpdate extends ResourceUpdate {
103
109
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
104
110
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
105
111
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
112
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
106
113
  coupons?: CouponRel[] | null;
107
114
  sku_list?: SkuListRel | null;
108
115
  tags?: TagRel[] | null;
@@ -116,6 +123,7 @@ declare class FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
116
123
  order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
117
124
  sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
118
125
  coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
126
+ custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
119
127
  coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
120
128
  sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
121
129
  attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -27,6 +27,10 @@ class FreeGiftPromotions extends resource_1.ApiResource {
27
27
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
28
28
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options);
29
29
  }
30
+ async custom_promotion_rule(freeGiftPromotionId, params, options) {
31
+ const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
32
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options);
33
+ }
30
34
  async coupons(freeGiftPromotionId, params, options) {
31
35
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
32
36
  return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
9
10
  import type { Coupon, CouponType } from './coupons';
10
11
  import type { SkuList } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -31,6 +32,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
31
32
  type CouponCodesPromotionRuleRel = ResourceRel & {
32
33
  type: CouponCodesPromotionRuleType;
33
34
  };
35
+ type CustomPromotionRuleRel = ResourceRel & {
36
+ type: CustomPromotionRuleType;
37
+ };
34
38
  type CouponRel = ResourceRel & {
35
39
  type: CouponType;
36
40
  };
@@ -54,6 +58,7 @@ interface FreeShippingPromotion extends Resource {
54
58
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
55
59
  sku_list_promotion_rule?: SkuListPromotionRule | null;
56
60
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
61
+ custom_promotion_rule?: CustomPromotionRule | null;
57
62
  coupons?: Coupon[] | null;
58
63
  sku_list?: SkuList | null;
59
64
  attachments?: Attachment[] | null;
@@ -76,6 +81,7 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
76
81
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
77
82
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
78
83
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
84
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
79
85
  coupons?: CouponRel[] | null;
80
86
  tags?: TagRel[] | null;
81
87
  }
@@ -94,6 +100,7 @@ interface FreeShippingPromotionUpdate extends ResourceUpdate {
94
100
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
95
101
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
96
102
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
103
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
97
104
  coupons?: CouponRel[] | null;
98
105
  tags?: TagRel[] | null;
99
106
  }
@@ -106,6 +113,7 @@ declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion>
106
113
  order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
107
114
  sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
108
115
  coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
116
+ custom_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
109
117
  coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
110
118
  sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
111
119
  attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -27,6 +27,10 @@ class FreeShippingPromotions extends resource_1.ApiResource {
27
27
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
28
28
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
29
29
  }
30
+ async custom_promotion_rule(freeShippingPromotionId, params, options) {
31
+ const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
32
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options);
33
+ }
30
34
  async coupons(freeShippingPromotionId, params, options) {
31
35
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
32
36
  return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
@@ -16,6 +16,7 @@ interface InventoryModel extends Resource {
16
16
  stock_locations_cutoff?: number | null;
17
17
  stock_reservation_cutoff?: number | null;
18
18
  put_stock_transfers_on_hold?: boolean | null;
19
+ manual_stock_decrement?: boolean | null;
19
20
  inventory_stock_locations?: InventoryStockLocation[] | null;
20
21
  inventory_return_locations?: InventoryReturnLocation[] | null;
21
22
  attachments?: Attachment[] | null;
@@ -27,6 +28,7 @@ interface InventoryModelCreate extends ResourceCreate {
27
28
  stock_locations_cutoff?: number | null;
28
29
  stock_reservation_cutoff?: number | null;
29
30
  put_stock_transfers_on_hold?: boolean | null;
31
+ manual_stock_decrement?: boolean | null;
30
32
  }
31
33
  interface InventoryModelUpdate extends ResourceUpdate {
32
34
  name?: string | null;
@@ -34,6 +36,7 @@ interface InventoryModelUpdate extends ResourceUpdate {
34
36
  stock_locations_cutoff?: number | null;
35
37
  stock_reservation_cutoff?: number | null;
36
38
  put_stock_transfers_on_hold?: boolean | null;
39
+ manual_stock_decrement?: boolean | null;
37
40
  }
38
41
  declare class InventoryModels extends ApiResource<InventoryModel> {
39
42
  static readonly TYPE: InventoryModelType;
@@ -13,6 +13,7 @@ import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } fro
13
13
  import type { Shipment, ShipmentType } from './shipments';
14
14
  import type { Sku, SkuType } from './skus';
15
15
  import type { LineItemOption } from './line_item_options';
16
+ import type { ReturnLineItem } from './return_line_items';
16
17
  import type { StockReservation } from './stock_reservations';
17
18
  import type { StockLineItem } from './stock_line_items';
18
19
  import type { StockTransfer } from './stock_transfers';
@@ -96,6 +97,7 @@ interface LineItem extends Resource {
96
97
  sku?: Sku | null;
97
98
  bundle?: Bundle | null;
98
99
  line_item_options?: LineItemOption[] | null;
100
+ return_line_items?: ReturnLineItem[] | null;
99
101
  /**
100
102
  * @deprecated This field should not be used as it may be removed in the future without notice
101
103
  */
@@ -144,6 +146,7 @@ declare class LineItems extends ApiResource<LineItem> {
144
146
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
145
147
  order(lineItemId: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
146
148
  line_item_options(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
149
+ return_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
147
150
  stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
148
151
  stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
149
152
  stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
@@ -19,6 +19,10 @@ class LineItems extends resource_1.ApiResource {
19
19
  const _lineItemId = lineItemId.id || lineItemId;
20
20
  return this.resources.fetch({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options);
21
21
  }
22
+ async return_line_items(lineItemId, params, options) {
23
+ const _lineItemId = lineItemId.id || lineItemId;
24
+ return this.resources.fetch({ type: 'return_line_items' }, `line_items/${_lineItemId}/return_line_items`, params, options);
25
+ }
22
26
  async stock_reservations(lineItemId, params, options) {
23
27
  const _lineItemId = lineItemId.id || lineItemId;
24
28
  return this.resources.fetch({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options);
@@ -217,6 +217,7 @@ interface Order extends Resource {
217
217
  voids?: Void[] | null;
218
218
  refunds?: Refund[] | null;
219
219
  returns?: Return[] | null;
220
+ order_subscription?: OrderSubscription | null;
220
221
  order_subscriptions?: OrderSubscription[] | null;
221
222
  order_factories?: OrderFactory[] | null;
222
223
  order_copies?: OrderCopy[] | null;
@@ -331,6 +332,7 @@ declare class Orders extends ApiResource<Order> {
331
332
  voids(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
332
333
  refunds(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
333
334
  returns(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
335
+ order_subscription(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
334
336
  order_subscriptions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
335
337
  order_factories(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderFactory>>;
336
338
  order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
@@ -95,6 +95,10 @@ class Orders extends resource_1.ApiResource {
95
95
  const _orderId = orderId.id || orderId;
96
96
  return this.resources.fetch({ type: 'returns' }, `orders/${_orderId}/returns`, params, options);
97
97
  }
98
+ async order_subscription(orderId, params, options) {
99
+ const _orderId = orderId.id || orderId;
100
+ return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscription`, params, options);
101
+ }
98
102
  async order_subscriptions(orderId, params, options) {
99
103
  const _orderId = orderId.id || orderId;
100
104
  return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscriptions`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule, PromotionRuleType } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule, OrderAmountPromotionRuleType } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule, SkuListPromotionRuleType } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule, CouponCodesPromotionRuleType } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
9
10
  import type { Coupon, CouponType } from './coupons';
10
11
  import type { SkuList, SkuListType } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -32,6 +33,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
33
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
34
  type: CouponCodesPromotionRuleType;
34
35
  };
36
+ type CustomPromotionRuleRel = ResourceRel & {
37
+ type: CustomPromotionRuleType;
38
+ };
35
39
  type CouponRel = ResourceRel & {
36
40
  type: CouponType;
37
41
  };
@@ -59,6 +63,7 @@ interface PercentageDiscountPromotion extends Resource {
59
63
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
60
64
  sku_list_promotion_rule?: SkuListPromotionRule | null;
61
65
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
66
+ custom_promotion_rule?: CustomPromotionRule | null;
62
67
  coupons?: Coupon[] | null;
63
68
  sku_list?: SkuList | null;
64
69
  attachments?: Attachment[] | null;
@@ -83,6 +88,7 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
83
88
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
84
89
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
85
90
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
91
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
86
92
  coupons?: CouponRel[] | null;
87
93
  sku_list?: SkuListRel | null;
88
94
  tags?: TagRel[] | null;
@@ -103,6 +109,7 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
103
109
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
104
110
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
105
111
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
112
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
106
113
  coupons?: CouponRel[] | null;
107
114
  sku_list?: SkuListRel | null;
108
115
  tags?: TagRel[] | null;
@@ -116,6 +123,7 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
116
123
  order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
117
124
  sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
118
125
  coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
126
+ custom_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
119
127
  coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
120
128
  sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
121
129
  attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
@@ -27,6 +27,10 @@ class PercentageDiscountPromotions extends resource_1.ApiResource {
27
27
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
28
28
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupon_codes_promotion_rule`, params, options);
29
29
  }
30
+ async custom_promotion_rule(percentageDiscountPromotionId, params, options) {
31
+ const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
32
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/custom_promotion_rule`, params, options);
33
+ }
30
34
  async coupons(percentageDiscountPromotionId, params, options) {
31
35
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
32
36
  return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
9
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
10
  import type { Coupon } from './coupons';
10
11
  import type { SkuList } from './sku_lists';
11
12
  import type { Attachment } from './attachments';
@@ -33,6 +34,7 @@ interface Promotion extends Resource {
33
34
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
34
35
  sku_list_promotion_rule?: SkuListPromotionRule | null;
35
36
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
37
+ custom_promotion_rule?: CustomPromotionRule | null;
36
38
  coupons?: Coupon[] | null;
37
39
  sku_list?: SkuList | null;
38
40
  attachments?: Attachment[] | null;
@@ -46,6 +48,7 @@ declare class Promotions extends ApiResource<Promotion> {
46
48
  order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
47
49
  sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
48
50
  coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
51
+ custom_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
49
52
  coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
50
53
  sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
51
54
  attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;