@commercelayer/sdk 5.27.3 → 5.29.0-alfa.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 (220) hide show
  1. package/lib/cjs/api.d.ts +3 -2
  2. package/lib/cjs/api.js +5 -2
  3. package/lib/cjs/client.js +5 -5
  4. package/lib/cjs/commercelayer.d.ts +3 -2
  5. package/lib/cjs/commercelayer.js +5 -4
  6. package/lib/cjs/common.js +1 -1
  7. package/lib/cjs/error.js +1 -2
  8. package/lib/cjs/model.d.ts +1 -0
  9. package/lib/cjs/query.d.ts +1 -1
  10. package/lib/cjs/query.js +1 -1
  11. package/lib/cjs/resource.js +22 -25
  12. package/lib/cjs/resources/adjustments.d.ts +3 -0
  13. package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
  14. package/lib/cjs/resources/avalara_accounts.d.ts +6 -6
  15. package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +11 -13
  16. package/lib/cjs/resources/buy_x_pay_y_promotions.js +6 -2
  17. package/lib/cjs/resources/external_gateways.d.ts +5 -1
  18. package/lib/cjs/resources/external_gateways.js +3 -0
  19. package/lib/cjs/resources/external_promotions.d.ts +15 -13
  20. package/lib/cjs/resources/external_promotions.js +9 -2
  21. package/lib/cjs/resources/external_tax_calculators.d.ts +4 -0
  22. package/lib/cjs/resources/external_tax_calculators.js +3 -0
  23. package/lib/cjs/resources/fixed_amount_promotions.d.ts +11 -13
  24. package/lib/cjs/resources/fixed_amount_promotions.js +6 -2
  25. package/lib/cjs/resources/fixed_price_promotions.d.ts +11 -13
  26. package/lib/cjs/resources/fixed_price_promotions.js +6 -2
  27. package/lib/cjs/resources/free_gift_promotions.d.ts +11 -13
  28. package/lib/cjs/resources/free_gift_promotions.js +6 -2
  29. package/lib/cjs/resources/free_shipping_promotions.d.ts +17 -14
  30. package/lib/cjs/resources/free_shipping_promotions.js +6 -2
  31. package/lib/cjs/resources/gift_cards.d.ts +3 -0
  32. package/lib/cjs/resources/inventory_models.d.ts +3 -0
  33. package/lib/cjs/resources/line_items.d.ts +15 -4
  34. package/lib/cjs/resources/line_items.js +7 -0
  35. package/lib/cjs/resources/markets.d.ts +1 -1
  36. package/lib/cjs/resources/order_subscriptions.d.ts +1 -4
  37. package/lib/cjs/resources/orders.d.ts +16 -1
  38. package/lib/cjs/resources/orders.js +14 -0
  39. package/lib/cjs/resources/parcel_line_items.d.ts +0 -8
  40. package/lib/cjs/resources/payment_methods.d.ts +8 -5
  41. package/lib/cjs/resources/percentage_discount_promotions.d.ts +11 -13
  42. package/lib/cjs/resources/percentage_discount_promotions.js +6 -2
  43. package/lib/cjs/resources/promotions.d.ts +6 -3
  44. package/lib/cjs/resources/promotions.js +6 -2
  45. package/lib/cjs/resources/resource_errors.d.ts +22 -0
  46. package/lib/cjs/resources/resource_errors.js +16 -0
  47. package/lib/cjs/resources/shipments.d.ts +0 -4
  48. package/lib/cjs/resources/shipping_methods.d.ts +9 -5
  49. package/lib/cjs/resources/shipping_methods.js +3 -0
  50. package/lib/cjs/resources/stock_line_items.d.ts +6 -0
  51. package/lib/cjs/resources/stock_line_items.js +9 -0
  52. package/lib/cjs/resources/stock_reservations.d.ts +0 -1
  53. package/lib/cjs/resources/stock_transfers.d.ts +1 -1
  54. package/lib/cjs/resources/stripe_payments.d.ts +4 -1
  55. package/lib/cjs/resources/webhooks.d.ts +3 -3
  56. package/lib/cjs/resources/webhooks.js +3 -3
  57. package/lib/esm/api.d.ts +3 -2
  58. package/lib/esm/api.js +2 -0
  59. package/lib/esm/client.js +19 -30
  60. package/lib/esm/commercelayer.d.ts +3 -2
  61. package/lib/esm/commercelayer.js +261 -149
  62. package/lib/esm/common.js +1 -1
  63. package/lib/esm/error.js +10 -5
  64. package/lib/esm/model.d.ts +1 -0
  65. package/lib/esm/query.d.ts +1 -1
  66. package/lib/esm/query.js +1 -1
  67. package/lib/esm/resource.js +37 -50
  68. package/lib/esm/resources/addresses.js +1 -1
  69. package/lib/esm/resources/adjustments.d.ts +3 -0
  70. package/lib/esm/resources/adjustments.js +1 -1
  71. package/lib/esm/resources/adyen_gateways.d.ts +2 -2
  72. package/lib/esm/resources/adyen_gateways.js +1 -1
  73. package/lib/esm/resources/adyen_payments.js +1 -1
  74. package/lib/esm/resources/application.js +1 -1
  75. package/lib/esm/resources/attachments.js +1 -1
  76. package/lib/esm/resources/authorizations.js +1 -1
  77. package/lib/esm/resources/avalara_accounts.d.ts +6 -6
  78. package/lib/esm/resources/avalara_accounts.js +1 -1
  79. package/lib/esm/resources/axerve_gateways.js +1 -1
  80. package/lib/esm/resources/axerve_payments.js +1 -1
  81. package/lib/esm/resources/billing_info_validation_rules.js +1 -1
  82. package/lib/esm/resources/bing_geocoders.js +1 -1
  83. package/lib/esm/resources/braintree_gateways.js +1 -1
  84. package/lib/esm/resources/braintree_payments.js +1 -1
  85. package/lib/esm/resources/bundles.js +1 -1
  86. package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +11 -13
  87. package/lib/esm/resources/buy_x_pay_y_promotions.js +7 -3
  88. package/lib/esm/resources/captures.js +1 -1
  89. package/lib/esm/resources/carrier_accounts.js +1 -1
  90. package/lib/esm/resources/checkout_com_gateways.js +1 -1
  91. package/lib/esm/resources/checkout_com_payments.js +1 -1
  92. package/lib/esm/resources/cleanups.js +1 -1
  93. package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
  94. package/lib/esm/resources/coupon_recipients.js +1 -1
  95. package/lib/esm/resources/coupons.js +1 -1
  96. package/lib/esm/resources/custom_promotion_rules.js +1 -1
  97. package/lib/esm/resources/customer_addresses.js +1 -1
  98. package/lib/esm/resources/customer_groups.js +1 -1
  99. package/lib/esm/resources/customer_password_resets.js +1 -1
  100. package/lib/esm/resources/customer_payment_sources.js +1 -1
  101. package/lib/esm/resources/customer_subscriptions.js +1 -1
  102. package/lib/esm/resources/customers.js +1 -1
  103. package/lib/esm/resources/delivery_lead_times.js +1 -1
  104. package/lib/esm/resources/event_callbacks.js +1 -1
  105. package/lib/esm/resources/events.js +1 -1
  106. package/lib/esm/resources/exports.js +1 -1
  107. package/lib/esm/resources/external_gateways.d.ts +5 -1
  108. package/lib/esm/resources/external_gateways.js +4 -1
  109. package/lib/esm/resources/external_payments.js +1 -1
  110. package/lib/esm/resources/external_promotions.d.ts +15 -13
  111. package/lib/esm/resources/external_promotions.js +10 -3
  112. package/lib/esm/resources/external_tax_calculators.d.ts +4 -0
  113. package/lib/esm/resources/external_tax_calculators.js +4 -1
  114. package/lib/esm/resources/fixed_amount_promotions.d.ts +11 -13
  115. package/lib/esm/resources/fixed_amount_promotions.js +7 -3
  116. package/lib/esm/resources/fixed_price_promotions.d.ts +11 -13
  117. package/lib/esm/resources/fixed_price_promotions.js +7 -3
  118. package/lib/esm/resources/free_gift_promotions.d.ts +11 -13
  119. package/lib/esm/resources/free_gift_promotions.js +7 -3
  120. package/lib/esm/resources/free_shipping_promotions.d.ts +17 -14
  121. package/lib/esm/resources/free_shipping_promotions.js +7 -3
  122. package/lib/esm/resources/geocoders.js +1 -1
  123. package/lib/esm/resources/gift_card_recipients.js +1 -1
  124. package/lib/esm/resources/gift_cards.d.ts +3 -0
  125. package/lib/esm/resources/gift_cards.js +1 -1
  126. package/lib/esm/resources/google_geocoders.js +1 -1
  127. package/lib/esm/resources/imports.js +1 -1
  128. package/lib/esm/resources/in_stock_subscriptions.js +1 -1
  129. package/lib/esm/resources/inventory_models.d.ts +3 -0
  130. package/lib/esm/resources/inventory_models.js +1 -1
  131. package/lib/esm/resources/inventory_return_locations.js +1 -1
  132. package/lib/esm/resources/inventory_stock_locations.js +1 -1
  133. package/lib/esm/resources/klarna_gateways.js +1 -1
  134. package/lib/esm/resources/klarna_payments.js +1 -1
  135. package/lib/esm/resources/line_item_options.js +1 -1
  136. package/lib/esm/resources/line_items.d.ts +15 -4
  137. package/lib/esm/resources/line_items.js +8 -1
  138. package/lib/esm/resources/manual_gateways.js +1 -1
  139. package/lib/esm/resources/manual_tax_calculators.js +1 -1
  140. package/lib/esm/resources/markets.d.ts +1 -1
  141. package/lib/esm/resources/markets.js +1 -1
  142. package/lib/esm/resources/merchants.js +1 -1
  143. package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
  144. package/lib/esm/resources/order_copies.js +1 -1
  145. package/lib/esm/resources/order_factories.js +1 -1
  146. package/lib/esm/resources/order_subscription_items.js +1 -1
  147. package/lib/esm/resources/order_subscriptions.d.ts +1 -4
  148. package/lib/esm/resources/order_subscriptions.js +1 -1
  149. package/lib/esm/resources/order_validation_rules.js +1 -1
  150. package/lib/esm/resources/orders.d.ts +16 -1
  151. package/lib/esm/resources/orders.js +15 -1
  152. package/lib/esm/resources/organization.js +1 -1
  153. package/lib/esm/resources/packages.js +1 -1
  154. package/lib/esm/resources/parcel_line_items.d.ts +0 -8
  155. package/lib/esm/resources/parcel_line_items.js +1 -1
  156. package/lib/esm/resources/parcels.js +1 -1
  157. package/lib/esm/resources/payment_gateways.js +1 -1
  158. package/lib/esm/resources/payment_methods.d.ts +8 -5
  159. package/lib/esm/resources/payment_methods.js +1 -1
  160. package/lib/esm/resources/payment_options.js +1 -1
  161. package/lib/esm/resources/paypal_gateways.js +1 -1
  162. package/lib/esm/resources/paypal_payments.js +1 -1
  163. package/lib/esm/resources/percentage_discount_promotions.d.ts +11 -13
  164. package/lib/esm/resources/percentage_discount_promotions.js +7 -3
  165. package/lib/esm/resources/price_frequency_tiers.js +1 -1
  166. package/lib/esm/resources/price_lists.js +1 -1
  167. package/lib/esm/resources/price_tiers.js +1 -1
  168. package/lib/esm/resources/price_volume_tiers.js +1 -1
  169. package/lib/esm/resources/prices.js +1 -1
  170. package/lib/esm/resources/promotion_rules.js +1 -1
  171. package/lib/esm/resources/promotions.d.ts +6 -3
  172. package/lib/esm/resources/promotions.js +7 -3
  173. package/lib/esm/resources/recurring_order_copies.js +1 -1
  174. package/lib/esm/resources/refunds.js +1 -1
  175. package/lib/esm/resources/reserved_stocks.js +1 -1
  176. package/lib/esm/resources/resource_errors.d.ts +22 -0
  177. package/lib/esm/resources/resource_errors.js +14 -0
  178. package/lib/esm/resources/return_line_items.js +1 -1
  179. package/lib/esm/resources/returns.js +1 -1
  180. package/lib/esm/resources/satispay_gateways.js +1 -1
  181. package/lib/esm/resources/satispay_payments.js +1 -1
  182. package/lib/esm/resources/shipments.d.ts +0 -4
  183. package/lib/esm/resources/shipments.js +1 -1
  184. package/lib/esm/resources/shipping_categories.js +1 -1
  185. package/lib/esm/resources/shipping_method_tiers.js +1 -1
  186. package/lib/esm/resources/shipping_methods.d.ts +9 -5
  187. package/lib/esm/resources/shipping_methods.js +4 -1
  188. package/lib/esm/resources/shipping_weight_tiers.js +1 -1
  189. package/lib/esm/resources/shipping_zones.js +1 -1
  190. package/lib/esm/resources/sku_list_items.js +1 -1
  191. package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
  192. package/lib/esm/resources/sku_lists.js +1 -1
  193. package/lib/esm/resources/sku_options.js +1 -1
  194. package/lib/esm/resources/skus.js +1 -1
  195. package/lib/esm/resources/stock_items.js +1 -1
  196. package/lib/esm/resources/stock_line_items.d.ts +6 -0
  197. package/lib/esm/resources/stock_line_items.js +10 -1
  198. package/lib/esm/resources/stock_locations.js +1 -1
  199. package/lib/esm/resources/stock_reservations.d.ts +0 -1
  200. package/lib/esm/resources/stock_reservations.js +1 -1
  201. package/lib/esm/resources/stock_transfers.d.ts +1 -1
  202. package/lib/esm/resources/stock_transfers.js +1 -1
  203. package/lib/esm/resources/stripe_gateways.js +1 -1
  204. package/lib/esm/resources/stripe_payments.d.ts +4 -1
  205. package/lib/esm/resources/stripe_payments.js +1 -1
  206. package/lib/esm/resources/subscription_models.js +1 -1
  207. package/lib/esm/resources/tags.js +1 -1
  208. package/lib/esm/resources/tax_calculators.js +1 -1
  209. package/lib/esm/resources/tax_categories.js +1 -1
  210. package/lib/esm/resources/tax_rules.js +1 -1
  211. package/lib/esm/resources/taxjar_accounts.js +1 -1
  212. package/lib/esm/resources/transactions.js +1 -1
  213. package/lib/esm/resources/versions.js +1 -1
  214. package/lib/esm/resources/voids.js +1 -1
  215. package/lib/esm/resources/webhooks.d.ts +3 -3
  216. package/lib/esm/resources/webhooks.js +4 -4
  217. package/lib/esm/resources/wire_transfers.js +1 -1
  218. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  219. package/lib/tsconfig.tsbuildinfo +1 -1
  220. package/package.json +16 -16
