@commercelayer/sdk 5.11.0 → 5.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/lib/cjs/api.d.ts +5 -0
  2. package/lib/cjs/api.js +2 -2
  3. package/lib/cjs/client.js +1 -33
  4. package/lib/cjs/commercelayer.d.ts +0 -1
  5. package/lib/cjs/commercelayer.js +1 -1
  6. package/lib/cjs/error.d.ts +2 -1
  7. package/lib/cjs/error.js +38 -1
  8. package/lib/cjs/resource.d.ts +1 -1
  9. package/lib/cjs/resource.js +5 -5
  10. package/lib/cjs/resources/adyen_payments.d.ts +1 -0
  11. package/lib/cjs/resources/adyen_payments.js +3 -0
  12. package/lib/cjs/resources/authorizations.d.ts +3 -0
  13. package/lib/cjs/resources/authorizations.js +9 -0
  14. package/lib/cjs/resources/axerve_payments.d.ts +1 -0
  15. package/lib/cjs/resources/axerve_payments.js +3 -0
  16. package/lib/cjs/resources/bundles.d.ts +2 -0
  17. package/lib/cjs/resources/bundles.js +6 -0
  18. package/lib/cjs/resources/captures.d.ts +2 -0
  19. package/lib/cjs/resources/captures.js +6 -0
  20. package/lib/cjs/resources/checkout_com_payments.d.ts +2 -0
  21. package/lib/cjs/resources/checkout_com_payments.js +6 -0
  22. package/lib/cjs/resources/customer_password_resets.d.ts +1 -0
  23. package/lib/cjs/resources/customer_password_resets.js +3 -0
  24. package/lib/cjs/resources/gift_cards.d.ts +4 -0
  25. package/lib/cjs/resources/gift_cards.js +12 -0
  26. package/lib/cjs/resources/in_stock_subscriptions.d.ts +2 -0
  27. package/lib/cjs/resources/in_stock_subscriptions.js +6 -0
  28. package/lib/cjs/resources/klarna_payments.d.ts +1 -0
  29. package/lib/cjs/resources/klarna_payments.js +3 -0
  30. package/lib/cjs/resources/line_items.d.ts +2 -0
  31. package/lib/cjs/resources/line_items.js +6 -0
  32. package/lib/cjs/resources/markets.d.ts +2 -0
  33. package/lib/cjs/resources/markets.js +6 -0
  34. package/lib/cjs/resources/order_subscriptions.d.ts +3 -0
  35. package/lib/cjs/resources/order_subscriptions.js +9 -0
  36. package/lib/cjs/resources/orders.d.ts +27 -0
  37. package/lib/cjs/resources/orders.js +81 -0
  38. package/lib/cjs/resources/payment_methods.d.ts +2 -0
  39. package/lib/cjs/resources/payment_methods.js +6 -0
  40. package/lib/cjs/resources/return_line_items.d.ts +1 -0
  41. package/lib/cjs/resources/return_line_items.js +3 -0
  42. package/lib/cjs/resources/returns.d.ts +9 -0
  43. package/lib/cjs/resources/returns.js +27 -0
  44. package/lib/cjs/resources/satispay_payments.d.ts +1 -0
  45. package/lib/cjs/resources/satispay_payments.js +3 -0
  46. package/lib/cjs/resources/shipments.d.ts +7 -0
  47. package/lib/cjs/resources/shipments.js +21 -0
  48. package/lib/cjs/resources/shipping_methods.d.ts +2 -0
  49. package/lib/cjs/resources/shipping_methods.js +6 -0
  50. package/lib/cjs/resources/stock_transfers.d.ts +5 -0
  51. package/lib/cjs/resources/stock_transfers.js +15 -0
  52. package/lib/cjs/resources/stripe_payments.d.ts +2 -0
  53. package/lib/cjs/resources/stripe_payments.js +6 -0
  54. package/lib/cjs/resources/webhooks.d.ts +1 -0
  55. package/lib/cjs/resources/webhooks.js +3 -0
  56. package/lib/esm/api.d.ts +5 -0
  57. package/lib/esm/client.js +1 -33
  58. package/lib/esm/commercelayer.d.ts +0 -1
  59. package/lib/esm/commercelayer.js +1 -1
  60. package/lib/esm/error.d.ts +2 -1
  61. package/lib/esm/error.js +34 -1
  62. package/lib/esm/resource.d.ts +1 -1
  63. package/lib/esm/resource.js +5 -5
  64. package/lib/esm/resources/adyen_payments.d.ts +1 -0
  65. package/lib/esm/resources/adyen_payments.js +3 -0
  66. package/lib/esm/resources/authorizations.d.ts +3 -0
  67. package/lib/esm/resources/authorizations.js +9 -0
  68. package/lib/esm/resources/axerve_payments.d.ts +1 -0
  69. package/lib/esm/resources/axerve_payments.js +3 -0
  70. package/lib/esm/resources/bundles.d.ts +2 -0
  71. package/lib/esm/resources/bundles.js +6 -0
  72. package/lib/esm/resources/captures.d.ts +2 -0
  73. package/lib/esm/resources/captures.js +6 -0
  74. package/lib/esm/resources/checkout_com_payments.d.ts +2 -0
  75. package/lib/esm/resources/checkout_com_payments.js +6 -0
  76. package/lib/esm/resources/customer_password_resets.d.ts +1 -0
  77. package/lib/esm/resources/customer_password_resets.js +3 -0
  78. package/lib/esm/resources/gift_cards.d.ts +4 -0
  79. package/lib/esm/resources/gift_cards.js +12 -0
  80. package/lib/esm/resources/in_stock_subscriptions.d.ts +2 -0
  81. package/lib/esm/resources/in_stock_subscriptions.js +6 -0
  82. package/lib/esm/resources/klarna_payments.d.ts +1 -0
  83. package/lib/esm/resources/klarna_payments.js +3 -0
  84. package/lib/esm/resources/line_items.d.ts +2 -0
  85. package/lib/esm/resources/line_items.js +6 -0
  86. package/lib/esm/resources/markets.d.ts +2 -0
  87. package/lib/esm/resources/markets.js +6 -0
  88. package/lib/esm/resources/order_subscriptions.d.ts +3 -0
  89. package/lib/esm/resources/order_subscriptions.js +9 -0
  90. package/lib/esm/resources/orders.d.ts +27 -0
  91. package/lib/esm/resources/orders.js +81 -0
  92. package/lib/esm/resources/payment_methods.d.ts +2 -0
  93. package/lib/esm/resources/payment_methods.js +6 -0
  94. package/lib/esm/resources/return_line_items.d.ts +1 -0
  95. package/lib/esm/resources/return_line_items.js +3 -0
  96. package/lib/esm/resources/returns.d.ts +9 -0
  97. package/lib/esm/resources/returns.js +27 -0
  98. package/lib/esm/resources/satispay_payments.d.ts +1 -0
  99. package/lib/esm/resources/satispay_payments.js +3 -0
  100. package/lib/esm/resources/shipments.d.ts +7 -0
  101. package/lib/esm/resources/shipments.js +21 -0
  102. package/lib/esm/resources/shipping_methods.d.ts +2 -0
  103. package/lib/esm/resources/shipping_methods.js +6 -0
  104. package/lib/esm/resources/stock_transfers.d.ts +5 -0
  105. package/lib/esm/resources/stock_transfers.js +15 -0
  106. package/lib/esm/resources/stripe_payments.d.ts +2 -0
  107. package/lib/esm/resources/stripe_payments.js +6 -0
  108. package/lib/esm/resources/webhooks.d.ts +1 -0
  109. package/lib/esm/resources/webhooks.js +3 -0
  110. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  111. package/lib/tsconfig.tsbuildinfo +1 -1
  112. package/package.json +6 -6
