@commercelayer/sdk 5.13.2 → 5.14.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 (43) hide show
  1. package/lib/cjs/commercelayer.d.ts +2 -2
  2. package/lib/cjs/commercelayer.js +1 -1
  3. package/lib/cjs/resources/external_promotions.d.ts +8 -0
  4. package/lib/cjs/resources/external_promotions.js +4 -0
  5. package/lib/cjs/resources/fixed_amount_promotions.d.ts +8 -0
  6. package/lib/cjs/resources/fixed_amount_promotions.js +4 -0
  7. package/lib/cjs/resources/fixed_price_promotions.d.ts +8 -0
  8. package/lib/cjs/resources/fixed_price_promotions.js +4 -0
  9. package/lib/cjs/resources/free_gift_promotions.d.ts +8 -0
  10. package/lib/cjs/resources/free_gift_promotions.js +4 -0
  11. package/lib/cjs/resources/free_shipping_promotions.d.ts +8 -0
  12. package/lib/cjs/resources/free_shipping_promotions.js +4 -0
  13. package/lib/cjs/resources/imports.d.ts +3 -0
  14. package/lib/cjs/resources/line_items.d.ts +4 -0
  15. package/lib/cjs/resources/order_subscription_items.d.ts +4 -0
  16. package/lib/cjs/resources/orders.d.ts +2 -0
  17. package/lib/cjs/resources/percentage_discount_promotions.d.ts +8 -0
  18. package/lib/cjs/resources/percentage_discount_promotions.js +4 -0
  19. package/lib/cjs/resources/promotions.d.ts +3 -0
  20. package/lib/cjs/resources/promotions.js +4 -0
  21. package/lib/esm/commercelayer.d.ts +2 -2
  22. package/lib/esm/commercelayer.js +1 -1
  23. package/lib/esm/resources/external_promotions.d.ts +8 -0
  24. package/lib/esm/resources/external_promotions.js +4 -0
  25. package/lib/esm/resources/fixed_amount_promotions.d.ts +8 -0
  26. package/lib/esm/resources/fixed_amount_promotions.js +4 -0
  27. package/lib/esm/resources/fixed_price_promotions.d.ts +8 -0
  28. package/lib/esm/resources/fixed_price_promotions.js +4 -0
  29. package/lib/esm/resources/free_gift_promotions.d.ts +8 -0
  30. package/lib/esm/resources/free_gift_promotions.js +4 -0
  31. package/lib/esm/resources/free_shipping_promotions.d.ts +8 -0
  32. package/lib/esm/resources/free_shipping_promotions.js +4 -0
  33. package/lib/esm/resources/imports.d.ts +3 -0
  34. package/lib/esm/resources/line_items.d.ts +4 -0
  35. package/lib/esm/resources/order_subscription_items.d.ts +4 -0
  36. package/lib/esm/resources/orders.d.ts +2 -0
  37. package/lib/esm/resources/percentage_discount_promotions.d.ts +8 -0
  38. package/lib/esm/resources/percentage_discount_promotions.js +4 -0
  39. package/lib/esm/resources/promotions.d.ts +3 -0
  40. package/lib/esm/resources/promotions.js +4 -0
  41. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  42. package/lib/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +4 -4
@@ -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 } from './sku_lists';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
@@ -30,6 +31,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
31
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
32
  type: CouponCodesPromotionRuleType;
32
33
  };
34
+ type CouponRel = ResourceRel & {
35
+ type: CouponType;
36
+ };
33
37
  type TagRel = ResourceRel & {
34
38
  type: TagType;
35
39
  };