@@ -2,12 +2,13 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market, MarketType } from './markets';
5
- import type { PromotionRule, PromotionRuleType } from './promotion_rules';
5
+ import type { PromotionRule } 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
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
10
10
  import type { SkuList, SkuListType } from './sku_lists';
11
+ import type { Coupon } from './coupons';
11
12
  import type { Attachment } from './attachments';
12
13
  import type { Event } from './events';
13
14
  import type { Tag, TagType } from './tags';
@@ -20,9 +21,6 @@ type FixedPricePromotionRel = ResourceRel & {
20
21
  type MarketRel = ResourceRel & {
21
22
  type: MarketType;
22
23
  };
23
- type PromotionRuleRel = ResourceRel & {
24
- type: PromotionRuleType;
25
- };
26
24
  type OrderAmountPromotionRuleRel = ResourceRel & {
27
25
  type: OrderAmountPromotionRuleType;
28
26
  };
@@ -32,8 +30,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
30
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
31
  type: CouponCodesPromotionRuleType;
34
32
  };
35
- type CouponRel = ResourceRel & {
36
- type: CouponType;
33
+ type CustomPromotionRuleRel = ResourceRel & {
34
+ type: CustomPromotionRuleType;
37
35
  };
38
36
  type SkuListRel = ResourceRel & {
39
37
  type: SkuListType;
@@ -61,8 +59,9 @@ interface FixedPricePromotion extends Resource {
61
59
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
62
60
  sku_list_promotion_rule?: SkuListPromotionRule | null;
63
61
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
64
- coupons?: Coupon[] | null;
62
+ custom_promotion_rule?: CustomPromotionRule | null;
65
63
  sku_list?: SkuList | null;
64
+ coupons?: Coupon[] | null;
66
65
  attachments?: Attachment[] | null;
67
66
  events?: Event[] | null;
68
67
  tags?: Tag[] | null;
@@ -81,11 +80,10 @@ interface FixedPricePromotionCreate extends ResourceCreate {
81
80
  _enable?: boolean | null;
82
81
  fixed_amount_cents: number;
83
82
  market?: MarketRel | null;
84
- promotion_rules?: PromotionRuleRel[] | null;
85
83
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
86
84
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
87
85
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
88
- coupons?: CouponRel[] | null;
86
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
89
87
  sku_list: SkuListRel;
90
88
  tags?: TagRel[] | null;
91
89
  }
@@ -101,11 +99,10 @@ interface FixedPricePromotionUpdate extends ResourceUpdate {
101
99
  _enable?: boolean | null;
102
100
  fixed_amount_cents?: number | null;
103
101
  market?: MarketRel | null;
104
- promotion_rules?: PromotionRuleRel[] | null;
105
102
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
106
103
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
107
104
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
108
- coupons?: CouponRel[] | null;
105
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
109
106
  sku_list?: SkuListRel | null;
110
107
  tags?: TagRel[] | null;
111
108
  }
@@ -118,8 +115,9 @@ declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
118
115
  order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
119
116
  sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
120
117
  coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
121
- coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
118
+ custom_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
122
119
  sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
120
+ coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
123
121
  attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
124
122
  events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
125
123
  tags(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class FixedPricePromotions extends ApiResource {
3
+ static TYPE = 'fixed_price_promotions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: FixedPricePromotions.TYPE }, params, options);
5
6
  }
@@ -25,14 +26,18 @@ class FixedPricePromotions extends ApiResource {
25
26
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
26
27
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
27
28
  }
28
- async coupons(fixedPricePromotionId, params, options) {
29
+ async custom_promotion_rule(fixedPricePromotionId, params, options) {
29
30
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
30
- return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
31
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/custom_promotion_rule`, params, options);
31
32
  }
32
33
  async sku_list(fixedPricePromotionId, params, options) {
33
34
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
34
35
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, params, options);
35
36
  }
37
+ async coupons(fixedPricePromotionId, params, options) {
38
+ const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
39
+ return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
40
+ }
36
41
  async attachments(fixedPricePromotionId, params, options) {
37
42
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
38
43
  return this.resources.fetch({ type: 'attachments' }, `fixed_price_promotions/${_fixedPricePromotionId}/attachments`, params, options);
@@ -69,5 +74,4 @@ class FixedPricePromotions extends ApiResource {
69
74
  return FixedPricePromotions.TYPE;
70
75
  }
71
76
  }
72
- FixedPricePromotions.TYPE = 'fixed_price_promotions';
73
77
  export default FixedPricePromotions;
@@ -2,12 +2,13 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market, MarketType } from './markets';
5
- import type { PromotionRule, PromotionRuleType } from './promotion_rules';
5
+ import type { PromotionRule } 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
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
10
10
  import type { SkuList, SkuListType } from './sku_lists';
11
+ import type { Coupon } from './coupons';
11
12
  import type { Attachment } from './attachments';
12
13
  import type { Event } from './events';
13
14
  import type { Tag, TagType } from './tags';
@@ -20,9 +21,6 @@ type FreeGiftPromotionRel = ResourceRel & {
20
21
  type MarketRel = ResourceRel & {
21
22
  type: MarketType;
22
23
  };
23
- type PromotionRuleRel = ResourceRel & {
24
- type: PromotionRuleType;
25
- };
26
24
  type OrderAmountPromotionRuleRel = ResourceRel & {
27
25
  type: OrderAmountPromotionRuleType;
28
26
  };
@@ -32,8 +30,8 @@ type SkuListPromotionRuleRel = ResourceRel & {
32
30
  type CouponCodesPromotionRuleRel = ResourceRel & {
33
31
  type: CouponCodesPromotionRuleType;
34
32
  };
35
- type CouponRel = ResourceRel & {
36
- type: CouponType;
33
+ type CustomPromotionRuleRel = ResourceRel & {
34
+ type: CustomPromotionRuleType;
37
35
  };
38
36
  type SkuListRel = ResourceRel & {
39
37
  type: SkuListType;
@@ -59,8 +57,9 @@ interface FreeGiftPromotion extends Resource {
59
57
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
60
58
  sku_list_promotion_rule?: SkuListPromotionRule | null;
61
59
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
62
- coupons?: Coupon[] | null;
60
+ custom_promotion_rule?: CustomPromotionRule | null;
63
61
  sku_list?: SkuList | null;
62
+ coupons?: Coupon[] | null;
64
63
  attachments?: Attachment[] | null;
65
64
  events?: Event[] | null;
66
65
  tags?: Tag[] | null;
@@ -79,11 +78,10 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
79
78
  _enable?: boolean | null;
80
79
  max_quantity?: number | null;
81
80
  market?: MarketRel | null;
82
- promotion_rules?: PromotionRuleRel[] | null;
83
81
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
84
82
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
85
83
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
86
- coupons?: CouponRel[] | null;
84
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
87
85
  sku_list: SkuListRel;
88
86
  tags?: TagRel[] | null;
89
87
  }
@@ -99,11 +97,10 @@ interface FreeGiftPromotionUpdate extends ResourceUpdate {
99
97
  _enable?: boolean | null;
100
98
  max_quantity?: number | null;
101
99
  market?: MarketRel | null;
102
- promotion_rules?: PromotionRuleRel[] | null;
103
100
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
104
101
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
105
102
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
106
- coupons?: CouponRel[] | null;
103
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
107
104
  sku_list?: SkuListRel | null;
108
105
  tags?: TagRel[] | null;
109
106
  }
@@ -116,8 +113,9 @@ declare class FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
116
113
  order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
117
114
  sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
118
115
  coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
119
- coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
116
+ custom_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
120
117
  sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
118
+ coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
121
119
  attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
122
120
  events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
123
121
  tags(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class FreeGiftPromotions extends ApiResource {
3
+ static TYPE = 'free_gift_promotions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: FreeGiftPromotions.TYPE }, params, options);
5
6
  }
@@ -25,14 +26,18 @@ class FreeGiftPromotions extends ApiResource {
25
26
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
26
27
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options);
27
28
  }
28
- async coupons(freeGiftPromotionId, params, options) {
29
+ async custom_promotion_rule(freeGiftPromotionId, params, options) {
29
30
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
30
- return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
31
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/custom_promotion_rule`, params, options);
31
32
  }
32
33
  async sku_list(freeGiftPromotionId, params, options) {
33
34
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
34
35
  return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, params, options);
35
36
  }
37
+ async coupons(freeGiftPromotionId, params, options) {
38
+ const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
39
+ return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
40
+ }
36
41
  async attachments(freeGiftPromotionId, params, options) {
37
42
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
38
43
  return this.resources.fetch({ type: 'attachments' }, `free_gift_promotions/${_freeGiftPromotionId}/attachments`, params, options);
@@ -69,5 +74,4 @@ class FreeGiftPromotions extends ApiResource {
69
74
  return FreeGiftPromotions.TYPE;
70
75
  }
71
76
  }
72
- FreeGiftPromotions.TYPE = 'free_gift_promotions';
73
77
  export default FreeGiftPromotions;
@@ -2,12 +2,13 @@ import { ApiResource } from '../resource';
2
2
  import type { Resource, ResourceCreate, ResourceUpdate, ResourceId, ResourcesConfig, ResourceRel, ListResponse } from '../resource';
3
3
  import type { QueryParamsRetrieve, QueryParamsList } from '../query';
4
4
  import type { Market, MarketType } from './markets';
5
- import type { PromotionRule, PromotionRuleType } from './promotion_rules';
5
+ import type { PromotionRule } 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';
10
- import type { SkuList } from './sku_lists';
9
+ import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
10
+ import type { SkuList, SkuListType } from './sku_lists';
11
+ import type { Coupon } from './coupons';
11
12
  import type { Attachment } from './attachments';
12
13
  import type { Event } from './events';
13
14
  import type { Tag, TagType } from './tags';
@@ -19,9 +20,6 @@ type FreeShippingPromotionRel = ResourceRel & {
19
20
  type MarketRel = ResourceRel & {
20
21
  type: MarketType;
21
22
  };
22
- type PromotionRuleRel = ResourceRel & {
23
- type: PromotionRuleType;
24
- };
25
23
  type OrderAmountPromotionRuleRel = ResourceRel & {
26
24
  type: OrderAmountPromotionRuleType;
27
25
  };
@@ -31,8 +29,11 @@ type SkuListPromotionRuleRel = ResourceRel & {
31
29
  type CouponCodesPromotionRuleRel = ResourceRel & {
32
30
  type: CouponCodesPromotionRuleType;
33
31
  };
34
- type CouponRel = ResourceRel & {
35
- type: CouponType;
32
+ type CustomPromotionRuleRel = ResourceRel & {
33
+ type: CustomPromotionRuleType;
34
+ };
35
+ type SkuListRel = ResourceRel & {
36
+ type: SkuListType;
36
37
  };
37
38
  type TagRel = ResourceRel & {
38
39
  type: TagType;
@@ -54,8 +55,9 @@ interface FreeShippingPromotion extends Resource {
54
55
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
55
56
  sku_list_promotion_rule?: SkuListPromotionRule | null;
56
57
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
57
- coupons?: Coupon[] | null;
58
+ custom_promotion_rule?: CustomPromotionRule | null;
58
59
  sku_list?: SkuList | null;
60
+ coupons?: Coupon[] | null;
59
61
  attachments?: Attachment[] | null;
60
62
  events?: Event[] | null;
61
63
  tags?: Tag[] | null;
@@ -72,11 +74,11 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
72
74
  _disable?: boolean | null;
73
75
  _enable?: boolean | null;
74
76
  market?: MarketRel | null;
75
- promotion_rules?: PromotionRuleRel[] | null;
76
77
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
77
78
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
78
79
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
79
- coupons?: CouponRel[] | null;
80
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
81
+ sku_list?: SkuListRel | null;
80
82
  tags?: TagRel[] | null;
81
83
  }
82
84
  interface FreeShippingPromotionUpdate extends ResourceUpdate {
@@ -90,11 +92,11 @@ interface FreeShippingPromotionUpdate extends ResourceUpdate {
90
92
  _disable?: boolean | null;
91
93
  _enable?: boolean | null;
92
94
  market?: MarketRel | null;
93
- promotion_rules?: PromotionRuleRel[] | null;
94
95
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
95
96
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
96
97
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
97
- coupons?: CouponRel[] | null;
98
+ custom_promotion_rule?: CustomPromotionRuleRel | null;
99
+ sku_list?: SkuListRel | null;
98
100
  tags?: TagRel[] | null;
99
101
  }
100
102
  declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion> {
@@ -106,8 +108,9 @@ declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion>
106
108
  order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
107
109
  sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
108
110
  coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
109
- coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
111
+ custom_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
110
112
  sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
113
+ coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
111
114
  attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
112
115
  events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
113
116
  tags(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class FreeShippingPromotions extends ApiResource {
3
+ static TYPE = 'free_shipping_promotions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: FreeShippingPromotions.TYPE }, params, options);
5
6
  }
@@ -25,14 +26,18 @@ class FreeShippingPromotions extends ApiResource {
25
26
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
26
27
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
27
28
  }
28
- async coupons(freeShippingPromotionId, params, options) {
29
+ async custom_promotion_rule(freeShippingPromotionId, params, options) {
29
30
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
30
- return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
31
+ return this.resources.fetch({ type: 'custom_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/custom_promotion_rule`, params, options);
31
32
  }
32
33
  async sku_list(freeShippingPromotionId, params, options) {
33
34
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
34
35
  return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
35
36
  }
37
+ async coupons(freeShippingPromotionId, params, options) {
38
+ const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
39
+ return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
40
+ }
36
41
  async attachments(freeShippingPromotionId, params, options) {
37
42
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
38
43
  return this.resources.fetch({ type: 'attachments' }, `free_shipping_promotions/${_freeShippingPromotionId}/attachments`, params, options);
@@ -65,5 +70,4 @@ class FreeShippingPromotions extends ApiResource {
65
70
  return FreeShippingPromotions.TYPE;
66
71
  }
67
72
  }
68
- FreeShippingPromotions.TYPE = 'free_shipping_promotions';
69
73
  export default FreeShippingPromotions;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Geocoders extends ApiResource {
3
+ static TYPE = 'geocoders';
3
4
  async addresses(geocoderId, params, options) {
4
5
  const _geocoderId = geocoderId.id || geocoderId;
5
6
  return this.resources.fetch({ type: 'addresses' }, `geocoders/${_geocoderId}/addresses`, params, options);
@@ -18,5 +19,4 @@ class Geocoders extends ApiResource {
18
19
  return Geocoders.TYPE;
19
20
  }
20
21
  }
21
- Geocoders.TYPE = 'geocoders';
22
22
  export default Geocoders;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class GiftCardRecipients extends ApiResource {
3
+ static TYPE = 'gift_card_recipients';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: GiftCardRecipients.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class GiftCardRecipients extends ApiResource {
31
32
  return GiftCardRecipients.TYPE;
32
33
  }
33
34
  }
34
- GiftCardRecipients.TYPE = 'gift_card_recipients';
35
35
  export default GiftCardRecipients;
@@ -37,6 +37,7 @@ interface GiftCard extends Resource {
37
37
  balance_log: Array<Record<string, any>>;
38
38
  single_use?: boolean | null;
39
39
  rechargeable?: boolean | null;
40
+ distribute_discount?: boolean | null;
40
41
  image_url?: string | null;
41
42
  expires_at?: string | null;
42
43
  recipient_email?: string | null;
@@ -54,6 +55,7 @@ interface GiftCardCreate extends ResourceCreate {
54
55
  balance_max_cents?: string | null;
55
56
  single_use?: boolean | null;
56
57
  rechargeable?: boolean | null;
58
+ distribute_discount?: boolean | null;
57
59
  image_url?: string | null;
58
60
  expires_at?: string | null;
59
61
  recipient_email?: string | null;
@@ -67,6 +69,7 @@ interface GiftCardUpdate extends ResourceUpdate {
67
69
  balance_max_cents?: string | null;
68
70
  single_use?: boolean | null;
69
71
  rechargeable?: boolean | null;
72
+ distribute_discount?: boolean | null;
70
73
  image_url?: string | null;
71
74
  expires_at?: string | null;
72
75
  recipient_email?: string | null;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class GiftCards extends ApiResource {
3
+ static TYPE = 'gift_cards';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: GiftCards.TYPE }, params, options);
5
6
  }
@@ -55,5 +56,4 @@ class GiftCards extends ApiResource {
55
56
  return GiftCards.TYPE;
56
57
  }
57
58
  }
58
- GiftCards.TYPE = 'gift_cards';
59
59
  export default GiftCards;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class GoogleGeocoders extends ApiResource {
3
+ static TYPE = 'google_geocoders';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: GoogleGeocoders.TYPE }, params, options);
5
6
  }
@@ -27,5 +28,4 @@ class GoogleGeocoders extends ApiResource {
27
28
  return GoogleGeocoders.TYPE;
28
29
  }
29
30
  }
30
- GoogleGeocoders.TYPE = 'google_geocoders';
31
31
  export default GoogleGeocoders;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class Imports extends ApiResource {
3
+ static TYPE = 'imports';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: Imports.TYPE }, params, options);
5
6
  }
@@ -20,5 +21,4 @@ class Imports extends ApiResource {
20
21
  return Imports.TYPE;
21
22
  }
22
23
  }
23
- Imports.TYPE = 'imports';
24
24
  export default Imports;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class InStockSubscriptions extends ApiResource {
3
+ static TYPE = 'in_stock_subscriptions';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: InStockSubscriptions.TYPE }, params, options);
5
6
  }
@@ -45,5 +46,4 @@ class InStockSubscriptions extends ApiResource {
45
46
  return InStockSubscriptions.TYPE;
46
47
  }
47
48
  }
48
- InStockSubscriptions.TYPE = 'in_stock_subscriptions';
49
49
  export default InStockSubscriptions;
@@ -16,6 +16,7 @@ interface InventoryModel extends Resource {
16
16
  stock_locations_cutoff?: number | null;
17
17
  stock_reservation_cutoff?: number | null;
18
18
  put_stock_transfers_on_hold?: boolean | null;
19
+ manual_stock_decrement?: boolean | null;
19
20
  inventory_stock_locations?: InventoryStockLocation[] | null;
20
21
  inventory_return_locations?: InventoryReturnLocation[] | null;
21
22
  attachments?: Attachment[] | null;
@@ -27,6 +28,7 @@ interface InventoryModelCreate extends ResourceCreate {
27
28
  stock_locations_cutoff?: number | null;
28
29
  stock_reservation_cutoff?: number | null;
29
30
  put_stock_transfers_on_hold?: boolean | null;
31
+ manual_stock_decrement?: boolean | null;
30
32
  }
31
33
  interface InventoryModelUpdate extends ResourceUpdate {
32
34
  name?: string | null;
@@ -34,6 +36,7 @@ interface InventoryModelUpdate extends ResourceUpdate {
34
36
  stock_locations_cutoff?: number | null;
35
37
  stock_reservation_cutoff?: number | null;
36
38
  put_stock_transfers_on_hold?: boolean | null;
39
+ manual_stock_decrement?: boolean | null;
37
40
  }
38
41
  declare class InventoryModels extends ApiResource<InventoryModel> {
39
42
  static readonly TYPE: InventoryModelType;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class InventoryModels extends ApiResource {
3
+ static TYPE = 'inventory_models';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: InventoryModels.TYPE }, params, options);
5
6
  }
@@ -35,5 +36,4 @@ class InventoryModels extends ApiResource {
35
36
  return InventoryModels.TYPE;
36
37
  }
37
38
  }
38
- InventoryModels.TYPE = 'inventory_models';
39
39
  export default InventoryModels;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class InventoryReturnLocations extends ApiResource {
3
+ static TYPE = 'inventory_return_locations';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: InventoryReturnLocations.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class InventoryReturnLocations extends ApiResource {
31
32
  return InventoryReturnLocations.TYPE;
32
33
  }
33
34
  }
34
- InventoryReturnLocations.TYPE = 'inventory_return_locations';
35
35
  export default InventoryReturnLocations;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class InventoryStockLocations extends ApiResource {
3
+ static TYPE = 'inventory_stock_locations';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: InventoryStockLocations.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class InventoryStockLocations extends ApiResource {
31
32
  return InventoryStockLocations.TYPE;
32
33
  }
33
34
  }
34
- InventoryStockLocations.TYPE = 'inventory_stock_locations';
35
35
  export default InventoryStockLocations;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class KlarnaGateways extends ApiResource {
3
+ static TYPE = 'klarna_gateways';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: KlarnaGateways.TYPE }, params, options);
5
6
  }
@@ -31,5 +32,4 @@ class KlarnaGateways extends ApiResource {
31
32
  return KlarnaGateways.TYPE;
32
33
  }
33
34
  }
34
- KlarnaGateways.TYPE = 'klarna_gateways';
35
35
  export default KlarnaGateways;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class KlarnaPayments extends ApiResource {
3
+ static TYPE = 'klarna_payments';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: KlarnaPayments.TYPE }, params, options);
5
6
  }