@@ -47,6 +47,8 @@ declare class Captures extends ApiResource<Capture> {
47
47
  reference_authorization(captureId: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
48
48
  refunds(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Refund>>;
49
49
  events(captureId: string | Capture, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
50
+ _refund(id: string | Capture, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
51
+ _refund_amount_cents(id: string | Capture, triggerValue: number, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Capture>;
50
52
  isCapture(resource: any): resource is Capture;
51
53
  relationship(id: string | ResourceId | null): CaptureRel;
52
54
  type(): CaptureType;
@@ -23,6 +23,12 @@ class Captures extends ApiResource {
23
23
  const _captureId = captureId.id || captureId;
24
24
  return this.resources.fetch({ type: 'events' }, `captures/${_captureId}/events`, params, options);
25
25
  }
26
+ async _refund(id, params, options) {
27
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Captures.TYPE, _refund: true }, params, options);
28
+ }
29
+ async _refund_amount_cents(id, triggerValue, params, options) {
30
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Captures.TYPE, _refund_amount_cents: triggerValue }, params, options);
31
+ }
26
32
  isCapture(resource) {
27
33
  return resource.type && (resource.type === Captures.TYPE);
28
34
  }
@@ -52,6 +52,8 @@ declare class CheckoutComPayments extends ApiResource<CheckoutComPayment> {
52
52
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
53
53
  order(checkoutComPaymentId: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
54
54
  payment_gateway(checkoutComPaymentId: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
55
+ _details(id: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
56
+ _refresh(id: string | CheckoutComPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CheckoutComPayment>;
55
57
  isCheckoutComPayment(resource: any): resource is CheckoutComPayment;
56
58
  relationship(id: string | ResourceId | null): CheckoutComPaymentRel;
57
59
  type(): CheckoutComPaymentType;
@@ -17,6 +17,12 @@ class CheckoutComPayments extends ApiResource {
17
17
  const _checkoutComPaymentId = checkoutComPaymentId.id || checkoutComPaymentId;
18
18
  return this.resources.fetch({ type: 'payment_gateways' }, `checkout_com_payments/${_checkoutComPaymentId}/payment_gateway`, params, options);
19
19
  }
20
+ async _details(id, params, options) {
21
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: CheckoutComPayments.TYPE, _details: true }, params, options);
22
+ }
23
+ async _refresh(id, params, options) {
24
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: CheckoutComPayments.TYPE, _refresh: true }, params, options);
25
+ }
20
26
  isCheckoutComPayment(resource) {
21
27
  return resource.type && (resource.type === CheckoutComPayments.TYPE);
22
28
  }
@@ -29,6 +29,7 @@ declare class CustomerPasswordResets extends ApiResource<CustomerPasswordReset>
29
29
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
30
30
  customer(customerPasswordResetId: string | CustomerPasswordReset, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
31
31
  events(customerPasswordResetId: string | CustomerPasswordReset, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
32
+ _reset_password_token(id: string | CustomerPasswordReset, triggerValue: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerPasswordReset>;
32
33
  isCustomerPasswordReset(resource: any): resource is CustomerPasswordReset;
33
34
  relationship(id: string | ResourceId | null): CustomerPasswordResetRel;
34
35
  type(): CustomerPasswordResetType;
@@ -17,6 +17,9 @@ class CustomerPasswordResets extends ApiResource {
17
17
  const _customerPasswordResetId = customerPasswordResetId.id || customerPasswordResetId;
18
18
  return this.resources.fetch({ type: 'events' }, `customer_password_resets/${_customerPasswordResetId}/events`, params, options);
19
19
  }
20
+ async _reset_password_token(id, triggerValue, params, options) {
21
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: CustomerPasswordResets.TYPE, _reset_password_token: triggerValue }, params, options);
22
+ }
20
23
  isCustomerPasswordReset(resource) {
21
24
  return resource.type && (resource.type === CustomerPasswordResets.TYPE);
22
25
  }
@@ -86,6 +86,10 @@ declare class GiftCards extends ApiResource<GiftCard> {
86
86
  attachments(giftCardId: string | GiftCard, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
87
87
  events(giftCardId: string | GiftCard, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
88
88
  tags(giftCardId: string | GiftCard, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
89
+ _purchase(id: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
90
+ _activate(id: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
91
+ _deactivate(id: string | GiftCard, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
92
+ _balance_change_cents(id: string | GiftCard, triggerValue: number, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
89
93
  isGiftCard(resource: any): resource is GiftCard;
90
94
  relationship(id: string | ResourceId | null): GiftCardRel;
91
95
  type(): GiftCardType;
@@ -29,6 +29,18 @@ class GiftCards extends ApiResource {
29
29
  const _giftCardId = giftCardId.id || giftCardId;
30
30
  return this.resources.fetch({ type: 'tags' }, `gift_cards/${_giftCardId}/tags`, params, options);
31
31
  }
32
+ async _purchase(id, params, options) {
33
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _purchase: true }, params, options);
34
+ }
35
+ async _activate(id, params, options) {
36
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _activate: true }, params, options);
37
+ }
38
+ async _deactivate(id, params, options) {
39
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _deactivate: true }, params, options);
40
+ }
41
+ async _balance_change_cents(id, triggerValue, params, options) {
42
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: GiftCards.TYPE, _balance_change_cents: triggerValue }, params, options);
43
+ }
32
44
  isGiftCard(resource) {
33
45
  return resource.type && (resource.type === GiftCards.TYPE);
34
46
  }
@@ -55,6 +55,8 @@ declare class InStockSubscriptions extends ApiResource<InStockSubscription> {
55
55
  customer(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
56
56
  sku(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
57
57
  events(inStockSubscriptionId: string | InStockSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
58
+ _activate(id: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
59
+ _deactivate(id: string | InStockSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
58
60
  isInStockSubscription(resource: any): resource is InStockSubscription;
59
61
  relationship(id: string | ResourceId | null): InStockSubscriptionRel;
60
62
  type(): InStockSubscriptionType;
@@ -25,6 +25,12 @@ class InStockSubscriptions extends ApiResource {
25
25
  const _inStockSubscriptionId = inStockSubscriptionId.id || inStockSubscriptionId;
26
26
  return this.resources.fetch({ type: 'events' }, `in_stock_subscriptions/${_inStockSubscriptionId}/events`, params, options);
27
27
  }
28
+ async _activate(id, params, options) {
29
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: InStockSubscriptions.TYPE, _activate: true }, params, options);
30
+ }
31
+ async _deactivate(id, params, options) {
32
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: InStockSubscriptions.TYPE, _deactivate: true }, params, options);
33
+ }
28
34
  isInStockSubscription(resource) {
29
35
  return resource.type && (resource.type === InStockSubscriptions.TYPE);
30
36
  }
@@ -39,6 +39,7 @@ declare class KlarnaPayments extends ApiResource<KlarnaPayment> {
39
39
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
40
40
  order(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
41
41
  payment_gateway(klarnaPaymentId: string | KlarnaPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
42
+ _update(id: string | KlarnaPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaPayment>;
42
43
  isKlarnaPayment(resource: any): resource is KlarnaPayment;
43
44
  relationship(id: string | ResourceId | null): KlarnaPaymentRel;
44
45
  type(): KlarnaPaymentType;
@@ -17,6 +17,9 @@ class KlarnaPayments extends ApiResource {
17
17
  const _klarnaPaymentId = klarnaPaymentId.id || klarnaPaymentId;
18
18
  return this.resources.fetch({ type: 'payment_gateways' }, `klarna_payments/${_klarnaPaymentId}/payment_gateway`, params, options);
19
19
  }
20
+ async _update(id, params, options) {
21
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: KlarnaPayments.TYPE, _update: true }, params, options);
22
+ }
20
23
  isKlarnaPayment(resource) {
21
24
  return resource.type && (resource.type === KlarnaPayments.TYPE);
22
25
  }
@@ -138,6 +138,8 @@ declare class LineItems extends ApiResource<LineItem> {
138
138
  stock_transfers(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
139
139
  events(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
140
140
  tags(lineItemId: string | LineItem, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
141
+ _external_price(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
142
+ _reserve_stock(id: string | LineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
141
143
  isLineItem(resource: any): resource is LineItem;
142
144
  relationship(id: string | ResourceId | null): LineItemRel;
143
145
  type(): LineItemType;
@@ -37,6 +37,12 @@ class LineItems extends ApiResource {
37
37
  const _lineItemId = lineItemId.id || lineItemId;
38
38
  return this.resources.fetch({ type: 'tags' }, `line_items/${_lineItemId}/tags`, params, options);
39
39
  }
40
+ async _external_price(id, params, options) {
41
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: LineItems.TYPE, _external_price: true }, params, options);
42
+ }
43
+ async _reserve_stock(id, params, options) {
44
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: LineItems.TYPE, _reserve_stock: true }, params, options);
45
+ }
40
46
  isLineItem(resource) {
41
47
  return resource.type && (resource.type === LineItems.TYPE);
42
48
  }
@@ -89,6 +89,8 @@ declare class Markets extends ApiResource<Market> {
89
89
  tax_calculator(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCalculator>;
90
90
  customer_group(marketId: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
91
91
  attachments(marketId: string | Market, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
92
+ _disable(id: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
93
+ _enable(id: string | Market, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
92
94
  isMarket(resource: any): resource is Market;
93
95
  relationship(id: string | ResourceId | null): MarketRel;
94
96
  type(): MarketType;
@@ -37,6 +37,12 @@ class Markets extends ApiResource {
37
37
  const _marketId = marketId.id || marketId;
38
38
  return this.resources.fetch({ type: 'attachments' }, `markets/${_marketId}/attachments`, params, options);
39
39
  }
40
+ async _disable(id, params, options) {
41
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Markets.TYPE, _disable: true }, params, options);
42
+ }
43
+ async _enable(id, params, options) {
44
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Markets.TYPE, _enable: true }, params, options);
45
+ }
40
46
  isMarket(resource) {
41
47
  return resource.type && (resource.type === Markets.TYPE);
42
48
  }
@@ -85,6 +85,9 @@ declare class OrderSubscriptions extends ApiResource<OrderSubscription> {
85
85
  recurring_order_copies(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<RecurringOrderCopy>>;
86
86
  orders(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Order>>;
87
87
  events(orderSubscriptionId: string | OrderSubscription, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
88
+ _activate(id: string | OrderSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
89
+ _deactivate(id: string | OrderSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
90
+ _cancel(id: string | OrderSubscription, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderSubscription>;
88
91
  isOrderSubscription(resource: any): resource is OrderSubscription;
89
92
  relationship(id: string | ResourceId | null): OrderSubscriptionRel;
90
93
  type(): OrderSubscriptionType;
@@ -49,6 +49,15 @@ class OrderSubscriptions extends ApiResource {
49
49
  const _orderSubscriptionId = orderSubscriptionId.id || orderSubscriptionId;
50
50
  return this.resources.fetch({ type: 'events' }, `order_subscriptions/${_orderSubscriptionId}/events`, params, options);
51
51
  }
52
+ async _activate(id, params, options) {
53
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: OrderSubscriptions.TYPE, _activate: true }, params, options);
54
+ }
55
+ async _deactivate(id, params, options) {
56
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: OrderSubscriptions.TYPE, _deactivate: true }, params, options);
57
+ }
58
+ async _cancel(id, params, options) {
59
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: OrderSubscriptions.TYPE, _cancel: true }, params, options);
60
+ }
52
61
  isOrderSubscription(resource) {
53
62
  return resource.type && (resource.type === OrderSubscriptions.TYPE);
54
63
  }
@@ -305,6 +305,33 @@ declare class Orders extends ApiResource<Order> {
305
305
  attachments(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
306
306
  events(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
307
307
  tags(orderId: string | Order, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
308
+ _archive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
309
+ _unarchive(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
310
+ _place(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
311
+ _cancel(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
312
+ _approve(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
313
+ _approve_and_capture(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
314
+ _authorize(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
315
+ _authorization_amount_cents(id: string | Order, triggerValue: number, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
316
+ _capture(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
317
+ _refund(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
318
+ _update_taxes(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
319
+ _nullify_payment_source(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
320
+ _billing_address_clone_id(id: string | Order, triggerValue: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
321
+ _shipping_address_clone_id(id: string | Order, triggerValue: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
322
+ _customer_payment_source_id(id: string | Order, triggerValue: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
323
+ _shipping_address_same_as_billing(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
324
+ _billing_address_same_as_shipping(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
325
+ _commit_invoice(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
326
+ _refund_invoice(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
327
+ _save_payment_source_to_customer_wallet(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
328
+ _save_shipping_address_to_customer_address_book(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
329
+ _save_billing_address_to_customer_address_book(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
330
+ _refresh(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
331
+ _validate(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
332
+ _create_subscriptions(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
333
+ _start_editing(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
334
+ _stop_editing(id: string | Order, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
308
335
  isOrder(resource: any): resource is Order;
309
336
  relationship(id: string | ResourceId | null): OrderRel;
310
337
  type(): OrderType;
@@ -101,6 +101,87 @@ class Orders extends ApiResource {
101
101
  const _orderId = orderId.id || orderId;
102
102
  return this.resources.fetch({ type: 'tags' }, `orders/${_orderId}/tags`, params, options);
103
103
  }
104
+ async _archive(id, params, options) {
105
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _archive: true }, params, options);
106
+ }
107
+ async _unarchive(id, params, options) {
108
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _unarchive: true }, params, options);
109
+ }
110
+ async _place(id, params, options) {
111
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _place: true }, params, options);
112
+ }
113
+ async _cancel(id, params, options) {
114
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _cancel: true }, params, options);
115
+ }
116
+ async _approve(id, params, options) {
117
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _approve: true }, params, options);
118
+ }
119
+ async _approve_and_capture(id, params, options) {
120
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _approve_and_capture: true }, params, options);
121
+ }
122
+ async _authorize(id, params, options) {
123
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _authorize: true }, params, options);
124
+ }
125
+ async _authorization_amount_cents(id, triggerValue, params, options) {
126
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _authorization_amount_cents: triggerValue }, params, options);
127
+ }
128
+ async _capture(id, params, options) {
129
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _capture: true }, params, options);
130
+ }
131
+ async _refund(id, params, options) {
132
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refund: true }, params, options);
133
+ }
134
+ async _update_taxes(id, params, options) {
135
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _update_taxes: true }, params, options);
136
+ }
137
+ async _nullify_payment_source(id, params, options) {
138
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _nullify_payment_source: true }, params, options);
139
+ }
140
+ async _billing_address_clone_id(id, triggerValue, params, options) {
141
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _billing_address_clone_id: triggerValue }, params, options);
142
+ }
143
+ async _shipping_address_clone_id(id, triggerValue, params, options) {
144
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _shipping_address_clone_id: triggerValue }, params, options);
145
+ }
146
+ async _customer_payment_source_id(id, triggerValue, params, options) {
147
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _customer_payment_source_id: triggerValue }, params, options);
148
+ }
149
+ async _shipping_address_same_as_billing(id, params, options) {
150
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _shipping_address_same_as_billing: true }, params, options);
151
+ }
152
+ async _billing_address_same_as_shipping(id, params, options) {
153
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _billing_address_same_as_shipping: true }, params, options);
154
+ }
155
+ async _commit_invoice(id, params, options) {
156
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _commit_invoice: true }, params, options);
157
+ }
158
+ async _refund_invoice(id, params, options) {
159
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refund_invoice: true }, params, options);
160
+ }
161
+ async _save_payment_source_to_customer_wallet(id, params, options) {
162
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_payment_source_to_customer_wallet: true }, params, options);
163
+ }
164
+ async _save_shipping_address_to_customer_address_book(id, params, options) {
165
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_shipping_address_to_customer_address_book: true }, params, options);
166
+ }
167
+ async _save_billing_address_to_customer_address_book(id, params, options) {
168
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _save_billing_address_to_customer_address_book: true }, params, options);
169
+ }
170
+ async _refresh(id, params, options) {
171
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _refresh: true }, params, options);
172
+ }
173
+ async _validate(id, params, options) {
174
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _validate: true }, params, options);
175
+ }
176
+ async _create_subscriptions(id, params, options) {
177
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _create_subscriptions: true }, params, options);
178
+ }
179
+ async _start_editing(id, params, options) {
180
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _start_editing: true }, params, options);
181
+ }
182
+ async _stop_editing(id, params, options) {
183
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Orders.TYPE, _stop_editing: true }, params, options);
184
+ }
104
185
  isOrder(resource) {
105
186
  return resource.type && (resource.type === Orders.TYPE);
106
187
  }
