@commercelayer/sdk 5.27.2 → 5.28.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 (67) hide show
  1. package/lib/cjs/client.js +1 -1
  2. package/lib/cjs/commercelayer.d.ts +2 -2
  3. package/lib/cjs/commercelayer.js +1 -1
  4. package/lib/cjs/error.d.ts +2 -2
  5. package/lib/cjs/jsonapi.d.ts +1 -0
  6. package/lib/cjs/jsonapi.js +1 -1
  7. package/lib/cjs/resource.d.ts +1 -1
  8. package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
  9. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +8 -0
  10. package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -0
  11. package/lib/cjs/resources/external_promotions.d.ts +8 -0
  12. package/lib/cjs/resources/external_promotions.js +4 -0
  13. package/lib/cjs/resources/fixed_amount_promotions.d.ts +8 -0
  14. package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
  15. package/lib/cjs/resources/fixed_price_promotions.d.ts +8 -0
  16. package/lib/cjs/resources/fixed_price_promotions.js +4 -0
  17. package/lib/cjs/resources/free_gift_promotions.d.ts +8 -0
  18. package/lib/cjs/resources/free_gift_promotions.js +4 -0
  19. package/lib/cjs/resources/free_shipping_promotions.d.ts +8 -0
  20. package/lib/cjs/resources/free_shipping_promotions.js +4 -0
  21. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  22. package/lib/cjs/resources/line_items.d.ts +3 -0
  23. package/lib/cjs/resources/line_items.js +4 -0
  24. package/lib/cjs/resources/orders.d.ts +2 -0
  25. package/lib/cjs/resources/orders.js +4 -0
  26. package/lib/cjs/resources/percentage_discount_promotions.d.ts +8 -0
  27. package/lib/cjs/resources/percentage_discount_promotions.js +4 -0
  28. package/lib/cjs/resources/promotions.d.ts +3 -0
  29. package/lib/cjs/resources/promotions.js +4 -0
  30. package/lib/cjs/resources/stock_line_items.d.ts +6 -0
  31. package/lib/cjs/resources/stock_line_items.js +9 -0
  32. package/lib/cjs/resources/stock_reservations.d.ts +0 -1
  33. package/lib/esm/client.js +1 -1
  34. package/lib/esm/commercelayer.d.ts +2 -2
  35. package/lib/esm/commercelayer.js +1 -1
  36. package/lib/esm/error.d.ts +2 -2
  37. package/lib/esm/jsonapi.d.ts +1 -0
  38. package/lib/esm/jsonapi.js +1 -1
  39. package/lib/esm/resource.d.ts +1 -1
  40. package/lib/esm/resources/avalara_accounts.d.ts +6 -6
  41. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +8 -0
  42. package/lib/esm/resources/buy_x_pay_y_promotions.js +4 -0
  43. package/lib/esm/resources/external_promotions.d.ts +8 -0
  44. package/lib/esm/resources/external_promotions.js +4 -0
  45. package/lib/esm/resources/fixed_amount_promotions.d.ts +8 -0
  46. package/lib/esm/resources/fixed_amount_promotions.js +4 -0
  47. package/lib/esm/resources/fixed_price_promotions.d.ts +8 -0
  48. package/lib/esm/resources/fixed_price_promotions.js +4 -0
  49. package/lib/esm/resources/free_gift_promotions.d.ts +8 -0
  50. package/lib/esm/resources/free_gift_promotions.js +4 -0
  51. package/lib/esm/resources/free_shipping_promotions.d.ts +8 -0
  52. package/lib/esm/resources/free_shipping_promotions.js +4 -0
  53. package/lib/esm/resources/inventory_models.d.ts +3 -0
  54. package/lib/esm/resources/line_items.d.ts +3 -0
  55. package/lib/esm/resources/line_items.js +4 -0
  56. package/lib/esm/resources/orders.d.ts +2 -0
  57. package/lib/esm/resources/orders.js +4 -0
  58. package/lib/esm/resources/percentage_discount_promotions.d.ts +8 -0
  59. package/lib/esm/resources/percentage_discount_promotions.js +4 -0
  60. package/lib/esm/resources/promotions.d.ts +3 -0
  61. package/lib/esm/resources/promotions.js +4 -0
  62. package/lib/esm/resources/stock_line_items.d.ts +6 -0
  63. package/lib/esm/resources/stock_line_items.js +9 -0
  64. package/lib/esm/resources/stock_reservations.d.ts +0 -1
  65. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  66. package/lib/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +4 -4
