@commercelayer/sdk 5.28.0 → 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.
- package/lib/cjs/api.d.ts +3 -2
- package/lib/cjs/api.js +5 -2
- package/lib/cjs/client.js +5 -5
- package/lib/cjs/commercelayer.d.ts +3 -2
- package/lib/cjs/commercelayer.js +5 -4
- package/lib/cjs/common.js +1 -1
- package/lib/cjs/error.js +1 -2
- package/lib/cjs/model.d.ts +1 -0
- package/lib/cjs/query.d.ts +1 -1
- package/lib/cjs/query.js +1 -1
- package/lib/cjs/resource.js +22 -25
- package/lib/cjs/resources/adjustments.d.ts +3 -0
- package/lib/cjs/resources/adyen_gateways.d.ts +2 -2
- package/lib/cjs/resources/buy_x_pay_y_promotions.d.ts +4 -14
- package/lib/cjs/resources/buy_x_pay_y_promotions.js +4 -4
- package/lib/cjs/resources/external_gateways.d.ts +5 -1
- package/lib/cjs/resources/external_gateways.js +3 -0
- package/lib/cjs/resources/external_promotions.d.ts +8 -14
- package/lib/cjs/resources/external_promotions.js +7 -4
- package/lib/cjs/resources/external_tax_calculators.d.ts +4 -0
- package/lib/cjs/resources/external_tax_calculators.js +3 -0
- package/lib/cjs/resources/fixed_amount_promotions.d.ts +4 -14
- package/lib/cjs/resources/fixed_amount_promotions.js +4 -4
- package/lib/cjs/resources/fixed_price_promotions.d.ts +4 -14
- package/lib/cjs/resources/fixed_price_promotions.js +4 -4
- package/lib/cjs/resources/free_gift_promotions.d.ts +4 -14
- package/lib/cjs/resources/free_gift_promotions.js +4 -4
- package/lib/cjs/resources/free_shipping_promotions.d.ts +9 -14
- package/lib/cjs/resources/free_shipping_promotions.js +4 -4
- package/lib/cjs/resources/gift_cards.d.ts +3 -0
- package/lib/cjs/resources/line_items.d.ts +12 -4
- package/lib/cjs/resources/line_items.js +3 -0
- package/lib/cjs/resources/markets.d.ts +1 -1
- package/lib/cjs/resources/order_subscriptions.d.ts +1 -4
- package/lib/cjs/resources/orders.d.ts +14 -1
- package/lib/cjs/resources/orders.js +10 -0
- package/lib/cjs/resources/parcel_line_items.d.ts +0 -8
- package/lib/cjs/resources/payment_methods.d.ts +8 -5
- package/lib/cjs/resources/percentage_discount_promotions.d.ts +4 -14
- package/lib/cjs/resources/percentage_discount_promotions.js +4 -4
- package/lib/cjs/resources/promotions.d.ts +3 -3
- package/lib/cjs/resources/promotions.js +4 -4
- package/lib/cjs/resources/resource_errors.d.ts +22 -0
- package/lib/cjs/resources/resource_errors.js +16 -0
- package/lib/cjs/resources/shipments.d.ts +0 -4
- package/lib/cjs/resources/shipping_methods.d.ts +9 -5
- package/lib/cjs/resources/shipping_methods.js +3 -0
- package/lib/cjs/resources/stock_transfers.d.ts +1 -1
- package/lib/cjs/resources/stripe_payments.d.ts +4 -1
- package/lib/cjs/resources/webhooks.d.ts +3 -3
- package/lib/cjs/resources/webhooks.js +3 -3
- package/lib/esm/api.d.ts +3 -2
- package/lib/esm/api.js +2 -0
- package/lib/esm/client.js +19 -30
- package/lib/esm/commercelayer.d.ts +3 -2
- package/lib/esm/commercelayer.js +261 -149
- package/lib/esm/common.js +1 -1
- package/lib/esm/error.js +10 -5
- package/lib/esm/model.d.ts +1 -0
- package/lib/esm/query.d.ts +1 -1
- package/lib/esm/query.js +1 -1
- package/lib/esm/resource.js +37 -50
- package/lib/esm/resources/addresses.js +1 -1
- package/lib/esm/resources/adjustments.d.ts +3 -0
- package/lib/esm/resources/adjustments.js +1 -1
- package/lib/esm/resources/adyen_gateways.d.ts +2 -2
- package/lib/esm/resources/adyen_gateways.js +1 -1
- package/lib/esm/resources/adyen_payments.js +1 -1
- package/lib/esm/resources/application.js +1 -1
- package/lib/esm/resources/attachments.js +1 -1
- package/lib/esm/resources/authorizations.js +1 -1
- package/lib/esm/resources/avalara_accounts.js +1 -1
- package/lib/esm/resources/axerve_gateways.js +1 -1
- package/lib/esm/resources/axerve_payments.js +1 -1
- package/lib/esm/resources/billing_info_validation_rules.js +1 -1
- package/lib/esm/resources/bing_geocoders.js +1 -1
- package/lib/esm/resources/braintree_gateways.js +1 -1
- package/lib/esm/resources/braintree_payments.js +1 -1
- package/lib/esm/resources/bundles.js +1 -1
- package/lib/esm/resources/buy_x_pay_y_promotions.d.ts +4 -14
- package/lib/esm/resources/buy_x_pay_y_promotions.js +5 -5
- package/lib/esm/resources/captures.js +1 -1
- package/lib/esm/resources/carrier_accounts.js +1 -1
- package/lib/esm/resources/checkout_com_gateways.js +1 -1
- package/lib/esm/resources/checkout_com_payments.js +1 -1
- package/lib/esm/resources/cleanups.js +1 -1
- package/lib/esm/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/esm/resources/coupon_recipients.js +1 -1
- package/lib/esm/resources/coupons.js +1 -1
- package/lib/esm/resources/custom_promotion_rules.js +1 -1
- package/lib/esm/resources/customer_addresses.js +1 -1
- package/lib/esm/resources/customer_groups.js +1 -1
- package/lib/esm/resources/customer_password_resets.js +1 -1
- package/lib/esm/resources/customer_payment_sources.js +1 -1
- package/lib/esm/resources/customer_subscriptions.js +1 -1
- package/lib/esm/resources/customers.js +1 -1
- package/lib/esm/resources/delivery_lead_times.js +1 -1
- package/lib/esm/resources/event_callbacks.js +1 -1
- package/lib/esm/resources/events.js +1 -1
- package/lib/esm/resources/exports.js +1 -1
- package/lib/esm/resources/external_gateways.d.ts +5 -1
- package/lib/esm/resources/external_gateways.js +4 -1
- package/lib/esm/resources/external_payments.js +1 -1
- package/lib/esm/resources/external_promotions.d.ts +8 -14
- package/lib/esm/resources/external_promotions.js +8 -5
- package/lib/esm/resources/external_tax_calculators.d.ts +4 -0
- package/lib/esm/resources/external_tax_calculators.js +4 -1
- package/lib/esm/resources/fixed_amount_promotions.d.ts +4 -14
- package/lib/esm/resources/fixed_amount_promotions.js +5 -5
- package/lib/esm/resources/fixed_price_promotions.d.ts +4 -14
- package/lib/esm/resources/fixed_price_promotions.js +5 -5
- package/lib/esm/resources/free_gift_promotions.d.ts +4 -14
- package/lib/esm/resources/free_gift_promotions.js +5 -5
- package/lib/esm/resources/free_shipping_promotions.d.ts +9 -14
- package/lib/esm/resources/free_shipping_promotions.js +5 -5
- package/lib/esm/resources/geocoders.js +1 -1
- package/lib/esm/resources/gift_card_recipients.js +1 -1
- package/lib/esm/resources/gift_cards.d.ts +3 -0
- package/lib/esm/resources/gift_cards.js +1 -1
- package/lib/esm/resources/google_geocoders.js +1 -1
- package/lib/esm/resources/imports.js +1 -1
- package/lib/esm/resources/in_stock_subscriptions.js +1 -1
- package/lib/esm/resources/inventory_models.js +1 -1
- package/lib/esm/resources/inventory_return_locations.js +1 -1
- package/lib/esm/resources/inventory_stock_locations.js +1 -1
- package/lib/esm/resources/klarna_gateways.js +1 -1
- package/lib/esm/resources/klarna_payments.js +1 -1
- package/lib/esm/resources/line_item_options.js +1 -1
- package/lib/esm/resources/line_items.d.ts +12 -4
- package/lib/esm/resources/line_items.js +4 -1
- package/lib/esm/resources/manual_gateways.js +1 -1
- package/lib/esm/resources/manual_tax_calculators.js +1 -1
- package/lib/esm/resources/markets.d.ts +1 -1
- package/lib/esm/resources/markets.js +1 -1
- package/lib/esm/resources/merchants.js +1 -1
- package/lib/esm/resources/order_amount_promotion_rules.js +1 -1
- package/lib/esm/resources/order_copies.js +1 -1
- package/lib/esm/resources/order_factories.js +1 -1
- package/lib/esm/resources/order_subscription_items.js +1 -1
- package/lib/esm/resources/order_subscriptions.d.ts +1 -4
- package/lib/esm/resources/order_subscriptions.js +1 -1
- package/lib/esm/resources/order_validation_rules.js +1 -1
- package/lib/esm/resources/orders.d.ts +14 -1
- package/lib/esm/resources/orders.js +11 -1
- package/lib/esm/resources/organization.js +1 -1
- package/lib/esm/resources/packages.js +1 -1
- package/lib/esm/resources/parcel_line_items.d.ts +0 -8
- package/lib/esm/resources/parcel_line_items.js +1 -1
- package/lib/esm/resources/parcels.js +1 -1
- package/lib/esm/resources/payment_gateways.js +1 -1
- package/lib/esm/resources/payment_methods.d.ts +8 -5
- package/lib/esm/resources/payment_methods.js +1 -1
- package/lib/esm/resources/payment_options.js +1 -1
- package/lib/esm/resources/paypal_gateways.js +1 -1
- package/lib/esm/resources/paypal_payments.js +1 -1
- package/lib/esm/resources/percentage_discount_promotions.d.ts +4 -14
- package/lib/esm/resources/percentage_discount_promotions.js +5 -5
- package/lib/esm/resources/price_frequency_tiers.js +1 -1
- package/lib/esm/resources/price_lists.js +1 -1
- package/lib/esm/resources/price_tiers.js +1 -1
- package/lib/esm/resources/price_volume_tiers.js +1 -1
- package/lib/esm/resources/prices.js +1 -1
- package/lib/esm/resources/promotion_rules.js +1 -1
- package/lib/esm/resources/promotions.d.ts +3 -3
- package/lib/esm/resources/promotions.js +5 -5
- package/lib/esm/resources/recurring_order_copies.js +1 -1
- package/lib/esm/resources/refunds.js +1 -1
- package/lib/esm/resources/reserved_stocks.js +1 -1
- package/lib/esm/resources/resource_errors.d.ts +22 -0
- package/lib/esm/resources/resource_errors.js +14 -0
- package/lib/esm/resources/return_line_items.js +1 -1
- package/lib/esm/resources/returns.js +1 -1
- package/lib/esm/resources/satispay_gateways.js +1 -1
- package/lib/esm/resources/satispay_payments.js +1 -1
- package/lib/esm/resources/shipments.d.ts +0 -4
- package/lib/esm/resources/shipments.js +1 -1
- package/lib/esm/resources/shipping_categories.js +1 -1
- package/lib/esm/resources/shipping_method_tiers.js +1 -1
- package/lib/esm/resources/shipping_methods.d.ts +9 -5
- package/lib/esm/resources/shipping_methods.js +4 -1
- package/lib/esm/resources/shipping_weight_tiers.js +1 -1
- package/lib/esm/resources/shipping_zones.js +1 -1
- package/lib/esm/resources/sku_list_items.js +1 -1
- package/lib/esm/resources/sku_list_promotion_rules.js +1 -1
- package/lib/esm/resources/sku_lists.js +1 -1
- package/lib/esm/resources/sku_options.js +1 -1
- package/lib/esm/resources/skus.js +1 -1
- package/lib/esm/resources/stock_items.js +1 -1
- package/lib/esm/resources/stock_line_items.js +1 -1
- package/lib/esm/resources/stock_locations.js +1 -1
- package/lib/esm/resources/stock_reservations.js +1 -1
- package/lib/esm/resources/stock_transfers.d.ts +1 -1
- package/lib/esm/resources/stock_transfers.js +1 -1
- package/lib/esm/resources/stripe_gateways.js +1 -1
- package/lib/esm/resources/stripe_payments.d.ts +4 -1
- package/lib/esm/resources/stripe_payments.js +1 -1
- package/lib/esm/resources/subscription_models.js +1 -1
- package/lib/esm/resources/tags.js +1 -1
- package/lib/esm/resources/tax_calculators.js +1 -1
- package/lib/esm/resources/tax_categories.js +1 -1
- package/lib/esm/resources/tax_rules.js +1 -1
- package/lib/esm/resources/taxjar_accounts.js +1 -1
- package/lib/esm/resources/transactions.js +1 -1
- package/lib/esm/resources/versions.js +1 -1
- package/lib/esm/resources/voids.js +1 -1
- package/lib/esm/resources/webhooks.d.ts +3 -3
- package/lib/esm/resources/webhooks.js +4 -4
- package/lib/esm/resources/wire_transfers.js +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Markets extends ApiResource {
|
3
|
+
static TYPE = 'markets';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Markets.TYPE }, params, options);
|
5
6
|
}
|
@@ -57,5 +58,4 @@ class Markets extends ApiResource {
|
|
57
58
|
return Markets.TYPE;
|
58
59
|
}
|
59
60
|
}
|
60
|
-
Markets.TYPE = 'markets';
|
61
61
|
export default Markets;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Merchants extends ApiResource {
|
3
|
+
static TYPE = 'merchants';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Merchants.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class Merchants extends ApiResource {
|
|
31
32
|
return Merchants.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
Merchants.TYPE = 'merchants';
|
35
35
|
export default Merchants;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderAmountPromotionRules extends ApiResource {
|
3
|
+
static TYPE = 'order_amount_promotion_rules';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: OrderAmountPromotionRules.TYPE }, params, options);
|
5
6
|
}
|
@@ -23,5 +24,4 @@ class OrderAmountPromotionRules extends ApiResource {
|
|
23
24
|
return OrderAmountPromotionRules.TYPE;
|
24
25
|
}
|
25
26
|
}
|
26
|
-
OrderAmountPromotionRules.TYPE = 'order_amount_promotion_rules';
|
27
27
|
export default OrderAmountPromotionRules;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderCopies extends ApiResource {
|
3
|
+
static TYPE = 'order_copies';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: OrderCopies.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class OrderCopies extends ApiResource {
|
|
35
36
|
return OrderCopies.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
OrderCopies.TYPE = 'order_copies';
|
39
39
|
export default OrderCopies;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderFactories extends ApiResource {
|
3
|
+
static TYPE = 'order_factories';
|
3
4
|
async source_order(orderFactoryId, params, options) {
|
4
5
|
const _orderFactoryId = orderFactoryId.id || orderFactoryId;
|
5
6
|
return this.resources.fetch({ type: 'orders' }, `order_factories/${_orderFactoryId}/source_order`, params, options);
|
@@ -22,5 +23,4 @@ class OrderFactories extends ApiResource {
|
|
22
23
|
return OrderFactories.TYPE;
|
23
24
|
}
|
24
25
|
}
|
25
|
-
OrderFactories.TYPE = 'order_factories';
|
26
26
|
export default OrderFactories;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderSubscriptionItems extends ApiResource {
|
3
|
+
static TYPE = 'order_subscription_items';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: OrderSubscriptionItems.TYPE }, params, options);
|
5
6
|
}
|
@@ -27,5 +28,4 @@ class OrderSubscriptionItems extends ApiResource {
|
|
27
28
|
return OrderSubscriptionItems.TYPE;
|
28
29
|
}
|
29
30
|
}
|
30
|
-
OrderSubscriptionItems.TYPE = 'order_subscription_items';
|
31
31
|
export default OrderSubscriptionItems;
|
@@ -33,6 +33,7 @@ interface OrderSubscription extends Resource {
|
|
33
33
|
customer_email?: string | null;
|
34
34
|
starts_at?: string | null;
|
35
35
|
expires_at?: string | null;
|
36
|
+
last_run_at?: string | null;
|
36
37
|
next_run_at?: string | null;
|
37
38
|
occurrencies?: number | null;
|
38
39
|
errors_count?: number | null;
|
@@ -45,10 +46,6 @@ interface OrderSubscription extends Resource {
|
|
45
46
|
customer_payment_source?: CustomerPaymentSource | null;
|
46
47
|
order_subscription_items?: OrderSubscriptionItem[] | null;
|
47
48
|
order_factories?: OrderFactory[] | null;
|
48
|
-
/**
|
49
|
-
* @deprecated This field should not be used as it may be removed in the future without notice
|
50
|
-
*/
|
51
|
-
order_copies?: object[];
|
52
49
|
recurring_order_copies?: RecurringOrderCopy[] | null;
|
53
50
|
orders?: Order[] | null;
|
54
51
|
events?: Event[] | null;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderSubscriptions extends ApiResource {
|
3
|
+
static TYPE = 'order_subscriptions';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: OrderSubscriptions.TYPE }, params, options);
|
5
6
|
}
|
@@ -72,5 +73,4 @@ class OrderSubscriptions extends ApiResource {
|
|
72
73
|
return OrderSubscriptions.TYPE;
|
73
74
|
}
|
74
75
|
}
|
75
|
-
OrderSubscriptions.TYPE = 'order_subscriptions';
|
76
76
|
export default OrderSubscriptions;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class OrderValidationRules extends ApiResource {
|
3
|
+
static TYPE = 'order_validation_rules';
|
3
4
|
async market(orderValidationRuleId, params, options) {
|
4
5
|
const _orderValidationRuleId = orderValidationRuleId.id || orderValidationRuleId;
|
5
6
|
return this.resources.fetch({ type: 'markets' }, `order_validation_rules/${_orderValidationRuleId}/market`, params, options);
|
@@ -22,5 +23,4 @@ class OrderValidationRules extends ApiResource {
|
|
22
23
|
return OrderValidationRules.TYPE;
|
23
24
|
}
|
24
25
|
}
|
25
|
-
OrderValidationRules.TYPE = 'order_validation_rules';
|
26
26
|
export default OrderValidationRules;
|
@@ -35,6 +35,7 @@ import type { OrderFactory } from './order_factories';
|
|
35
35
|
import type { OrderCopy } from './order_copies';
|
36
36
|
import type { RecurringOrderCopy } from './recurring_order_copies';
|
37
37
|
import type { Attachment } from './attachments';
|
38
|
+
import type { ResourceError } from './resource_errors';
|
38
39
|
import type { Event } from './events';
|
39
40
|
import type { Tag, TagType } from './tags';
|
40
41
|
import type { Version } from './versions';
|
@@ -91,7 +92,8 @@ interface Order extends Resource {
|
|
91
92
|
readonly type: OrderType;
|
92
93
|
number?: string | null;
|
93
94
|
autorefresh?: boolean | null;
|
94
|
-
|
95
|
+
place_async?: boolean | null;
|
96
|
+
status: 'draft' | 'pending' | 'placing' | 'placed' | 'editing' | 'approved' | 'cancelled';
|
95
97
|
payment_status: 'unpaid' | 'authorized' | 'partially_authorized' | 'paid' | 'partially_paid' | 'voided' | 'partially_voided' | 'refunded' | 'partially_refunded' | 'free';
|
96
98
|
fulfillment_status: 'unfulfilled' | 'in_progress' | 'fulfilled' | 'not_required';
|
97
99
|
guest?: boolean | null;
|
@@ -178,6 +180,7 @@ interface Order extends Resource {
|
|
178
180
|
shipments_count?: number | null;
|
179
181
|
tax_calculations_count?: number | null;
|
180
182
|
validations_count?: number | null;
|
183
|
+
errors_count?: number | null;
|
181
184
|
payment_source_details?: Record<string, any> | null;
|
182
185
|
token?: string | null;
|
183
186
|
cart_url?: string | null;
|
@@ -194,6 +197,8 @@ interface Order extends Resource {
|
|
194
197
|
archived_at?: string | null;
|
195
198
|
expires_at?: string | null;
|
196
199
|
subscription_created_at?: string | null;
|
200
|
+
circuit_state?: string | null;
|
201
|
+
circuit_failure_count?: number | null;
|
197
202
|
market?: Market | null;
|
198
203
|
customer?: Customer | null;
|
199
204
|
shipping_address?: Address | null;
|
@@ -223,6 +228,7 @@ interface Order extends Resource {
|
|
223
228
|
order_copies?: OrderCopy[] | null;
|
224
229
|
recurring_order_copies?: RecurringOrderCopy[] | null;
|
225
230
|
attachments?: Attachment[] | null;
|
231
|
+
resource_errors?: ResourceError[] | null;
|
226
232
|
events?: Event[] | null;
|
227
233
|
tags?: Tag[] | null;
|
228
234
|
versions?: Version[] | null;
|
@@ -230,6 +236,7 @@ interface Order extends Resource {
|
|
230
236
|
interface OrderCreate extends ResourceCreate {
|
231
237
|
number?: string | null;
|
232
238
|
autorefresh?: boolean | null;
|
239
|
+
place_async?: boolean | null;
|
233
240
|
guest?: boolean | null;
|
234
241
|
customer_email?: string | null;
|
235
242
|
customer_password?: string | null;
|
@@ -256,6 +263,7 @@ interface OrderCreate extends ResourceCreate {
|
|
256
263
|
interface OrderUpdate extends ResourceUpdate {
|
257
264
|
number?: string | null;
|
258
265
|
autorefresh?: boolean | null;
|
266
|
+
place_async?: boolean | null;
|
259
267
|
guest?: boolean | null;
|
260
268
|
customer_email?: string | null;
|
261
269
|
customer_password?: string | null;
|
@@ -273,6 +281,7 @@ interface OrderUpdate extends ResourceUpdate {
|
|
273
281
|
privacy_url?: string | null;
|
274
282
|
_archive?: boolean | null;
|
275
283
|
_unarchive?: boolean | null;
|
284
|
+
_pending?: boolean | null;
|
276
285
|
_place?: boolean | null;
|
277
286
|
_cancel?: boolean | null;
|
278
287
|
_approve?: boolean | null;
|
@@ -298,6 +307,7 @@ interface OrderUpdate extends ResourceUpdate {
|
|
298
307
|
_create_subscriptions?: boolean | null;
|
299
308
|
_start_editing?: boolean | null;
|
300
309
|
_stop_editing?: boolean | null;
|
310
|
+
_reset_circuit?: boolean | null;
|
301
311
|
market?: MarketRel | null;
|
302
312
|
customer?: CustomerRel | null;
|
303
313
|
shipping_address?: AddressRel | null;
|
@@ -338,11 +348,13 @@ declare class Orders extends ApiResource<Order> {
|
|
338
348
|
order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderCopy>>;
|
339
349
|
recurring_order_copies(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
|
340
350
|
attachments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
351
|
+
resource_errors(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ResourceError>>;
|
341
352
|
events(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
342
353
|
tags(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
343
354
|
versions(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Version>>;
|
344
355
|
_archive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
345
356
|
_unarchive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
357
|
+
_pending(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
346
358
|
_place(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
347
359
|
_cancel(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
348
360
|
_approve(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
@@ -368,6 +380,7 @@ declare class Orders extends ApiResource<Order> {
|
|
368
380
|
_create_subscriptions(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
369
381
|
_start_editing(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
370
382
|
_stop_editing(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
383
|
+
_reset_circuit(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
371
384
|
isOrder(resource: any): resource is Order;
|
372
385
|
relationship(id: string | ResourceId | null): OrderRel;
|
373
386
|
type(): OrderType;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Orders extends ApiResource {
|
3
|
+
static TYPE = 'orders';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Orders.TYPE }, params, options);
|
5
6
|
}
|
@@ -117,6 +118,10 @@ class Orders extends ApiResource {
|
|
117
118
|
const _orderId = orderId.id || orderId;
|
118
119
|
return this.resources.fetch({ type: 'attachments' }, `orders/${_orderId}/attachments`, params, options);
|
119
120
|
}
|
121
|
+
async resource_errors(orderId, params, options) {
|
122
|
+
const _orderId = orderId.id || orderId;
|
123
|
+
return this.resources.fetch({ type: 'resource_errors' }, `orders/${_orderId}/resource_errors`, params, options);
|
124
|
+
}
|
120
125
|
async events(orderId, params, options) {
|
121
126
|
const _orderId = orderId.id || orderId;
|
122
127
|
return this.resources.fetch({ type: 'events' }, `orders/${_orderId}/events`, params, options);
|
@@ -135,6 +140,9 @@ class Orders extends ApiResource {
|
|
135
140
|
async _unarchive(id, params, options) {
|
136
141
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
|
137
142
|
}
|
143
|
+
async _pending(id, params, options) {
|
144
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _pending: true }, params, options);
|
145
|
+
}
|
138
146
|
async _place(id, params, options) {
|
139
147
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
|
140
148
|
}
|
@@ -210,6 +218,9 @@ class Orders extends ApiResource {
|
|
210
218
|
async _stop_editing(id, params, options) {
|
211
219
|
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _stop_editing: true }, params, options);
|
212
220
|
}
|
221
|
+
async _reset_circuit(id, params, options) {
|
222
|
+
return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _reset_circuit: true }, params, options);
|
223
|
+
}
|
213
224
|
isOrder(resource) {
|
214
225
|
return resource.type && (resource.type === Orders.TYPE);
|
215
226
|
}
|
@@ -220,5 +231,4 @@ class Orders extends ApiResource {
|
|
220
231
|
return Orders.TYPE;
|
221
232
|
}
|
222
233
|
}
|
223
|
-
Orders.TYPE = 'orders';
|
224
234
|
export default Orders;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiSingleton } from '../resource';
|
2
2
|
class Organizations extends ApiSingleton {
|
3
|
+
static TYPE = 'organization';
|
3
4
|
isOrganization(resource) {
|
4
5
|
return resource.type && (resource.type === Organizations.TYPE);
|
5
6
|
}
|
@@ -10,5 +11,4 @@ class Organizations extends ApiSingleton {
|
|
10
11
|
return Organizations.TYPE;
|
11
12
|
}
|
12
13
|
}
|
13
|
-
Organizations.TYPE = 'organization';
|
14
14
|
export default Organizations;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Packages extends ApiResource {
|
3
|
+
static TYPE = 'packages';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Packages.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class Packages extends ApiResource {
|
|
35
36
|
return Packages.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
Packages.TYPE = 'packages';
|
39
39
|
export default Packages;
|
@@ -23,20 +23,12 @@ interface ParcelLineItem extends Resource {
|
|
23
23
|
image_url?: string | null;
|
24
24
|
parcel?: Parcel | null;
|
25
25
|
stock_line_item?: StockLineItem | null;
|
26
|
-
/**
|
27
|
-
* @deprecated This field should not be used as it may be removed in the future without notice
|
28
|
-
*/
|
29
|
-
shipment_line_item?: object;
|
30
26
|
versions?: Version[] | null;
|
31
27
|
}
|
32
28
|
interface ParcelLineItemCreate extends ResourceCreate {
|
33
29
|
quantity: number;
|
34
30
|
parcel: ParcelRel;
|
35
31
|
stock_line_item: StockLineItemRel;
|
36
|
-
/**
|
37
|
-
* @deprecated This field should not be used as it may be removed in the future without notice
|
38
|
-
*/
|
39
|
-
shipment_line_item?: object;
|
40
32
|
}
|
41
33
|
type ParcelLineItemUpdate = ResourceUpdate;
|
42
34
|
declare class ParcelLineItems extends ApiResource<ParcelLineItem> {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class ParcelLineItems extends ApiResource {
|
3
|
+
static TYPE = 'parcel_line_items';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: ParcelLineItems.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class ParcelLineItems extends ApiResource {
|
|
31
32
|
return ParcelLineItems.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
ParcelLineItems.TYPE = 'parcel_line_items';
|
35
35
|
export default ParcelLineItems;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Parcels extends ApiResource {
|
3
|
+
static TYPE = 'parcels';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Parcels.TYPE }, params, options);
|
5
6
|
}
|
@@ -43,5 +44,4 @@ class Parcels extends ApiResource {
|
|
43
44
|
return Parcels.TYPE;
|
44
45
|
}
|
45
46
|
}
|
46
|
-
Parcels.TYPE = 'parcels';
|
47
47
|
export default Parcels;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaymentGateways extends ApiResource {
|
3
|
+
static TYPE = 'payment_gateways';
|
3
4
|
async payment_methods(paymentGatewayId, params, options) {
|
4
5
|
const _paymentGatewayId = paymentGatewayId.id || paymentGatewayId;
|
5
6
|
return this.resources.fetch({ type: 'payment_methods' }, `payment_gateways/${_paymentGatewayId}/payment_methods`, params, options);
|
@@ -18,5 +19,4 @@ class PaymentGateways extends ApiResource {
|
|
18
19
|
return PaymentGateways.TYPE;
|
19
20
|
}
|
20
21
|
}
|
21
|
-
PaymentGateways.TYPE = 'payment_gateways';
|
22
22
|
export default PaymentGateways;
|
@@ -22,14 +22,15 @@ interface PaymentMethod extends Resource {
|
|
22
22
|
currency_code?: string | null;
|
23
23
|
moto?: boolean | null;
|
24
24
|
require_capture?: boolean | null;
|
25
|
+
auto_place?: boolean | null;
|
25
26
|
auto_capture?: boolean | null;
|
26
|
-
disabled_at?: string | null;
|
27
27
|
price_amount_cents: number;
|
28
28
|
price_amount_float?: number | null;
|
29
29
|
formatted_price_amount?: string | null;
|
30
30
|
auto_capture_max_amount_cents?: number | null;
|
31
31
|
auto_capture_max_amount_float?: number | null;
|
32
32
|
formatted_auto_capture_max_amount?: string | null;
|
33
|
+
disabled_at?: string | null;
|
33
34
|
market?: Market | null;
|
34
35
|
payment_gateway?: PaymentGateway | null;
|
35
36
|
attachments?: Attachment[] | null;
|
@@ -40,11 +41,12 @@ interface PaymentMethodCreate extends ResourceCreate {
|
|
40
41
|
currency_code?: string | null;
|
41
42
|
moto?: boolean | null;
|
42
43
|
require_capture?: boolean | null;
|
44
|
+
auto_place?: boolean | null;
|
43
45
|
auto_capture?: boolean | null;
|
44
|
-
_disable?: boolean | null;
|
45
|
-
_enable?: boolean | null;
|
46
46
|
price_amount_cents: number;
|
47
47
|
auto_capture_max_amount_cents?: number | null;
|
48
|
+
_disable?: boolean | null;
|
49
|
+
_enable?: boolean | null;
|
48
50
|
market?: MarketRel | null;
|
49
51
|
payment_gateway: PaymentGatewayRel;
|
50
52
|
}
|
@@ -53,11 +55,12 @@ interface PaymentMethodUpdate extends ResourceUpdate {
|
|
53
55
|
currency_code?: string | null;
|
54
56
|
moto?: boolean | null;
|
55
57
|
require_capture?: boolean | null;
|
58
|
+
auto_place?: boolean | null;
|
56
59
|
auto_capture?: boolean | null;
|
57
|
-
_disable?: boolean | null;
|
58
|
-
_enable?: boolean | null;
|
59
60
|
price_amount_cents?: number | null;
|
60
61
|
auto_capture_max_amount_cents?: number | null;
|
62
|
+
_disable?: boolean | null;
|
63
|
+
_enable?: boolean | null;
|
61
64
|
market?: MarketRel | null;
|
62
65
|
payment_gateway?: PaymentGatewayRel | null;
|
63
66
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaymentMethods extends ApiResource {
|
3
|
+
static TYPE = 'payment_methods';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PaymentMethods.TYPE }, params, options);
|
5
6
|
}
|
@@ -41,5 +42,4 @@ class PaymentMethods extends ApiResource {
|
|
41
42
|
return PaymentMethods.TYPE;
|
42
43
|
}
|
43
44
|
}
|
44
|
-
PaymentMethods.TYPE = 'payment_methods';
|
45
45
|
export default PaymentMethods;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaymentOptions extends ApiResource {
|
3
|
+
static TYPE = 'payment_options';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PaymentOptions.TYPE }, params, options);
|
5
6
|
}
|
@@ -27,5 +28,4 @@ class PaymentOptions extends ApiResource {
|
|
27
28
|
return PaymentOptions.TYPE;
|
28
29
|
}
|
29
30
|
}
|
30
|
-
PaymentOptions.TYPE = 'payment_options';
|
31
31
|
export default PaymentOptions;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaypalGateways extends ApiResource {
|
3
|
+
static TYPE = 'paypal_gateways';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PaypalGateways.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class PaypalGateways extends ApiResource {
|
|
31
32
|
return PaypalGateways.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
PaypalGateways.TYPE = 'paypal_gateways';
|
35
35
|
export default PaypalGateways;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PaypalPayments extends ApiResource {
|
3
|
+
static TYPE = 'paypal_payments';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PaypalPayments.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class PaypalPayments extends ApiResource {
|
|
31
32
|
return PaypalPayments.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
PaypalPayments.TYPE = 'paypal_payments';
|
35
35
|
export default PaypalPayments;
|
@@ -2,13 +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
|
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
9
|
import type { CustomPromotionRule, CustomPromotionRuleType } from './custom_promotion_rules';
|
10
|
-
import type { Coupon, CouponType } from './coupons';
|
11
10
|
import type { SkuList, SkuListType } from './sku_lists';
|
11
|
+
import type { Coupon } from './coupons';
|
12
12
|
import type { Attachment } from './attachments';
|
13
13
|
import type { Event } from './events';
|
14
14
|
import type { Tag, TagType } from './tags';
|
@@ -21,9 +21,6 @@ type PercentageDiscountPromotionRel = ResourceRel & {
|
|
21
21
|
type MarketRel = ResourceRel & {
|
22
22
|
type: MarketType;
|
23
23
|
};
|
24
|
-
type PromotionRuleRel = ResourceRel & {
|
25
|
-
type: PromotionRuleType;
|
26
|
-
};
|
27
24
|
type OrderAmountPromotionRuleRel = ResourceRel & {
|
28
25
|
type: OrderAmountPromotionRuleType;
|
29
26
|
};
|
@@ -36,9 +33,6 @@ type CouponCodesPromotionRuleRel = ResourceRel & {
|
|
36
33
|
type CustomPromotionRuleRel = ResourceRel & {
|
37
34
|
type: CustomPromotionRuleType;
|
38
35
|
};
|
39
|
-
type CouponRel = ResourceRel & {
|
40
|
-
type: CouponType;
|
41
|
-
};
|
42
36
|
type SkuListRel = ResourceRel & {
|
43
37
|
type: SkuListType;
|
44
38
|
};
|
@@ -64,8 +58,8 @@ interface PercentageDiscountPromotion extends Resource {
|
|
64
58
|
sku_list_promotion_rule?: SkuListPromotionRule | null;
|
65
59
|
coupon_codes_promotion_rule?: CouponCodesPromotionRule | null;
|
66
60
|
custom_promotion_rule?: CustomPromotionRule | null;
|
67
|
-
coupons?: Coupon[] | null;
|
68
61
|
sku_list?: SkuList | null;
|
62
|
+
coupons?: Coupon[] | null;
|
69
63
|
attachments?: Attachment[] | null;
|
70
64
|
events?: Event[] | null;
|
71
65
|
tags?: Tag[] | null;
|
@@ -84,12 +78,10 @@ interface PercentageDiscountPromotionCreate extends ResourceCreate {
|
|
84
78
|
_enable?: boolean | null;
|
85
79
|
percentage: number;
|
86
80
|
market?: MarketRel | null;
|
87
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
88
81
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
89
82
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
90
83
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
91
84
|
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
92
|
-
coupons?: CouponRel[] | null;
|
93
85
|
sku_list?: SkuListRel | null;
|
94
86
|
tags?: TagRel[] | null;
|
95
87
|
}
|
@@ -105,12 +97,10 @@ interface PercentageDiscountPromotionUpdate extends ResourceUpdate {
|
|
105
97
|
_enable?: boolean | null;
|
106
98
|
percentage?: number | null;
|
107
99
|
market?: MarketRel | null;
|
108
|
-
promotion_rules?: PromotionRuleRel[] | null;
|
109
100
|
order_amount_promotion_rule?: OrderAmountPromotionRuleRel | null;
|
110
101
|
sku_list_promotion_rule?: SkuListPromotionRuleRel | null;
|
111
102
|
coupon_codes_promotion_rule?: CouponCodesPromotionRuleRel | null;
|
112
103
|
custom_promotion_rule?: CustomPromotionRuleRel | null;
|
113
|
-
coupons?: CouponRel[] | null;
|
114
104
|
sku_list?: SkuListRel | null;
|
115
105
|
tags?: TagRel[] | null;
|
116
106
|
}
|
@@ -124,8 +114,8 @@ declare class PercentageDiscountPromotions extends ApiResource<PercentageDiscoun
|
|
124
114
|
sku_list_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuListPromotionRule>;
|
125
115
|
coupon_codes_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CouponCodesPromotionRule>;
|
126
116
|
custom_promotion_rule(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomPromotionRule>;
|
127
|
-
coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
128
117
|
sku_list(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuList>;
|
118
|
+
coupons(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Coupon>>;
|
129
119
|
attachments(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
|
130
120
|
events(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
|
131
121
|
tags(percentageDiscountPromotionId: string | PercentageDiscountPromotion, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PercentageDiscountPromotions extends ApiResource {
|
3
|
+
static TYPE = 'percentage_discount_promotions';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PercentageDiscountPromotions.TYPE }, params, options);
|
5
6
|
}
|
@@ -29,14 +30,14 @@ class PercentageDiscountPromotions extends ApiResource {
|
|
29
30
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
30
31
|
return this.resources.fetch({ type: 'custom_promotion_rules' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/custom_promotion_rule`, params, options);
|
31
32
|
}
|
32
|
-
async coupons(percentageDiscountPromotionId, params, options) {
|
33
|
-
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
34
|
-
return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
|
35
|
-
}
|
36
33
|
async sku_list(percentageDiscountPromotionId, params, options) {
|
37
34
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
38
35
|
return this.resources.fetch({ type: 'sku_lists' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/sku_list`, params, options);
|
39
36
|
}
|
37
|
+
async coupons(percentageDiscountPromotionId, params, options) {
|
38
|
+
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
39
|
+
return this.resources.fetch({ type: 'coupons' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/coupons`, params, options);
|
40
|
+
}
|
40
41
|
async attachments(percentageDiscountPromotionId, params, options) {
|
41
42
|
const _percentageDiscountPromotionId = percentageDiscountPromotionId.id || percentageDiscountPromotionId;
|
42
43
|
return this.resources.fetch({ type: 'attachments' }, `percentage_discount_promotions/${_percentageDiscountPromotionId}/attachments`, params, options);
|
@@ -73,5 +74,4 @@ class PercentageDiscountPromotions extends ApiResource {
|
|
73
74
|
return PercentageDiscountPromotions.TYPE;
|
74
75
|
}
|
75
76
|
}
|
76
|
-
PercentageDiscountPromotions.TYPE = 'percentage_discount_promotions';
|
77
77
|
export default PercentageDiscountPromotions;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PriceFrequencyTiers extends ApiResource {
|
3
|
+
static TYPE = 'price_frequency_tiers';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PriceFrequencyTiers.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class PriceFrequencyTiers extends ApiResource {
|
|
35
36
|
return PriceFrequencyTiers.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
PriceFrequencyTiers.TYPE = 'price_frequency_tiers';
|
39
39
|
export default PriceFrequencyTiers;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PriceLists extends ApiResource {
|
3
|
+
static TYPE = 'price_lists';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PriceLists.TYPE }, params, options);
|
5
6
|
}
|
@@ -31,5 +32,4 @@ class PriceLists extends ApiResource {
|
|
31
32
|
return PriceLists.TYPE;
|
32
33
|
}
|
33
34
|
}
|
34
|
-
PriceLists.TYPE = 'price_lists';
|
35
35
|
export default PriceLists;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PriceTiers extends ApiResource {
|
3
|
+
static TYPE = 'price_tiers';
|
3
4
|
async price(priceTierId, params, options) {
|
4
5
|
const _priceTierId = priceTierId.id || priceTierId;
|
5
6
|
return this.resources.fetch({ type: 'prices' }, `price_tiers/${_priceTierId}/price`, params, options);
|
@@ -22,5 +23,4 @@ class PriceTiers extends ApiResource {
|
|
22
23
|
return PriceTiers.TYPE;
|
23
24
|
}
|
24
25
|
}
|
25
|
-
PriceTiers.TYPE = 'price_tiers';
|
26
26
|
export default PriceTiers;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PriceVolumeTiers extends ApiResource {
|
3
|
+
static TYPE = 'price_volume_tiers';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: PriceVolumeTiers.TYPE }, params, options);
|
5
6
|
}
|
@@ -35,5 +36,4 @@ class PriceVolumeTiers extends ApiResource {
|
|
35
36
|
return PriceVolumeTiers.TYPE;
|
36
37
|
}
|
37
38
|
}
|
38
|
-
PriceVolumeTiers.TYPE = 'price_volume_tiers';
|
39
39
|
export default PriceVolumeTiers;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class Prices extends ApiResource {
|
3
|
+
static TYPE = 'prices';
|
3
4
|
async create(resource, params, options) {
|
4
5
|
return this.resources.create({ ...resource, type: Prices.TYPE }, params, options);
|
5
6
|
}
|
@@ -47,5 +48,4 @@ class Prices extends ApiResource {
|
|
47
48
|
return Prices.TYPE;
|
48
49
|
}
|
49
50
|
}
|
50
|
-
Prices.TYPE = 'prices';
|
51
51
|
export default Prices;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ApiResource } from '../resource';
|
2
2
|
class PromotionRules extends ApiResource {
|
3
|
+
static TYPE = 'promotion_rules';
|
3
4
|
async versions(promotionRuleId, params, options) {
|
4
5
|
const _promotionRuleId = promotionRuleId.id || promotionRuleId;
|
5
6
|
return this.resources.fetch({ type: 'versions' }, `promotion_rules/${_promotionRuleId}/versions`, params, options);
|
@@ -14,5 +15,4 @@ class PromotionRules extends ApiResource {
|
|
14
15
|
return PromotionRules.TYPE;
|
15
16
|
}
|
16
17
|
}
|
17
|
-
PromotionRules.TYPE = 'promotion_rules';
|
18
18
|
export default PromotionRules;
|