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