@wix/auto_sdk_pricing-plans_orders 1.0.123 → 1.0.125

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 (49) hide show
  1. package/build/cjs/index.d.ts +129 -129
  2. package/build/cjs/index.js +629 -629
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +787 -787
  5. package/build/cjs/index.typings.js +502 -502
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +484 -484
  8. package/build/cjs/meta.js +388 -388
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +199 -199
  11. package/build/cjs/schemas.js +1711 -1699
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +129 -129
  14. package/build/es/index.mjs +629 -629
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +787 -787
  17. package/build/es/index.typings.mjs +502 -502
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +484 -484
  20. package/build/es/meta.mjs +388 -388
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +199 -199
  23. package/build/es/schemas.mjs +1711 -1699
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +129 -129
  26. package/build/internal/cjs/index.typings.d.ts +813 -813
  27. package/build/internal/cjs/meta.d.ts +500 -500
  28. package/build/internal/cjs/schemas.d.ts +199 -199
  29. package/build/internal/es/index.d.mts +129 -129
  30. package/build/internal/es/index.typings.d.mts +813 -813
  31. package/build/internal/es/meta.d.mts +500 -500
  32. package/build/internal/es/schemas.d.mts +199 -199
  33. package/package.json +2 -2
  34. package/build/internal/cjs/index.js +0 -2066
  35. package/build/internal/cjs/index.js.map +0 -1
  36. package/build/internal/cjs/index.typings.js +0 -1531
  37. package/build/internal/cjs/index.typings.js.map +0 -1
  38. package/build/internal/cjs/meta.js +0 -1357
  39. package/build/internal/cjs/meta.js.map +0 -1
  40. package/build/internal/cjs/schemas.js +0 -3112
  41. package/build/internal/cjs/schemas.js.map +0 -1
  42. package/build/internal/es/index.mjs +0 -2003
  43. package/build/internal/es/index.mjs.map +0 -1
  44. package/build/internal/es/index.typings.mjs +0 -1481
  45. package/build/internal/es/index.typings.mjs.map +0 -1
  46. package/build/internal/es/meta.mjs +0 -1304
  47. package/build/internal/es/meta.mjs.map +0 -1
  48. package/build/internal/es/schemas.mjs +0 -3046
  49. package/build/internal/es/schemas.mjs.map +0 -1