@@ -65,6 +65,8 @@ declare class PaymentMethods extends ApiResource<PaymentMethod> {
65
65
  market(paymentMethodId: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
66
66
  payment_gateway(paymentMethodId: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
67
67
  attachments(paymentMethodId: string | PaymentMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
68
+ _disable(id: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
69
+ _enable(id: string | PaymentMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentMethod>;
68
70
  isPaymentMethod(resource: any): resource is PaymentMethod;
69
71
  relationship(id: string | ResourceId | null): PaymentMethodRel;
70
72
  type(): PaymentMethodType;
@@ -21,6 +21,12 @@ class PaymentMethods extends ApiResource {
21
21
  const _paymentMethodId = paymentMethodId.id || paymentMethodId;
22
22
  return this.resources.fetch({ type: 'attachments' }, `payment_methods/${_paymentMethodId}/attachments`, params, options);
23
23
  }
24
+ async _disable(id, params, options) {
25
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: PaymentMethods.TYPE, _disable: true }, params, options);
26
+ }
27
+ async _enable(id, params, options) {
28
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: PaymentMethods.TYPE, _enable: true }, params, options);
29
+ }
24
30
  isPaymentMethod(resource) {
25
31
  return resource.type && (resource.type === PaymentMethods.TYPE);
26
32
  }
@@ -43,6 +43,7 @@ declare class ReturnLineItems extends ApiResource<ReturnLineItem> {
43
43
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
44
44
  return(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
45
45
  line_item(returnLineItemId: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
46
+ _restock(id: string | ReturnLineItem, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ReturnLineItem>;
46
47
  isReturnLineItem(resource: any): resource is ReturnLineItem;
47
48
  relationship(id: string | ResourceId | null): ReturnLineItemRel;
48
49
  type(): ReturnLineItemType;
@@ -17,6 +17,9 @@ class ReturnLineItems extends ApiResource {
17
17
  const _returnLineItemId = returnLineItemId.id || returnLineItemId;
18
18
  return this.resources.fetch({ type: 'line_items' }, `return_line_items/${_returnLineItemId}/line_item`, params, options);
19
19
  }
20
+ async _restock(id, params, options) {
21
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ReturnLineItems.TYPE, _restock: true }, params, options);
22
+ }
20
23
  isReturnLineItem(resource) {
21
24
  return resource.type && (resource.type === ReturnLineItems.TYPE);
22
25
  }
@@ -76,6 +76,15 @@ declare class Returns extends ApiResource<Return> {
76
76
  attachments(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
77
77
  events(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
78
78
  tags(returnId: string | Return, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Tag>>;
79
+ _request(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
80
+ _approve(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
81
+ _cancel(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
82
+ _ship(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
83
+ _reject(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
84
+ _receive(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
85
+ _restock(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
86
+ _archive(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
87
+ _unarchive(id: string | Return, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Return>;
79
88
  isReturn(resource: any): resource is Return;
80
89
  relationship(id: string | ResourceId | null): ReturnRel;
81
90
  type(): ReturnType;
@@ -45,6 +45,33 @@ class Returns extends ApiResource {
45
45
  const _returnId = returnId.id || returnId;
46
46
  return this.resources.fetch({ type: 'tags' }, `returns/${_returnId}/tags`, params, options);
47
47
  }
48
+ async _request(id, params, options) {
49
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _request: true }, params, options);
50
+ }
51
+ async _approve(id, params, options) {
52
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _approve: true }, params, options);
53
+ }
54
+ async _cancel(id, params, options) {
55
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _cancel: true }, params, options);
56
+ }
57
+ async _ship(id, params, options) {
58
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _ship: true }, params, options);
59
+ }
60
+ async _reject(id, params, options) {
61
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _reject: true }, params, options);
62
+ }
63
+ async _receive(id, params, options) {
64
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _receive: true }, params, options);
65
+ }
66
+ async _restock(id, params, options) {
67
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _restock: true }, params, options);
68
+ }
69
+ async _archive(id, params, options) {
70
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _archive: true }, params, options);
71
+ }
72
+ async _unarchive(id, params, options) {
73
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Returns.TYPE, _unarchive: true }, params, options);
74
+ }
48
75
  isReturn(resource) {
49
76
  return resource.type && (resource.type === Returns.TYPE);
50
77
  }