@@ -34,5 +35,4 @@ class KlarnaPayments extends ApiResource {
34
35
  return KlarnaPayments.TYPE;
35
36
  }
36
37
  }
37
- KlarnaPayments.TYPE = 'klarna_payments';
38
38
  export default KlarnaPayments;
@@ -1,5 +1,6 @@
1
1
  import { ApiResource } from '../resource';
2
2
  class LineItemOptions extends ApiResource {
3
+ static TYPE = 'line_item_options';
3
4
  async create(resource, params, options) {
4
5
  return this.resources.create({ ...resource, type: LineItemOptions.TYPE }, params, options);
5
6
  }
@@ -35,5 +36,4 @@ class LineItemOptions extends ApiResource {
35
36
  return LineItemOptions.TYPE;
36
37
  }
37
38
  }
38
- LineItemOptions.TYPE = 'line_item_options';
39
39
  export default LineItemOptions;
@@ -13,6 +13,7 @@ import type { PercentageDiscountPromotion, PercentageDiscountPromotionType } fro
13
13
  import type { Shipment, ShipmentType } from './shipments';
14
14
  import type { Sku, SkuType } from './skus';
15
15
  import type { LineItemOption } from './line_item_options';
16
+ import type { ReturnLineItem } from './return_line_items';
16
17
  import type { StockReservation } from './stock_reservations';