@@ -50,6 +54,7 @@ interface FixedAmountPromotion extends Resource {
50
54
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
51
55
  sku_list_promotion_rule?: SkuListPromotionRule | null;
52
56
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
57
+ coupons?: Coupon[] | null;
53
58
  sku_list?: SkuList | null;
54
59
  attachments?: Attachment[] | null;
55
60
  events?: Event[] | null;
@@ -68,6 +73,7 @@ interface FixedAmountPromotionCreate extends ResourceCreate {
68
73
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
69
74
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
70
75
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
76
+ coupons?: CouponRel[] | null;
71
77
  tags?: TagRel[] | null;
72
78
  }
73
79
  interface FixedAmountPromotionUpdate extends ResourceUpdate {
@@ -82,6 +88,7 @@ interface FixedAmountPromotionUpdate extends ResourceUpdate {
82
88
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
83
89
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
84
90
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
91
+ coupons?: CouponRel[] | null;
85
92
  tags?: TagRel[] | null;
86
93
  }
87
94
  declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
@@ -93,6 +100,7 @@ declare class FixedAmountPromotions extends ApiResource<FixedAmountPromotion> {
93
100
  order_amount_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
94
101
  sku_list_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
95
102
  coupon_codes_promotion_rule(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
103
+ coupons(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
96
104
  sku_list(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
97
105
  attachments(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
98
106
  events(fixedAmountPromotionId: string | FixedAmountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -25,6 +25,10 @@ class FixedAmountPromotions extends ApiResource {
25
25
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async coupons(fixedAmountPromotionId, params, options) {
29
+ const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
30
+ return this.resources.fetch({ type: 'coupons' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/coupons`, params, options);
31
+ }
28
32
  async sku_list(fixedAmountPromotionId, params, options) {
29
33
  const _fixedAmountPromotionId = fixedAmountPromotionId.id || fixedAmountPromotionId;
30
34
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_amount_promotions/${_fixedAmountPromotionId}/sku_list`, 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
  };
@@ -54,6 +58,7 @@ interface FixedPricePromotion extends Resource {
54
58
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
55
59
  sku_list_promotion_rule?: SkuListPromotionRule | null;
56
60
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
61
+ coupons?: Coupon[] | null;
57
62
  sku_list?: SkuList | null;
58
63
  attachments?: Attachment[] | null;
59
64
  events?: Event[] | null;
@@ -73,6 +78,7 @@ interface FixedPricePromotionCreate extends ResourceCreate {
73
78
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
74
79
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
75
80
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
81
+ coupons?: CouponRel[] | null;
76
82
  sku_list: SkuListRel;
77
83
  tags?: TagRel[] | null;
78
84
  }
@@ -88,6 +94,7 @@ interface FixedPricePromotionUpdate extends ResourceUpdate {
88
94
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
89
95
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
90
96
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
97
+ coupons?: CouponRel[] | null;
91
98
  sku_list?: SkuListRel | null;
92
99
  tags?: TagRel[] | null;
93
100
  }
@@ -100,6 +107,7 @@ declare class FixedPricePromotions extends ApiResource<FixedPricePromotion> {
100
107
  order_amount_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
101
108
  sku_list_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
102
109
  coupon_codes_promotion_rule(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
110
+ coupons(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
103
111
  sku_list(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
104
112
  attachments(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
105
113
  events(fixedPricePromotionId: string | FixedPricePromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -25,6 +25,10 @@ class FixedPricePromotions extends ApiResource {
25
25
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async coupons(fixedPricePromotionId, params, options) {
29
+ const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
30
+ return this.resources.fetch({ type: 'coupons' }, `fixed_price_promotions/${_fixedPricePromotionId}/coupons`, params, options);
31
+ }
28
32
  async sku_list(fixedPricePromotionId, params, options) {
29
33
  const _fixedPricePromotionId = fixedPricePromotionId.id || fixedPricePromotionId;
30
34
  return this.resources.fetch({ type: 'sku_lists' }, `fixed_price_promotions/${_fixedPricePromotionId}/sku_list`, 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
  };
@@ -52,6 +56,7 @@ interface FreeGiftPromotion extends Resource {
52
56
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
53
57
  sku_list_promotion_rule?: SkuListPromotionRule | null;
54
58
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
59
+ coupons?: Coupon[] | null;
55
60
  sku_list?: SkuList | null;
56
61
  attachments?: Attachment[] | null;
57
62
  events?: Event[] | null;
@@ -71,6 +76,7 @@ interface FreeGiftPromotionCreate extends ResourceCreate {
71
76
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
72
77
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
73
78
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
79
+ coupons?: CouponRel[] | null;
74
80
  sku_list: SkuListRel;
75
81
  tags?: TagRel[] | null;
76
82
  }
@@ -86,6 +92,7 @@ interface FreeGiftPromotionUpdate extends ResourceUpdate {
86
92
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
87
93
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
88
94
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
95
+ coupons?: CouponRel[] | null;
89
96
  sku_list?: SkuListRel | null;
90
97
  tags?: TagRel[] | null;
91
98
  }
@@ -98,6 +105,7 @@ declare class FreeGiftPromotions extends ApiResource<FreeGiftPromotion> {
98
105
  order_amount_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
99
106
  sku_list_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
100
107
  coupon_codes_promotion_rule(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
108
+ coupons(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
101
109
  sku_list(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
102
110
  attachments(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
103
111
  events(freeGiftPromotionId: string | FreeGiftPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -25,6 +25,10 @@ class FreeGiftPromotions extends ApiResource {
25
25
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_gift_promotions/${_freeGiftPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async coupons(freeGiftPromotionId, params, options) {
29
+ const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
30
+ return this.resources.fetch({ type: 'coupons' }, `free_gift_promotions/${_freeGiftPromotionId}/coupons`, params, options);
31
+ }
28
32
  async sku_list(freeGiftPromotionId, params, options) {
29
33
  const _freeGiftPromotionId = freeGiftPromotionId.id || freeGiftPromotionId;
30
34
  return this.resources.fetch({ type: 'sku_lists' }, `free_gift_promotions/${_freeGiftPromotionId}/sku_list`, 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 } from './sku_lists';
10
11
  import type { Attachment } from './attachments';
11
12
  import type { Event } from './events';
@@ -30,6 +31,9 @@ type SkuListPromotionRuleRel = ResourceRel & {
30
31
  type CouponCodesPromotionRuleRel = ResourceRel & {
31
32
  type: CouponCodesPromotionRuleType;
32
33
  };
34
+ type CouponRel = ResourceRel & {
35
+ type: CouponType;
36
+ };
33
37
  type TagRel = ResourceRel & {
34
38
  type: TagType;
35
39
  };
@@ -47,6 +51,7 @@ interface FreeShippingPromotion extends Resource {
47
51
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
48
52
  sku_list_promotion_rule?: SkuListPromotionRule | null;
49
53
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
54
+ coupons?: Coupon[] | null;
50
55
  sku_list?: SkuList | null;
51
56
  attachments?: Attachment[] | null;
52
57
  events?: Event[] | null;
@@ -64,6 +69,7 @@ interface FreeShippingPromotionCreate extends ResourceCreate {
64
69
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
65
70
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
66
71
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
72
+ coupons?: CouponRel[] | null;
67
73
  tags?: TagRel[] | null;
68
74
  }
69
75
  interface FreeShippingPromotionUpdate extends ResourceUpdate {
@@ -77,6 +83,7 @@ interface FreeShippingPromotionUpdate extends ResourceUpdate {
77
83
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
78
84
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
79
85
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
86
+ coupons?: CouponRel[] | null;
80
87
  tags?: TagRel[] | null;
81
88
  }
82
89
  declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion> {
@@ -88,6 +95,7 @@ declare class FreeShippingPromotions extends ApiResource<FreeShippingPromotion>
88
95
  order_amount_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
89
96
  sku_list_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
90
97
  coupon_codes_promotion_rule(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
98
+ coupons(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
91
99
  sku_list(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
92
100
  attachments(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
93
101
  events(freeShippingPromotionId: string | FreeShippingPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -25,6 +25,10 @@ class FreeShippingPromotions extends ApiResource {
25
25
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async coupons(freeShippingPromotionId, params, options) {
29
+ const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
30
+ return this.resources.fetch({ type: 'coupons' }, `free_shipping_promotions/${_freeShippingPromotionId}/coupons`, params, options);
31
+ }
28
32
  async sku_list(freeShippingPromotionId, params, options) {
29
33
  const _freeShippingPromotionId = freeShippingPromotionId.id || freeShippingPromotionId;
30
34
  return this.resources.fetch({ type: 'sku_lists' }, `free_shipping_promotions/${_freeShippingPromotionId}/sku_list`, params, options);
@@ -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;
@@ -88,6 +88,8 @@ interface LineItem extends Resource {
88
88
  frequency?: string | null;
89
89
  order?: Order | null;
90
90
  item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku | null;
91
+ sku?: Sku | null;
92
+ bundle?: Bundle | null;
91
93
  line_item_options?: LineItemOption[] | null;
92
94
  /**
93
95
  * @deprecated This field should not be used as it may be removed in the future without notice
@@ -113,6 +115,8 @@ interface LineItemCreate extends ResourceCreate {
113
115
  frequency?: string | null;
114
116
  order: OrderRel;
115
117
  item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel | null;
118
+ sku?: SkuRel | null;
119
+ bundle?: BundleRel | null;
116
120
  tags?: TagRel[] | null;
117
121
  }
118
122
  interface LineItemUpdate extends ResourceUpdate {
@@ -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;
@@ -219,6 +219,7 @@ interface OrderCreate extends ResourceCreate {
219
219
  customer_email?: string | null;
220
220
  customer_password?: string | null;
221
221
  language_code?: string | null;
222
+ freight_taxable?: boolean | null;
222
223
  shipping_country_code_lock?: string | null;
223
224
  coupon_code?: string | null;
224
225
  gift_card_code?: string | null;
@@ -240,6 +241,7 @@ interface OrderUpdate extends ResourceUpdate {
240
241
  customer_email?: string | null;
241
242
  customer_password?: string | null;
242
243
  language_code?: string | null;
244
+ freight_taxable?: boolean | null;
243
245
  shipping_country_code_lock?: string | null;
244
246
  coupon_code?: string | null;
245
247
  gift_card_code?: string | null;
@@ -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
  };
@@ -52,6 +56,7 @@ interface PercentageDiscountPromotion extends Resource {
52
56
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
53
57
  sku_list_promotion_rule?: SkuListPromotionRule | null;
54
58
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
59
+ coupons?: Coupon[] | null;
55
60
  sku_list?: SkuList | null;
56
61
  attachments?: Attachment[] | null;
57
62
  events?: Event[] | null;
@@ -71,6 +76,7 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
71
76
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
72
77
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
73
78
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
79
+ coupons?: CouponRel[] | null;
74
80
  sku_list?: SkuListRel | null;
75
81
  tags?: TagRel[] | null;
76
82
  }
@@ -86,6 +92,7 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
86
92
  order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
87
93
  sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
88
94
  coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
95
+ coupons?: CouponRel[] | null;
89
96
  sku_list?: SkuListRel | null;
90
97
  tags?: TagRel[] | null;
91
98
  }
@@ -98,6 +105,7 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
98
105
  order_amount_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
99
106
  sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
100
107
  coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
108
+ coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
101
109
  sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
102
110
  attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
103
111
  events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -25,6 +25,10 @@ class PercentageDiscountPromotions extends ApiResource {
25
25
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
26
26
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupon_codes_promotion_rule`, params, options);
27
27
  }
28
+ async coupons(percentageDiscountPromotionId, params, options) {
29
+ const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
30
+ return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
31
+ }
28
32
  async sku_list(percentageDiscountPromotionId, params, options) {
29
33
  const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
30
34
  return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
@@ -6,6 +6,7 @@ import type { PromotionRule } from './promotion_rules';
6
6
  import type { OrderAmountPromotionRule } from './order_amount_promotion_rules';
7
7
  import type { SkuListPromotionRule } from './sku_list_promotion_rules';
8
8
  import type { CouponCodesPromotionRule } from './coupon_codes_promotion_rules';
9
+ import type { 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';
@@ -29,6 +30,7 @@ interface Promotion extends Resource {
29
30
  order_amount_promotion_rule?: OrderAmountPromotionRule | null;
30
31
  sku_list_promotion_rule?: SkuListPromotionRule | null;
31
32
  coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
33
+ coupons?: Coupon[] | null;
32
34
  sku_list?: SkuList | null;
33
35
  attachments?: Attachment[] | null;
34
36
  events?: Event[] | null;
@@ -41,6 +43,7 @@ declare class Promotions extends ApiResource<Promotion> {
41
43
  order_amount_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
42
44
  sku_list_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
43
45
  coupon_codes_promotion_rule(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
46
+ coupons(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
44
47
  sku_list(promotionId: string | Promotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
45
48
  attachments(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
46
49
  events(promotionId: string | Promotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
@@ -16,6 +16,10 @@ class Promotions extends ApiResource {
16
16
  const _promotionId = promotionId.id || promotionId;
17
17
  return this.resources.fetch({ type: 'coupon_codes_promotion_rules' }, `promotions/${_promotionId}/coupon_codes_promotion_rule`, params, options);
18
18
  }
19
+ async coupons(promotionId, params, options) {
20
+ const _promotionId = promotionId.id || promotionId;
21
+ return this.resources.fetch({ type: 'coupons' }, `promotions/${_promotionId}/coupons`, params, options);
22
+ }
19
23
  async sku_list(promotionId, params, options) {
20
24
  const _promotionId = promotionId.id || promotionId;
21
25
  return this.resources.fetch({ type: 'sku_lists' }, `promotions/${_promotionId}/sku_list`, params, options);