@@ -1,7 +1,107 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { ManagementGetOrderOptions, GetOrderResponse, ManagementListOrdersOptions, ListOrdersResponse, CancellationEffectiveAtWithLiterals, CreateOnlineOrderOptions, CreateOnlineOrderResponse, CreateOnlineOrderApplicationErrors, CreateOnlineOrderValidationErrors, CreateOfflineOrderOptions, CreateOfflineOrderResponse, CreateOfflineOrderApplicationErrors, CreateOfflineOrderValidationErrors, GetOnlineOrderPreviewOptions, GetOnlineOrderPreviewResponse, GetOnlineOrderPreviewApplicationErrors, GetOnlineOrderPreviewValidationErrors, GetOfflineOrderPreviewOptions, GetOfflineOrderPreviewResponse, GetOfflineOrderPreviewApplicationErrors, GetOfflineOrderPreviewValidationErrors, GetPricePreviewOptions, GetPricePreviewResponse, GetPricePreviewApplicationErrors, MemberGetOrderOptions, Order, MemberListOrdersOptions, MemberListOrdersResponse, OrderAutoRenewCanceledEnvelope, OrderCanceledEnvelope, OrderCycleStartedEnvelope, OrderEndDatePostponedEnvelope, OrderEndedEnvelope, OrderMarkedAsPaidEnvelope, OrderPausedEnvelope, OrderPurchasedEnvelope, OrderResumedEnvelope, OrderStartedEnvelope, OrderUpdatedEnvelope, OrderCreatedEnvelope, OrderStartDateChangedEnvelope } from './index.typings.js';
2
+ import { CreateOnlineOrderOptions, CreateOnlineOrderResponse, CreateOnlineOrderApplicationErrors, CreateOnlineOrderValidationErrors, CreateOfflineOrderOptions, CreateOfflineOrderResponse, CreateOfflineOrderApplicationErrors, CreateOfflineOrderValidationErrors, GetOnlineOrderPreviewOptions, GetOnlineOrderPreviewResponse, GetOnlineOrderPreviewApplicationErrors, GetOnlineOrderPreviewValidationErrors, GetOfflineOrderPreviewOptions, GetOfflineOrderPreviewResponse, GetOfflineOrderPreviewApplicationErrors, GetOfflineOrderPreviewValidationErrors, GetPricePreviewOptions, GetPricePreviewResponse, GetPricePreviewApplicationErrors, ManagementGetOrderOptions, GetOrderResponse, ManagementListOrdersOptions, ListOrdersResponse, CancellationEffectiveAtWithLiterals, MemberGetOrderOptions, Order, MemberListOrdersOptions, MemberListOrdersResponse, OrderCreatedEnvelope, OrderStartDateChangedEnvelope, OrderUpdatedEnvelope, OrderAutoRenewCanceledEnvelope, OrderCanceledEnvelope, OrderCycleStartedEnvelope, OrderEndDatePostponedEnvelope, OrderEndedEnvelope, OrderMarkedAsPaidEnvelope, OrderPausedEnvelope, OrderPurchasedEnvelope, OrderResumedEnvelope, OrderStartedEnvelope } from './index.typings.js';
3
3
  export { AccountInfo, AccountInfoMetadata, ActionEvent, AddressLocation, ApplicationError, ApplyCouponRequest, ApplyCouponResponse, BaseEventMetadata, BulkActionMetadata, BulkOrderResult, BulkPauseOrderRequest, BulkPauseOrderResponse, BulkResumeOrderRequest, BulkResumeOrderResponse, Buyer, CancelOrderRequest, CancelOrderResponse, Cancellation, CancellationCause, CancellationCauseWithLiterals, CancellationEffectiveAt, Captcha, ChangeStartDateRequest, ChangeStartDateResponse, Coupon, CouponsError, CreateExternalOrderRequest, CreateExternalOrderResponse, CreateGuestOnlineOrderRequest, CreateGuestOnlineOrderResponse, CreateOfflineOrderRequest, CreateOnlineOrderRequest, CurrentCycle, Cursors, DomainEvent, DomainEventBodyOneOf, Duration, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, Fee, FormData, GetAvailableOrderActionsRequest, GetAvailableOrderActionsResponse, GetGuestOnlineOrderPreviewRequest, GetGuestOnlineOrderPreviewResponse, GetOfflineOrderPreviewRequest, GetOnlineOrderPreviewRequest, GetOrderRequest, GetOrdersStatsRequest, GetOrdersStatsResponse, GetPricePreviewRequest, Guest, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, ListOrdersRequest, MarkAsPaidRequest, MarkAsPaidResponse, MemberGetOrderRequest, MemberGetOrderResponse, MemberListOrdersRequest, MessageEnvelope, OnBehalf, OrderAutoRenewCanceled, OrderCanceled, OrderCycle, OrderCycleStarted, OrderEndDatePostponed, OrderEnded, OrderMarkedAsPaid, OrderMethod, OrderMethodWithLiterals, OrderPaused, OrderPurchased, OrderResumed, OrderStartDateChanged, OrderStarted, OrderStatus, OrderStatusWithLiterals, OrderType, OrderTypeWithLiterals, PagingMetadataV2, PauseOrderRequest, PauseOrderResponse, PausePeriod, PaymentStatus, PaymentStatusWithLiterals, PeriodUnit, PeriodUnitWithLiterals, PostponeEndDateRequest, PostponeEndDateResponse, Price, PriceDetails, PriceDetailsPricingModelOneOf, PriceDuration, PricingDetails, PricingDetailsPricingModelOneOf, ReasonNotSuspendable, ReasonNotSuspendableWithLiterals, Recurrence, RequestCancellationRequest, RequestCancellationResponse, RestoreInfo, ResumeOrderRequest, ResumeOrderResponse, Set, SetSubmissionRequest, SetSubmissionResponse, SetWithLiterals, SortOrder, SortOrderWithLiterals, Sorting, SpannedPrice, Status, StatusWithLiterals, Tax, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
+ declare function createOnlineOrder$1(httpClient: HttpClient): CreateOnlineOrderSignature;
6
+ interface CreateOnlineOrderSignature {
7
+ /**
8
+ * Creates an online order for a site member.
9
+ *
10
+ * If this method is called by a [site member](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member), the plan is automatically ordered on behalf of that site member. Otherwise, you must specify `onBehalf.memberId` in your call.
11
+ *
12
+ * When an online order is created, but payment hasn't been processed, its status is set to `DRAFT`. After the payment has been processed, if the start date is in the future the order's status is set to `PENDING`. Otherwise, it's set to `ACTIVE`.
13
+ * @param - Plan ID.
14
+ */
15
+ (planId: string, options?: NonNullablePaths<CreateOnlineOrderOptions, `onBehalf.memberId`, 3>): Promise<NonNullablePaths<CreateOnlineOrderResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice`, 7> & {
16
+ __applicationErrorsType?: CreateOnlineOrderApplicationErrors;
17
+ __validationErrorsType?: CreateOnlineOrderValidationErrors;
18
+ }>;
19
+ }
20
+ declare function createOfflineOrder$1(httpClient: HttpClient): CreateOfflineOrderSignature;
21
+ interface CreateOfflineOrderSignature {
22
+ /**
23
+ * Creates an order for a buyer who purchased the plan with an offline transaction.
24
+ *
25
+ * An offline order is handled off of the Wix site and is marked as `type`: `offline`. If a pricing plan
26
+ * has a limit on the amount of purchases per buyer, that limit is ignored for offline orders.
27
+ * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
28
+ *
29
+ * When creating a free offline order:
30
+ * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
31
+ * The order's last payment status is set to `"NOT_APPLICABLE"`. "
32
+ *
33
+ * When creating a non-free offline order:
34
+ * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
35
+ * The order's last payment status is set to `"UNPAID"` or `"PAID"` based on the data passed in the `paid` boolean in the request.
36
+ *
37
+ * Payment for an offline order can be set in 1 of 2 ways:
38
+ * + During order creation, set `paid`: `true`.
39
+ * + After creation, call Mark As Paid.
40
+ * @param - ID of the plan being ordered, from the Plans API.
41
+ * @param - ID of the member ordering the plan, from the Members API.
42
+ * @param - Options for creating an offline order.
43
+ */
44
+ (planId: string, memberId: string, options?: CreateOfflineOrderOptions): Promise<NonNullablePaths<CreateOfflineOrderResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice`, 7> & {
45
+ __applicationErrorsType?: CreateOfflineOrderApplicationErrors;
46
+ __validationErrorsType?: CreateOfflineOrderValidationErrors;
47
+ }>;
48
+ }
49
+ declare function getOnlineOrderPreview$1(httpClient: HttpClient): GetOnlineOrderPreviewSignature;
50
+ interface GetOnlineOrderPreviewSignature {
51
+ /**
52
+ * Returns an `order` object that represents a potential online order for a site member.
53
+ *
54
+ * You can use this method to show a site member a preview of an online order before [creating](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/orders/create-online-order) it.
55
+ *
56
+ * This method must be called using the [site member identity](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member). Therefore, [Wix apps](https://dev.wix.com/docs/build-apps) can't currently call this method using REST.
57
+ * @param - Plan ID.
58
+ */
59
+ (planId: string, options?: GetOnlineOrderPreviewOptions): Promise<NonNullablePaths<GetOnlineOrderPreviewResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice` | `purchaseLimitExceeded`, 7> & {
60
+ __applicationErrorsType?: GetOnlineOrderPreviewApplicationErrors;
61
+ __validationErrorsType?: GetOnlineOrderPreviewValidationErrors;
62
+ }>;
63
+ }
64
+ declare function getOfflineOrderPreview$1(httpClient: HttpClient): GetOfflineOrderPreviewSignature;
65
+ interface GetOfflineOrderPreviewSignature {
66
+ /**
67
+ * Performs a dry run of a purchase and provides an order preview.
68
+ *
69
+ * The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually
70
+ * created, the preview order's `orderId` and `subscriptionId` are displayed as a string of multiple zero characters
71
+ * (`000000-0000`). Tax is only calculated if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
72
+ * <br>
73
+ * If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview.
74
+ * But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then
75
+ * `purchaseLimitExceeded` will return as `true`.
76
+ *
77
+ * To get a general price preview for a plan that's not buyer-specific, call Get Price Preview.
78
+ * @param - Member ID of the buyer the previewed order is for, from the Members API.
79
+ * @param - Options for previewing the offline order.
80
+ * @param - ID of the plan of the previewed order.
81
+ */
82
+ (planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions): Promise<NonNullablePaths<GetOfflineOrderPreviewResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice` | `purchaseLimitExceeded`, 7> & {
83
+ __applicationErrorsType?: GetOfflineOrderPreviewApplicationErrors;
84
+ __validationErrorsType?: GetOfflineOrderPreviewValidationErrors;
85
+ }>;
86
+ }
87
+ declare function getPricePreview$1(httpClient: HttpClient): GetPricePreviewSignature;
88
+ interface GetPricePreviewSignature {
89
+ /**
90
+ * Retrieves a plan's pricing.
91
+ *
92
+ * The price preview uses the same logic as purchasing a plan, but the preview is not saved. Tax is only applied if
93
+ * the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection). The price is returned
94
+ * in the pricing model format used for orders. Learn more about [pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models).
95
+ *
96
+ * Buyers do not have to be logged in to preview the price, and as such, the details returned are not buyer-specific. To
97
+ * generate a preview of a purchase for a specific buyer, call Get Offline Order Preview.
98
+ * @param - ID of plan to preview.
99
+ * @param - Options for getting a price preview.
100
+ */
101
+ (planId: string, options?: GetPricePreviewOptions): Promise<NonNullablePaths<GetPricePreviewResponse, `price.subscription.cycleDuration.unit` | `price.subtotal` | `price.discount` | `price.tax.name` | `price.tax.includedInPrice` | `price.tax.rate` | `price.tax.amount` | `price.total` | `price.planPrice` | `price.currency` | `price.coupon.code` | `price.coupon.amount` | `price.coupon._id` | `prices` | `prices.${number}.duration.cycleFrom` | `prices.${number}.price.subtotal` | `prices.${number}.price.coupon.code` | `prices.${number}.price.coupon.amount` | `prices.${number}.price.coupon._id` | `prices.${number}.price.discount` | `prices.${number}.price.tax.name` | `prices.${number}.price.tax.includedInPrice` | `prices.${number}.price.tax.rate` | `prices.${number}.price.tax.amount` | `prices.${number}.price.total` | `prices.${number}.price.currency` | `prices.${number}.price.proration`, 6> & {
102
+ __applicationErrorsType?: GetPricePreviewApplicationErrors;
103
+ }>;
104
+ }
5
105
  declare function managementGetOrder$1(httpClient: HttpClient): ManagementGetOrderSignature;
6
106
  interface ManagementGetOrderSignature {
7
107
  /**
@@ -111,106 +211,6 @@ interface ResumeOrderSignature {
111
211
  */
112
212
  (_id: string): Promise<void>;
113
213
  }
114
- declare function createOnlineOrder$1(httpClient: HttpClient): CreateOnlineOrderSignature;
115
- interface CreateOnlineOrderSignature {
116
- /**
117
- * Creates an online order for a site member.
118
- *
119
- * If this method is called by a [site member](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member), the plan is automatically ordered on behalf of that site member. Otherwise, you must specify `onBehalf.memberId` in your call.
120
- *
121
- * When an online order is created, but payment hasn't been processed, its status is set to `DRAFT`. After the payment has been processed, if the start date is in the future the order's status is set to `PENDING`. Otherwise, it's set to `ACTIVE`.
122
- * @param - Plan ID.
123
- */
124
- (planId: string, options?: NonNullablePaths<CreateOnlineOrderOptions, `onBehalf.memberId`, 3>): Promise<NonNullablePaths<CreateOnlineOrderResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice`, 7> & {
125
- __applicationErrorsType?: CreateOnlineOrderApplicationErrors;
126
- __validationErrorsType?: CreateOnlineOrderValidationErrors;
127
- }>;
128
- }
129
- declare function createOfflineOrder$1(httpClient: HttpClient): CreateOfflineOrderSignature;
130
- interface CreateOfflineOrderSignature {
131
- /**
132
- * Creates an order for a buyer who purchased the plan with an offline transaction.
133
- *
134
- * An offline order is handled off of the Wix site and is marked as `type`: `offline`. If a pricing plan
135
- * has a limit on the amount of purchases per buyer, that limit is ignored for offline orders.
136
- * Tax is only applied if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
137
- *
138
- * When creating a free offline order:
139
- * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
140
- * The order's last payment status is set to `"NOT_APPLICABLE"`. "
141
- *
142
- * When creating a non-free offline order:
143
- * The order's status is set to `"PENDING"` if the start date is in the future. Otherwise, the status is set to `"ACTIVE"`.
144
- * The order's last payment status is set to `"UNPAID"` or `"PAID"` based on the data passed in the `paid` boolean in the request.
145
- *
146
- * Payment for an offline order can be set in 1 of 2 ways:
147
- * + During order creation, set `paid`: `true`.
148
- * + After creation, call Mark As Paid.
149
- * @param - ID of the plan being ordered, from the Plans API.
150
- * @param - ID of the member ordering the plan, from the Members API.
151
- * @param - Options for creating an offline order.
152
- */
153
- (planId: string, memberId: string, options?: CreateOfflineOrderOptions): Promise<NonNullablePaths<CreateOfflineOrderResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice`, 7> & {
154
- __applicationErrorsType?: CreateOfflineOrderApplicationErrors;
155
- __validationErrorsType?: CreateOfflineOrderValidationErrors;
156
- }>;
157
- }
158
- declare function getOnlineOrderPreview$1(httpClient: HttpClient): GetOnlineOrderPreviewSignature;
159
- interface GetOnlineOrderPreviewSignature {
160
- /**
161
- * Returns an `order` object that represents a potential online order for a site member.
162
- *
163
- * You can use this method to show a site member a preview of an online order before [creating](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/orders/create-online-order) it.
164
- *
165
- * This method must be called using the [site member identity](https://dev.wix.com/docs/rest/articles/getting-started/about-identities#site-member). Therefore, [Wix apps](https://dev.wix.com/docs/build-apps) can't currently call this method using REST.
166
- * @param - Plan ID.
167
- */
168
- (planId: string, options?: GetOnlineOrderPreviewOptions): Promise<NonNullablePaths<GetOnlineOrderPreviewResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice` | `purchaseLimitExceeded`, 7> & {
169
- __applicationErrorsType?: GetOnlineOrderPreviewApplicationErrors;
170
- __validationErrorsType?: GetOnlineOrderPreviewValidationErrors;
171
- }>;
172
- }
173
- declare function getOfflineOrderPreview$1(httpClient: HttpClient): GetOfflineOrderPreviewSignature;
174
- interface GetOfflineOrderPreviewSignature {
175
- /**
176
- * Performs a dry run of a purchase and provides an order preview.
177
- *
178
- * The preview uses the same logic as purchasing a plan, but the preview is not saved. Because an order is not actually
179
- * created, the preview order's `orderId` and `subscriptionId` are displayed as a string of multiple zero characters
180
- * (`000000-0000`). Tax is only calculated if the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection).
181
- * <br>
182
- * If a pricing plan has a limit on the amount of purchases per buyer, that limit is not considered for generating the preview.
183
- * But, if that limit has been reached and this order would then exceed the amount of purchases permitted for this buyer, then
184
- * `purchaseLimitExceeded` will return as `true`.
185
- *
186
- * To get a general price preview for a plan that's not buyer-specific, call Get Price Preview.
187
- * @param - Member ID of the buyer the previewed order is for, from the Members API.
188
- * @param - Options for previewing the offline order.
189
- * @param - ID of the plan of the previewed order.
190
- */
191
- (planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions): Promise<NonNullablePaths<GetOfflineOrderPreviewResponse, `order._id` | `order.planId` | `order.subscriptionId` | `order.buyer.memberId` | `order.buyer.contactId` | `order.priceDetails.subscription.cycleDuration.unit` | `order.priceDetails.subtotal` | `order.priceDetails.discount` | `order.priceDetails.tax.name` | `order.priceDetails.tax.includedInPrice` | `order.priceDetails.tax.rate` | `order.priceDetails.tax.amount` | `order.priceDetails.total` | `order.priceDetails.planPrice` | `order.priceDetails.currency` | `order.priceDetails.coupon.code` | `order.priceDetails.coupon.amount` | `order.priceDetails.coupon._id` | `order.pricing.prices` | `order.pricing.prices.${number}.duration.cycleFrom` | `order.pricing.prices.${number}.price.subtotal` | `order.pricing.prices.${number}.price.discount` | `order.pricing.prices.${number}.price.total` | `order.pricing.prices.${number}.price.currency` | `order.pricing.prices.${number}.price.proration` | `order.type` | `order.status` | `order.cancellation.cause` | `order.cancellation.effectiveAt` | `order.lastPaymentStatus` | `order.pausePeriods` | `order.pausePeriods.${number}.status` | `order.currentCycle.index` | `order.planName` | `order.planDescription` | `order.planPrice` | `purchaseLimitExceeded`, 7> & {
192
- __applicationErrorsType?: GetOfflineOrderPreviewApplicationErrors;
193
- __validationErrorsType?: GetOfflineOrderPreviewValidationErrors;
194
- }>;
195
- }
196
- declare function getPricePreview$1(httpClient: HttpClient): GetPricePreviewSignature;
197
- interface GetPricePreviewSignature {
198
- /**
199
- * Retrieves a plan's pricing.
200
- *
201
- * The price preview uses the same logic as purchasing a plan, but the preview is not saved. Tax is only applied if
202
- * the site [has it configured](https://support.wix.com/en/article/pricing-plans-setting-up-tax-collection). The price is returned
203
- * in the pricing model format used for orders. Learn more about [pricing models](https://dev.wix.com/api/rest/wix-pricing-plans/pricing-plans/introduction#wix-pricing-plans_pricing-plans_introduction_pricing-models).
204
- *
205
- * Buyers do not have to be logged in to preview the price, and as such, the details returned are not buyer-specific. To
206
- * generate a preview of a purchase for a specific buyer, call Get Offline Order Preview.
207
- * @param - ID of plan to preview.
208
- * @param - Options for getting a price preview.
209
- */
210
- (planId: string, options?: GetPricePreviewOptions): Promise<NonNullablePaths<GetPricePreviewResponse, `price.subscription.cycleDuration.unit` | `price.subtotal` | `price.discount` | `price.tax.name` | `price.tax.includedInPrice` | `price.tax.rate` | `price.tax.amount` | `price.total` | `price.planPrice` | `price.currency` | `price.coupon.code` | `price.coupon.amount` | `price.coupon._id` | `prices` | `prices.${number}.duration.cycleFrom` | `prices.${number}.price.subtotal` | `prices.${number}.price.coupon.code` | `prices.${number}.price.coupon.amount` | `prices.${number}.price.coupon._id` | `prices.${number}.price.discount` | `prices.${number}.price.tax.name` | `prices.${number}.price.tax.includedInPrice` | `prices.${number}.price.tax.rate` | `prices.${number}.price.tax.amount` | `prices.${number}.price.total` | `prices.${number}.price.currency` | `prices.${number}.price.proration`, 6> & {
211
- __applicationErrorsType?: GetPricePreviewApplicationErrors;
212
- }>;
213
- }
214
214
  declare function memberGetOrder$1(httpClient: HttpClient): MemberGetOrderSignature;
215
215
  interface MemberGetOrderSignature {
216
216
  /**
@@ -246,6 +246,9 @@ interface RequestCancellationSignature {
246
246
  */
247
247
  (_id: string, effectiveAt: CancellationEffectiveAtWithLiterals): Promise<void>;
248
248
  }
249
+ declare const onOrderCreated$1: EventDefinition<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
250
+ declare const onOrderStartDateChanged$1: EventDefinition<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
251
+ declare const onOrderUpdated$1: EventDefinition<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
249
252
  declare const onOrderAutoRenewCanceled$1: EventDefinition<OrderAutoRenewCanceledEnvelope, "wix.pricing_plans.v2.order_auto_renew_canceled">;
250
253
  declare const onOrderCanceled$1: EventDefinition<OrderCanceledEnvelope, "wix.pricing_plans.v2.order_canceled">;
251
254
  declare const onOrderCycleStarted$1: EventDefinition<OrderCycleStartedEnvelope, "wix.pricing_plans.v2.order_cycle_started">;
@@ -256,10 +259,12 @@ declare const onOrderPaused$1: EventDefinition<OrderPausedEnvelope, "wix.pricing
256
259
  declare const onOrderPurchased$1: EventDefinition<OrderPurchasedEnvelope, "wix.pricing_plans.v2.order_purchased">;
257
260
  declare const onOrderResumed$1: EventDefinition<OrderResumedEnvelope, "wix.pricing_plans.v2.order_resumed">;
258
261
  declare const onOrderStarted$1: EventDefinition<OrderStartedEnvelope, "wix.pricing_plans.v2.order_started">;
259
- declare const onOrderUpdated$1: EventDefinition<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
260
- declare const onOrderCreated$1: EventDefinition<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
261
- declare const onOrderStartDateChanged$1: EventDefinition<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
262
262
 
263
+ declare const createOnlineOrder: MaybeContext<BuildRESTFunction<typeof createOnlineOrder$1> & typeof createOnlineOrder$1>;
264
+ declare const createOfflineOrder: MaybeContext<BuildRESTFunction<typeof createOfflineOrder$1> & typeof createOfflineOrder$1>;
265
+ declare const getOnlineOrderPreview: MaybeContext<BuildRESTFunction<typeof getOnlineOrderPreview$1> & typeof getOnlineOrderPreview$1>;
266
+ declare const getOfflineOrderPreview: MaybeContext<BuildRESTFunction<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1>;
267
+ declare const getPricePreview: MaybeContext<BuildRESTFunction<typeof getPricePreview$1> & typeof getPricePreview$1>;
263
268
  declare const managementGetOrder: MaybeContext<BuildRESTFunction<typeof managementGetOrder$1> & typeof managementGetOrder$1>;
264
269
  declare const managementListOrders: MaybeContext<BuildRESTFunction<typeof managementListOrders$1> & typeof managementListOrders$1>;
265
270
  declare const postponeEndDate: MaybeContext<BuildRESTFunction<typeof postponeEndDate$1> & typeof postponeEndDate$1>;
@@ -267,14 +272,29 @@ declare const cancelOrder: MaybeContext<BuildRESTFunction<typeof cancelOrder$1>
267
272
  declare const markAsPaid: MaybeContext<BuildRESTFunction<typeof markAsPaid$1> & typeof markAsPaid$1>;
268
273
  declare const pauseOrder: MaybeContext<BuildRESTFunction<typeof pauseOrder$1> & typeof pauseOrder$1>;
269
274
  declare const resumeOrder: MaybeContext<BuildRESTFunction<typeof resumeOrder$1> & typeof resumeOrder$1>;
270
- declare const createOnlineOrder: MaybeContext<BuildRESTFunction<typeof createOnlineOrder$1> & typeof createOnlineOrder$1>;
271
- declare const createOfflineOrder: MaybeContext<BuildRESTFunction<typeof createOfflineOrder$1> & typeof createOfflineOrder$1>;
272
- declare const getOnlineOrderPreview: MaybeContext<BuildRESTFunction<typeof getOnlineOrderPreview$1> & typeof getOnlineOrderPreview$1>;
273
- declare const getOfflineOrderPreview: MaybeContext<BuildRESTFunction<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1>;
274
- declare const getPricePreview: MaybeContext<BuildRESTFunction<typeof getPricePreview$1> & typeof getPricePreview$1>;
275
275
  declare const memberGetOrder: MaybeContext<BuildRESTFunction<typeof memberGetOrder$1> & typeof memberGetOrder$1>;
276
276
  declare const memberListOrders: MaybeContext<BuildRESTFunction<typeof memberListOrders$1> & typeof memberListOrders$1>;
277
277
  declare const requestCancellation: MaybeContext<BuildRESTFunction<typeof requestCancellation$1> & typeof requestCancellation$1>;
278
+ /**
279
+ * Triggered when an order is created.
280
+ */
281
+ declare const onOrderCreated: BuildEventDefinition<typeof onOrderCreated$1> & typeof onOrderCreated$1;
282
+ /**
283
+ * Triggered when an order's `startDate` is changed.
284
+ */
285
+ declare const onOrderStartDateChanged: BuildEventDefinition<typeof onOrderStartDateChanged$1> & typeof onOrderStartDateChanged$1;
286
+ /**
287
+ * Triggered for any of the following update events:
288
+ *
289
+ * + Order is paid for. Order Purchased is also triggered.
290
+ * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
291
+ * + New payment cycle of an order starts. Order Cycle Started is also triggered.
292
+ * + Offline order is marked as paid. Order Marked As Paid is also triggered.
293
+ * + End date of the order is postponed. Order End Date Postponed is also triggered
294
+ * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
295
+ * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
296
+ */
297
+ declare const onOrderUpdated: BuildEventDefinition<typeof onOrderUpdated$1> & typeof onOrderUpdated$1;
278
298
  /**
279
299
  * Triggered when an order is canceled and `effectiveAt` is set to `NEXT_PAYMENT_DATE`.
280
300
  *
@@ -333,25 +353,5 @@ declare const onOrderResumed: BuildEventDefinition<typeof onOrderResumed$1> & ty
333
353
  * Triggered when an order reaches its `startDate`. Applies to both purchased and free orders.
334
354
  */
335
355
  declare const onOrderStarted: BuildEventDefinition<typeof onOrderStarted$1> & typeof onOrderStarted$1;
336
- /**
337
- * Triggered for any of the following update events:
338
- *
339
- * + Order is paid for. Order Purchased is also triggered.
340
- * + Order reaches its start date or end date. Order Started and Order Ended, respectively, are also triggered.
341
- * + New payment cycle of an order starts. Order Cycle Started is also triggered.
342
- * + Offline order is marked as paid. Order Marked As Paid is also triggered.
343
- * + End date of the order is postponed. Order End Date Postponed is also triggered
344
- * + Order is paused, or a paused order is resumed. Order Paused and Order Resumed, respectively, are also triggered.
345
- * + Order is canceled, either immediately or at the end of the payment cycle. Order Canceled and Order Auto Renew Canceled, respectively, are also triggered.
346
- */
347
- declare const onOrderUpdated: BuildEventDefinition<typeof onOrderUpdated$1> & typeof onOrderUpdated$1;
348
- /**
349
- * Triggered when an order is created.
350
- */
351
- declare const onOrderCreated: BuildEventDefinition<typeof onOrderCreated$1> & typeof onOrderCreated$1;
352
- /**
353
- * Triggered when an order's `startDate` is changed.
354
- */
355
- declare const onOrderStartDateChanged: BuildEventDefinition<typeof onOrderStartDateChanged$1> & typeof onOrderStartDateChanged$1;
356
356
 
357
357
  export { CancellationEffectiveAtWithLiterals, CreateOfflineOrderApplicationErrors, CreateOfflineOrderOptions, CreateOfflineOrderResponse, CreateOfflineOrderValidationErrors, CreateOnlineOrderApplicationErrors, CreateOnlineOrderOptions, CreateOnlineOrderResponse, CreateOnlineOrderValidationErrors, GetOfflineOrderPreviewApplicationErrors, GetOfflineOrderPreviewOptions, GetOfflineOrderPreviewResponse, GetOfflineOrderPreviewValidationErrors, GetOnlineOrderPreviewApplicationErrors, GetOnlineOrderPreviewOptions, GetOnlineOrderPreviewResponse, GetOnlineOrderPreviewValidationErrors, GetOrderResponse, GetPricePreviewApplicationErrors, GetPricePreviewOptions, GetPricePreviewResponse, ListOrdersResponse, ManagementGetOrderOptions, ManagementListOrdersOptions, MemberGetOrderOptions, MemberListOrdersOptions, MemberListOrdersResponse, Order, OrderAutoRenewCanceledEnvelope, OrderCanceledEnvelope, OrderCreatedEnvelope, OrderCycleStartedEnvelope, OrderEndDatePostponedEnvelope, OrderEndedEnvelope, OrderMarkedAsPaidEnvelope, OrderPausedEnvelope, OrderPurchasedEnvelope, OrderResumedEnvelope, OrderStartDateChangedEnvelope, OrderStartedEnvelope, OrderUpdatedEnvelope, cancelOrder, createOfflineOrder, createOnlineOrder, getOfflineOrderPreview, getOnlineOrderPreview, getPricePreview, managementGetOrder, managementListOrders, markAsPaid, memberGetOrder, memberListOrders, onOrderAutoRenewCanceled, onOrderCanceled, onOrderCreated, onOrderCycleStarted, onOrderEndDatePostponed, onOrderEnded, onOrderMarkedAsPaid, onOrderPaused, onOrderPurchased, onOrderResumed, onOrderStartDateChanged, onOrderStarted, onOrderUpdated, pauseOrder, postponeEndDate, requestCancellation, resumeOrder };