@commercelayer/sdk 4.41.0 → 4.44.1

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 (65) hide show
  1. package/lib/cjs/commercelayer.d.ts +2 -2
  2. package/lib/cjs/commercelayer.js +1 -1
  3. package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
  4. package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
  5. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +10 -12
  6. package/lib/cjs/resources/buy_x_pay_y_promotions.js +6 -2
  7. package/lib/cjs/resources/external_promotions.d.ts +10 -12
  8. package/lib/cjs/resources/external_promotions.js +6 -2
  9. package/lib/cjs/resources/fixed_amount_promotions.d.ts +10 -12
  10. package/lib/cjs/resources/fixed_amount_promotions.js +6 -2
  11. package/lib/cjs/resources/fixed_price_promotions.d.ts +10 -12
  12. package/lib/cjs/resources/fixed_price_promotions.js +6 -2
  13. package/lib/cjs/resources/free_gift_promotions.d.ts +10 -12
  14. package/lib/cjs/resources/free_gift_promotions.js +6 -2
  15. package/lib/cjs/resources/free_shipping_promotions.d.ts +15 -12
  16. package/lib/cjs/resources/free_shipping_promotions.js +6 -2
  17. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  18. package/lib/cjs/resources/line_items.d.ts +3 -0
  19. package/lib/cjs/resources/line_items.js +4 -0
  20. package/lib/cjs/resources/order_subscriptions.d.ts +1 -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/payment_methods.d.ts +3 -0
  24. package/lib/cjs/resources/percentage_discount_promotions.d.ts +10 -12
  25. package/lib/cjs/resources/percentage_discount_promotions.js +6 -2
  26. package/lib/cjs/resources/promotions.d.ts +6 -3
  27. package/lib/cjs/resources/promotions.js +6 -2
  28. package/lib/cjs/resources/stock_line_items.d.ts +3 -0
  29. package/lib/cjs/resources/stock_reservations.d.ts +0 -1
  30. package/lib/cjs/resources/stock_transfers.d.ts +1 -1
  31. package/lib/cjs/resources/stripe_payments.d.ts +3 -0
  32. package/lib/esm/commercelayer.d.ts +2 -2
  33. package/lib/esm/commercelayer.js +1 -1
  34. package/lib/esm/resources/adyen_gateways.d.ts +2 -2
  35. package/lib/esm/resources/avalara_accounts.d.ts +6 -6
  36. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +10 -12
  37. package/lib/esm/resources/buy_x_pay_y_promotions.js +6 -2
  38. package/lib/esm/resources/external_promotions.d.ts +10 -12
  39. package/lib/esm/resources/external_promotions.js +6 -2
  40. package/lib/esm/resources/fixed_amount_promotions.d.ts +10 -12
  41. package/lib/esm/resources/fixed_amount_promotions.js +6 -2
  42. package/lib/esm/resources/fixed_price_promotions.d.ts +10 -12
  43. package/lib/esm/resources/fixed_price_promotions.js +6 -2
  44. package/lib/esm/resources/free_gift_promotions.d.ts +10 -12
  45. package/lib/esm/resources/free_gift_promotions.js +6 -2
  46. package/lib/esm/resources/free_shipping_promotions.d.ts +15 -12
  47. package/lib/esm/resources/free_shipping_promotions.js +6 -2
  48. package/lib/esm/resources/inventory_models.d.ts +3 -0
  49. package/lib/esm/resources/line_items.d.ts +3 -0
  50. package/lib/esm/resources/line_items.js +4 -0
  51. package/lib/esm/resources/order_subscriptions.d.ts +1 -0
  52. package/lib/esm/resources/orders.d.ts +2 -0
  53. package/lib/esm/resources/orders.js +4 -0
  54. package/lib/esm/resources/payment_methods.d.ts +3 -0
  55. package/lib/esm/resources/percentage_discount_promotions.d.ts +10 -12
  56. package/lib/esm/resources/percentage_discount_promotions.js +6 -2
  57. package/lib/esm/resources/promotions.d.ts +6 -3
  58. package/lib/esm/resources/promotions.js +6 -2
  59. package/lib/esm/resources/stock_line_items.d.ts +3 -0
  60. package/lib/esm/resources/stock_reservations.d.ts +0 -1
  61. package/lib/esm/resources/stock_transfers.d.ts +1 -1
  62. package/lib/esm/resources/stripe_payments.d.ts +3 -0
  63. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  64. package/lib/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +18 -18