17
18
  import type { StockLineItem } from './stock_line_items';
18
19
  import type { StockTransfer } from './stock_transfers';
@@ -91,15 +92,18 @@ interface LineItem extends Resource {
91
92
  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;
92
93
  frequency?: string | null;
93
94
  coupon_code?: string | null;
95
+ circuit_state?: string | null;
96
+ circuit_failure_count?: number | null;
94
97
  order?: Order | null;
95
98
  item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
96
99
  sku?: Sku | null;
97
100
  bundle?: Bundle | null;
101
+ adjustment?: Adjustment | null;
102
+ gift_card?: GiftCard | null;
103
+ shipment?: Shipment | null;
104
+ payment_method?: PaymentMethod | null;
98
105
  line_item_options?: LineItemOption[] | null;
99
- /**
100
- * @deprecated This field should not be used as it may be removed in the future without notice
101
- */
102
- shipment_line_items?: object[];
106
+ return_line_items?: ReturnLineItem[] | null;
103
107
  stock_reservations?: StockReservation[] | null;
104
108
  stock_line_items?: StockLineItem[] | null;
105
109
  stock_transfers?: StockTransfer[] | null;
@@ -123,6 +127,10 @@ interface LineItemCreate extends ResourceCreate {
123
127
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
124
128
  sku?: SkuRel | null;
125
129
  bundle?: BundleRel | null;
130
+ adjustment?: AdjustmentRel | null;
131
+ gift_card?: GiftCardRel | null;
132
+ shipment?: ShipmentRel | null;
133
+ payment_method?: PaymentMethodRel | null;
126
134
  tags?: TagRel[] | null;
127
135
  }
128
136
  interface LineItemUpdate extends ResourceUpdate {
@@ -135,6 +143,7 @@ interface LineItemUpdate extends ResourceUpdate {
135
143
  name?: string | null;
136
144
  image_url?: string | null;
137
145
  frequency?: string | null;
146
+ _reset_circuit?: boolean | null;
138
147
  tags?: TagRel[] | null;
139
148
  }
140
149
  declare class LineItems extends ApiResource<LineItem> {
@@ -144,6 +153,7 @@ declare class LineItems extends ApiResource<LineItem> {
144
153
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
145
154
  order(lineItemId: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
146
155
  line_item_options(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
156
+ return_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ReturnLineItem>>;
147
157
  stock_reservations(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockReservation>>;
148
158
  stock_line_items(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
149
159
  stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
@@ -151,6 +161,7 @@ declare class LineItems extends ApiResource<LineItem> {
151
161
  tags(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
152
162
  _external_price(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
153
163
  _reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
164
+ _reset_circuit(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
154
165
  isLineItem(resource: any): resource is LineItem;
155
166
  relationship(id: string | ResourceId | null): LineItemRel;
156
167
  type(): LineItemType;