@commercelayer/sdk 5.13.2 → 5.15.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 (69) hide show
  1. package/lib/cjs/api.d.ts +9 -7
  2. package/lib/cjs/api.js +9 -3
  3. package/lib/cjs/commercelayer.d.ts +4 -2
  4. package/lib/cjs/commercelayer.js +3 -1
  5. package/lib/cjs/model.d.ts +2 -0
  6. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +137 -0
  7. package/lib/cjs/resources/buy_x_pay_y_promotions.js +75 -0
  8. package/lib/cjs/resources/coupon_codes_promotion_rules.d.ts +7 -3
  9. package/lib/cjs/resources/coupons.d.ts +3 -0
  10. package/lib/cjs/resources/custom_promotion_rules.d.ts +62 -0
  11. package/lib/cjs/resources/custom_promotion_rules.js +29 -0
  12. package/lib/cjs/resources/external_promotions.d.ts +28 -1
  13. package/lib/cjs/resources/external_promotions.js +14 -0
  14. package/lib/cjs/resources/fixed_amount_promotions.d.ts +28 -1
  15. package/lib/cjs/resources/fixed_amount_promotions.js +14 -0
  16. package/lib/cjs/resources/fixed_price_promotions.d.ts +19 -0
  17. package/lib/cjs/resources/fixed_price_promotions.js +10 -0
  18. package/lib/cjs/resources/free_gift_promotions.d.ts +19 -0
  19. package/lib/cjs/resources/free_gift_promotions.js +10 -0
  20. package/lib/cjs/resources/free_shipping_promotions.d.ts +19 -0
  21. package/lib/cjs/resources/free_shipping_promotions.js +10 -0
  22. package/lib/cjs/resources/imports.d.ts +3 -0
  23. package/lib/cjs/resources/line_items.d.ts +5 -0
  24. package/lib/cjs/resources/order_amount_promotion_rules.d.ts +7 -3
  25. package/lib/cjs/resources/order_subscription_items.d.ts +4 -0
  26. package/lib/cjs/resources/orders.d.ts +23 -0
  27. package/lib/cjs/resources/orders.js +16 -0
  28. package/lib/cjs/resources/percentage_discount_promotions.d.ts +19 -0
  29. package/lib/cjs/resources/percentage_discount_promotions.js +10 -0
  30. package/lib/cjs/resources/promotion_rules.d.ts +2 -1
  31. package/lib/cjs/resources/promotions.d.ts +6 -0
  32. package/lib/cjs/resources/promotions.js +4 -0
  33. package/lib/cjs/resources/sku_list_promotion_rules.d.ts +7 -3
  34. package/lib/esm/api.d.ts +9 -7
  35. package/lib/esm/api.js +4 -0
  36. package/lib/esm/commercelayer.d.ts +4 -2
  37. package/lib/esm/commercelayer.js +3 -1
  38. package/lib/esm/model.d.ts +2 -0
  39. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +137 -0
  40. package/lib/esm/resources/buy_x_pay_y_promotions.js +73 -0
  41. package/lib/esm/resources/coupon_codes_promotion_rules.d.ts +7 -3
  42. package/lib/esm/resources/coupons.d.ts +3 -0
  43. package/lib/esm/resources/custom_promotion_rules.d.ts +62 -0
  44. package/lib/esm/resources/custom_promotion_rules.js +27 -0
  45. package/lib/esm/resources/external_promotions.d.ts +28 -1
  46. package/lib/esm/resources/external_promotions.js +14 -0
  47. package/lib/esm/resources/fixed_amount_promotions.d.ts +28 -1
  48. package/lib/esm/resources/fixed_amount_promotions.js +14 -0
  49. package/lib/esm/resources/fixed_price_promotions.d.ts +19 -0
  50. package/lib/esm/resources/fixed_price_promotions.js +10 -0
  51. package/lib/esm/resources/free_gift_promotions.d.ts +19 -0
  52. package/lib/esm/resources/free_gift_promotions.js +10 -0
  53. package/lib/esm/resources/free_shipping_promotions.d.ts +19 -0
  54. package/lib/esm/resources/free_shipping_promotions.js +10 -0
  55. package/lib/esm/resources/imports.d.ts +3 -0
  56. package/lib/esm/resources/line_items.d.ts +5 -0
  57. package/lib/esm/resources/order_amount_promotion_rules.d.ts +7 -3
  58. package/lib/esm/resources/order_subscription_items.d.ts +4 -0
  59. package/lib/esm/resources/orders.d.ts +23 -0
  60. package/lib/esm/resources/orders.js +16 -0
  61. package/lib/esm/resources/percentage_discount_promotions.d.ts +19 -0
  62. package/lib/esm/resources/percentage_discount_promotions.js +10 -0
  63. package/lib/esm/resources/promotion_rules.d.ts +2 -1
  64. package/lib/esm/resources/promotions.d.ts +6 -0
  65. package/lib/esm/resources/promotions.js +4 -0
  66. package/lib/esm/resources/sku_list_promotion_rules.d.ts +7 -3
  67. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  68. package/lib/tsconfig.tsbuildinfo +1 -1
  69. package/package.json +11 -11