@@ -40,6 +40,7 @@ declare class SatispayPayments extends ApiResource<SatispayPayment> {
40
40
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
41
41
  order(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
42
42
  payment_gateway(satispayPaymentId: string | SatispayPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
43
+ _refresh(id: string | SatispayPayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SatispayPayment>;
43
44
  isSatispayPayment(resource: any): resource is SatispayPayment;
44
45
  relationship(id: string | ResourceId | null): SatispayPaymentRel;
45
46
  type(): SatispayPaymentType;
@@ -17,6 +17,9 @@ class SatispayPayments extends ApiResource {
17
17
  const _satispayPaymentId = satispayPaymentId.id || satispayPaymentId;
18
18
  return this.resources.fetch({ type: 'payment_gateways' }, `satispay_payments/${_satispayPaymentId}/payment_gateway`, params, options);
19
19
  }
20
+ async _refresh(id, params, options) {
21
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: SatispayPayments.TYPE, _refresh: true }, params, options);
22
+ }
20
23
  isSatispayPayment(resource) {
21
24
  return resource.type && (resource.type === SatispayPayments.TYPE);
22
25
  }
@@ -91,6 +91,13 @@ declare class Shipments extends ApiResource<Shipment> {
91
91
  parcels(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Parcel>>;
92
92
  attachments(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
93
93
  events(shipmentId: string | Shipment, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
94
+ _on_hold(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
95
+ _picking(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
96
+ _packing(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
97
+ _ready_to_ship(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
98
+ _ship(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
99
+ _get_rates(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
100
+ _purchase(id: string | Shipment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
94
101
  isShipment(resource: any): resource is Shipment;
95
102
  relationship(id: string | ResourceId | null): ShipmentRel;
96
103
  type(): ShipmentType;
@@ -59,6 +59,27 @@ class Shipments extends ApiResource {
59
59
  const _shipmentId = shipmentId.id || shipmentId;
60
60
  return this.resources.fetch({ type: 'events' }, `shipments/${_shipmentId}/events`, params, options);
61
61
  }
62
+ async _on_hold(id, params, options) {
63
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _on_hold: true }, params, options);
64
+ }
65
+ async _picking(id, params, options) {
66
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _picking: true }, params, options);
67
+ }
68
+ async _packing(id, params, options) {
69
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _packing: true }, params, options);
70
+ }
71
+ async _ready_to_ship(id, params, options) {
72
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _ready_to_ship: true }, params, options);
73
+ }
74
+ async _ship(id, params, options) {
75
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _ship: true }, params, options);
76
+ }
77
+ async _get_rates(id, params, options) {
78
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _get_rates: true }, params, options);
79
+ }
80
+ async _purchase(id, params, options) {
81
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: Shipments.TYPE, _purchase: true }, params, options);
82
+ }
62
83
  isShipment(resource) {
63
84
  return resource.type && (resource.type === Shipments.TYPE);
64
85
  }