@@ -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>>;
@@ -18,6 +18,10 @@ class Promotions extends resource_1.ApiResource {
18
18
  const _promotionId = promotionId.id || promotionId;
19
19
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
20
20
  }
21
+ async custom_promotion_rule(promotionId, params, options) {
22
+ const _promotionId = promotionId.id || promotionId;
23
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `promotions/${_promotionId}/custom_promotion_rule`, params, options);
24
+ }
21
25
  async coupons(promotionId, params, options) {
22
26
  const _promotionId = promotionId.id || promotionId;
23
27
  return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
@@ -44,6 +44,9 @@ interface StockLineItemCreate extends ResourceCreate {
44
44
  interface StockLineItemUpdate extends ResourceUpdate {
45
45
  sku_code?: string | null;
46
46
  quantity?: number | null;
47
+ _reserve_stock?: boolean | null;
48
+ _release_stock?: boolean | null;
49
+ _decrement_stock?: boolean | null;
47
50
  shipment?: ShipmentRel | null;
48
51
  line_item?: LineItemRel | null;
49
52
  stock_item?: StockItemRel | null;
@@ -59,6 +62,9 @@ declare class StockLineItems extends ApiResource<StockLineItem> {
59
62
  stock_item(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockItem>;
60
63
  sku(stockLineItemId: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
61
64
  versions(stockLineItemId: string | StockLineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
65
+ _reserve_stock(id: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
66
+ _release_stock(id: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
67
+ _decrement_stock(id: string | StockLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLineItem>;
62
68
  isStockLineItem(resource: any): resource is StockLineItem;
63
69
  relationship(id: string | ResourceId | null): StockLineItemRel;
64
70
  type(): StockLineItemType;
@@ -31,6 +31,15 @@ class StockLineItems extends resource_1.ApiResource {
31
31
  const _stockLineItemId = stockLineItemId.id || stockLineItemId;
32
32
  return this.resources.fetch({ type: 'versions' }, `stock_line_items/${_stockLineItemId}/versions`, params, options);
33
33
  }
34
+ async _reserve_stock(id, params, options) {
35
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockLineItems.TYPE, _reserve_stock: true }, params, options);
36
+ }
37
+ async _release_stock(id, params, options) {
38
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockLineItems.TYPE, _release_stock: true }, params, options);
39
+ }
40
+ async _decrement_stock(id, params, options) {
41
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockLineItems.TYPE, _decrement_stock: true }, params, options);
42
+ }
34
43
  isStockLineItem(resource) {
35
44
  return resource.type && (resource.type === StockLineItems.TYPE);
36
45
  }
@@ -31,7 +31,6 @@ interface StockReservationCreate extends ResourceCreate {
31
31
  interface StockReservationUpdate extends ResourceUpdate {
32
32
  quantity?: number | null;
33
33
  _pending?: boolean | null;
34
- stock_item?: StockItemRel | null;
35
34
  }
36
35
  declare class StockReservations extends ApiResource<StockReservation> {
37
36
  static readonly TYPE: StockReservationType;
package/lib/esm/client.js CHANGED
@@ -132,7 +132,7 @@ class ApiClient {
132
132
  // const start = Date.now()
133
133
  return __classPrivateFieldGet(this, _ApiClient_client, "f").request(requestParams)
134
134
  .then(response => response.data)
135
- .catch(error => handleError(error));
135
+ .catch((error) => handleError(error));
136
136
  // .finally(() => console.log(`<<-- ${method} ${path} ${Date.now() - start}`))
137
137
  }
138
138
  customHeaders(headers) {
@@ -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;
@@ -16,7 +16,7 @@ import ResourceAdapter from './resource';
16
16
  import Debug from './debug';
17
17
  const debug = Debug('commercelayer');
18
18
  // Autogenerated schema version number, do not remove this line
19
- const OPEN_API_SCHEMA_VERSION = '4.23.0';
19
+ const OPEN_API_SCHEMA_VERSION = '4.24.0';
20
20
  export { OPEN_API_SCHEMA_VERSION };
21
21
  class CommerceLayerClient {
22
22
  // ##__CL_RESOURCES_DEF_STOP__##
@@ -8,8 +8,8 @@ declare enum ErrorType {
8
8
  }
9
9
  declare class SdkError extends Error {
10
10
  static NAME: string;
11
- static isSdkError(error: any): error is ApiError;
12
- type: string;
11
+ static isSdkError(error: any): error is SdkError;
12
+ type: ErrorType;
13
13
  code?: string;
14
14
  source?: Error;
15
15
  request?: any;
@@ -1,5 +1,6 @@
1
1
  import type { DocWithData, ResourceObject as JSONAPIObject } from 'jsonapi-typescript';
2
2
  import type { ResourceCreate, ResourceUpdate, ResourceId, ResourceType, Resource } from './resource';
3
+ export type { DocWithData };
3
4
  declare const denormalize: <R extends Resource>(response: DocWithData) => R | R[];
4
5
  declare const normalize: (resource: (ResourceCreate & ResourceType) | (ResourceUpdate & ResourceId)) => JSONAPIObject;
5
6
  export { denormalize, normalize };
@@ -38,7 +38,7 @@ const denormalizeResource = (res, included) => {
38
38
  const rel = res.relationships[key].data;
39
39
  if (rel) {
40
40
  if (Array.isArray(rel))
41
- resource[key] = rel.map(r => denormalizeResource(findIncluded(r, included), included));
41
+ resource[key] = rel.map((r) => denormalizeResource(findIncluded(r, included), included));
42
42
  else
43
43
  resource[key] = denormalizeResource(findIncluded(rel, included), included);
44
44
  }
@@ -70,7 +70,7 @@ declare abstract class ApiResourceBase<R extends Resource> {
70
70
  constructor(adapter: ResourceAdapter);
71
71
  abstract relationship(id: string | ResourceId | null): ResourceRel;
72
72
  abstract type(): ResourceTypeLock;
73
- parse(resource: any): R | R[];
73
+ parse(resource: string): R | R[];
74
74
  update(resource: ResourceUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<R>;
75
75
  }
76
76
  declare abstract class ApiResource<R extends Resource> extends ApiResourceBase<R> {
@@ -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>>;
@@ -25,6 +25,10 @@ class BuyXPayYPromotions extends ApiResource {
25
25
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async custom_promotion_rule(buyXPayYPromotionId, params, options) {
29
+ const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/custom_promotion_rule`, params, options);
31
+ }
28
32
  async coupons(buyXPayYPromotionId, params, options) {
29
33
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
30
34
  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>>;
@@ -25,6 +25,10 @@ class ExternalPromotions extends ApiResource {
25
25
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `external_promotions/${_externalPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async custom_promotion_rule(externalPromotionId, params, options) {
29
+ const _externalPromotionId = externalPromotionId.id || externalPromotionId;
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `external_promotions/${_externalPromotionId}/custom_promotion_rule`, params, options);
31
+ }
28
32
  async coupons(externalPromotionId, params, options) {
29
33
  const _externalPromotionId = externalPromotionId.id || externalPromotionId;
30
34
  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>>;
@@ -25,6 +25,10 @@ class FixedAmountPromotions extends ApiResource {
25
25
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async custom_promotion_rule(fixedAmountPromotionId, params, options) {
29
+ const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/custom_promotion_rule`, params, options);
31
+ }
28
32
  async coupons(fixedAmountPromotionId, params, options) {
29
33
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
30
34
  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>>;
@@ -25,6 +25,10 @@ class FixedPricePromotions extends ApiResource {
25
25
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async custom_promotion_rule(fixedPricePromotionId, params, options) {
29
+ const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/custom_promotion_rule`, params, options);
31
+ }
28
32
  async coupons(fixedPricePromotionId, params, options) {
29
33
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
30
34
  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>>;
@@ -25,6 +25,10 @@ class FreeGiftPromotions extends ApiResource {
25
25
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async custom_promotion_rule(freeGiftPromotionId, params, options) {
29
+ const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options);
31
+ }
28
32
  async coupons(freeGiftPromotionId, params, options) {
29
33
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
30
34
  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>>;
@@ -25,6 +25,10 @@ class FreeShippingPromotions extends ApiResource {
25
25
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async custom_promotion_rule(freeShippingPromotionId, params, options) {
29
+ const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options);
31
+ }
28
32
  async coupons(freeShippingPromotionId, params, options) {
29
33
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
30
34
  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>>;