@@ -9,6 +9,7 @@ type ImportRel = ResourceRel & {
9
9
  interface Import extends Resource {
10
10
  readonly type: ImportType;
11
11
  resource_type: string;
12
+ format?: string | null;
12
13
  parent_resource_id?: string | null;
13
14
  status: 'pending' | 'in_progress' | 'interrupted' | 'completed';
14
15
  started_at?: string | null;
@@ -21,6 +22,7 @@ interface Import extends Resource {
21
22
  processed_count?: number | null;
22
23
  errors_log?: Record<string, any> | null;
23
24
  warnings_log?: Record<string, any> | null;
25
+ cleanup_records?: boolean | null;
24
26
  attachment_url?: string | null;
25
27
  events?: Event[] | null;
26
28
  }
@@ -29,6 +31,7 @@ interface ImportCreate extends ResourceCreate {
29
31
  format?: string | null;
30
32
  parent_resource_id?: string | null;
31
33
  inputs: Array<Record<string, any>>;
34
+ cleanup_records?: boolean | null;
32
35
  }
33
36
  declare class Imports extends ApiResource<Import> {
34
37
  static readonly TYPE: ImportType;
@@ -86,8 +86,11 @@ interface LineItem extends Resource {
86
86
  tax_breakdown?: Record<string, any> | null;
87
87
  item_type?: 'skus' | 'bundles' | 'shipments' | 'payment_methods' | 'adjustments' | 'gift_cards' | 'percentage_discount_promotions' | 'free_shipping_promotions' | 'free_gift_promotions' | 'fixed_price_promotions' | 'external_promotions' | 'fixed_amount_promotions' | null;
88
88
  frequency?: string | null;
89
+ coupon_code?: string | null;
89
90
  order?: Order | null;
90
91
  item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
92
+ sku?: Sku | null;
93
+ bundle?: Bundle | null;
91
94
  line_item_options?: LineItemOption[] | null;
92
95
  /**
93
96
  * @deprecated This field should not be used as it may be removed in the future without notice
@@ -113,6 +116,8 @@ interface LineItemCreate extends ResourceCreate {
113
116
  frequency?: string | null;
114
117
  order: OrderRel;
115
118
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
119
+ sku?: SkuRel | null;
120
+ bundle?: BundleRel | null;
116
121
  tags?: TagRel[] | null;
117
122
  }
118
123
  interface LineItemUpdate extends ResourceUpdate {
@@ -3,6 +3,7 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions';
5
5
  import type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions';
6
+ import type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions';
6
7
  import type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions';
7
8
  import type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions';
8
9
  import type { ExternalPromotion, ExternalPromotionType } from './external_promotions';
@@ -18,6 +19,9 @@ type PercentageDiscountPromotionRel = ResourceRel & {
18
19
  type FreeShippingPromotionRel = ResourceRel & {
19
20
  type: FreeShippingPromotionType;
20
21
  };
22
+ type BuyXPayYPromotionRel = ResourceRel & {
23
+ type: BuyXPayYPromotionType;
24
+ };
21
25
  type FreeGiftPromotionRel = ResourceRel & {
22
26
  type: FreeGiftPromotionType;
23
27
  };
@@ -36,18 +40,18 @@ interface OrderAmountPromotionRule extends Resource {
36
40
  order_amount_float?: number | null;
37
41
  formatted_order_amount?: string | null;
38
42
  use_subtotal?: boolean | null;
39
- promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
43
+ promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
40
44
  versions?: Version[] | null;
41
45
  }
42
46
  interface OrderAmountPromotionRuleCreate extends ResourceCreate {
43
47
  order_amount_cents?: number | null;
44
48
  use_subtotal?: boolean | null;
45
- promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
49
+ promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
46
50
  }
47
51
  interface OrderAmountPromotionRuleUpdate extends ResourceUpdate {
48
52
  order_amount_cents?: number | null;
49
53
  use_subtotal?: boolean | null;
50
- promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
54
+ promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
51
55
  }
52
56
  declare class OrderAmountPromotionRules extends ApiResource<OrderAmountPromotionRule> {
53
57
  static readonly TYPE: OrderAmountPromotionRuleType;
@@ -33,6 +33,8 @@ interface OrderSubscriptionItem extends Resource {
33
33
  formatted_total_amount?: string | null;
34
34
  order_subscription?: OrderSubscription | null;
35
35
  item?: Adjustment | Bundle | Sku | null;
36
+ sku?: Sku | null;
37
+ bundle?: Bundle | null;
36
38
  source_line_item?: LineItem | null;
37
39
  }
38
40
  interface OrderSubscriptionItemCreate extends ResourceCreate {
@@ -42,6 +44,8 @@ interface OrderSubscriptionItemCreate extends ResourceCreate {
42
44
  unit_amount_cents?: number | null;
43
45
  order_subscription: OrderSubscriptionRel;
44
46
  item: AdjustmentRel | BundleRel | SkuRel;
47
+ sku?: SkuRel | null;
48
+ bundle?: BundleRel | null;
45
49
  }
46
50
  interface OrderSubscriptionItemUpdate extends ResourceUpdate {
47
51
  sku_code?: string | null;
@@ -19,6 +19,10 @@ import type { SatispayPayment, SatispayPaymentType } from './satispay_payments';
19
19
  import type { StripePayment, StripePaymentType } from './stripe_payments';
20
20
  import type { WireTransfer, WireTransferType } from './wire_transfers';
21
21
  import type { LineItem } from './line_items';
22
+ import type { LineItemOption } from './line_item_options';
23
+ import type { StockReservation } from './stock_reservations';
24
+ import type { StockLineItem } from './stock_line_items';
25
+ import type { StockTransfer } from './stock_transfers';
22
26
  import type { Shipment } from './shipments';
23
27
  import type { Authorization } from './authorizations';
24
28
  import type { Capture } from './captures';
@@ -97,6 +101,9 @@ interface Order extends Resource {
97
101
  tax_included?: boolean | null;
98
102
  tax_rate?: number | null;
99
103
  freight_taxable?: boolean | null;
104
+ payment_method_taxable?: boolean | null;
105
+ adjustment_taxable?: boolean | null;
106
+ gift_card_taxable?: boolean | null;
100
107
  requires_billing_info?: boolean | null;
101
108
  country_code?: string | null;
102
109
  shipping_country_code_lock?: string | null;
@@ -197,6 +204,10 @@ interface Order extends Resource {
197
204
  payment_method?: PaymentMethod | null;
198
205
  payment_source?: AdyenPayment | AxervePayment | BraintreePayment | CheckoutComPayment | ExternalPayment | KlarnaPayment | PaypalPayment | SatispayPayment | StripePayment | WireTransfer | null;
199
206
  line_items?: LineItem[] | null;
207
+ line_item_options?: LineItemOption[] | null;
208
+ stock_reservations?: StockReservation[] | null;
209
+ stock_line_items?: StockLineItem[] | null;
210
+ stock_transfers?: StockTransfer[] | null;
200
211
  shipments?: Shipment[] | null;
201
212
  transactions?: Array<Authorization | Capture | Void | Refund> | null;
202
213
  authorizations?: Authorization[] | null;
@@ -219,6 +230,10 @@ interface OrderCreate extends ResourceCreate {
219
230
  customer_email?: string | null;
220
231
  customer_password?: string | null;
221
232
  language_code?: string | null;
233
+ freight_taxable?: boolean | null;
234
+ payment_method_taxable?: boolean | null;
235
+ adjustment_taxable?: boolean | null;
236
+ gift_card_taxable?: boolean | null;
222
237
  shipping_country_code_lock?: string | null;
223
238
  coupon_code?: string | null;
224
239
  gift_card_code?: string | null;
@@ -240,6 +255,10 @@ interface OrderUpdate extends ResourceUpdate {
240
255
  customer_email?: string | null;
241
256
  customer_password?: string | null;
242
257
  language_code?: string | null;
258
+ freight_taxable?: boolean | null;
259
+ payment_method_taxable?: boolean | null;
260
+ adjustment_taxable?: boolean | null;
261
+ gift_card_taxable?: boolean | null;
243
262
  shipping_country_code_lock?: string | null;
244
263
  coupon_code?: string | null;
245
264
  gift_card_code?: string | null;
@@ -297,6 +316,10 @@ declare class Orders extends ApiResource<Order> {
297
316
  available_free_bundles(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Bundle>>;
298
317
  payment_method(orderId: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
299
318
  line_items(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItem>>;
319
+ line_item_options(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
320
+ stock_reservations(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
321
+ stock_line_items(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
322
+ stock_transfers(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
300
323
  shipments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Shipment>>;
301
324
  authorizations(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Authorization>>;
302
325
  captures(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Capture>>;
@@ -51,6 +51,22 @@ class Orders extends resource_1.ApiResource {
51
51
  const _orderId = orderId.id || orderId;
52
52
  return this.resources.fetch({ type: 'line_items' }, `orders/${_orderId}/line_items`, params, options);
53
53
  }
54
+ async line_item_options(orderId, params, options) {
55
+ const _orderId = orderId.id || orderId;
56
+ return this.resources.fetch({ type: 'line_item_options' }, `orders/${_orderId}/line_item_options`, params, options);
57
+ }
58
+ async stock_reservations(orderId, params, options) {
59
+ const _orderId = orderId.id || orderId;
60
+ return this.resources.fetch({ type: 'stock_reservations' }, `orders/${_orderId}/stock_reservations`, params, options);
61
+ }
62
+ async stock_line_items(orderId, params, options) {
63
+ const _orderId = orderId.id || orderId;
64
+ return this.resources.fetch({ type: 'stock_line_items' }, `orders/${_orderId}/stock_line_items`, params, options);
65
+ }
66
+ async stock_transfers(orderId, params, options) {
67
+ const _orderId = orderId.id || orderId;
68
+ return this.resources.fetch({ type: 'stock_transfers' }, `orders/${_orderId}/stock_transfers`, params, options);
69
+ }
54
70
  async shipments(orderId, params, options) {
55
71
  const _orderId = orderId.id || orderId;
56
72
  return this.resources.fetch({ type: 'shipments' }, `orders/${_orderId}/shipments`, 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 { Coupon, CouponType } from './coupons';
9
10
  import type { SkuList, SkuListType } from './sku_lists';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
@@ -31,6 +32,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
31
32
  type CouponCodesPromotionRuleRel = ResourceRel & {
32
33
  type: CouponCodesPromotionRuleType;
33
34
  };
35
+ type CouponRel = ResourceRel & {
36
+ type: CouponType;
37
+ };
34
38
  type SkuListRel = ResourceRel & {
35
39
  type: SkuListType;
36
40
  };
@@ -41,17 +45,21 @@ interface PercentageDiscountPromotion extends Resource {
41
45
  readonly type: PercentageDiscountPromotionType;
42
46
  name: string;
43
47
  currency_code?: string | null;
48
+ exclusive?: boolean | null;
49
+ priority?: number | null;
44
50
  starts_at: string;
45
51
  expires_at: string;
46
52
  total_usage_limit: number;
47
53
  total_usage_count?: number | null;
48
54
  active?: boolean | null;
55
+ disabled_at?: string | null;
49
56
  percentage: number;
50
57
  market?: Market | null;
51
58
  promotion_rules?: PromotionRule[] | null;
52
59
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
53
60
  sku_list_promotion_rule?: SkuListPromotionRule | null;
54
61
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
62
+ coupons?: Coupon[] | null;
55
63
  sku_list?: SkuList | null;
56
64
  attachments?: Attachment[] | null;
57
65
  events?: Event[] | null;
@@ -62,6 +70,8 @@ interface PercentageDiscountPromotion extends Resource {
62
70
  interface PercentageDiscountPromotionCreate extends ResourceCreate {
63
71
  name: string;
64
72
  currency_code?: string | null;
73
+ exclusive?: boolean | null;
74
+ priority?: number | null;
65
75
  starts_at: string;
66
76
  expires_at: string;
67
77
  total_usage_limit: number;
@@ -71,21 +81,27 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
71
81
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
72
82
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
73
83
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
84
+ coupons?: CouponRel[] | null;
74
85
  sku_list?: SkuListRel | null;
75
86
  tags?: TagRel[] | null;
76
87
  }
77
88
  interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
78
89
  name?: string | null;
79
90
  currency_code?: string | null;
91
+ exclusive?: boolean | null;
92
+ priority?: number | null;
80
93
  starts_at?: string | null;
81
94
  expires_at?: string | null;
82
95
  total_usage_limit?: number | null;
96
+ _disable?: boolean | null;
97
+ _enable?: boolean | null;
83
98
  percentage?: number | null;
84
99
  market?: MarketRel | null;
85
100
  promotion_rules?: PromotionRuleRel[] | null;
86
101
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
87
102
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
88
103
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
104
+ coupons?: CouponRel[] | null;
89
105
  sku_list?: SkuListRel | null;
90
106
  tags?: TagRel[] | null;
91
107
  }
@@ -98,12 +114,15 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
98
114
  order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
99
115
  sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
100
116
  coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
117
+ coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
101
118
  sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
102
119
  attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
103
120
  events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
104
121
  tags(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
105
122
  versions(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
106
123
  skus(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Sku>>;
124
+ _disable(id: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
125
+ _enable(id: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PercentageDiscountPromotion>;
107
126
  isPercentageDiscountPromotion(resource: any): resource is PercentageDiscountPromotion;
108
127
  relationship(id: string | ResourceId | null): PercentageDiscountPromotionRel;
109
128
  type(): PercentageDiscountPromotionType;
@@ -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 coupons(percentageDiscountPromotionId, params, options) {
31
+ const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
32
+ return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
33
+ }
30
34
  async sku_list(percentageDiscountPromotionId, params, options) {
31
35
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
32
36
  return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
@@ -51,6 +55,12 @@ class PercentageDiscountPromotions extends resource_1.ApiResource {
51
55
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
52
56
  return this.resources.fetch({ type: 'skus' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/skus`, params, options);
53
57
  }
58
+ async _disable(id, params, options) {
59
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: PercentageDiscountPromotions.TYPE, _disable: true }, params, options);
60
+ }
61
+ async _enable(id, params, options) {
62
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: PercentageDiscountPromotions.TYPE, _enable: true }, params, options);
63
+ }
54
64
  isPercentageDiscountPromotion(resource) {
55
65
  return resource.type && (resource.type === PercentageDiscountPromotions.TYPE);
56
66
  }
@@ -3,6 +3,7 @@ import type { Resource, ResourceId, ResourcesConfig, ResourceRel, ListResponse }
3
3
  import type { QueryParamsList } from '../query';
4
4
  import type { PercentageDiscountPromotion } from './percentage_discount_promotions';
5
5
  import type { FreeShippingPromotion } from './free_shipping_promotions';
6
+ import type { BuyXPayYPromotion } from './buy_x_pay_y_promotions';
6
7
  import type { FreeGiftPromotion } from './free_gift_promotions';
7
8
  import type { FixedPricePromotion } from './fixed_price_promotions';
8
9
  import type { ExternalPromotion } from './external_promotions';
@@ -14,7 +15,7 @@ type PromotionRuleRel = ResourceRel & {
14
15
  };
15
16
  interface PromotionRule extends Resource {
16
17
  readonly type: PromotionRuleType;
17
- promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
18
+ promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
18
19
  versions?: Version[] | null;
19
20
  }
20
21
  declare class PromotionRules extends ApiResource<PromotionRule> {
@@ -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 { Coupon } from './coupons';
9
10
  import type { SkuList } from './sku_lists';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
@@ -19,16 +20,20 @@ interface Promotion extends Resource {
19
20
  readonly type: PromotionType;
20
21
  name: string;
21
22
  currency_code?: string | null;
23
+ exclusive?: boolean | null;
24
+ priority?: number | null;
22
25
  starts_at: string;
23
26
  expires_at: string;
24
27
  total_usage_limit: number;
25
28
  total_usage_count?: number | null;
26
29
  active?: boolean | null;
30
+ disabled_at?: string | null;
27
31
  market?: Market | null;
28
32
  promotion_rules?: PromotionRule[] | null;
29
33
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
30
34
  sku_list_promotion_rule?: SkuListPromotionRule | null;
31
35
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
36
+ coupons?: Coupon[] | null;
32
37
  sku_list?: SkuList | null;
33
38
  attachments?: Attachment[] | null;
34
39
  events?: Event[] | null;
@@ -41,6 +46,7 @@ declare class Promotions extends ApiResource<Promotion> {
41
46
  order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
42
47
  sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
43
48
  coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
49
+ coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
44
50
  sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
45
51
  attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
46
52
  events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -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 coupons(promotionId, params, options) {
22
+ const _promotionId = promotionId.id || promotionId;
23
+ return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
24
+ }
21
25
  async sku_list(promotionId, params, options) {
22
26
  const _promotionId = promotionId.id || promotionId;
23
27
  return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);
@@ -3,6 +3,7 @@ import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesCon
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } from './percentage_discount_promotions';
5
5
  import type { FreeShippingPromotion, FreeShippingPromotionType } from './free_shipping_promotions';
6
+ import type { BuyXPayYPromotion, BuyXPayYPromotionType } from './buy_x_pay_y_promotions';
6
7
  import type { FreeGiftPromotion, FreeGiftPromotionType } from './free_gift_promotions';
7
8
  import type { FixedPricePromotion, FixedPricePromotionType } from './fixed_price_promotions';
8
9
  import type { ExternalPromotion, ExternalPromotionType } from './external_promotions';
@@ -20,6 +21,9 @@ type PercentageDiscountPromotionRel = ResourceRel & {
20
21
  type FreeShippingPromotionRel = ResourceRel & {
21
22
  type: FreeShippingPromotionType;
22
23
  };
24
+ type BuyXPayYPromotionRel = ResourceRel & {
25
+ type: BuyXPayYPromotionType;
26
+ };
23
27
  type FreeGiftPromotionRel = ResourceRel & {
24
28
  type: FreeGiftPromotionType;
25
29
  };
@@ -39,7 +43,7 @@ interface SkuListPromotionRule extends Resource {
39
43
  readonly type: SkuListPromotionRuleType;
40
44
  all_skus?: boolean | null;
41
45
  min_quantity?: number | null;
42
- promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
46
+ promotion?: PercentageDiscountPromotion | FreeShippingPromotion | BuyXPayYPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion | FixedAmountPromotion | null;
43
47
  versions?: Version[] | null;
44
48
  sku_list?: SkuList | null;
45
49
  skus?: Sku[] | null;
@@ -47,13 +51,13 @@ interface SkuListPromotionRule extends Resource {
47
51
  interface SkuListPromotionRuleCreate extends ResourceCreate {
48
52
  all_skus?: boolean | null;
49
53
  min_quantity?: number | null;
50
- promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
54
+ promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel;
51
55
  sku_list?: SkuListRel | null;
52
56
  }
53
57
  interface SkuListPromotionRuleUpdate extends ResourceUpdate {
54
58
  all_skus?: boolean | null;
55
59
  min_quantity?: number | null;
56
- promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
60
+ promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | BuyXPayYPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel | FixedAmountPromotionRel | null;
57
61
  sku_list?: SkuListRel | null;
58
62
  }
59
63
  declare class SkuListPromotionRules extends ApiResource<SkuListPromotionRule> {
package/lib/esm/api.d.ts CHANGED
@@ -19,6 +19,7 @@ export { default as BingGeocoders } from './resources/bing_geocoders';
19
19
  export { default as BraintreeGateways } from './resources/braintree_gateways';
20
20
  export { default as BraintreePayments } from './resources/braintree_payments';
21
21
  export { default as Bundles } from './resources/bundles';
22
+ export { default as BuyXPayYPromotions } from './resources/buy_x_pay_y_promotions';
22
23
  export { default as Captures } from './resources/captures';
23
24
  export { default as CarrierAccounts } from './resources/carrier_accounts';
24
25
  export { default as CheckoutComGateways } from './resources/checkout_com_gateways';
@@ -27,6 +28,7 @@ export { default as Cleanups } from './resources/cleanups';
27
28
  export { default as CouponCodesPromotionRules } from './resources/coupon_codes_promotion_rules';
28
29
  export { default as CouponRecipients } from './resources/coupon_recipients';
29
30
  export { default as Coupons } from './resources/coupons';
31
+ export { default as CustomPromotionRules } from './resources/custom_promotion_rules';
30
32
  export { default as CustomerAddresses } from './resources/customer_addresses';
31
33
  export { default as CustomerGroups } from './resources/customer_groups';
32
34
  export { default as CustomerPasswordResets } from './resources/customer_password_resets';
@@ -121,8 +123,8 @@ export { default as Versions } from './resources/versions';
121
123
  export { default as Voids } from './resources/voids';
122
124
  export { default as Webhooks } from './resources/webhooks';
123
125
  export { default as WireTransfers } from './resources/wire_transfers';
124
- export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
125
- export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
126
+ export type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'event_callbacks' | 'events' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_factories' | 'order_subscription_items' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'recurring_order_copies' | 'refunds' | 'reserved_stocks' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_reservations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'versions' | 'voids' | 'webhooks' | 'wire_transfers';
127
+ export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "axerve_gateways", "axerve_payments", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "buy_x_pay_y_promotions", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "cleanups", "coupon_codes_promotion_rules", "coupon_recipients", "coupons", "custom_promotion_rules", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "event_callbacks", "events", "exports", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "fixed_price_promotions", "free_gift_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "klarna_gateways", "klarna_payments", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_factories", "order_subscription_items", "order_subscriptions", "order_validation_rules", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_frequency_tiers", "price_lists", "price_tiers", "price_volume_tiers", "prices", "promotion_rules", "promotions", "recurring_order_copies", "refunds", "reserved_stocks", "return_line_items", "returns", "satispay_gateways", "satispay_payments", "shipments", "shipping_categories", "shipping_method_tiers", "shipping_methods", "shipping_weight_tiers", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_reservations", "stock_transfers", "stripe_gateways", "stripe_payments", "subscription_models", "tags", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "versions", "voids", "webhooks", "wire_transfers"];
126
128
  export type RetrievableResourceType = ResourceTypeLock;
127
129
  export type RetrievableResource = Resource & {
128
130
  type: RetrievableResourceType;
@@ -131,26 +133,26 @@ export type ListableResourceType = Exclude<ResourceTypeLock, 'application' | 'or
131
133
  export type ListableResource = Resource & {
132
134
  type: ListableResourceType;
133
135
  };
134
- export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
136
+ export type CreatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
135
137
  export type CreatableResource = Resource & {
136
138
  type: CreatableResourceType;
137
139
  };
138
- export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
140
+ export type UpdatableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
139
141
  export type UpdatableResource = Resource & {
140
142
  type: UpdatableResourceType;
141
143
  };
142
- export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
144
+ export type DeletableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'attachments' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'exports' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscription_items' | 'order_subscriptions' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_volume_tiers' | 'prices' | 'recurring_order_copies' | 'return_line_items' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipping_categories' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'subscription_models' | 'tags' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'webhooks' | 'wire_transfers';
143
145
  export type DeletableResource = Resource & {
144
146
  type: DeletableResourceType;
145
147
  };
146
- export type TaggableResourceType = 'addresses' | 'bundles' | 'coupons' | 'customers' | 'external_promotions' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_cards' | 'line_item_options' | 'line_items' | 'orders' | 'percentage_discount_promotions' | 'promotions' | 'returns' | 'sku_options' | 'skus';
148
+ export type TaggableResourceType = 'addresses' | 'bundles' | 'buy_x_pay_y_promotions' | 'coupons' | 'customers' | 'external_promotions' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_cards' | 'line_item_options' | 'line_items' | 'orders' | 'percentage_discount_promotions' | 'promotions' | 'returns' | 'sku_options' | 'skus';
147
149
  export type TaggableResource = Resource & {
148
150
  type: TaggableResourceType;
149
151
  tags?: Array<ResourceRel & {
150
152
  type: TagType;
151
153
  }> | null;
152
154
  };
153
- export type VersionableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_payment_sources' | 'customer_subscriptions' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
155
+ export type VersionableResourceType = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'authorizations' | 'avalara_accounts' | 'axerve_gateways' | 'axerve_payments' | 'billing_info_validation_rules' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'buy_x_pay_y_promotions' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'cleanups' | 'coupon_codes_promotion_rules' | 'coupon_recipients' | 'coupons' | 'custom_promotion_rules' | 'customer_addresses' | 'customer_groups' | 'customer_payment_sources' | 'customer_subscriptions' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'fixed_price_promotions' | 'free_gift_promotions' | 'free_shipping_promotions' | 'gift_card_recipients' | 'gift_cards' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'klarna_gateways' | 'klarna_payments' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_subscriptions' | 'order_validation_rules' | 'orders' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_frequency_tiers' | 'price_lists' | 'price_tiers' | 'price_volume_tiers' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'returns' | 'satispay_gateways' | 'satispay_payments' | 'shipments' | 'shipping_categories' | 'shipping_method_tiers' | 'shipping_methods' | 'shipping_weight_tiers' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
154
156
  export type VersionableResource = Resource & {
155
157
  type: VersionableResourceType;
156
158
  versions?: Array<ResourceRel & {
package/lib/esm/api.js CHANGED
@@ -18,6 +18,7 @@ export { default as BingGeocoders } from './resources/bing_geocoders';
18
18
  export { default as BraintreeGateways } from './resources/braintree_gateways';
19
19
  export { default as BraintreePayments } from './resources/braintree_payments';
20
20
  export { default as Bundles } from './resources/bundles';
21
+ export { default as BuyXPayYPromotions } from './resources/buy_x_pay_y_promotions';
21
22
  export { default as Captures } from './resources/captures';
22
23
  export { default as CarrierAccounts } from './resources/carrier_accounts';
23
24
  export { default as CheckoutComGateways } from './resources/checkout_com_gateways';
@@ -26,6 +27,7 @@ export { default as Cleanups } from './resources/cleanups';
26
27
  export { default as CouponCodesPromotionRules } from './resources/coupon_codes_promotion_rules';
27
28
  export { default as CouponRecipients } from './resources/coupon_recipients';
28
29
  export { default as Coupons } from './resources/coupons';
30
+ export { default as CustomPromotionRules } from './resources/custom_promotion_rules';
29
31
  export { default as CustomerAddresses } from './resources/customer_addresses';
30
32
  export { default as CustomerGroups } from './resources/customer_groups';
31
33
  export { default as CustomerPasswordResets } from './resources/customer_password_resets';
@@ -138,6 +140,7 @@ export const resourceList = [
138
140
  'braintree_gateways',
139
141
  'braintree_payments',
140
142
  'bundles',
143
+ 'buy_x_pay_y_promotions',
141
144
  'captures',
142
145
  'carrier_accounts',
143
146
  'checkout_com_gateways',
@@ -146,6 +149,7 @@ export const resourceList = [
146
149
  'coupon_codes_promotion_rules',
147
150
  'coupon_recipients',
148
151
  'coupons',
152
+ 'custom_promotion_rules',
149
153
  'customer_addresses',
150
154
  'customer_groups',
151
155
  'customer_password_resets',
@@ -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.11.0";
5
+ declare const OPEN_API_SCHEMA_VERSION = "4.13.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.11.0";
12
+ readonly openApiSchemaVersion = "4.13.0";
13
13
  addresses: api.Addresses;
14
14
  adjustments: api.Adjustments;
15
15
  adyen_gateways: api.AdyenGateways;
@@ -25,6 +25,7 @@ declare class CommerceLayerClient {
25
25
  braintree_gateways: api.BraintreeGateways;
26
26
  braintree_payments: api.BraintreePayments;
27
27
  bundles: api.Bundles;
28
+ buy_x_pay_y_promotions: api.BuyXPayYPromotions;
28
29
  captures: api.Captures;
29
30
  carrier_accounts: api.CarrierAccounts;
30
31
  checkout_com_gateways: api.CheckoutComGateways;
@@ -33,6 +34,7 @@ declare class CommerceLayerClient {
33
34
  coupon_codes_promotion_rules: api.CouponCodesPromotionRules;
34
35
  coupon_recipients: api.CouponRecipients;
35
36
  coupons: api.Coupons;
37
+ custom_promotion_rules: api.CustomPromotionRules;
36
38
  customer_addresses: api.CustomerAddresses;
37
39
  customer_groups: api.CustomerGroups;
38
40
  customer_password_resets: api.CustomerPasswordResets;