@@ -106,6 +106,8 @@ declare class ShippingMethods extends ApiResource<ShippingMethod> {
106
106
  shipping_method_tiers(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingMethodTier>>;
107
107
  shipping_weight_tiers(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ShippingWeightTier>>;
108
108
  attachments(shippingMethodId: string | ShippingMethod, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
109
+ _disable(id: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
110
+ _enable(id: string | ShippingMethod, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ShippingMethod>;
109
111
  isShippingMethod(resource: any): resource is ShippingMethod;
110
112
  relationship(id: string | ResourceId | null): ShippingMethodRel;
111
113
  type(): ShippingMethodType;
@@ -41,6 +41,12 @@ class ShippingMethods extends ApiResource {
41
41
  const _shippingMethodId = shippingMethodId.id || shippingMethodId;
42
42
  return this.resources.fetch({ type: 'attachments' }, `shipping_methods/${_shippingMethodId}/attachments`, params, options);
43
43
  }
44
+ async _disable(id, params, options) {
45
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ShippingMethods.TYPE, _disable: true }, params, options);
46
+ }
47
+ async _enable(id, params, options) {
48
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: ShippingMethods.TYPE, _enable: true }, params, options);
49
+ }
44
50
  isShippingMethod(resource) {
45
51
  return resource.type && (resource.type === ShippingMethods.TYPE);
46
52
  }
@@ -67,6 +67,11 @@ declare class StockTransfers extends ApiResource<StockTransfer> {
67
67
  shipment(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
68
68
  line_item(stockTransferId: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
69
69
  events(stockTransferId: string | StockTransfer, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Event>>;
70
+ _upcoming(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
71
+ _picking(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
72
+ _in_transit(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
73
+ _complete(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
74
+ _cancel(id: string | StockTransfer, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
70
75
  isStockTransfer(resource: any): resource is StockTransfer;
71
76
  relationship(id: string | ResourceId | null): StockTransferRel;
72
77
  type(): StockTransferType;
@@ -33,6 +33,21 @@ class StockTransfers extends ApiResource {
33
33
  const _stockTransferId = stockTransferId.id || stockTransferId;
34
34
  return this.resources.fetch({ type: 'events' }, `stock_transfers/${_stockTransferId}/events`, params, options);
35
35
  }
36
+ async _upcoming(id, params, options) {
37
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _upcoming: true }, params, options);
38
+ }
39
+ async _picking(id, params, options) {
40
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _picking: true }, params, options);
41
+ }
42
+ async _in_transit(id, params, options) {
43
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _in_transit: true }, params, options);
44
+ }
45
+ async _complete(id, params, options) {
46
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _complete: true }, params, options);
47
+ }
48
+ async _cancel(id, params, options) {
49
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StockTransfers.TYPE, _cancel: true }, params, options);
50
+ }
36
51
  isStockTransfer(resource) {
37
52
  return resource.type && (resource.type === StockTransfers.TYPE);
38
53
  }
@@ -41,6 +41,8 @@ declare class StripePayments extends ApiResource<StripePayment> {
41
41
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
42
42
  order(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
43
43
  payment_gateway(stripePaymentId: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
44
+ _update(id: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
45
+ _refresh(id: string | StripePayment, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
44
46
  isStripePayment(resource: any): resource is StripePayment;
45
47
  relationship(id: string | ResourceId | null): StripePaymentRel;
46
48
  type(): StripePaymentType;
@@ -17,6 +17,12 @@ class StripePayments extends ApiResource {
17
17
  const _stripePaymentId = stripePaymentId.id || stripePaymentId;
18
18
  return this.resources.fetch({ type: 'payment_gateways' }, `stripe_payments/${_stripePaymentId}/payment_gateway`, params, options);
19
19
  }
20
+ async _update(id, params, options) {
21
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StripePayments.TYPE, _update: true }, params, options);
22
+ }
23
+ async _refresh(id, params, options) {
24
+ return this.resources.update({ id: (typeof id === 'string') ? id : id.id, type: StripePayments.TYPE, _refresh: true }, params, options);
25
+ }
20
26
  isStripePayment(resource) {
21
27
  return resource.type && (resource.type === StripePayments.TYPE);
22
28
  }
@@ -36,6 +36,7 @@ declare class Webhooks extends ApiResource<Webhook> {
36
36
  update(resource: WebhookUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
37
37
  delete(id: string | ResourceId, options?: ResourcesConfig): Promise<void>;
38
38
  last_event_callbacks(webhookId: string | Webhook, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
39
+ _reset_circuit(id: string | Webhook, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
39
40
  isWebhook(resource: any): resource is Webhook;
40
41
  relationship(id: string | ResourceId | null): WebhookRel;
41
42
  type(): WebhookType;