@@ -5,8 +5,9 @@ import type { PromotionRule } from './promotion_rules';
5
5
  import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
6
6
  import type { SkuListPromotionRule } from './sku_list_promotion_rules';
7
7
  import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
8
- import type { Coupon } from './coupons';
8
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -17,9 +18,6 @@ type FreeShippingPromotionRel = ResourceRel & {
17
18
  type MarketRel = ResourceRel & {
18
19
  type: 'markets';
19
20
  };
20
- type PromotionRuleRel = ResourceRel & {
21
- type: 'promotion_rules';
22
- };
23
21
  type OrderAmountPromotionRuleRel = ResourceRel & {
24
22
  type: 'order_amount_promotion_rules';
25
23
  };
@@ -29,8 +27,11 @@ type SkuListPromotionRuleRel = ResourceRel & {
29
27
  type CouponCodesPromotionRuleRel = ResourceRel & {
30
28
  type: 'coupon_codes_promotion_rules';
31
29
  };
32
- type CouponRel = ResourceRel & {
33
- type: 'coupons';
30
+ type CustomPromotionRuleRel = ResourceRel & {
31
+ type: 'custom_promotion_rules';
32
+ };
33
+ type SkuListRel = ResourceRel & {
34
+ type: 'sku_lists';
34
35
  };
35
36
  type TagRel = ResourceRel & {
36
37
  type: 'tags';
@@ -51,8 +52,9 @@ interface FreeShippingPromotion extends Resource {
51
52
  order_amount_promotion_rule?: OrderAmountPromotionRule;
52
53
  sku_list_promotion_rule?: SkuListPromotionRule;
53
54
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
54
- coupons?: Coupon[];
55
+ custom_promotion_rule?: CustomPromotionRule;
55
56
  sku_list?: SkuList;
57
+ coupons?: Coupon[];
56
58
  attachments?: Attachment[];
57
59
  events?: Event[];
58
60
  tags?: Tag[];
@@ -69,11 +71,11 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
69
71
  _disable?: boolean;
70
72
  _enable?: boolean;
71
73
  market?: MarketRel;
72
- promotion_rules?: PromotionRuleRel[];
73
74
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
74
75
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
75
76
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
76
- coupons?: CouponRel[];
77
+ custom_promotion_rule?: CustomPromotionRuleRel;
78
+ sku_list?: SkuListRel;
77
79
  tags?: TagRel[];
78
80
  }
79
81
  interface FreeShippingPromotionUpdate extends ResourceUpdate {
@@ -87,11 +89,11 @@ interface FreeShippingPromotionUpdate extends ResourceUpdate {
87
89
  _disable?: boolean;
88
90
  _enable?: boolean;
89
91
  market?: MarketRel;
90
- promotion_rules?: PromotionRuleRel[];
91
92
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
92
93
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
93
94
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
94
- coupons?: CouponRel[];
95
+ custom_promotion_rule?: CustomPromotionRuleRel;
96
+ sku_list?: SkuListRel;
95
97
  tags?: TagRel[];
96
98
  }
97
99
  declare class FreeShippingPromotions extends ApiResource {
@@ -105,8 +107,9 @@ declare class FreeShippingPromotions extends ApiResource {
105
107
  order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
106
108
  sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
107
109
  coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
108
- coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
110
+ custom_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
109
111
  sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
112
+ coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
110
113
  attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
111
114
  events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
112
115
  tags(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -34,14 +34,18 @@ class FreeShippingPromotions extends resource_1.ApiResource {
34
34
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
35
35
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
36
36
  }
37
- async coupons(freeShippingPromotionId, params, options) {
37
+ async custom_promotion_rule(freeShippingPromotionId, params, options) {
38
38
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
39
- return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
39
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options);
40
40
  }
41
41
  async sku_list(freeShippingPromotionId, params, options) {
42
42
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
43
43
  return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
44
44
  }
45
+ async coupons(freeShippingPromotionId, params, options) {
46
+ const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
47
+ return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
48
+ }
45
49
  async attachments(freeShippingPromotionId, params, options) {
46
50
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
47
51
  return this.resources.fetch({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options);
@@ -13,6 +13,7 @@ interface InventoryModel extends Resource {
13
13
  stock_locations_cutoff?: number;
14
14
  stock_reservation_cutoff?: number;
15
15
  put_stock_transfers_on_hold?: boolean;
16
+ manual_stock_decrement?: boolean;
16
17
  inventory_stock_locations?: InventoryStockLocation[];
17
18
  inventory_return_locations?: InventoryReturnLocation[];
18
19
  attachments?: Attachment[];
@@ -24,6 +25,7 @@ interface InventoryModelCreate extends ResourceCreate {
24
25
  stock_locations_cutoff?: number;
25
26
  stock_reservation_cutoff?: number;
26
27
  put_stock_transfers_on_hold?: boolean;
28
+ manual_stock_decrement?: boolean;
27
29
  }
28
30
  interface InventoryModelUpdate extends ResourceUpdate {
29
31
  name?: string;
@@ -31,6 +33,7 @@ interface InventoryModelUpdate extends ResourceUpdate {
31
33
  stock_locations_cutoff?: number;
32
34
  stock_reservation_cutoff?: number;
33
35
  put_stock_transfers_on_hold?: boolean;
36
+ manual_stock_decrement?: boolean;
34
37
  }
35
38
  declare class InventoryModels extends ApiResource {
36
39
  static readonly TYPE: 'inventory_models';
@@ -12,6 +12,7 @@ import type { PercentageDiscountPromotion } from './percentage_discount_promotio
12
12
  import type { Shipment } from './shipments';
13
13
  import type { Sku } from './skus';
14
14
  import type { LineItemOption } from './line_item_options';
15
+ import type { ReturnLineItem } from './return_line_items';
15
16
  import type { StockReservation } from './stock_reservations';
16
17
  import type { StockLineItem } from './stock_line_items';
17
18
  import type { StockTransfer } from './stock_transfers';
@@ -93,6 +94,7 @@ interface LineItem extends Resource {
93
94
  sku?: Sku;
94
95
  bundle?: Bundle;
95
96
  line_item_options?: LineItemOption[];
97
+ return_line_items?: ReturnLineItem[];
96
98
  /**
97
99
  * @deprecated This field should not be used as it may be removed in the future without notice
98
100
  */
@@ -143,6 +145,7 @@ declare class LineItems extends ApiResource {
143
145
  delete(id: string, options?: ResourcesConfig): Promise<void>;
144
146
  order(lineItemId: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
145
147
  line_item_options(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
148
+ return_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
146
149
  stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
147
150
  stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
148
151
  stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
@@ -26,6 +26,10 @@ class LineItems extends resource_1.ApiResource {
26
26
  const _lineItemId = lineItemId.id || lineItemId;
27
27
  return this.resources.fetch({ type: 'line_item_options' }, `line_items/${_lineItemId}/line_item_options`, params, options);
28
28
  }
29
+ async return_line_items(lineItemId, params, options) {
30
+ const _lineItemId = lineItemId.id || lineItemId;
31
+ return this.resources.fetch({ type: 'return_line_items' }, `line_items/${_lineItemId}/return_line_items`, params, options);
32
+ }
29
33
  async stock_reservations(lineItemId, params, options) {
30
34
  const _lineItemId = lineItemId.id || lineItemId;
31
35
  return this.resources.fetch({ type: 'stock_reservations' }, `line_items/${_lineItemId}/stock_reservations`, params, options);
@@ -30,6 +30,7 @@ interface OrderSubscription extends Resource {
30
30
  customer_email?: string;
31
31
  starts_at?: string;
32
32
  expires_at?: string;
33
+ last_run_at?: string;
33
34
  next_run_at?: string;
34
35
  occurrencies?: number;
35
36
  errors_count?: number;
@@ -214,6 +214,7 @@ interface Order extends Resource {
214
214
  voids?: Void[];
215
215
  refunds?: Refund[];
216
216
  returns?: Return[];
217
+ order_subscription?: OrderSubscription;
217
218
  order_subscriptions?: OrderSubscription[];
218
219
  order_factories?: OrderFactory[];
219
220
  order_copies?: OrderCopy[];
@@ -330,6 +331,7 @@ declare class Orders extends ApiResource {
330
331
  voids(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
331
332
  refunds(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
332
333
  returns(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Return>>;
334
+ order_subscription(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
333
335
  order_subscriptions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderSubscription>>;
334
336
  order_factories(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderFactory>>;
335
337
  order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
@@ -102,6 +102,10 @@ class Orders extends resource_1.ApiResource {
102
102
  const _orderId = orderId.id || orderId;
103
103
  return this.resources.fetch({ type: 'returns' }, `orders/${_orderId}/returns`, params, options);
104
104
  }
105
+ async order_subscription(orderId, params, options) {
106
+ const _orderId = orderId.id || orderId;
107
+ return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscription`, params, options);
108
+ }
105
109
  async order_subscriptions(orderId, params, options) {
106
110
  const _orderId = orderId.id || orderId;
107
111
  return this.resources.fetch({ type: 'order_subscriptions' }, `orders/${_orderId}/order_subscriptions`, params, options);
@@ -19,6 +19,7 @@ interface PaymentMethod extends Resource {
19
19
  currency_code?: string;
20
20
  moto?: boolean;
21
21
  require_capture?: boolean;
22
+ auto_place?: boolean;
22
23
  auto_capture?: boolean;
23
24
  disabled_at?: string;
24
25
  price_amount_cents?: number;
@@ -37,6 +38,7 @@ interface PaymentMethodCreate extends ResourceCreate {
37
38
  currency_code?: string;
38
39
  moto?: boolean;
39
40
  require_capture?: boolean;
41
+ auto_place?: boolean;
40
42
  auto_capture?: boolean;
41
43
  _disable?: boolean;
42
44
  _enable?: boolean;
@@ -50,6 +52,7 @@ interface PaymentMethodUpdate extends ResourceUpdate {
50
52
  currency_code?: string;
51
53
  moto?: boolean;
52
54
  require_capture?: boolean;
55
+ auto_place?: boolean;
53
56
  auto_capture?: boolean;
54
57
  _disable?: boolean;
55
58
  _enable?: boolean;
@@ -5,8 +5,9 @@ import type { PromotionRule } from './promotion_rules';
5
5
  import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
6
6
  import type { SkuListPromotionRule } from './sku_list_promotion_rules';
7
7
  import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
8
- import type { Coupon } from './coupons';
8
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -18,9 +19,6 @@ type PercentageDiscountPromotionRel = ResourceRel & {
18
19
  type MarketRel = ResourceRel & {
19
20
  type: 'markets';
20
21
  };
21
- type PromotionRuleRel = ResourceRel & {
22
- type: 'promotion_rules';
23
- };
24
22
  type OrderAmountPromotionRuleRel = ResourceRel & {
25
23
  type: 'order_amount_promotion_rules';
26
24
  };
@@ -30,8 +28,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
28
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
29
  type: 'coupon_codes_promotion_rules';
32
30
  };
33
- type CouponRel = ResourceRel & {
34
- type: 'coupons';
31
+ type CustomPromotionRuleRel = ResourceRel & {
32
+ type: 'custom_promotion_rules';
35
33
  };
36
34
  type SkuListRel = ResourceRel & {
37
35
  type: 'sku_lists';
@@ -56,8 +54,9 @@ interface PercentageDiscountPromotion extends Resource {
56
54
  order_amount_promotion_rule?: OrderAmountPromotionRule;
57
55
  sku_list_promotion_rule?: SkuListPromotionRule;
58
56
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
59
- coupons?: Coupon[];
57
+ custom_promotion_rule?: CustomPromotionRule;
60
58
  sku_list?: SkuList;
59
+ coupons?: Coupon[];
61
60
  attachments?: Attachment[];
62
61
  events?: Event[];
63
62
  tags?: Tag[];
@@ -76,11 +75,10 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
76
75
  _enable?: boolean;
77
76
  percentage: number;
78
77
  market?: MarketRel;
79
- promotion_rules?: PromotionRuleRel[];
80
78
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
81
79
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
82
80
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
83
- coupons?: CouponRel[];
81
+ custom_promotion_rule?: CustomPromotionRuleRel;
84
82
  sku_list?: SkuListRel;
85
83
  tags?: TagRel[];
86
84
  }
@@ -96,11 +94,10 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
96
94
  _enable?: boolean;
97
95
  percentage?: number;
98
96
  market?: MarketRel;
99
- promotion_rules?: PromotionRuleRel[];
100
97
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
101
98
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
102
99
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
103
- coupons?: CouponRel[];
100
+ custom_promotion_rule?: CustomPromotionRuleRel;
104
101
  sku_list?: SkuListRel;
105
102
  tags?: TagRel[];
106
103
  }
@@ -115,8 +112,9 @@ declare class PercentageDiscountPromotions extends ApiResource {
115
112
  order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
116
113
  sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
117
114
  coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
118
- coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
115
+ custom_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
119
116
  sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
117
+ coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
120
118
  attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
121
119
  events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
122
120
  tags(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -34,14 +34,18 @@ class PercentageDiscountPromotions extends resource_1.ApiResource {
34
34
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
35
35
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupon_codes_promotion_rule`, params, options);
36
36
  }
37
- async coupons(percentageDiscountPromotionId, params, options) {
37
+ async custom_promotion_rule(percentageDiscountPromotionId, params, options) {
38
38
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
39
- return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
39
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/custom_promotion_rule`, params, options);
40
40
  }
41
41
  async sku_list(percentageDiscountPromotionId, params, options) {
42
42
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
43
43
  return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
44
44
  }
45
+ async coupons(percentageDiscountPromotionId, params, options) {
46
+ const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
47
+ return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
48
+ }
45
49
  async attachments(percentageDiscountPromotionId, params, options) {
46
50
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
47
51
  return this.resources.fetch({ type: 'attachments' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/attachments`, params, options);
@@ -5,8 +5,9 @@ import type { PromotionRule } from './promotion_rules';
5
5
  import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
6
6
  import type { SkuListPromotionRule } from './sku_list_promotion_rules';
7
7
  import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
8
- import type { Coupon } from './coupons';
8
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -30,8 +31,9 @@ interface Promotion extends Resource {
30
31
  order_amount_promotion_rule?: OrderAmountPromotionRule;
31
32
  sku_list_promotion_rule?: SkuListPromotionRule;
32
33
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
33
- coupons?: Coupon[];
34
+ custom_promotion_rule?: CustomPromotionRule;
34
35
  sku_list?: SkuList;
36
+ coupons?: Coupon[];
35
37
  attachments?: Attachment[];
36
38
  events?: Event[];
37
39
  tags?: Tag[];
@@ -45,8 +47,9 @@ declare class Promotions extends ApiResource {
45
47
  order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
46
48
  sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
47
49
  coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
48
- coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
50
+ custom_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
49
51
  sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
52
+ coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
50
53
  attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
51
54
  events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
52
55
  tags(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -25,14 +25,18 @@ class Promotions extends resource_1.ApiResource {
25
25
  const _promotionId = promotionId.id || promotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
- async coupons(promotionId, params, options) {
28
+ async custom_promotion_rule(promotionId, params, options) {
29
29
  const _promotionId = promotionId.id || promotionId;
30
- return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
30
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `promotions/${_promotionId}/custom_promotion_rule`, params, options);
31
31
  }
32
32
  async sku_list(promotionId, params, options) {
33
33
  const _promotionId = promotionId.id || promotionId;
34
34
  return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);
35
35
  }
36
+ async coupons(promotionId, params, options) {
37
+ const _promotionId = promotionId.id || promotionId;
38
+ return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
39
+ }
36
40
  async attachments(promotionId, params, options) {
37
41
  const _promotionId = promotionId.id || promotionId;
38
42
  return this.resources.fetch({ type: 'attachments' }, `promotions/${_promotionId}/attachments`, params, options);
@@ -41,6 +41,9 @@ interface StockLineItemCreate extends ResourceCreate {
41
41
  interface StockLineItemUpdate extends ResourceUpdate {
42
42
  sku_code?: string;
43
43
  quantity?: number;
44
+ _reserve_stock?: boolean;
45
+ _release_stock?: boolean;
46
+ _decrement_stock?: boolean;
44
47
  shipment?: ShipmentRel;
45
48
  line_item?: LineItemRel;
46
49
  stock_item?: StockItemRel;
@@ -28,7 +28,6 @@ interface StockReservationCreate extends ResourceCreate {
28
28
  interface StockReservationUpdate extends ResourceUpdate {
29
29
  quantity?: number;
30
30
  _pending?: boolean;
31
- stock_item?: StockItemRel;
32
31
  }
33
32
  declare class StockReservations extends ApiResource {
34
33
  static readonly TYPE: 'stock_reservations';
@@ -22,7 +22,7 @@ type LineItemRel = ResourceRel & {
22
22
  type: 'line_items';
23
23
  };
24
24
  interface StockTransfer extends Resource {
25
- number?: number;
25
+ number?: string;
26
26
  sku_code?: string;
27
27
  status?: string;
28
28
  quantity?: number;
@@ -10,6 +10,7 @@ type OrderRel = ResourceRel & {
10
10
  type: 'orders';
11
11
  };
12
12
  interface StripePayment extends Resource {
13
+ stripe_id?: string;
13
14
  client_secret?: string;
14
15
  publishable_key?: string;
15
16
  options?: object;
@@ -26,6 +27,8 @@ interface StripePayment extends Resource {
26
27
  versions?: Version[];
27
28
  }
28
29
  interface StripePaymentCreate extends ResourceCreate {
30
+ stripe_id?: string;
31
+ client_secret?: string;
29
32
  options?: object;
30
33
  return_url?: string;
31
34
  receipt_email?: string;
@@ -2,7 +2,7 @@ import * as api from './api';
2
2
  import { ApiError } from './error';
3
3
  import type { ErrorInterceptor, InterceptorType, RawResponseReader, RequestInterceptor, ResponseInterceptor } from './interceptor';
4
4
  import { ResourcesInitConfig } from './resource';
5
- declare const OPEN_API_SCHEMA_VERSION = "4.23.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.26.0";
6
6
  export { OPEN_API_SCHEMA_VERSION };
7
7
  type SdkConfig = {};
8
8
  type CommerceLayerInitConfig = SdkConfig & ResourcesInitConfig;
@@ -10,7 +10,7 @@ type CommerceLayerConfig = Partial<CommerceLayerInitConfig>;
10
10
  declare class CommerceLayerClient {
11
11
  #private;
12
12
  static get openApiSchemaVersion(): string;
13
- readonly openApiSchemaVersion = "4.23.0";
13
+ readonly openApiSchemaVersion = "4.26.0";
14
14
  addresses: api.Addresses;
15
15
  adjustments: api.Adjustments;
16
16
  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.26.0';
20
20
  export { OPEN_API_SCHEMA_VERSION };
21
21
  class CommerceLayerClient {
22
22
  static get openApiSchemaVersion() { return OPEN_API_SCHEMA_VERSION; }
@@ -25,7 +25,7 @@ interface AdyenGatewayCreate extends ResourceCreate {
25
25
  api_key: string;
26
26
  public_key?: string;
27
27
  live_url_prefix: string;
28
- api_version?: string;
28
+ api_version?: number;
29
29
  async_api?: boolean;
30
30
  webhook_endpoint_secret?: string;
31
31
  adyen_payments?: AdyenPaymentRel[];
@@ -36,7 +36,7 @@ interface AdyenGatewayUpdate extends ResourceUpdate {
36
36
  api_key?: string;
37
37
  public_key?: string;
38
38
  live_url_prefix?: string;
39
- api_version?: string;
39
+ api_version?: number;
40
40
  async_api?: boolean;
41
41
  webhook_endpoint_secret?: string;
42
42
  adyen_payments?: AdyenPaymentRel[];
@@ -14,8 +14,8 @@ interface AvalaraAccount extends Resource {
14
14
  name?: string;
15
15
  username?: string;
16
16
  company_code?: string;
17
- commit_invoice?: string;
18
- ddp?: string;
17
+ commit_invoice?: boolean;
18
+ ddp?: boolean;
19
19
  markets?: Market[];
20
20
  attachments?: Attachment[];
21
21
  versions?: Version[];
@@ -26,8 +26,8 @@ interface AvalaraAccountCreate extends ResourceCreate {
26
26
  username: string;
27
27
  password: string;
28
28
  company_code: string;
29
- commit_invoice?: string;
30
- ddp?: string;
29
+ commit_invoice?: boolean;
30
+ ddp?: boolean;
31
31
  tax_categories?: TaxCategoryRel[];
32
32
  }
33
33
  interface AvalaraAccountUpdate extends ResourceUpdate {
@@ -35,8 +35,8 @@ interface AvalaraAccountUpdate extends ResourceUpdate {
35
35
  username?: string;
36
36
  password?: string;
37
37
  company_code?: string;
38
- commit_invoice?: string;
39
- ddp?: string;
38
+ commit_invoice?: boolean;
39
+ ddp?: boolean;
40
40
  tax_categories?: TaxCategoryRel[];
41
41
  }
42
42
  declare class AvalaraAccounts extends ApiResource {
@@ -5,8 +5,9 @@ import type { PromotionRule } from './promotion_rules';
5
5
  import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
6
6
  import type { SkuListPromotionRule } from './sku_list_promotion_rules';
7
7
  import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
8
- import type { Coupon } from './coupons';
8
+ import type { CustomPromotionRule } from './custom_promotion_rules';
9
9
  import type { SkuList } from './sku_lists';
10
+ import type { Coupon } from './coupons';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
12
13
  import type { Tag } from './tags';
@@ -18,9 +19,6 @@ type BuyXPayYPromotionRel = ResourceRel & {
18
19
  type MarketRel = ResourceRel & {
19
20
  type: 'markets';
20
21
  };
21
- type PromotionRuleRel = ResourceRel & {
22
- type: 'promotion_rules';
23
- };
24
22
  type OrderAmountPromotionRuleRel = ResourceRel & {
25
23
  type: 'order_amount_promotion_rules';
26
24
  };
@@ -30,8 +28,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
28
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
29
  type: 'coupon_codes_promotion_rules';
32
30
  };
33
- type CouponRel = ResourceRel & {
34
- type: 'coupons';
31
+ type CustomPromotionRuleRel = ResourceRel & {
32
+ type: 'custom_promotion_rules';
35
33
  };
36
34
  type SkuListRel = ResourceRel & {
37
35
  type: 'sku_lists';
@@ -58,8 +56,9 @@ interface BuyXPayYPromotion extends Resource {
58
56
  order_amount_promotion_rule?: OrderAmountPromotionRule;
59
57
  sku_list_promotion_rule?: SkuListPromotionRule;
60
58
  coupon_codes_promotion_rule?: CouponCodesPromotionRule;
61
- coupons?: Coupon[];
59
+ custom_promotion_rule?: CustomPromotionRule;
62
60
  sku_list?: SkuList;
61
+ coupons?: Coupon[];
63
62
  attachments?: Attachment[];
64
63
  events?: Event[];
65
64
  tags?: Tag[];
@@ -80,11 +79,10 @@ interface BuyXPayYPromotionCreate extends ResourceCreate {
80
79
  y: number;
81
80
  cheapest_free?: boolean;
82
81
  market?: MarketRel;
83
- promotion_rules?: PromotionRuleRel[];
84
82
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
85
83
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
86
84
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
87
- coupons?: CouponRel[];
85
+ custom_promotion_rule?: CustomPromotionRuleRel;
88
86
  sku_list: SkuListRel;
89
87
  tags?: TagRel[];
90
88
  }
@@ -102,11 +100,10 @@ interface BuyXPayYPromotionUpdate extends ResourceUpdate {
102
100
  y?: number;
103
101
  cheapest_free?: boolean;
104
102
  market?: MarketRel;
105
- promotion_rules?: PromotionRuleRel[];
106
103
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel;
107
104
  sku_list_promotion_rule?: SkuListPromotionRuleRel;
108
105
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel;
109
- coupons?: CouponRel[];
106
+ custom_promotion_rule?: CustomPromotionRuleRel;
110
107
  sku_list?: SkuListRel;
111
108
  tags?: TagRel[];
112
109
  }
@@ -121,8 +118,9 @@ declare class BuyXPayYPromotions extends ApiResource {
121
118
  order_amount_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
122
119
  sku_list_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
123
120
  coupon_codes_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
124
- coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
121
+ custom_promotion_rule(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
125
122
  sku_list(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
123
+ coupons(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
126
124
  attachments(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
127
125
  events(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
128
126
  tags(buyXPayYPromotionId: string | BuyXPayYPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -32,14 +32,18 @@ class BuyXPayYPromotions extends ApiResource {
32
32
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
33
33
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupon_codes_promotion_rule`, params, options);
34
34
  }
35
- async coupons(buyXPayYPromotionId, params, options) {
35
+ async custom_promotion_rule(buyXPayYPromotionId, params, options) {
36
36
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
37
- return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
37
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/custom_promotion_rule`, params, options);
38
38
  }
39
39
  async sku_list(buyXPayYPromotionId, params, options) {
40
40
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
41
41
  return this.resources.fetch({ type: 'sku_lists' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/sku_list`, params, options);
42
42
  }
43
+ async coupons(buyXPayYPromotionId, params, options) {
44
+ const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
45
+ return this.resources.fetch({ type: 'coupons' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/coupons`, params, options);
46
+ }
43
47
  async attachments(buyXPayYPromotionId, params, options) {
44
48
  const _buyXPayYPromotionId = buyXPayYPromotionId.id || buyXPayYPromotionId;
45
49
  return this.resources.fetch({ type: 'attachments' }, `buy_x_pay_y_promotions/${_buyXPayYPromotionId}/attachments`, params, options);