@wix/auto_sdk_subscription_subscriptions 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +99 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.context.js +141 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +134 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.http.js +3048 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +94 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js +636 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +273 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.public.js +768 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +3618 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.types.js +337 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +4355 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js +1985 -0
- package/build/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/billing-v1-subscription-subscriptions.context.d.ts +99 -0
- package/build/es/src/billing-v1-subscription-subscriptions.context.js +101 -0
- package/build/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -0
- package/build/es/src/billing-v1-subscription-subscriptions.http.d.ts +134 -0
- package/build/es/src/billing-v1-subscription-subscriptions.http.js +3013 -0
- package/build/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -0
- package/build/es/src/billing-v1-subscription-subscriptions.meta.d.ts +94 -0
- package/build/es/src/billing-v1-subscription-subscriptions.meta.js +578 -0
- package/build/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -0
- package/build/es/src/billing-v1-subscription-subscriptions.public.d.ts +273 -0
- package/build/es/src/billing-v1-subscription-subscriptions.public.js +696 -0
- package/build/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -0
- package/build/es/src/billing-v1-subscription-subscriptions.types.d.ts +3618 -0
- package/build/es/src/billing-v1-subscription-subscriptions.types.js +334 -0
- package/build/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -0
- package/build/es/src/billing-v1-subscription-subscriptions.universal.d.ts +4355 -0
- package/build/es/src/billing-v1-subscription-subscriptions.universal.js +1926 -0
- package/build/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.d.ts +101 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js +141 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.context.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.d.ts +134 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js +3048 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.http.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.d.ts +94 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js +636 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.meta.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.d.ts +293 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js +768 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.public.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.d.ts +3618 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js +337 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.types.js.map +1 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.d.ts +4379 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js +1985 -0
- package/build/internal/cjs/src/billing-v1-subscription-subscriptions.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.context.d.ts +101 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js +101 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.context.js.map +1 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.http.d.ts +134 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js +3013 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.http.js.map +1 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.d.ts +94 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js +578 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.meta.js.map +1 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.public.d.ts +293 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js +696 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.public.js.map +1 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.types.d.ts +3618 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js +334 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.types.js.map +1 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.d.ts +4379 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js +1926 -0
- package/build/internal/es/src/billing-v1-subscription-subscriptions.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,4379 @@
|
|
|
1
|
+
export interface Subscription {
|
|
2
|
+
/**
|
|
3
|
+
* Subscription's unique id. Automatically generated and read-only.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
6
|
+
_id?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Date when subscription was created
|
|
9
|
+
* @readonly
|
|
10
|
+
*/
|
|
11
|
+
_createdDate?: Date | null;
|
|
12
|
+
/**
|
|
13
|
+
* Date when subscription was updated
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
_updatedDate?: Date | null;
|
|
17
|
+
/**
|
|
18
|
+
* Revision of subscription. Increments upon changes
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
revision?: string | null;
|
|
22
|
+
/** Subscription name: minLength is 1, maxLength is 150 */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** Subscription description. Optional. */
|
|
25
|
+
description?: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* 3. No Start Date:
|
|
28
|
+
* - If the start_date is not provided, this field will default to "now",
|
|
29
|
+
* meaning the subscription will start immediately.
|
|
30
|
+
*/
|
|
31
|
+
startDate?: Date | null;
|
|
32
|
+
/**
|
|
33
|
+
* Represents when the subscription will end, relevant for subscriptions with a termed period.
|
|
34
|
+
* If not provided, will be calculated based on billing schedule. Should be empty for evergreen subscription.
|
|
35
|
+
* Note: A 13-hour tolerance is applied when validating the end date to handle for time zone differences and minor discrepancies.
|
|
36
|
+
*/
|
|
37
|
+
endDate?: Date | null;
|
|
38
|
+
/** Business origin subscription is coming from. In site-level subscription it will be vertical app_id and entity_id */
|
|
39
|
+
origin?: BusinessOrigin;
|
|
40
|
+
/** Customer information like id and identity type (member or contact) */
|
|
41
|
+
customer?: Customer;
|
|
42
|
+
/**
|
|
43
|
+
* Status of subscription
|
|
44
|
+
* @readonly
|
|
45
|
+
*/
|
|
46
|
+
status?: SubscriptionStatusEnumSubscriptionStatus;
|
|
47
|
+
/** Billing details parameters including schedule, currency, etc. */
|
|
48
|
+
billingSettings?: BillingSettings;
|
|
49
|
+
/**
|
|
50
|
+
* Includes many attributes about billing status of the subscription
|
|
51
|
+
* @readonly
|
|
52
|
+
*/
|
|
53
|
+
billingStatus?: BillingStatus;
|
|
54
|
+
/** Shipping address associated with subscription. At the moment used only for payments. Optional. */
|
|
55
|
+
shippingAddress?: FullAddressDetails;
|
|
56
|
+
/** Restrictions on possible subscription actions. If not provided, default policies are all restrictions enabled. */
|
|
57
|
+
policies?: SubscriptionPolicies;
|
|
58
|
+
/**
|
|
59
|
+
* Information related to either paused subscription or scheduled for future pause
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
pauseInfo?: PauseInfo;
|
|
63
|
+
/**
|
|
64
|
+
* Information related to cancellation for already canceled subscription or scheduled for cancel
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
cancellationInfo?: CancellationInfo;
|
|
68
|
+
/**
|
|
69
|
+
* Pending update for the next billing cycle
|
|
70
|
+
* @readonly
|
|
71
|
+
*/
|
|
72
|
+
pendingUpdateData?: SubscriptionUpdateData;
|
|
73
|
+
/**
|
|
74
|
+
* Key / Value store to keep up to 10 additional values related to the subscription.
|
|
75
|
+
* Key max length = 50, Value max length = 200. Value can not be empty.
|
|
76
|
+
* Should not include any sensitive or PII information.
|
|
77
|
+
*/
|
|
78
|
+
metadata?: Record<string, string>;
|
|
79
|
+
/**
|
|
80
|
+
* Pending update for a specific date
|
|
81
|
+
* @readonly
|
|
82
|
+
*/
|
|
83
|
+
specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateData;
|
|
84
|
+
/**
|
|
85
|
+
* ChangesCounter of subscription. Increments upon every change to the domain
|
|
86
|
+
* @readonly
|
|
87
|
+
*/
|
|
88
|
+
changesCounter?: string | null;
|
|
89
|
+
/** Billing order id. Optional. */
|
|
90
|
+
orderId?: string | null;
|
|
91
|
+
/** Platform origin subscription is coming from. */
|
|
92
|
+
platformOrigin?: PlatformOrigin;
|
|
93
|
+
/** The Business Location ID represents a business location in an external service, which includes the business address. */
|
|
94
|
+
businessLocationId?: string | null;
|
|
95
|
+
/** items, minSize is 1, maxSize is 100 */
|
|
96
|
+
items?: Item[];
|
|
97
|
+
}
|
|
98
|
+
export interface BusinessOrigin {
|
|
99
|
+
appId?: string | null;
|
|
100
|
+
entityId?: string | null;
|
|
101
|
+
}
|
|
102
|
+
export interface Customer extends CustomerIdOneOf {
|
|
103
|
+
/**
|
|
104
|
+
* Visitor ID of the customer. Available when the customer is an anonymous
|
|
105
|
+
* site visitor.
|
|
106
|
+
*/
|
|
107
|
+
visitorId?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Contact ID of the customer. Available when the customer is a
|
|
110
|
+
* [contact](https://dev.wix.com/docs/rest/api-reference/people-communications/contacts/contacts/contact-v-4#contact-object).
|
|
111
|
+
*/
|
|
112
|
+
contactId?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Member ID of the customer. Available when the customer is a
|
|
115
|
+
* [member](https://dev.wix.com/docs/rest/api-reference/people-communications/members/members#member-object).
|
|
116
|
+
*/
|
|
117
|
+
memberId?: string;
|
|
118
|
+
/** Wix account ID */
|
|
119
|
+
accountId?: string;
|
|
120
|
+
}
|
|
121
|
+
/** @oneof */
|
|
122
|
+
export interface CustomerIdOneOf {
|
|
123
|
+
/**
|
|
124
|
+
* Visitor ID of the customer. Available when the customer is an anonymous
|
|
125
|
+
* site visitor.
|
|
126
|
+
*/
|
|
127
|
+
visitorId?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Contact ID of the customer. Available when the customer is a
|
|
130
|
+
* [contact](https://dev.wix.com/docs/rest/api-reference/people-communications/contacts/contacts/contact-v-4#contact-object).
|
|
131
|
+
*/
|
|
132
|
+
contactId?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Member ID of the customer. Available when the customer is a
|
|
135
|
+
* [member](https://dev.wix.com/docs/rest/api-reference/people-communications/members/members#member-object).
|
|
136
|
+
*/
|
|
137
|
+
memberId?: string;
|
|
138
|
+
/** Wix account ID */
|
|
139
|
+
accountId?: string;
|
|
140
|
+
}
|
|
141
|
+
export declare enum SubscriptionStatusEnumSubscriptionStatus {
|
|
142
|
+
UNKNOWN = "UNKNOWN",
|
|
143
|
+
/** Subscription created in this status, but hasn't been paid for yet. Filtered out from subscriptions querying. */
|
|
144
|
+
DRAFT = "DRAFT",
|
|
145
|
+
/** Subscription that will be active in future. */
|
|
146
|
+
PENDING = "PENDING",
|
|
147
|
+
/** Subscription is active */
|
|
148
|
+
ACTIVE = "ACTIVE",
|
|
149
|
+
/** Subscription is paused */
|
|
150
|
+
PAUSED = "PAUSED",
|
|
151
|
+
/** Subscription was ended */
|
|
152
|
+
ENDED = "ENDED",
|
|
153
|
+
/** Subscription was canceled or auto-renew off. Ended before its time. */
|
|
154
|
+
CANCELED = "CANCELED"
|
|
155
|
+
}
|
|
156
|
+
export interface BillingSettings {
|
|
157
|
+
/** Currency of all subscription items prices. Three letter ISO currency code. https://en.wikipedia.org/wiki/ISO_4217 */
|
|
158
|
+
currency?: string;
|
|
159
|
+
/** customer payment source to make recurring payments with */
|
|
160
|
+
paymentMethod?: PaymentMethod;
|
|
161
|
+
/** Instructs how payments will be collected. */
|
|
162
|
+
collectionMethod?: CollectionMethodEnumCollectionMethod;
|
|
163
|
+
/**
|
|
164
|
+
* Duration of cycle. For example, 1 MONTH, 2 WEEKS, 7 DAYS, 1 YEAR etc.
|
|
165
|
+
* Shortest supported cycle duration is 7 days.
|
|
166
|
+
*/
|
|
167
|
+
cycleDuration?: Duration;
|
|
168
|
+
/** Number of billing cycles. If not set subscription auto-renewed until cycle-auto-renew will be disabled. */
|
|
169
|
+
totalCycles?: number | null;
|
|
170
|
+
/** If set to false, subscription will be canceled at the next billing cycle. */
|
|
171
|
+
cycleAutoRenew?: boolean;
|
|
172
|
+
/** Billing Schedule to be defined in order to override default billing schedule */
|
|
173
|
+
customBillingSchedule?: CustomBillingSchedule;
|
|
174
|
+
/** Definition of trial period */
|
|
175
|
+
freeTrialDuration?: Duration;
|
|
176
|
+
/**
|
|
177
|
+
* Shipping costs collected each cycle
|
|
178
|
+
* @deprecated
|
|
179
|
+
* @replacedBy shipping_charges
|
|
180
|
+
* @targetRemovalDate 2024-10-31
|
|
181
|
+
*/
|
|
182
|
+
shippingFee?: string | null;
|
|
183
|
+
/** Billing address associated with subscription to be used for payments. */
|
|
184
|
+
billingAddress?: FullAddressDetails;
|
|
185
|
+
taxSettings?: TaxSettings;
|
|
186
|
+
/**
|
|
187
|
+
* Fees that are only added to an invoice when a specific condition is met.
|
|
188
|
+
* For example, a setup fee that only applies to the very first invoice of a
|
|
189
|
+
* subscription.
|
|
190
|
+
*
|
|
191
|
+
* Max: 5 additional fees
|
|
192
|
+
*/
|
|
193
|
+
additionalFees?: AdditionalFee[];
|
|
194
|
+
/** Shipping fee charges */
|
|
195
|
+
shippingCharges?: ShippingCharges;
|
|
196
|
+
/** General discount that applied to all items in the subscription */
|
|
197
|
+
discounts?: Discount[];
|
|
198
|
+
/**
|
|
199
|
+
* Details about the external collection service.
|
|
200
|
+
* Only set when the collection_method is EXTERNAL.
|
|
201
|
+
*/
|
|
202
|
+
externalCollectionDetails?: ExternalCollectionDetails;
|
|
203
|
+
}
|
|
204
|
+
export interface PaymentMethod {
|
|
205
|
+
/** reference to payment source id stored in payments system */
|
|
206
|
+
_id?: string;
|
|
207
|
+
}
|
|
208
|
+
export declare enum CollectionMethodEnumCollectionMethod {
|
|
209
|
+
UNKNOWN = "UNKNOWN",
|
|
210
|
+
/** Subscriber automatically charged */
|
|
211
|
+
AUTO_CHARGE = "AUTO_CHARGE",
|
|
212
|
+
/** Payments manually collected and managed by owner */
|
|
213
|
+
OFFLINE = "OFFLINE",
|
|
214
|
+
/** Payment will be collected somehow. Billing only issues invoice per cycle. */
|
|
215
|
+
SEND_INVOICE = "SEND_INVOICE",
|
|
216
|
+
/** Payment will be collected externally */
|
|
217
|
+
EXTERNAL = "EXTERNAL",
|
|
218
|
+
/** Indicates the product has a zero amount, meaning its free with no payment required. */
|
|
219
|
+
FREE = "FREE"
|
|
220
|
+
}
|
|
221
|
+
export interface Duration {
|
|
222
|
+
/** Duration unit: DAY, WEEK, MONTH, YEAR */
|
|
223
|
+
unit?: DurationUnit;
|
|
224
|
+
/** Amount of units. For example, 1 MONTH, 1 YEAR, 2 WEEKS, etc. Optional. Default is 1. */
|
|
225
|
+
count?: number | null;
|
|
226
|
+
}
|
|
227
|
+
export declare enum DurationUnit {
|
|
228
|
+
UNKNOWN = "UNKNOWN",
|
|
229
|
+
DAY = "DAY",
|
|
230
|
+
WEEK = "WEEK",
|
|
231
|
+
MONTH = "MONTH",
|
|
232
|
+
YEAR = "YEAR"
|
|
233
|
+
}
|
|
234
|
+
export interface CustomBillingSchedule {
|
|
235
|
+
/**
|
|
236
|
+
* Amount of cycles to be paid on Subscription creation, currently only cycles_to_pay_on_creation equals to 1 is supported
|
|
237
|
+
* When used with Subscription.start_date, Subscription cycles will be paid on creation but Subscription will be activated in the future
|
|
238
|
+
*/
|
|
239
|
+
cyclesToPayOnCreation?: number | null;
|
|
240
|
+
}
|
|
241
|
+
export interface FullAddressDetails {
|
|
242
|
+
/** Details about the person associated with the address. */
|
|
243
|
+
contactDetails?: FullAddressContactDetails;
|
|
244
|
+
/** Information about the address. */
|
|
245
|
+
address?: Address;
|
|
246
|
+
}
|
|
247
|
+
export interface FullAddressContactDetails {
|
|
248
|
+
/** First name of the contact. */
|
|
249
|
+
firstName?: string | null;
|
|
250
|
+
/** Last name of the contact. */
|
|
251
|
+
lastName?: string | null;
|
|
252
|
+
/** Phone number of the contact. */
|
|
253
|
+
phone?: string | null;
|
|
254
|
+
/** Company associated with the contact. */
|
|
255
|
+
company?: string | null;
|
|
256
|
+
/** Email address of the contact. */
|
|
257
|
+
email?: string | null;
|
|
258
|
+
}
|
|
259
|
+
export interface Address extends AddressStreetOneOf {
|
|
260
|
+
/** Street name and number. */
|
|
261
|
+
streetAddress?: StreetAddress;
|
|
262
|
+
/** Main address line, usually street and number as free text. */
|
|
263
|
+
addressLine1?: string | null;
|
|
264
|
+
/**
|
|
265
|
+
* 2-letter country code in
|
|
266
|
+
* [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
|
|
267
|
+
* format.
|
|
268
|
+
*/
|
|
269
|
+
country?: string | null;
|
|
270
|
+
/**
|
|
271
|
+
* Subdivision. Usually a state, region, prefecture, or province code,
|
|
272
|
+
* according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2).
|
|
273
|
+
*/
|
|
274
|
+
subdivision?: string | null;
|
|
275
|
+
/** City name. */
|
|
276
|
+
city?: string | null;
|
|
277
|
+
/** Zip/postal code. */
|
|
278
|
+
postalCode?: string | null;
|
|
279
|
+
}
|
|
280
|
+
/** @oneof */
|
|
281
|
+
export interface AddressStreetOneOf {
|
|
282
|
+
/** Street name and number. */
|
|
283
|
+
streetAddress?: StreetAddress;
|
|
284
|
+
/** Main address line, usually street and number as free text. */
|
|
285
|
+
addressLine?: string | null;
|
|
286
|
+
}
|
|
287
|
+
export interface StreetAddress {
|
|
288
|
+
/** Street number. */
|
|
289
|
+
number?: string;
|
|
290
|
+
/** Street name. */
|
|
291
|
+
name?: string;
|
|
292
|
+
}
|
|
293
|
+
export interface TaxSettings {
|
|
294
|
+
/** If true then taxes are included in given prices */
|
|
295
|
+
inclusive?: boolean;
|
|
296
|
+
}
|
|
297
|
+
export interface AdditionalFee {
|
|
298
|
+
/**
|
|
299
|
+
* Name of the conditional fee.
|
|
300
|
+
*
|
|
301
|
+
* Max: 500 characters
|
|
302
|
+
*/
|
|
303
|
+
name?: string;
|
|
304
|
+
/**
|
|
305
|
+
* Amount of the conditional fee.
|
|
306
|
+
*
|
|
307
|
+
* Min: `0.01`
|
|
308
|
+
*/
|
|
309
|
+
amount?: string;
|
|
310
|
+
/**
|
|
311
|
+
* When the fee is added to the invoice.
|
|
312
|
+
*
|
|
313
|
+
* + `UNKNOWN_FEE_TRIGGER`: There is no information about when the fee is added to an invoice.
|
|
314
|
+
* + `FIRST_PAYMENT`: The fee is only added to the very first invoice of a subscription.
|
|
315
|
+
* @deprecated When the fee is added to the invoice.
|
|
316
|
+
*
|
|
317
|
+
* + `UNKNOWN_FEE_TRIGGER`: There is no information about when the fee is added to an invoice.
|
|
318
|
+
* + `FIRST_PAYMENT`: The fee is only added to the very first invoice of a subscription.
|
|
319
|
+
* @replacedBy cycles
|
|
320
|
+
* @targetRemovalDate 2025-12-31
|
|
321
|
+
*/
|
|
322
|
+
trigger?: AdditionalFeeTrigger;
|
|
323
|
+
/** Information about the tax of the conditional fee. */
|
|
324
|
+
tax?: Tax;
|
|
325
|
+
/**
|
|
326
|
+
* Specifies the cycles during which the fee will be applied. If this field is provided,
|
|
327
|
+
* it determines the exact range of cycles the fee applies to. The logic is as follows:
|
|
328
|
+
*
|
|
329
|
+
* - `cycle_from`: The first cycle the fee will be added to. Must be greater than 0.
|
|
330
|
+
* - `number_of_cycles`: The number of consecutive cycles the fee will be applied to,
|
|
331
|
+
* starting from `cycle_from`. If not specified, the fee applies to all cycles starting
|
|
332
|
+
* from `cycle_from`.
|
|
333
|
+
*
|
|
334
|
+
* Example:
|
|
335
|
+
* - `cycle_from = 1, number_of_cycles = 3`: Fee applies to cycles 1, 2, and 3.
|
|
336
|
+
* - `cycle_from = 2, number_of_cycles = None`: Fee applies to cycles 2 and onward indefinitely.
|
|
337
|
+
*
|
|
338
|
+
* If `cycles` is not specified (`None`), the fee will be applied on all cycles.
|
|
339
|
+
*/
|
|
340
|
+
cycles?: Cycles;
|
|
341
|
+
/** Indicates the source of the fee, Contains app_id and entity_id */
|
|
342
|
+
origin?: Origin;
|
|
343
|
+
}
|
|
344
|
+
export declare enum AdditionalFeeTrigger {
|
|
345
|
+
UNKNOWN = "UNKNOWN",
|
|
346
|
+
/** Charge upon subscription first payment */
|
|
347
|
+
FIRST_PAYMENT = "FIRST_PAYMENT"
|
|
348
|
+
}
|
|
349
|
+
export interface Tax extends TaxValueOneOf {
|
|
350
|
+
/**
|
|
351
|
+
* Tax amount for the invoice's line item. Available when the tax is an
|
|
352
|
+
* amount and not a precentage.
|
|
353
|
+
*
|
|
354
|
+
* Min: `0.01`
|
|
355
|
+
*/
|
|
356
|
+
amount?: string;
|
|
357
|
+
/**
|
|
358
|
+
* Tax amount for the invoice's line item price and application fee.
|
|
359
|
+
* Can't be combined with `invoiceItems.priceDetails.discount`.
|
|
360
|
+
* Available when the tax is a precentage and not an amount.
|
|
361
|
+
*
|
|
362
|
+
* Min: `0.01`
|
|
363
|
+
* Max: `100`
|
|
364
|
+
*/
|
|
365
|
+
percentage?: string;
|
|
366
|
+
/** Dynamic tax calculation */
|
|
367
|
+
dynamic?: DynamicTax;
|
|
368
|
+
}
|
|
369
|
+
/** @oneof */
|
|
370
|
+
export interface TaxValueOneOf {
|
|
371
|
+
/**
|
|
372
|
+
* Tax amount for the invoice's line item. Available when the tax is an
|
|
373
|
+
* amount and not a precentage.
|
|
374
|
+
*
|
|
375
|
+
* Min: `0.01`
|
|
376
|
+
*/
|
|
377
|
+
amount?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Tax amount for the invoice's line item price and application fee.
|
|
380
|
+
* Can't be combined with `invoiceItems.priceDetails.discount`.
|
|
381
|
+
* Available when the tax is a precentage and not an amount.
|
|
382
|
+
*
|
|
383
|
+
* Min: `0.01`
|
|
384
|
+
* Max: `100`
|
|
385
|
+
*/
|
|
386
|
+
percentage?: string;
|
|
387
|
+
/** Dynamic tax calculation */
|
|
388
|
+
dynamic?: DynamicTax;
|
|
389
|
+
}
|
|
390
|
+
export interface DynamicTax {
|
|
391
|
+
/** Tax group ID used to calculate tax, default will be used if not available */
|
|
392
|
+
taxGroupId?: string | null;
|
|
393
|
+
/** Taxable address used to calculate tax */
|
|
394
|
+
taxableAddressType?: TaxableAddressType;
|
|
395
|
+
}
|
|
396
|
+
export declare enum TaxableAddressType {
|
|
397
|
+
UNKNOWN = "UNKNOWN",
|
|
398
|
+
/** Tax will be calculated using a single address */
|
|
399
|
+
BUSINESS = "BUSINESS",
|
|
400
|
+
/** Tax will be calculated using multiple address (from BUSINESS to BILLING) */
|
|
401
|
+
BILLING = "BILLING",
|
|
402
|
+
/** Tax will be calculated using multiple address (from BUSINESS to SHIPPING) */
|
|
403
|
+
SHIPPING = "SHIPPING"
|
|
404
|
+
}
|
|
405
|
+
export interface Cycles {
|
|
406
|
+
/** The cycle will start. Minimum cycle number is 1 */
|
|
407
|
+
cycleFrom?: number;
|
|
408
|
+
/** Number of cycles to be applied on. In order to apply a on all cycles until the end of the subscription, this field should be empty. */
|
|
409
|
+
numberOfCycles?: number | null;
|
|
410
|
+
}
|
|
411
|
+
export interface Origin {
|
|
412
|
+
appId?: string;
|
|
413
|
+
entityId?: string;
|
|
414
|
+
}
|
|
415
|
+
export interface ShippingCharges {
|
|
416
|
+
/**
|
|
417
|
+
* Amount of the shipping fee in `0.00` format.
|
|
418
|
+
*
|
|
419
|
+
* Min: `0.01`
|
|
420
|
+
*/
|
|
421
|
+
amount?: string;
|
|
422
|
+
/** Tax of the shipping fee */
|
|
423
|
+
tax?: Tax;
|
|
424
|
+
discounts?: Discount[];
|
|
425
|
+
}
|
|
426
|
+
export interface Discount extends DiscountValueOneOf {
|
|
427
|
+
/**
|
|
428
|
+
* Discount amount.
|
|
429
|
+
* Available when the discount is an amount.
|
|
430
|
+
*
|
|
431
|
+
* Min: `0.01`
|
|
432
|
+
*/
|
|
433
|
+
amount?: string;
|
|
434
|
+
/**
|
|
435
|
+
* Discount percentage.
|
|
436
|
+
* Available when the discount is a parcentage value.
|
|
437
|
+
*
|
|
438
|
+
* Min: `0.01`
|
|
439
|
+
* Max: `100`
|
|
440
|
+
*/
|
|
441
|
+
percentage?: string;
|
|
442
|
+
cycles?: DiscountCycles;
|
|
443
|
+
/** Discount origin is coming from. Contains app_id and entity_id */
|
|
444
|
+
origin?: DiscountOrigin;
|
|
445
|
+
}
|
|
446
|
+
/** @oneof */
|
|
447
|
+
export interface DiscountValueOneOf {
|
|
448
|
+
/**
|
|
449
|
+
* Discount amount.
|
|
450
|
+
* Available when the discount is an amount.
|
|
451
|
+
*
|
|
452
|
+
* Min: `0.01`
|
|
453
|
+
*/
|
|
454
|
+
amount?: string;
|
|
455
|
+
/**
|
|
456
|
+
* Discount percentage.
|
|
457
|
+
* Available when the discount is a parcentage value.
|
|
458
|
+
*
|
|
459
|
+
* Min: `0.01`
|
|
460
|
+
* Max: `100`
|
|
461
|
+
*/
|
|
462
|
+
percentage?: string;
|
|
463
|
+
}
|
|
464
|
+
export interface DiscountCycles {
|
|
465
|
+
/** The cycle from which the discount will start. Minimum cycle number is 1 */
|
|
466
|
+
cycleFrom?: number;
|
|
467
|
+
/** Number of cycles to be applied on them discount. In order to apply a discount on all cycles until the end of the subscription, this field should be empty. */
|
|
468
|
+
numberOfCycles?: number | null;
|
|
469
|
+
}
|
|
470
|
+
export interface DiscountOrigin {
|
|
471
|
+
appId?: string;
|
|
472
|
+
entityId?: string;
|
|
473
|
+
}
|
|
474
|
+
export interface ExternalCollectionDetails {
|
|
475
|
+
/** The name of the external collector. */
|
|
476
|
+
collectorName?: string;
|
|
477
|
+
}
|
|
478
|
+
export interface BillingStatus {
|
|
479
|
+
/**
|
|
480
|
+
* Current cycle of subscription billing schedule. When billing schedule starts cycles start from 1
|
|
481
|
+
* and incremented each next billing cycle.
|
|
482
|
+
* In case billing schedule not started (free trial, pay later start later) then current_cycle will remain 0
|
|
483
|
+
*/
|
|
484
|
+
currentCycle?: number;
|
|
485
|
+
/** how many cycled are remaining, For auto-renew subscriptions is not set. */
|
|
486
|
+
remainingCycles?: number | null;
|
|
487
|
+
/** Date when charge will be for next billing cycle */
|
|
488
|
+
nextBillingDate?: Date | null;
|
|
489
|
+
/** Previous Date charged for previous billing cycle */
|
|
490
|
+
previousBillingDate?: Date | null;
|
|
491
|
+
/** last payment details */
|
|
492
|
+
latestPaymentData?: PaymentData;
|
|
493
|
+
/** Free trial data */
|
|
494
|
+
freeTrialData?: FreeTrialData;
|
|
495
|
+
/**
|
|
496
|
+
* Grace period information during grace period after payment failure
|
|
497
|
+
* @readonly
|
|
498
|
+
*/
|
|
499
|
+
gracePeriodData?: GracePeriodData;
|
|
500
|
+
}
|
|
501
|
+
/** TODO: fill docs */
|
|
502
|
+
export interface PaymentData {
|
|
503
|
+
invoiceId?: string;
|
|
504
|
+
paymentStatus?: PaymentStatus;
|
|
505
|
+
totals?: Totals;
|
|
506
|
+
initialFailedPaymentDate?: Date | null;
|
|
507
|
+
}
|
|
508
|
+
export declare enum PaymentStatus {
|
|
509
|
+
/** Payment status unknown */
|
|
510
|
+
UNKNOWN = "UNKNOWN",
|
|
511
|
+
/** Payment has not been paid */
|
|
512
|
+
UNPAID = "UNPAID",
|
|
513
|
+
/** Payment has been paid // TODO: p13n review: we are not sending event when in SEND_INVOICE mode cycle was paid. should we and which event? */
|
|
514
|
+
PAID = "PAID",
|
|
515
|
+
/** Payment failed */
|
|
516
|
+
FAILED = "FAILED"
|
|
517
|
+
}
|
|
518
|
+
export interface Totals {
|
|
519
|
+
/**
|
|
520
|
+
* Total price of the subscription that the customer must pay per billing
|
|
521
|
+
* cycle. Calculated as: `subtotal + tax + shippingFee + applicationFee + extraCharge - discount - credit`
|
|
522
|
+
* @readonly
|
|
523
|
+
*/
|
|
524
|
+
totalPrice?: string;
|
|
525
|
+
/**
|
|
526
|
+
* Subtotal of all line items that belong to the subscription.
|
|
527
|
+
* Calculated as: `sum_{i=1}^{n} (itemPrice[i] * quantity[i])`
|
|
528
|
+
* @readonly
|
|
529
|
+
*/
|
|
530
|
+
subtotal?: string;
|
|
531
|
+
/**
|
|
532
|
+
* Total tax.
|
|
533
|
+
* @readonly
|
|
534
|
+
*/
|
|
535
|
+
tax?: string | null;
|
|
536
|
+
/**
|
|
537
|
+
* Total discount.
|
|
538
|
+
* @readonly
|
|
539
|
+
*/
|
|
540
|
+
discount?: string | null;
|
|
541
|
+
/**
|
|
542
|
+
* Total application fee.
|
|
543
|
+
* @readonly
|
|
544
|
+
*/
|
|
545
|
+
applicationFee?: string | null;
|
|
546
|
+
/**
|
|
547
|
+
* Total shipping fee.
|
|
548
|
+
* @readonly
|
|
549
|
+
*/
|
|
550
|
+
shippingFee?: string | null;
|
|
551
|
+
/**
|
|
552
|
+
* Total extra charges without tax.
|
|
553
|
+
* @readonly
|
|
554
|
+
*/
|
|
555
|
+
extraCharge?: string | null;
|
|
556
|
+
/**
|
|
557
|
+
* Total credits without tax.
|
|
558
|
+
* @readonly
|
|
559
|
+
*/
|
|
560
|
+
credit?: string | null;
|
|
561
|
+
/**
|
|
562
|
+
* The tax amount for the proration, which is also included in the total tax.
|
|
563
|
+
* @readonly
|
|
564
|
+
*/
|
|
565
|
+
prorationTax?: string | null;
|
|
566
|
+
}
|
|
567
|
+
export interface FreeTrialData {
|
|
568
|
+
/**
|
|
569
|
+
* Date when free trial starts
|
|
570
|
+
* @readonly
|
|
571
|
+
*/
|
|
572
|
+
startDate?: Date | null;
|
|
573
|
+
/**
|
|
574
|
+
* Date when free trial ends
|
|
575
|
+
* @readonly
|
|
576
|
+
*/
|
|
577
|
+
endDate?: Date | null;
|
|
578
|
+
}
|
|
579
|
+
export interface UpdateBillingDateData {
|
|
580
|
+
/**
|
|
581
|
+
* Date until the subscription is paid for.
|
|
582
|
+
* Different from `nextBillingDate` only when the next billing date is updated without immediately issuing a new invoice.
|
|
583
|
+
*/
|
|
584
|
+
paidUntil?: Date | null;
|
|
585
|
+
/** Information about how to adjust the item's payment due to the update of the billing date */
|
|
586
|
+
proration?: Proration;
|
|
587
|
+
}
|
|
588
|
+
export interface Proration extends ProrationTypeOneOf {
|
|
589
|
+
/**
|
|
590
|
+
* BASS automatically calculates the proration amount based on the number
|
|
591
|
+
* of days added to or removed from the current billing cycle. BASS uses
|
|
592
|
+
* this formula to calculate the charge or credit amount:
|
|
593
|
+
* `(Subscription total for the current billing cycle) * (number of days added to or removed from the current billing cycle) / (total number of days for the current billing cycle before the adjustment)`.
|
|
594
|
+
* For example, the customer has paid 100 UDS for the current
|
|
595
|
+
* billing cycle that last 31 days, and you want to extend the cycle by 8
|
|
596
|
+
* days. Then, BASS calculates the proration amount like this:
|
|
597
|
+
* `100 USD * 8 days / 31 days`, which equals `25.81 USD`.
|
|
598
|
+
*/
|
|
599
|
+
timeBased?: TimeBasedProration;
|
|
600
|
+
/** Proration amount that's based on your custom calculation. */
|
|
601
|
+
custom?: CustomProration;
|
|
602
|
+
}
|
|
603
|
+
/** @oneof */
|
|
604
|
+
export interface ProrationTypeOneOf {
|
|
605
|
+
/**
|
|
606
|
+
* BASS automatically calculates the proration amount based on the number
|
|
607
|
+
* of days added to or removed from the current billing cycle. BASS uses
|
|
608
|
+
* this formula to calculate the charge or credit amount:
|
|
609
|
+
* `(Subscription total for the current billing cycle) * (number of days added to or removed from the current billing cycle) / (total number of days for the current billing cycle before the adjustment)`.
|
|
610
|
+
* For example, the customer has paid 100 UDS for the current
|
|
611
|
+
* billing cycle that last 31 days, and you want to extend the cycle by 8
|
|
612
|
+
* days. Then, BASS calculates the proration amount like this:
|
|
613
|
+
* `100 USD * 8 days / 31 days`, which equals `25.81 USD`.
|
|
614
|
+
*/
|
|
615
|
+
timeBased?: TimeBasedProration;
|
|
616
|
+
/** Proration amount that's based on your custom calculation. */
|
|
617
|
+
custom?: CustomProration;
|
|
618
|
+
}
|
|
619
|
+
export interface TimeBasedProration {
|
|
620
|
+
}
|
|
621
|
+
export interface CustomProration extends CustomProrationAmountOneOf {
|
|
622
|
+
/**
|
|
623
|
+
* Proration charge amount that's based on your custom calculation.
|
|
624
|
+
* Increases the total that the customer must pay with the next invoice.
|
|
625
|
+
*
|
|
626
|
+
* Min: `0.01`
|
|
627
|
+
*/
|
|
628
|
+
charge?: string;
|
|
629
|
+
/**
|
|
630
|
+
* Proration credit amount that's based on your custom calculation.
|
|
631
|
+
* Lowers the total that the customer must pay with the next invoice.
|
|
632
|
+
*
|
|
633
|
+
* Min: `0.01`
|
|
634
|
+
*/
|
|
635
|
+
credit?: string;
|
|
636
|
+
}
|
|
637
|
+
/** @oneof */
|
|
638
|
+
export interface CustomProrationAmountOneOf {
|
|
639
|
+
/**
|
|
640
|
+
* Proration charge amount that's based on your custom calculation.
|
|
641
|
+
* Increases the total that the customer must pay with the next invoice.
|
|
642
|
+
*
|
|
643
|
+
* Min: `0.01`
|
|
644
|
+
*/
|
|
645
|
+
charge?: string;
|
|
646
|
+
/**
|
|
647
|
+
* Proration credit amount that's based on your custom calculation.
|
|
648
|
+
* Lowers the total that the customer must pay with the next invoice.
|
|
649
|
+
*
|
|
650
|
+
* Min: `0.01`
|
|
651
|
+
*/
|
|
652
|
+
credit?: string;
|
|
653
|
+
}
|
|
654
|
+
export interface GracePeriodData {
|
|
655
|
+
/**
|
|
656
|
+
* Grace period start date
|
|
657
|
+
* @readonly
|
|
658
|
+
*/
|
|
659
|
+
startDate?: Date | null;
|
|
660
|
+
/**
|
|
661
|
+
* Grace period end date
|
|
662
|
+
* @readonly
|
|
663
|
+
*/
|
|
664
|
+
endDate?: Date | null;
|
|
665
|
+
/** Automatic retry data during grade period, if have any. Optional. */
|
|
666
|
+
automaticRetryData?: AutomaticRetryData;
|
|
667
|
+
}
|
|
668
|
+
export interface AutomaticRetryData {
|
|
669
|
+
enabled?: boolean;
|
|
670
|
+
}
|
|
671
|
+
export interface SubscriptionPolicies {
|
|
672
|
+
/** Subscription can be canceled by the customer who bought it */
|
|
673
|
+
customerCanCancel?: boolean;
|
|
674
|
+
/** Subscription end date can be updated by business */
|
|
675
|
+
businessCanExtend?: boolean;
|
|
676
|
+
/** Subscription can be canceled not only immediately, but also at end of billing cycle by turning off auto-renew */
|
|
677
|
+
allowEndOfCycleCancellation?: boolean;
|
|
678
|
+
}
|
|
679
|
+
export interface PauseInfo {
|
|
680
|
+
pausePolicy?: PausePolicy;
|
|
681
|
+
pauseAt?: PauseAt;
|
|
682
|
+
startDate?: Date | null;
|
|
683
|
+
startCycle?: number | null;
|
|
684
|
+
resumeAt?: ResumeAt;
|
|
685
|
+
resumeDate?: Date | null;
|
|
686
|
+
resumeCycle?: number | null;
|
|
687
|
+
}
|
|
688
|
+
export declare enum PausePolicy {
|
|
689
|
+
NONE = "NONE",
|
|
690
|
+
/** Pause the payment and the service. When resuming, the subscription end date is extended by the number of cycles postponed, and if the pause happened in a middle of a cycle, the payment date is postponed by the amount of days that already paid. */
|
|
691
|
+
SERVICE_AND_PAYMENTS = "SERVICE_AND_PAYMENTS",
|
|
692
|
+
/** Pause the service and continue the billing. When resuming, extend the service by the time that was paused */
|
|
693
|
+
SERVICE_ONLY = "SERVICE_ONLY"
|
|
694
|
+
}
|
|
695
|
+
export declare enum PauseAt {
|
|
696
|
+
/** Cancel scheduled pause */
|
|
697
|
+
NONE = "NONE",
|
|
698
|
+
/** Pause the subscription now */
|
|
699
|
+
IMMEDIATELY = "IMMEDIATELY",
|
|
700
|
+
/** Pause the subscription at the next billing date */
|
|
701
|
+
NEXT_BILLING_DATE = "NEXT_BILLING_DATE",
|
|
702
|
+
/** A specific date must be defined in Schedule.specific_date */
|
|
703
|
+
SPECIFIC_DATE = "SPECIFIC_DATE",
|
|
704
|
+
/** The number of cycles must be defined in Schedule.number_of_cycles */
|
|
705
|
+
NUMBER_OF_CYCLES_FROM_TODAY = "NUMBER_OF_CYCLES_FROM_TODAY"
|
|
706
|
+
}
|
|
707
|
+
export declare enum ResumeAt {
|
|
708
|
+
/** Cancel scheduled resume */
|
|
709
|
+
NONE = "NONE",
|
|
710
|
+
/** Resume the subscription now */
|
|
711
|
+
IMMEDIATELY = "IMMEDIATELY",
|
|
712
|
+
/** Resume the subscription at the next billing date */
|
|
713
|
+
NEXT_BILLING_DATE = "NEXT_BILLING_DATE",
|
|
714
|
+
/** A specific date must be defined in Schedule.specific_date */
|
|
715
|
+
SPECIFIC_DATE = "SPECIFIC_DATE"
|
|
716
|
+
}
|
|
717
|
+
export interface CancellationInfo {
|
|
718
|
+
/** Subscription cancel date. Can contain a future or past date */
|
|
719
|
+
cancellationDate?: Date | null;
|
|
720
|
+
/** Initiator for cancellation */
|
|
721
|
+
initiator?: HistoryActionInitiator;
|
|
722
|
+
/** Reason for cancellation. Optional. */
|
|
723
|
+
reason?: string | null;
|
|
724
|
+
}
|
|
725
|
+
export declare enum HistoryActionInitiator {
|
|
726
|
+
UNDEFINED = "UNDEFINED",
|
|
727
|
+
BUSINESS = "BUSINESS",
|
|
728
|
+
CUSTOMER = "CUSTOMER",
|
|
729
|
+
SYSTEM = "SYSTEM",
|
|
730
|
+
PAYMENT_FAILURE = "PAYMENT_FAILURE"
|
|
731
|
+
}
|
|
732
|
+
export interface SubscriptionUpdateData {
|
|
733
|
+
itemsToUpdate?: ItemChange[];
|
|
734
|
+
itemsToAdd?: Item[];
|
|
735
|
+
itemsToDelete?: string[] | null;
|
|
736
|
+
/** @readonly */
|
|
737
|
+
numberOfRequests?: number;
|
|
738
|
+
}
|
|
739
|
+
export interface ItemChange {
|
|
740
|
+
/** Item ID */
|
|
741
|
+
_id?: string;
|
|
742
|
+
pricingModel?: PricingModel;
|
|
743
|
+
quantity?: number | null;
|
|
744
|
+
tax?: Tax;
|
|
745
|
+
}
|
|
746
|
+
export interface PricingModel extends PricingModelModelOneOf {
|
|
747
|
+
/** Details about the fixed item price. */
|
|
748
|
+
fixedPrice?: FixedPrice;
|
|
749
|
+
}
|
|
750
|
+
/** @oneof */
|
|
751
|
+
export interface PricingModelModelOneOf {
|
|
752
|
+
/** Details about the fixed item price. */
|
|
753
|
+
fixedPrice?: FixedPrice;
|
|
754
|
+
}
|
|
755
|
+
export interface FixedPrice {
|
|
756
|
+
/**
|
|
757
|
+
* Fixed item price with a period as a decimal separator. For example, `3.99`.
|
|
758
|
+
* Price doesn't include tax, discounts, or application fee.
|
|
759
|
+
*
|
|
760
|
+
* Min: `0.01`
|
|
761
|
+
*/
|
|
762
|
+
itemPrice?: string;
|
|
763
|
+
}
|
|
764
|
+
export interface Item {
|
|
765
|
+
/**
|
|
766
|
+
* Unique identifier of subscription item. Automatically generated and read-only.
|
|
767
|
+
* @readonly
|
|
768
|
+
*/
|
|
769
|
+
_id?: string | null;
|
|
770
|
+
/** Name of the item. Typically product name. */
|
|
771
|
+
name?: string;
|
|
772
|
+
/** Description of the item. */
|
|
773
|
+
description?: string | null;
|
|
774
|
+
/** References to external product catalog data known to client. */
|
|
775
|
+
catalogReference?: CatalogReference;
|
|
776
|
+
/** Category of item. Whether it is digital or physical one. */
|
|
777
|
+
category?: ItemCategory;
|
|
778
|
+
/** Amount of products */
|
|
779
|
+
quantity?: number;
|
|
780
|
+
/** Pricing model of the item. Whether fixed price or dynamic price models. */
|
|
781
|
+
pricingModel?: PricingModel;
|
|
782
|
+
/** Tax, positive value, optional */
|
|
783
|
+
tax?: Tax;
|
|
784
|
+
/** Discounts applied on item price */
|
|
785
|
+
discounts?: Discount[];
|
|
786
|
+
/** Application specific fee, positive value, optional (if application_fee == 0, don't include it to request). Only positive values. */
|
|
787
|
+
applicationFee?: ApplicationFee;
|
|
788
|
+
/**
|
|
789
|
+
* External reference identifier for mapping item in consumer's system.
|
|
790
|
+
* This allows the consumer to correlate the item in their system with the item in this API.
|
|
791
|
+
*/
|
|
792
|
+
externalId?: string | null;
|
|
793
|
+
/**
|
|
794
|
+
* Key / Value store to keep up to 10 additional values related to the subscription item.
|
|
795
|
+
* Key max length = 50, Value max length = 200. Value can not be empty.
|
|
796
|
+
* Should not include any sensitive or PII information.
|
|
797
|
+
*/
|
|
798
|
+
metadata?: Record<string, string>;
|
|
799
|
+
}
|
|
800
|
+
export interface CatalogReference {
|
|
801
|
+
/** Product ID from the external catalog. */
|
|
802
|
+
catalogItemId?: string;
|
|
803
|
+
/**
|
|
804
|
+
* ID of the app that the product catalog belongs to.
|
|
805
|
+
* When omitted, BASS assumes that the product belongs to the subscription's
|
|
806
|
+
* `origin.appId`.
|
|
807
|
+
*
|
|
808
|
+
* Min: 1 character
|
|
809
|
+
* Max: 50 characters
|
|
810
|
+
*/
|
|
811
|
+
appId?: string | null;
|
|
812
|
+
}
|
|
813
|
+
export declare enum ItemCategory {
|
|
814
|
+
UNKNOWN = "UNKNOWN",
|
|
815
|
+
PHYSICAL = "PHYSICAL",
|
|
816
|
+
DIGITAL = "DIGITAL"
|
|
817
|
+
}
|
|
818
|
+
export interface ApplicationFee extends ApplicationFeeValueOneOf {
|
|
819
|
+
/** Amount of the application fee in `0.00` format. */
|
|
820
|
+
amount?: string;
|
|
821
|
+
/**
|
|
822
|
+
* Discounts for the application fee.
|
|
823
|
+
*
|
|
824
|
+
* Max: 5 discounts
|
|
825
|
+
*/
|
|
826
|
+
discounts?: Discount[];
|
|
827
|
+
}
|
|
828
|
+
/** @oneof */
|
|
829
|
+
export interface ApplicationFeeValueOneOf {
|
|
830
|
+
/** Amount of the application fee in `0.00` format. */
|
|
831
|
+
amount?: string;
|
|
832
|
+
}
|
|
833
|
+
export interface SpecificDateSubscriptionUpdateData {
|
|
834
|
+
updateData?: SubscriptionUpdateData;
|
|
835
|
+
executionDate?: Date | null;
|
|
836
|
+
}
|
|
837
|
+
export interface PlatformOrigin {
|
|
838
|
+
appId?: string | null;
|
|
839
|
+
entityId?: string | null;
|
|
840
|
+
}
|
|
841
|
+
export interface InvoiceMarkedAsPaid {
|
|
842
|
+
/** The subscription for which one of the invoices has been marked as paid */
|
|
843
|
+
subscription?: Subscription;
|
|
844
|
+
/** The cycle that has been marked as paid */
|
|
845
|
+
paidCycle?: number;
|
|
846
|
+
/** The invoice ID that has been marked as paid */
|
|
847
|
+
invoiceId?: string;
|
|
848
|
+
/** The transaction ID of the payment order that has been marked as paid */
|
|
849
|
+
paymentTransactionId?: string | null;
|
|
850
|
+
}
|
|
851
|
+
export interface ListSubscriptionHistoryRequest {
|
|
852
|
+
subscriptionId: string;
|
|
853
|
+
/** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
|
|
854
|
+
mode?: HistoryViewMode;
|
|
855
|
+
/** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
|
|
856
|
+
cursor?: CursorPaging;
|
|
857
|
+
}
|
|
858
|
+
export declare enum HistoryViewMode {
|
|
859
|
+
UNKNOWN = "UNKNOWN",
|
|
860
|
+
/** Comprehensive view including all history events. */
|
|
861
|
+
BACKOFFICE = "BACKOFFICE",
|
|
862
|
+
/** User-centric view of the history. */
|
|
863
|
+
USER = "USER"
|
|
864
|
+
}
|
|
865
|
+
export interface CursorPaging {
|
|
866
|
+
/** Maximum number of items to return in the results. */
|
|
867
|
+
limit?: number | null;
|
|
868
|
+
/**
|
|
869
|
+
* Pointer to the next or previous page in the list of results.
|
|
870
|
+
*
|
|
871
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
872
|
+
* Not relevant for the first request.
|
|
873
|
+
*/
|
|
874
|
+
cursor?: string | null;
|
|
875
|
+
}
|
|
876
|
+
export interface ListSubscriptionHistoryResponse {
|
|
877
|
+
/** List of history entries for the subscription. */
|
|
878
|
+
historyEntries?: SubscriptionHistoryEntry[];
|
|
879
|
+
/** Paging metadata. A `next` cursor is returned if there are more results. */
|
|
880
|
+
pagingMetadata?: PagingMetadataV2;
|
|
881
|
+
}
|
|
882
|
+
export interface SubscriptionHistoryEntry {
|
|
883
|
+
entryId?: string;
|
|
884
|
+
/** TODO: add max length? it is not defined in domainevents, so should we? */
|
|
885
|
+
slug?: string;
|
|
886
|
+
entryTime?: Date | null;
|
|
887
|
+
event?: SubscriptionEvent;
|
|
888
|
+
}
|
|
889
|
+
export interface SubscriptionEvent extends SubscriptionEventPayloadOneOf {
|
|
890
|
+
created?: SubscriptionCreated;
|
|
891
|
+
updated?: SubscriptionUpdated;
|
|
892
|
+
deleted?: SubscriptionDeleted;
|
|
893
|
+
activated?: SubscriptionActivated;
|
|
894
|
+
ended?: SubscriptionEnded;
|
|
895
|
+
canceled?: SubscriptionCanceled;
|
|
896
|
+
paused?: SubscriptionPaused;
|
|
897
|
+
resumed?: SubscriptionResumed;
|
|
898
|
+
pauseRequested?: PauseSubscriptionRequested;
|
|
899
|
+
resumeRequested?: ResumeSubscriptionRequested;
|
|
900
|
+
scheduledPauseCanceled?: ScheduledPauseCanceled;
|
|
901
|
+
scheduledResumeCanceled?: ScheduledResumeCanceled;
|
|
902
|
+
billingCycleStarted?: SubscriptionBillingCycleStarted;
|
|
903
|
+
autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
|
|
904
|
+
autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
|
|
905
|
+
cycleReadyToPay?: SubscriptionCycleReadyToPay;
|
|
906
|
+
extended?: SubscriptionExtended;
|
|
907
|
+
initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
|
|
908
|
+
latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
|
|
909
|
+
revived?: SubscriptionRevived;
|
|
910
|
+
billingDateUpdated?: SubscriptionBillingDateUpdated;
|
|
911
|
+
futureUpdatesRequested?: FutureUpdatesRequested;
|
|
912
|
+
updatesApplied?: UpdatesApplied;
|
|
913
|
+
resetPendingUpdates?: ResetPendingUpdates;
|
|
914
|
+
gracePeriodStarted?: GracePeriodStarted;
|
|
915
|
+
gracePeriodEnded?: GracePeriodEnded;
|
|
916
|
+
paymentMethodUpdated?: PaymentMethodUpdated;
|
|
917
|
+
collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
|
|
918
|
+
freeTrailStarted?: FreeTrailStarted;
|
|
919
|
+
freeTrailEnded?: FreeTrailEnded;
|
|
920
|
+
invoiceMarkedAsPaid?: InvoiceMarkedAsPaid;
|
|
921
|
+
initiatePaymentMethodSetup?: InitiatedPaymentMethodSetup;
|
|
922
|
+
subscriptionBoAction?: SubscriptionBackOfficeAction;
|
|
923
|
+
unknown?: UnknownSubscriptionEvent;
|
|
924
|
+
}
|
|
925
|
+
/** @oneof */
|
|
926
|
+
export interface SubscriptionEventPayloadOneOf {
|
|
927
|
+
created?: SubscriptionCreated;
|
|
928
|
+
updated?: SubscriptionUpdated;
|
|
929
|
+
deleted?: SubscriptionDeleted;
|
|
930
|
+
activated?: SubscriptionActivated;
|
|
931
|
+
ended?: SubscriptionEnded;
|
|
932
|
+
canceled?: SubscriptionCanceled;
|
|
933
|
+
paused?: SubscriptionPaused;
|
|
934
|
+
resumed?: SubscriptionResumed;
|
|
935
|
+
pauseRequested?: PauseSubscriptionRequested;
|
|
936
|
+
resumeRequested?: ResumeSubscriptionRequested;
|
|
937
|
+
scheduledPauseCanceled?: ScheduledPauseCanceled;
|
|
938
|
+
scheduledResumeCanceled?: ScheduledResumeCanceled;
|
|
939
|
+
billingCycleStarted?: SubscriptionBillingCycleStarted;
|
|
940
|
+
autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOn;
|
|
941
|
+
autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOff;
|
|
942
|
+
cycleReadyToPay?: SubscriptionCycleReadyToPay;
|
|
943
|
+
extended?: SubscriptionExtended;
|
|
944
|
+
initialPurchaseCompleted?: SubscriptionInitialPurchaseCompleted;
|
|
945
|
+
latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaid;
|
|
946
|
+
revived?: SubscriptionRevived;
|
|
947
|
+
billingDateUpdated?: SubscriptionBillingDateUpdated;
|
|
948
|
+
futureUpdatesRequested?: FutureUpdatesRequested;
|
|
949
|
+
updatesApplied?: UpdatesApplied;
|
|
950
|
+
resetPendingUpdates?: ResetPendingUpdates;
|
|
951
|
+
gracePeriodStarted?: GracePeriodStarted;
|
|
952
|
+
gracePeriodEnded?: GracePeriodEnded;
|
|
953
|
+
paymentMethodUpdated?: PaymentMethodUpdated;
|
|
954
|
+
collectionMethodUpdated?: SubscriptionCollectionMethodUpdated;
|
|
955
|
+
freeTrailStarted?: FreeTrailStarted;
|
|
956
|
+
freeTrailEnded?: FreeTrailEnded;
|
|
957
|
+
invoiceMarkedAsPaid?: InvoiceMarkedAsPaid;
|
|
958
|
+
initiatePaymentMethodSetup?: InitiatedPaymentMethodSetup;
|
|
959
|
+
subscriptionBoAction?: SubscriptionBackOfficeAction;
|
|
960
|
+
unknown?: UnknownSubscriptionEvent;
|
|
961
|
+
}
|
|
962
|
+
export interface SubscriptionCreated {
|
|
963
|
+
subscription?: Subscription;
|
|
964
|
+
}
|
|
965
|
+
export interface SubscriptionUpdated {
|
|
966
|
+
current?: Subscription;
|
|
967
|
+
previous?: Subscription;
|
|
968
|
+
diff?: SubscriptionDiff;
|
|
969
|
+
}
|
|
970
|
+
export interface SubscriptionDiff {
|
|
971
|
+
added?: string | null;
|
|
972
|
+
changed?: string | null;
|
|
973
|
+
deleted?: string | null;
|
|
974
|
+
}
|
|
975
|
+
export interface SubscriptionDeleted {
|
|
976
|
+
subscriptionId?: string;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Sent each time a subscription status has been set to Active
|
|
980
|
+
* Active shows that a subscription is live and operational.
|
|
981
|
+
* For example:
|
|
982
|
+
* * For subscription with free trial, free trial start date is also the activation date.
|
|
983
|
+
* * For a subscription with future start date, the start date is also the activation date.
|
|
984
|
+
* * When a subscription is resumed from a pause status, the resume date is also the activation date.
|
|
985
|
+
*/
|
|
986
|
+
export interface SubscriptionActivated {
|
|
987
|
+
subscription?: Subscription;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Sent each time a subscription status has been set to Ended
|
|
991
|
+
* Ended shows that a subscription reached its end date and ended its life cycle as a result of the agreement.
|
|
992
|
+
* This is different from a Canceled subscription which ends the subscription before a designated end date.
|
|
993
|
+
* Therefore, Ended and Canceled are mutually exclusive.
|
|
994
|
+
*/
|
|
995
|
+
export interface SubscriptionEnded {
|
|
996
|
+
subscription?: Subscription;
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Sent each time a subscription status has been set to Canceled
|
|
1000
|
+
* Canceled shows that a subscription was canceled and ended its life cycle as a result of some intervention
|
|
1001
|
+
* For example:
|
|
1002
|
+
* * A user decided to cancel a subscription before the original end date
|
|
1003
|
+
* * A subscription is canceled due to bad payment
|
|
1004
|
+
*/
|
|
1005
|
+
export interface SubscriptionCanceled {
|
|
1006
|
+
subscription?: Subscription;
|
|
1007
|
+
actionDetails?: ActionDetails;
|
|
1008
|
+
}
|
|
1009
|
+
export interface ActionDetails {
|
|
1010
|
+
initiator?: HistoryActionInitiator;
|
|
1011
|
+
reason?: string | null;
|
|
1012
|
+
}
|
|
1013
|
+
export interface SubscriptionPaused {
|
|
1014
|
+
subscription?: Subscription;
|
|
1015
|
+
pausePolicy?: PausePolicy;
|
|
1016
|
+
actionDetails?: ActionDetails;
|
|
1017
|
+
}
|
|
1018
|
+
export interface SubscriptionResumed {
|
|
1019
|
+
subscription?: Subscription;
|
|
1020
|
+
actionDetails?: ActionDetails;
|
|
1021
|
+
}
|
|
1022
|
+
export interface PauseSubscriptionRequested {
|
|
1023
|
+
subscription?: Subscription;
|
|
1024
|
+
pauseAt?: PauseAt;
|
|
1025
|
+
pausePolicy?: PausePolicy;
|
|
1026
|
+
actionDetails?: ActionDetails;
|
|
1027
|
+
}
|
|
1028
|
+
export interface ResumeSubscriptionRequested {
|
|
1029
|
+
subscription?: Subscription;
|
|
1030
|
+
resumeAt?: ResumeAt;
|
|
1031
|
+
actionDetails?: ActionDetails;
|
|
1032
|
+
}
|
|
1033
|
+
export interface ScheduledPauseCanceled {
|
|
1034
|
+
subscription?: Subscription;
|
|
1035
|
+
actionDetails?: ActionDetails;
|
|
1036
|
+
}
|
|
1037
|
+
export interface ScheduledResumeCanceled {
|
|
1038
|
+
subscription?: Subscription;
|
|
1039
|
+
actionDetails?: ActionDetails;
|
|
1040
|
+
}
|
|
1041
|
+
export interface SubscriptionBillingCycleStarted {
|
|
1042
|
+
subscription?: Subscription;
|
|
1043
|
+
/** Wix Pay transaction id, optional. Exists if event was triggered by a payment. */
|
|
1044
|
+
paymentTransactionId?: string | null;
|
|
1045
|
+
}
|
|
1046
|
+
export interface SubscriptionAutoRenewalTurnedOn {
|
|
1047
|
+
subscription?: Subscription;
|
|
1048
|
+
actionDetails?: ActionDetails;
|
|
1049
|
+
}
|
|
1050
|
+
export interface SubscriptionAutoRenewalTurnedOff {
|
|
1051
|
+
subscription?: Subscription;
|
|
1052
|
+
actionDetails?: ActionDetails;
|
|
1053
|
+
}
|
|
1054
|
+
export interface SubscriptionCycleReadyToPay {
|
|
1055
|
+
subscription?: Subscription;
|
|
1056
|
+
}
|
|
1057
|
+
export interface SubscriptionExtended extends SubscriptionExtendedExtendPolicyOneOf {
|
|
1058
|
+
extensionPeriod?: Duration;
|
|
1059
|
+
extensionBillingCycles?: number;
|
|
1060
|
+
subscription?: Subscription;
|
|
1061
|
+
actionDetails?: ActionDetails;
|
|
1062
|
+
}
|
|
1063
|
+
/** @oneof */
|
|
1064
|
+
export interface SubscriptionExtendedExtendPolicyOneOf {
|
|
1065
|
+
extensionPeriod?: Duration;
|
|
1066
|
+
extensionBillingCycles?: number;
|
|
1067
|
+
}
|
|
1068
|
+
export interface SubscriptionInitialPurchaseCompleted {
|
|
1069
|
+
subscription?: Subscription;
|
|
1070
|
+
actionDetails?: ActionDetails;
|
|
1071
|
+
paymentTransactionId?: string | null;
|
|
1072
|
+
}
|
|
1073
|
+
export interface LatestInvoiceMarkedAsPaid {
|
|
1074
|
+
subscription?: Subscription;
|
|
1075
|
+
}
|
|
1076
|
+
export interface SubscriptionRevived {
|
|
1077
|
+
subscription?: Subscription;
|
|
1078
|
+
}
|
|
1079
|
+
export interface SubscriptionBillingDateUpdated {
|
|
1080
|
+
subscription?: Subscription;
|
|
1081
|
+
billingDate?: Date | null;
|
|
1082
|
+
proration?: Proration;
|
|
1083
|
+
}
|
|
1084
|
+
export interface FutureUpdatesRequested {
|
|
1085
|
+
subscription?: Subscription;
|
|
1086
|
+
requestedUpdateData?: SubscriptionUpdateData;
|
|
1087
|
+
}
|
|
1088
|
+
export interface UpdatesApplied {
|
|
1089
|
+
subscription?: Subscription;
|
|
1090
|
+
updateAction?: UpdateAction;
|
|
1091
|
+
appliedUpdateData?: SubscriptionUpdateData;
|
|
1092
|
+
}
|
|
1093
|
+
export declare enum UpdateAction {
|
|
1094
|
+
NONE = "NONE",
|
|
1095
|
+
/** Update subscription immediately, please note proration for updates changing price are not yet supported */
|
|
1096
|
+
IMMEDIATELY = "IMMEDIATELY",
|
|
1097
|
+
/** Request updates that will take affect only at the start of the next billing cycle. */
|
|
1098
|
+
NEXT_BILLING_CYCLE = "NEXT_BILLING_CYCLE",
|
|
1099
|
+
/** Reset all pending updates */
|
|
1100
|
+
RESET_PENDING_UPDATES = "RESET_PENDING_UPDATES",
|
|
1101
|
+
/** Request updates that will take affect only at a specific date. */
|
|
1102
|
+
SPECIFIC_DATE = "SPECIFIC_DATE"
|
|
1103
|
+
}
|
|
1104
|
+
export interface ResetPendingUpdates {
|
|
1105
|
+
subscription?: Subscription;
|
|
1106
|
+
}
|
|
1107
|
+
export interface GracePeriodStarted {
|
|
1108
|
+
subscription?: Subscription;
|
|
1109
|
+
}
|
|
1110
|
+
export interface GracePeriodEnded {
|
|
1111
|
+
subscription?: Subscription;
|
|
1112
|
+
/** Indication for the payment settlement method. */
|
|
1113
|
+
paymentSettlementMethod?: PaymentSettlementMethod;
|
|
1114
|
+
}
|
|
1115
|
+
export declare enum PaymentSettlementMethod {
|
|
1116
|
+
UNKNOWN = "UNKNOWN",
|
|
1117
|
+
/** System-defined payment settlement. */
|
|
1118
|
+
SYSTEM = "SYSTEM",
|
|
1119
|
+
/** Manually mark the payment as paid. */
|
|
1120
|
+
MARK_AS_PAID = "MARK_AS_PAID",
|
|
1121
|
+
/** Require the customer to pay immediately, by insert a new payment method. */
|
|
1122
|
+
CUSTOMER_PAY_NOW = "CUSTOMER_PAY_NOW"
|
|
1123
|
+
}
|
|
1124
|
+
export interface PaymentMethodUpdated {
|
|
1125
|
+
subscription?: Subscription;
|
|
1126
|
+
initiator?: HistoryActionInitiator;
|
|
1127
|
+
paymentMode?: PaymentMode;
|
|
1128
|
+
}
|
|
1129
|
+
export declare enum PaymentMode {
|
|
1130
|
+
NONE = "NONE",
|
|
1131
|
+
/** The latest invoice of the subscription will be charged. */
|
|
1132
|
+
CHARGE = "CHARGE",
|
|
1133
|
+
/** An authorization invoice with zero amount will be created. */
|
|
1134
|
+
AUTHORIZATION = "AUTHORIZATION"
|
|
1135
|
+
}
|
|
1136
|
+
export interface SubscriptionCollectionMethodUpdated {
|
|
1137
|
+
subscription?: Subscription;
|
|
1138
|
+
newCollectionMethod?: CollectionMethodEnumCollectionMethod;
|
|
1139
|
+
previousCollectionMethod?: CollectionMethodEnumCollectionMethod;
|
|
1140
|
+
}
|
|
1141
|
+
export interface FreeTrailStarted {
|
|
1142
|
+
subscription?: Subscription;
|
|
1143
|
+
}
|
|
1144
|
+
export interface FreeTrailEnded {
|
|
1145
|
+
subscription?: Subscription;
|
|
1146
|
+
}
|
|
1147
|
+
export interface InitiatedPaymentMethodSetup {
|
|
1148
|
+
subscription?: Subscription;
|
|
1149
|
+
}
|
|
1150
|
+
export interface SubscriptionBackOfficeAction {
|
|
1151
|
+
subscription?: Subscription;
|
|
1152
|
+
/** The backoffice method name */
|
|
1153
|
+
name?: string;
|
|
1154
|
+
/** json as string format, to store the flatted request object */
|
|
1155
|
+
params?: string;
|
|
1156
|
+
}
|
|
1157
|
+
/** Defines unknown events restored from the logs */
|
|
1158
|
+
export interface UnknownSubscriptionEvent {
|
|
1159
|
+
subscriptionAsString?: string | null;
|
|
1160
|
+
}
|
|
1161
|
+
export interface PagingMetadataV2 {
|
|
1162
|
+
/** Number of items returned in the response. */
|
|
1163
|
+
count?: number | null;
|
|
1164
|
+
/** Offset that was requested. */
|
|
1165
|
+
offset?: number | null;
|
|
1166
|
+
/** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
|
|
1167
|
+
total?: number | null;
|
|
1168
|
+
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
1169
|
+
tooManyToCount?: boolean | null;
|
|
1170
|
+
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
1171
|
+
cursors?: Cursors;
|
|
1172
|
+
}
|
|
1173
|
+
export interface Cursors {
|
|
1174
|
+
/** Cursor string pointing to the next page in the list of results. */
|
|
1175
|
+
next?: string | null;
|
|
1176
|
+
/** Cursor pointing to the previous page in the list of results. */
|
|
1177
|
+
prev?: string | null;
|
|
1178
|
+
}
|
|
1179
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
1180
|
+
createdEvent?: EntityCreatedEvent;
|
|
1181
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
1182
|
+
deletedEvent?: EntityDeletedEvent;
|
|
1183
|
+
actionEvent?: ActionEvent;
|
|
1184
|
+
/**
|
|
1185
|
+
* Unique event ID.
|
|
1186
|
+
* Allows clients to ignore duplicate webhooks.
|
|
1187
|
+
*/
|
|
1188
|
+
_id?: string;
|
|
1189
|
+
/**
|
|
1190
|
+
* Assumes actions are also always typed to an entity_type
|
|
1191
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
1192
|
+
*/
|
|
1193
|
+
entityFqdn?: string;
|
|
1194
|
+
/**
|
|
1195
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
1196
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
1197
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
1198
|
+
*/
|
|
1199
|
+
slug?: string;
|
|
1200
|
+
/** ID of the entity associated with the event. */
|
|
1201
|
+
entityId?: string;
|
|
1202
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
1203
|
+
eventTime?: Date | null;
|
|
1204
|
+
/**
|
|
1205
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
1206
|
+
* (for example, GDPR).
|
|
1207
|
+
*/
|
|
1208
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
1209
|
+
/** If present, indicates the action that triggered the event. */
|
|
1210
|
+
originatedFrom?: string | null;
|
|
1211
|
+
/**
|
|
1212
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
1213
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
1214
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
1215
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
1216
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
1217
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
1218
|
+
*/
|
|
1219
|
+
entityEventSequence?: string | null;
|
|
1220
|
+
}
|
|
1221
|
+
/** @oneof */
|
|
1222
|
+
export interface DomainEventBodyOneOf {
|
|
1223
|
+
createdEvent?: EntityCreatedEvent;
|
|
1224
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
1225
|
+
deletedEvent?: EntityDeletedEvent;
|
|
1226
|
+
actionEvent?: ActionEvent;
|
|
1227
|
+
}
|
|
1228
|
+
export interface EntityCreatedEvent {
|
|
1229
|
+
entity?: string;
|
|
1230
|
+
}
|
|
1231
|
+
export interface RestoreInfo {
|
|
1232
|
+
deletedDate?: Date | null;
|
|
1233
|
+
}
|
|
1234
|
+
export interface EntityUpdatedEvent {
|
|
1235
|
+
/**
|
|
1236
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
1237
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
1238
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
1239
|
+
*/
|
|
1240
|
+
currentEntity?: string;
|
|
1241
|
+
}
|
|
1242
|
+
export interface EntityDeletedEvent {
|
|
1243
|
+
/** Entity that was deleted */
|
|
1244
|
+
deletedEntity?: string | null;
|
|
1245
|
+
}
|
|
1246
|
+
export interface ActionEvent {
|
|
1247
|
+
body?: string;
|
|
1248
|
+
}
|
|
1249
|
+
export interface MessageEnvelope {
|
|
1250
|
+
/** App instance ID. */
|
|
1251
|
+
instanceId?: string | null;
|
|
1252
|
+
/** Event type. */
|
|
1253
|
+
eventType?: string;
|
|
1254
|
+
/** The identification type and identity data. */
|
|
1255
|
+
identity?: IdentificationData;
|
|
1256
|
+
/** Stringify payload. */
|
|
1257
|
+
data?: string;
|
|
1258
|
+
}
|
|
1259
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
1260
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1261
|
+
anonymousVisitorId?: string;
|
|
1262
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1263
|
+
memberId?: string;
|
|
1264
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1265
|
+
wixUserId?: string;
|
|
1266
|
+
/** ID of an app. */
|
|
1267
|
+
appId?: string;
|
|
1268
|
+
/** @readonly */
|
|
1269
|
+
identityType?: WebhookIdentityType;
|
|
1270
|
+
}
|
|
1271
|
+
/** @oneof */
|
|
1272
|
+
export interface IdentificationDataIdOneOf {
|
|
1273
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
1274
|
+
anonymousVisitorId?: string;
|
|
1275
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
1276
|
+
memberId?: string;
|
|
1277
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
1278
|
+
wixUserId?: string;
|
|
1279
|
+
/** ID of an app. */
|
|
1280
|
+
appId?: string;
|
|
1281
|
+
}
|
|
1282
|
+
export declare enum WebhookIdentityType {
|
|
1283
|
+
UNKNOWN = "UNKNOWN",
|
|
1284
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
1285
|
+
MEMBER = "MEMBER",
|
|
1286
|
+
WIX_USER = "WIX_USER",
|
|
1287
|
+
APP = "APP"
|
|
1288
|
+
}
|
|
1289
|
+
export interface GetSubscriptionRequest {
|
|
1290
|
+
_id: string;
|
|
1291
|
+
}
|
|
1292
|
+
export interface GetSubscriptionResponse {
|
|
1293
|
+
subscription?: Subscription;
|
|
1294
|
+
}
|
|
1295
|
+
export interface CustomerCancelSubscriptionRequest {
|
|
1296
|
+
_id: string;
|
|
1297
|
+
/** Optional action reason message */
|
|
1298
|
+
reason?: string | null;
|
|
1299
|
+
}
|
|
1300
|
+
export interface CustomerCancelSubscriptionResponse {
|
|
1301
|
+
subscription?: Subscription;
|
|
1302
|
+
}
|
|
1303
|
+
export interface CustomerTurnOnAutoRenewalRequest {
|
|
1304
|
+
_id: string;
|
|
1305
|
+
/** Optional action reason message */
|
|
1306
|
+
reason?: string | null;
|
|
1307
|
+
}
|
|
1308
|
+
export interface CustomerTurnOnAutoRenewalResponse {
|
|
1309
|
+
subscription?: Subscription;
|
|
1310
|
+
}
|
|
1311
|
+
export interface CustomerTurnOffAutoRenewalRequest {
|
|
1312
|
+
_id: string;
|
|
1313
|
+
/** Optional action reason message */
|
|
1314
|
+
reason?: string | null;
|
|
1315
|
+
}
|
|
1316
|
+
export interface CustomerTurnOffAutoRenewalResponse {
|
|
1317
|
+
subscription?: Subscription;
|
|
1318
|
+
}
|
|
1319
|
+
export interface CustomerExtendSubscriptionRequest {
|
|
1320
|
+
/** The ID of the subscription to be extended */
|
|
1321
|
+
_id: string;
|
|
1322
|
+
/** Optional action reason message */
|
|
1323
|
+
reason?: string | null;
|
|
1324
|
+
/** For termed - Subscription end date will be updated with the extension period and number of cycles will be added */
|
|
1325
|
+
billingCyclesToAdd: number | null;
|
|
1326
|
+
}
|
|
1327
|
+
export interface CustomerExtendSubscriptionResponse {
|
|
1328
|
+
/** The now extended subscription */
|
|
1329
|
+
subscription?: Subscription;
|
|
1330
|
+
}
|
|
1331
|
+
export interface QuerySubscriptionsRequest {
|
|
1332
|
+
query?: QueryV2;
|
|
1333
|
+
}
|
|
1334
|
+
export interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
1335
|
+
/** Paging options to limit and skip the number of items. */
|
|
1336
|
+
paging?: Paging;
|
|
1337
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
1338
|
+
cursorPaging?: CursorPaging;
|
|
1339
|
+
/**
|
|
1340
|
+
* Filter object.
|
|
1341
|
+
*
|
|
1342
|
+
* Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
|
|
1343
|
+
*/
|
|
1344
|
+
filter?: Record<string, any> | null;
|
|
1345
|
+
/**
|
|
1346
|
+
* Sort object.
|
|
1347
|
+
*
|
|
1348
|
+
* Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
|
|
1349
|
+
*/
|
|
1350
|
+
sort?: Sorting[];
|
|
1351
|
+
/** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
|
|
1352
|
+
fields?: string[];
|
|
1353
|
+
/** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
|
|
1354
|
+
fieldsets?: string[];
|
|
1355
|
+
}
|
|
1356
|
+
/** @oneof */
|
|
1357
|
+
export interface QueryV2PagingMethodOneOf {
|
|
1358
|
+
/** Paging options to limit and skip the number of items. */
|
|
1359
|
+
paging?: Paging;
|
|
1360
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
1361
|
+
cursorPaging?: CursorPaging;
|
|
1362
|
+
}
|
|
1363
|
+
export interface Sorting {
|
|
1364
|
+
/** Name of the field to sort by. */
|
|
1365
|
+
fieldName?: string;
|
|
1366
|
+
/** Sort order. */
|
|
1367
|
+
order?: SortOrder;
|
|
1368
|
+
}
|
|
1369
|
+
export declare enum SortOrder {
|
|
1370
|
+
ASC = "ASC",
|
|
1371
|
+
DESC = "DESC"
|
|
1372
|
+
}
|
|
1373
|
+
export interface Paging {
|
|
1374
|
+
/** Number of items to load. */
|
|
1375
|
+
limit?: number | null;
|
|
1376
|
+
/** Number of items to skip in the current sort order. */
|
|
1377
|
+
offset?: number | null;
|
|
1378
|
+
}
|
|
1379
|
+
export interface QuerySubscriptionsResponse {
|
|
1380
|
+
subscriptions?: Subscription[];
|
|
1381
|
+
metadata?: PagingMetadataV2;
|
|
1382
|
+
}
|
|
1383
|
+
export interface CountSubscriptionsRequest {
|
|
1384
|
+
/** Filters to specify which subscriptions are counted. */
|
|
1385
|
+
filter?: CountSubscriptionFilter;
|
|
1386
|
+
}
|
|
1387
|
+
export interface CountSubscriptionFilter extends CountSubscriptionFilterStatusOneOf {
|
|
1388
|
+
/** List of statuses to filter the counted subscriptions by. */
|
|
1389
|
+
statuses?: SubscriptionStatus;
|
|
1390
|
+
/**
|
|
1391
|
+
* Predefined status combination to filter the counted subscriptions by.
|
|
1392
|
+
* + `ALL`: Includes these subscription statuses: `"DRAFT"`, `"PENDING"`, `"ACTIVE"`, `"PAUSED"`, `"ENDED"`, and `"CANCELED"`.
|
|
1393
|
+
* + `LIVE`: Includes these subscription statuses: `"PENDING"`, `"ACTIVE"`, and `"PAUSED"`.
|
|
1394
|
+
*/
|
|
1395
|
+
statusGroup?: SubscriptionStatusGroup;
|
|
1396
|
+
/**
|
|
1397
|
+
* Customer ID to filter the counted subscriptions by. You can pass a
|
|
1398
|
+
* [member ID](https://bo.wix.com/wix-docs/rest/members/members/member-object),
|
|
1399
|
+
* [contact ID](https://bo.wix.com/wix-docs/rest/crm/contacts/contacts-v4/contact-object),
|
|
1400
|
+
* or the ID of an anonymous site visitor as `customerId`. When providing a
|
|
1401
|
+
* `customerId` you must also specify a `paymentMethodId`.
|
|
1402
|
+
*/
|
|
1403
|
+
customerId?: string | null;
|
|
1404
|
+
/**
|
|
1405
|
+
* ID of the payment method to filter the counted subscriptions by.
|
|
1406
|
+
* You must provide a `paymentMethodId` when passing a `customerId`.
|
|
1407
|
+
*/
|
|
1408
|
+
paymentMethodId?: string | null;
|
|
1409
|
+
}
|
|
1410
|
+
/** @oneof */
|
|
1411
|
+
export interface CountSubscriptionFilterStatusOneOf {
|
|
1412
|
+
/** List of statuses to filter the counted subscriptions by. */
|
|
1413
|
+
statuses?: SubscriptionStatus;
|
|
1414
|
+
/**
|
|
1415
|
+
* Predefined status combination to filter the counted subscriptions by.
|
|
1416
|
+
* + `ALL`: Includes these subscription statuses: `"DRAFT"`, `"PENDING"`, `"ACTIVE"`, `"PAUSED"`, `"ENDED"`, and `"CANCELED"`.
|
|
1417
|
+
* + `LIVE`: Includes these subscription statuses: `"PENDING"`, `"ACTIVE"`, and `"PAUSED"`.
|
|
1418
|
+
*/
|
|
1419
|
+
statusGroup?: SubscriptionStatusGroup;
|
|
1420
|
+
}
|
|
1421
|
+
export interface SubscriptionStatus {
|
|
1422
|
+
/**
|
|
1423
|
+
* Statuses to filter the counted subscriptions by.
|
|
1424
|
+
*
|
|
1425
|
+
* Max: 6 statuses
|
|
1426
|
+
*/
|
|
1427
|
+
statuses?: SubscriptionStatusEnumSubscriptionStatus[];
|
|
1428
|
+
}
|
|
1429
|
+
export declare enum SubscriptionStatusGroup {
|
|
1430
|
+
ALL = "ALL",
|
|
1431
|
+
/** Union of ACTIVE, PAUSED and PENDING */
|
|
1432
|
+
LIVE = "LIVE"
|
|
1433
|
+
}
|
|
1434
|
+
export interface CountSubscriptionsResponse {
|
|
1435
|
+
/**
|
|
1436
|
+
* List of statuses and the corresponding number of subscriptions that match
|
|
1437
|
+
* the filters.
|
|
1438
|
+
*/
|
|
1439
|
+
countByStatus?: CountByStatus[];
|
|
1440
|
+
/** Total number of subscriptions that match the filters. */
|
|
1441
|
+
total?: number;
|
|
1442
|
+
}
|
|
1443
|
+
export interface CountByStatus {
|
|
1444
|
+
/** Subscription status. */
|
|
1445
|
+
status?: SubscriptionStatusEnumSubscriptionStatus;
|
|
1446
|
+
/** Number of subscriptions with the status that match the filters. */
|
|
1447
|
+
count?: number;
|
|
1448
|
+
}
|
|
1449
|
+
export interface UpdateSubscriptionPaymentMethodRequest {
|
|
1450
|
+
/** Subscription ID */
|
|
1451
|
+
_id: string;
|
|
1452
|
+
paymentMethodId: string;
|
|
1453
|
+
}
|
|
1454
|
+
export interface UpdateSubscriptionPaymentMethodResponse {
|
|
1455
|
+
subscription?: Subscription;
|
|
1456
|
+
}
|
|
1457
|
+
export interface CustomerAllowedActionsRequest {
|
|
1458
|
+
_id: string;
|
|
1459
|
+
}
|
|
1460
|
+
export interface CustomerAllowedActionsResponse {
|
|
1461
|
+
actions?: Action[];
|
|
1462
|
+
}
|
|
1463
|
+
export interface Action {
|
|
1464
|
+
actionType?: ActionType;
|
|
1465
|
+
pausePolicies?: PausePolicy[];
|
|
1466
|
+
pauseAt?: PauseAt[];
|
|
1467
|
+
resumeAt?: ResumeAt[];
|
|
1468
|
+
extendPolicies?: ExtendPolicyType[];
|
|
1469
|
+
}
|
|
1470
|
+
export declare enum ActionType {
|
|
1471
|
+
NONE = "NONE",
|
|
1472
|
+
CREATION = "CREATION",
|
|
1473
|
+
CANCEL = "CANCEL",
|
|
1474
|
+
CYCLE_AUTO_RENEW_ON = "CYCLE_AUTO_RENEW_ON",
|
|
1475
|
+
CYCLE_AUTO_RENEW_OFF = "CYCLE_AUTO_RENEW_OFF",
|
|
1476
|
+
PAUSE = "PAUSE",
|
|
1477
|
+
RESUME = "RESUME",
|
|
1478
|
+
MARK_AS_PAID = "MARK_AS_PAID",
|
|
1479
|
+
EXTEND = "EXTEND",
|
|
1480
|
+
UPDATE = "UPDATE",
|
|
1481
|
+
UPDATE_START_DATE = "UPDATE_START_DATE",
|
|
1482
|
+
UPM = "UPM",
|
|
1483
|
+
UPDATE_BILLING_DATE = "UPDATE_BILLING_DATE",
|
|
1484
|
+
UPDATE_COLLECTION_METHOD = "UPDATE_COLLECTION_METHOD"
|
|
1485
|
+
}
|
|
1486
|
+
export declare enum ExtendPolicyType {
|
|
1487
|
+
PERIOD = "PERIOD",
|
|
1488
|
+
BILLING_CYCLE = "BILLING_CYCLE"
|
|
1489
|
+
}
|
|
1490
|
+
export interface CustomerListUpcomingChargesRequest {
|
|
1491
|
+
/** Subscription id upcoming charge to be previewed for */
|
|
1492
|
+
_id: string;
|
|
1493
|
+
}
|
|
1494
|
+
export interface CustomerListUpcomingChargesResponse {
|
|
1495
|
+
/** Subscription upcoming charge. Will be empty if no more billing scheduled. */
|
|
1496
|
+
upcomingCharge?: SubscriptionCharge;
|
|
1497
|
+
}
|
|
1498
|
+
export interface SubscriptionCharge {
|
|
1499
|
+
/** cycle of future charge */
|
|
1500
|
+
cycle?: number;
|
|
1501
|
+
/** date of the charge */
|
|
1502
|
+
billingDate?: Date | null;
|
|
1503
|
+
/** breakdown of charge */
|
|
1504
|
+
totals?: Totals;
|
|
1505
|
+
/** List of items in the invoice */
|
|
1506
|
+
invoiceItems?: InvoiceItem[];
|
|
1507
|
+
/** Discount details for the invoice */
|
|
1508
|
+
discount?: InvoiceDiscount;
|
|
1509
|
+
}
|
|
1510
|
+
export interface InvoiceItem extends InvoiceItemPaymentTypeOneOf {
|
|
1511
|
+
/** Information about a line item that's purchased on a recurring basis. */
|
|
1512
|
+
recurring?: Recurring;
|
|
1513
|
+
/**
|
|
1514
|
+
* Empty object that's available when the line item is purchased a single
|
|
1515
|
+
* time, not on a recurring basis.
|
|
1516
|
+
*/
|
|
1517
|
+
oneTime?: OneTime;
|
|
1518
|
+
/** ID of the invoice line item. */
|
|
1519
|
+
_id?: string;
|
|
1520
|
+
/**
|
|
1521
|
+
* ID of the [subscription](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/subscription-object)
|
|
1522
|
+
* that belongs to the invoice line item.
|
|
1523
|
+
*/
|
|
1524
|
+
subscriptionId?: string | null;
|
|
1525
|
+
/**
|
|
1526
|
+
* Name of the invoice line item.
|
|
1527
|
+
* Typically the product name.
|
|
1528
|
+
*
|
|
1529
|
+
* Max: 200 characters
|
|
1530
|
+
*/
|
|
1531
|
+
name?: string;
|
|
1532
|
+
/**
|
|
1533
|
+
* Description of the invoice line item.
|
|
1534
|
+
*
|
|
1535
|
+
* Max: 500 characters
|
|
1536
|
+
*/
|
|
1537
|
+
description?: string | null;
|
|
1538
|
+
/** Information about the product from the external product catalog. */
|
|
1539
|
+
catalogReference?: CatalogReference;
|
|
1540
|
+
/**
|
|
1541
|
+
* Product category.
|
|
1542
|
+
*
|
|
1543
|
+
* + `"UNKNOWN"`: There is no information about the product category.
|
|
1544
|
+
* + `"PHYSICAL"`: A physical product that's shipped to the shipping address.
|
|
1545
|
+
* + `"DIGITAL"`: A digital product that doesn't require shipping.
|
|
1546
|
+
*/
|
|
1547
|
+
category?: ItemCategory;
|
|
1548
|
+
/** Quantity of the invoice line item. */
|
|
1549
|
+
quantity?: number;
|
|
1550
|
+
/** Information about the invoice line item's price. */
|
|
1551
|
+
priceDetails?: PriceDetails;
|
|
1552
|
+
/** Information about the invoice line item's totals */
|
|
1553
|
+
totals?: Totals;
|
|
1554
|
+
/**
|
|
1555
|
+
* Information about the invoice line item's tax data
|
|
1556
|
+
* @readonly
|
|
1557
|
+
*/
|
|
1558
|
+
taxData?: ItemTaxData;
|
|
1559
|
+
}
|
|
1560
|
+
/** @oneof */
|
|
1561
|
+
export interface InvoiceItemPaymentTypeOneOf {
|
|
1562
|
+
/** Information about a line item that's purchased on a recurring basis. */
|
|
1563
|
+
recurring?: Recurring;
|
|
1564
|
+
/**
|
|
1565
|
+
* Empty object that's available when the line item is purchased a single
|
|
1566
|
+
* time, not on a recurring basis.
|
|
1567
|
+
*/
|
|
1568
|
+
oneTime?: OneTime;
|
|
1569
|
+
}
|
|
1570
|
+
export interface Recurring {
|
|
1571
|
+
/**
|
|
1572
|
+
* Number of cycles. Describes how many times a customer purchases the line item
|
|
1573
|
+
* on a recurring basis.
|
|
1574
|
+
*/
|
|
1575
|
+
cycleNumber?: number;
|
|
1576
|
+
}
|
|
1577
|
+
export interface OneTime {
|
|
1578
|
+
}
|
|
1579
|
+
export interface PriceDetails {
|
|
1580
|
+
/**
|
|
1581
|
+
* Price of the invoice line item in `0.00` format.
|
|
1582
|
+
* A minus sign (-) indicates that the amount is negative.
|
|
1583
|
+
*/
|
|
1584
|
+
price?: string;
|
|
1585
|
+
/** Information about the invoice line item's tax. */
|
|
1586
|
+
tax?: Tax;
|
|
1587
|
+
/** Discount that's applied to a specicific invoice line item. */
|
|
1588
|
+
discount?: InvoiceDiscount;
|
|
1589
|
+
/**
|
|
1590
|
+
* Application fee. Set by the origin app, and not by BASS. Wix receives the
|
|
1591
|
+
* full `applicationFee`, while the merchant doesn't receive any portion of it.
|
|
1592
|
+
*/
|
|
1593
|
+
applicationFeeDetails?: InvoiceApplicationFee;
|
|
1594
|
+
}
|
|
1595
|
+
export interface InvoiceDiscount extends InvoiceDiscountValueOneOf {
|
|
1596
|
+
/**
|
|
1597
|
+
* Discount amount.
|
|
1598
|
+
* Available when the discount is an amount.
|
|
1599
|
+
*
|
|
1600
|
+
* Min: `0.01`
|
|
1601
|
+
*/
|
|
1602
|
+
amount?: string;
|
|
1603
|
+
/**
|
|
1604
|
+
* Discount percentage.
|
|
1605
|
+
* Available when the discount is a percentage value.
|
|
1606
|
+
*
|
|
1607
|
+
* Min: `0.01`
|
|
1608
|
+
* Max: `100`
|
|
1609
|
+
*/
|
|
1610
|
+
percentage?: string;
|
|
1611
|
+
/** Indicates the source of the discount. . Contains app_id and entity_id */
|
|
1612
|
+
origin?: DiscountOrigin;
|
|
1613
|
+
}
|
|
1614
|
+
/** @oneof */
|
|
1615
|
+
export interface InvoiceDiscountValueOneOf {
|
|
1616
|
+
/**
|
|
1617
|
+
* Discount amount.
|
|
1618
|
+
* Available when the discount is an amount.
|
|
1619
|
+
*
|
|
1620
|
+
* Min: `0.01`
|
|
1621
|
+
*/
|
|
1622
|
+
amount?: string;
|
|
1623
|
+
/**
|
|
1624
|
+
* Discount percentage.
|
|
1625
|
+
* Available when the discount is a percentage value.
|
|
1626
|
+
*
|
|
1627
|
+
* Min: `0.01`
|
|
1628
|
+
* Max: `100`
|
|
1629
|
+
*/
|
|
1630
|
+
percentage?: string;
|
|
1631
|
+
}
|
|
1632
|
+
export interface InvoiceApplicationFee extends InvoiceApplicationFeeValueOneOf {
|
|
1633
|
+
/**
|
|
1634
|
+
* Application fee amount. Set by the origin app, and not by BASS. Wix
|
|
1635
|
+
* receives the full `applicationFee`, while the merchant doesn't receive
|
|
1636
|
+
* any portion of it.
|
|
1637
|
+
*/
|
|
1638
|
+
amount?: string;
|
|
1639
|
+
/** Information about the discount for the invoice line item's application fee. */
|
|
1640
|
+
discount?: InvoiceDiscount;
|
|
1641
|
+
}
|
|
1642
|
+
/** @oneof */
|
|
1643
|
+
export interface InvoiceApplicationFeeValueOneOf {
|
|
1644
|
+
/**
|
|
1645
|
+
* Application fee amount. Set by the origin app, and not by BASS. Wix
|
|
1646
|
+
* receives the full `applicationFee`, while the merchant doesn't receive
|
|
1647
|
+
* any portion of it.
|
|
1648
|
+
*/
|
|
1649
|
+
amount?: string;
|
|
1650
|
+
}
|
|
1651
|
+
export interface ItemTaxData {
|
|
1652
|
+
/** Aggregated tax from tax_breakdowns */
|
|
1653
|
+
lineItemTaxSummary?: LineItemTaxSummary;
|
|
1654
|
+
/** A detailed description of all the tax authorities applied on this item. */
|
|
1655
|
+
taxBreakdowns?: TaxBreakdown[];
|
|
1656
|
+
}
|
|
1657
|
+
export interface LineItemTaxSummary {
|
|
1658
|
+
/** Calculated from external tax summary */
|
|
1659
|
+
aggregatedTaxAmount?: string;
|
|
1660
|
+
/** Aggregated from tax_breakdowns */
|
|
1661
|
+
aggregatedTaxRate?: string;
|
|
1662
|
+
/** Total taxable amount for this line item. */
|
|
1663
|
+
taxableAmount?: string;
|
|
1664
|
+
/** Aggregated from tax_breakdowns after applying exemptions */
|
|
1665
|
+
finalTaxAmount?: string | null;
|
|
1666
|
+
}
|
|
1667
|
+
export interface TaxBreakdown {
|
|
1668
|
+
taxType?: string;
|
|
1669
|
+
taxRate?: string;
|
|
1670
|
+
taxAmount?: string | null;
|
|
1671
|
+
taxableAmount?: string | null;
|
|
1672
|
+
nonTaxableAmount?: string | null;
|
|
1673
|
+
/** Name of the tax that was calculated. For example, "NY State Sales Tax", "Quebec GST", etc. */
|
|
1674
|
+
taxName?: string | null;
|
|
1675
|
+
/** Jurisdiction that taxes were calculated for. */
|
|
1676
|
+
jurisdiction?: string | null;
|
|
1677
|
+
/** Type of jurisdiction that taxes were calculated for. */
|
|
1678
|
+
jurisdictionType?: string;
|
|
1679
|
+
}
|
|
1680
|
+
export interface InitiatePaymentMethodSetupRequest {
|
|
1681
|
+
_id: string;
|
|
1682
|
+
paymentMode?: PaymentMode;
|
|
1683
|
+
paymentSettings?: PaymentSettings;
|
|
1684
|
+
}
|
|
1685
|
+
export interface PaymentSettings {
|
|
1686
|
+
/** Allowed payment providers for Subscriptions, for example to limit subscriptions to be created only with "Wix Payments" provider. */
|
|
1687
|
+
allowedProviderIds?: string[];
|
|
1688
|
+
/** payment order method, define how the order was applied */
|
|
1689
|
+
orderMethod?: OrderMethod;
|
|
1690
|
+
/** Wix Pay callback url(s) to return buyer to a third party system */
|
|
1691
|
+
redirectUrls?: RedirectUrls;
|
|
1692
|
+
paymentMethodId?: string | null;
|
|
1693
|
+
/**
|
|
1694
|
+
* Specifies an alternative origin for processing the payment.
|
|
1695
|
+
* When set, the payment order will be created with the specified origin
|
|
1696
|
+
* instead of the default origin.
|
|
1697
|
+
*/
|
|
1698
|
+
paymentOrigin?: PaymentOrigin;
|
|
1699
|
+
}
|
|
1700
|
+
export declare enum OrderMethod {
|
|
1701
|
+
UNKNOWN = "UNKNOWN",
|
|
1702
|
+
MOTO = "MOTO",
|
|
1703
|
+
NOT_MOTO = "NOT_MOTO"
|
|
1704
|
+
}
|
|
1705
|
+
export interface RedirectUrls {
|
|
1706
|
+
/** URL to redirect buyer in case of approved (successful) transaction (required) */
|
|
1707
|
+
successUrl?: string;
|
|
1708
|
+
/** URL to redirect buyer in case of failed/rejected transaction (required) */
|
|
1709
|
+
errorUrl?: string;
|
|
1710
|
+
/** URL to redirect buyer in case of buyer canceled the transaction (optional, default: `{error_url}`) */
|
|
1711
|
+
cancelUrl?: string;
|
|
1712
|
+
/**
|
|
1713
|
+
* URL to redirect buyer in case of pending transaction (that might take some time to process) (optional, default:
|
|
1714
|
+
* `{success_url}`)
|
|
1715
|
+
*/
|
|
1716
|
+
pendingUrl?: string;
|
|
1717
|
+
}
|
|
1718
|
+
export interface PaymentOrigin {
|
|
1719
|
+
/** ID of the app for which the Payment will create the order on. For example, Paypal. */
|
|
1720
|
+
appId?: string;
|
|
1721
|
+
/** Id of the entity that order will be created on */
|
|
1722
|
+
instanceId?: string;
|
|
1723
|
+
}
|
|
1724
|
+
export interface InitiatePaymentMethodSetupResponse {
|
|
1725
|
+
paymentOrderId?: string;
|
|
1726
|
+
}
|
|
1727
|
+
export interface SetIsMigratedEvent {
|
|
1728
|
+
subscriptionId?: string;
|
|
1729
|
+
}
|
|
1730
|
+
export interface SubscriptionDelayedSyncEvent {
|
|
1731
|
+
subscriptionId?: string;
|
|
1732
|
+
}
|
|
1733
|
+
export interface InvoiceAction extends InvoiceActionActionTypeOneOf {
|
|
1734
|
+
payRecurring?: PayRecurringInvoice;
|
|
1735
|
+
}
|
|
1736
|
+
/** @oneof */
|
|
1737
|
+
export interface InvoiceActionActionTypeOneOf {
|
|
1738
|
+
payRecurring?: PayRecurringInvoice;
|
|
1739
|
+
}
|
|
1740
|
+
export interface PayRecurringInvoice {
|
|
1741
|
+
invoiceId?: string;
|
|
1742
|
+
}
|
|
1743
|
+
export interface CreateSubscriptionRequest {
|
|
1744
|
+
subscription?: Subscription;
|
|
1745
|
+
/** Optional settings for the payments. Should be empty for free subscriptions. */
|
|
1746
|
+
paymentSettings?: PaymentSettings;
|
|
1747
|
+
/** Optional unique identifier for this request in order to prevent subscription duplications */
|
|
1748
|
+
idempotencyKey?: string | null;
|
|
1749
|
+
/** Optional origin override for setting identity of subscription creator instead of extracting from context */
|
|
1750
|
+
originOverride?: OriginOverride;
|
|
1751
|
+
}
|
|
1752
|
+
export interface OriginOverride {
|
|
1753
|
+
appId?: string;
|
|
1754
|
+
instanceId?: string;
|
|
1755
|
+
}
|
|
1756
|
+
export interface CreateSubscriptionResponse {
|
|
1757
|
+
subscription?: Subscription;
|
|
1758
|
+
/** Payments order that should be paid (or authorize card) in order to activate subscription. Empty for free subscriptions. */
|
|
1759
|
+
paymentOrderId?: string | null;
|
|
1760
|
+
}
|
|
1761
|
+
export interface UpdateSubscriptionRequest {
|
|
1762
|
+
/** Revision is validated if Subscription.revision is set */
|
|
1763
|
+
subscription?: Subscription;
|
|
1764
|
+
/**
|
|
1765
|
+
* Supported field: start_date
|
|
1766
|
+
* Can be updated only if Subscription is in Draft state
|
|
1767
|
+
*/
|
|
1768
|
+
fieldMask?: string[];
|
|
1769
|
+
}
|
|
1770
|
+
export interface UpdateSubscriptionResponse {
|
|
1771
|
+
subscription?: Subscription;
|
|
1772
|
+
}
|
|
1773
|
+
export interface UpdateSubscriptionStartDateRequest {
|
|
1774
|
+
/** Subscription ID */
|
|
1775
|
+
_id?: string;
|
|
1776
|
+
/**
|
|
1777
|
+
* Can be updated only if Subscription is in Draft state
|
|
1778
|
+
* By setting start_date in the future, end_date will be recalculated for termed Subscriptions
|
|
1779
|
+
* cycles_to_pay_on_creation will be set to 1 if no free trial is set
|
|
1780
|
+
*/
|
|
1781
|
+
startDate?: Date | null;
|
|
1782
|
+
}
|
|
1783
|
+
export interface UpdateSubscriptionStartDateResponse {
|
|
1784
|
+
subscription?: Subscription;
|
|
1785
|
+
}
|
|
1786
|
+
export interface UpdateSubscriptionPoliciesRequest {
|
|
1787
|
+
/** Subscription ID */
|
|
1788
|
+
_id?: string;
|
|
1789
|
+
cancellableByCustomer?: boolean | null;
|
|
1790
|
+
}
|
|
1791
|
+
export interface UpdateSubscriptionPoliciesResponse {
|
|
1792
|
+
/** Updated policies of the subscription */
|
|
1793
|
+
policies?: SubscriptionPolicies;
|
|
1794
|
+
}
|
|
1795
|
+
export interface UpdateSubscriptionBillingDateRequest {
|
|
1796
|
+
/** ID of the subscription to update the billing date for. */
|
|
1797
|
+
_id: string;
|
|
1798
|
+
/** New billing date in `YYYY-MM-DDThh:mm:ss:sssZ` format. */
|
|
1799
|
+
billingDate: Date | null;
|
|
1800
|
+
/**
|
|
1801
|
+
* Information about how BASS adjusts the total of the next invoice. Extending
|
|
1802
|
+
* the current billing cycle results in a higher payment, while shortening it
|
|
1803
|
+
* leads to a lower payment. BASS offers automatic calculation of the proration
|
|
1804
|
+
* amount based on the number of days added to or removed from the current billing
|
|
1805
|
+
* cycle. Alternatively, you can use your own custom method to calculate the
|
|
1806
|
+
* proration amount. The custom proration amount can't exceed the total of the
|
|
1807
|
+
* current billing cycle.
|
|
1808
|
+
*/
|
|
1809
|
+
proration?: Proration;
|
|
1810
|
+
}
|
|
1811
|
+
export interface UpdateSubscriptionBillingDateResponse {
|
|
1812
|
+
/** Updated subscription. */
|
|
1813
|
+
subscription?: Subscription;
|
|
1814
|
+
}
|
|
1815
|
+
export interface UpdateSubscriptionOriginRequest {
|
|
1816
|
+
/** ID of the subscription to update origin. */
|
|
1817
|
+
_id?: string;
|
|
1818
|
+
/** Origin entity ID of the subscription to update. */
|
|
1819
|
+
entityId?: string;
|
|
1820
|
+
}
|
|
1821
|
+
export interface UpdateSubscriptionOriginResponse {
|
|
1822
|
+
/** Updated subscription. */
|
|
1823
|
+
subscription?: Subscription;
|
|
1824
|
+
}
|
|
1825
|
+
export interface ReviseSubscriptionRequest {
|
|
1826
|
+
/** Subscription ID */
|
|
1827
|
+
_id?: string;
|
|
1828
|
+
/** 0 for no revision, maxSize is 100 */
|
|
1829
|
+
items?: Item[];
|
|
1830
|
+
}
|
|
1831
|
+
export interface ReviseSubscriptionResponse {
|
|
1832
|
+
subscription?: Subscription;
|
|
1833
|
+
}
|
|
1834
|
+
export interface UpdateSubscriptionItemsRequest {
|
|
1835
|
+
/** Subscription ID */
|
|
1836
|
+
_id?: string;
|
|
1837
|
+
/** Update action. For RESET_PENDING_UPDATES, nothing but the subscription ID should be defined in the request. */
|
|
1838
|
+
updateAction?: UpdateAction;
|
|
1839
|
+
/** Updates execution date. Relevant only for UpdateAction.SPECIFIC_DATE. Only specific date is supported. */
|
|
1840
|
+
scheduleAdditionalInfo?: ScheduleAdditionalInfo;
|
|
1841
|
+
/** Existing items to update */
|
|
1842
|
+
itemsToUpdate?: ItemChange[];
|
|
1843
|
+
/** Items to add */
|
|
1844
|
+
itemsToAdd?: Item[];
|
|
1845
|
+
/** Existing items to delete */
|
|
1846
|
+
itemsToDelete?: string[] | null;
|
|
1847
|
+
}
|
|
1848
|
+
export interface ScheduleAdditionalInfo extends ScheduleAdditionalInfoParamOneOf {
|
|
1849
|
+
/**
|
|
1850
|
+
* Future date when the update becomes effective in `YYYY-MM-DDThh:mm:ss.sssZ`
|
|
1851
|
+
* format. The use of this field may be restricted in various BASS endpoints.
|
|
1852
|
+
* For example, in _Bulk Update Subscription Items_ it's only available in
|
|
1853
|
+
* combination with `{"updateAction": "SPECIFIC_DATE"}`, in _Resume Subscription_
|
|
1854
|
+
* only in combination with `{"resumeAt": "SPECIFIC_DATE"}`, and in
|
|
1855
|
+
* _Pause Subscription_ only in combination with `{"pauseAt": "SPECIFIC_DATE"}`.
|
|
1856
|
+
*/
|
|
1857
|
+
specificDate?: Date | null;
|
|
1858
|
+
/**
|
|
1859
|
+
* When the update becomes effective, as number of billing cycles from now.
|
|
1860
|
+
* The use of this field may be restricted in various BASS endpoints.
|
|
1861
|
+
* For example, in _Pause Subscription_ it's only available in
|
|
1862
|
+
* combination with `{"pauseAt": "NUMBER_OF_CYCLES_FROM_TODAY"}`.
|
|
1863
|
+
* __Note__: Currently not supported in _Bulk Update Subscription Items by Filter_.
|
|
1864
|
+
*/
|
|
1865
|
+
numberOfCycles?: number;
|
|
1866
|
+
}
|
|
1867
|
+
/** @oneof */
|
|
1868
|
+
export interface ScheduleAdditionalInfoParamOneOf {
|
|
1869
|
+
/**
|
|
1870
|
+
* Future date when the update becomes effective in `YYYY-MM-DDThh:mm:ss.sssZ`
|
|
1871
|
+
* format. The use of this field may be restricted in various BASS endpoints.
|
|
1872
|
+
* For example, in _Bulk Update Subscription Items_ it's only available in
|
|
1873
|
+
* combination with `{"updateAction": "SPECIFIC_DATE"}`, in _Resume Subscription_
|
|
1874
|
+
* only in combination with `{"resumeAt": "SPECIFIC_DATE"}`, and in
|
|
1875
|
+
* _Pause Subscription_ only in combination with `{"pauseAt": "SPECIFIC_DATE"}`.
|
|
1876
|
+
*/
|
|
1877
|
+
specificDate?: Date | null;
|
|
1878
|
+
/**
|
|
1879
|
+
* When the update becomes effective, as number of billing cycles from now.
|
|
1880
|
+
* The use of this field may be restricted in various BASS endpoints.
|
|
1881
|
+
* For example, in _Pause Subscription_ it's only available in
|
|
1882
|
+
* combination with `{"pauseAt": "NUMBER_OF_CYCLES_FROM_TODAY"}`.
|
|
1883
|
+
* __Note__: Currently not supported in _Bulk Update Subscription Items by Filter_.
|
|
1884
|
+
*/
|
|
1885
|
+
numberOfCycles?: number;
|
|
1886
|
+
}
|
|
1887
|
+
export interface UpdateSubscriptionItemsResponse {
|
|
1888
|
+
subscription?: Subscription;
|
|
1889
|
+
}
|
|
1890
|
+
export interface BulkUpdateSubscriptionItemsByFilterRequest {
|
|
1891
|
+
/**
|
|
1892
|
+
* Filter to identify the subscriptions for which items are updated. For
|
|
1893
|
+
* supported fields see
|
|
1894
|
+
* [Search and Query: Bulk Update Subscription Items By Filter](https://bo.wix.com/wix-docs/rest/drafts/subscriptions-by-billing-by-wix/search-and-query#drafts_subscriptions-by-billing-by-wix_search-and-query_bulk-update-subscription-items-by-filter).
|
|
1895
|
+
* Sending an empty subscription filter results in a validation error.
|
|
1896
|
+
* In case you pass `{"updateAction": "RESET_PENDING_UPDATES"}`, use only the
|
|
1897
|
+
* `subscriptionId` field inside this filter. Passing any other filter results
|
|
1898
|
+
* in a failed validation error.
|
|
1899
|
+
*/
|
|
1900
|
+
subscriptionFilter?: Record<string, any> | null;
|
|
1901
|
+
/**
|
|
1902
|
+
* Filter to specify which subscription items are updated. Make sure to use
|
|
1903
|
+
* the catalog item ID and not the item's unique ID. All subscription items
|
|
1904
|
+
* with matching `items.catalogReference.catalogItemId` are updated.
|
|
1905
|
+
*
|
|
1906
|
+
* Max: `100` reference catalog item IDs
|
|
1907
|
+
*/
|
|
1908
|
+
catalogReferenceIds?: string[] | null;
|
|
1909
|
+
/**
|
|
1910
|
+
* Information about the update timing and update type.
|
|
1911
|
+
*
|
|
1912
|
+
* + `"IMMEDIATELY"`: The updates become effective immediately.
|
|
1913
|
+
* + `"NEXT_BILLING_CYCLE"`: The updates are scheduled for the beginning of the next billing cycle.
|
|
1914
|
+
* + `"SPECIFIC_DATE"`: The updates are scheduled for the date specified in `scheduleAdditionalInfo.specificDate`.
|
|
1915
|
+
* + `"RESET_PENDING_UPDATES"`: All currently scheduled updates for the specified supcriptions are canceled. Use only the `subscriptionId` field inside `subscriptionFilter`, all other filters result in failed validation errors.
|
|
1916
|
+
*/
|
|
1917
|
+
updateAction?: UpdateAction;
|
|
1918
|
+
/**
|
|
1919
|
+
* Additional information for updates. Currently, only supported for
|
|
1920
|
+
* `{"updateAction": "SPECIFIC_DATE"}`.
|
|
1921
|
+
*/
|
|
1922
|
+
scheduleAdditionalInfo?: ScheduleAdditionalInfo;
|
|
1923
|
+
/**
|
|
1924
|
+
* Update details for the susbcription items that match the filtering.
|
|
1925
|
+
* Currently, you can update only the item price, quantity, and tax. Note
|
|
1926
|
+
* that all item properties are updated to the same values. In case you want set
|
|
1927
|
+
* different values for individual items, you must call
|
|
1928
|
+
* _Bulk Update Subscription Items By Filter_ multiple times, once per unique update.
|
|
1929
|
+
*/
|
|
1930
|
+
bulkItemUpdateData?: BulkItemChange;
|
|
1931
|
+
/** __Not implemented yet__. Items to add to the subscriptions matching the filtering. */
|
|
1932
|
+
itemsToAdd?: Item[];
|
|
1933
|
+
}
|
|
1934
|
+
export interface BulkItemChange {
|
|
1935
|
+
/** Information about the new item price. */
|
|
1936
|
+
pricingModel?: PricingModel;
|
|
1937
|
+
/**
|
|
1938
|
+
* New item quantity.
|
|
1939
|
+
*
|
|
1940
|
+
* Min: `1`
|
|
1941
|
+
*/
|
|
1942
|
+
quantity?: number | null;
|
|
1943
|
+
/** Information about the new item tax. */
|
|
1944
|
+
tax?: Tax;
|
|
1945
|
+
}
|
|
1946
|
+
export interface BulkUpdateSubscriptionItemsByFilterResponse {
|
|
1947
|
+
/**
|
|
1948
|
+
* ID of your bulk job. You can use
|
|
1949
|
+
* [this Async Infra call](https://pbo.wix.com/fire-console/?artifact=com.wixpress.asyncinfra.async-job-service&service=wix.infra.asyncjobs.v1.AsyncJobService&method=ListAsyncJobItems&body=eyJqb2JfaWQiOiIifQ%3D%3D)
|
|
1950
|
+
* to retrieve information about the job status.
|
|
1951
|
+
*/
|
|
1952
|
+
jobId?: string;
|
|
1953
|
+
}
|
|
1954
|
+
export interface DeleteSubscriptionRequest {
|
|
1955
|
+
_id?: string;
|
|
1956
|
+
revision?: string;
|
|
1957
|
+
}
|
|
1958
|
+
export interface DeleteSubscriptionResponse {
|
|
1959
|
+
}
|
|
1960
|
+
export interface CancelSubscriptionRequest {
|
|
1961
|
+
_id: string;
|
|
1962
|
+
actionContext: ActionContext;
|
|
1963
|
+
}
|
|
1964
|
+
export interface ActionContext {
|
|
1965
|
+
initiator?: ActionInitiator;
|
|
1966
|
+
/** Optional action reason message */
|
|
1967
|
+
reason?: string | null;
|
|
1968
|
+
}
|
|
1969
|
+
export declare enum ActionInitiator {
|
|
1970
|
+
UNDEFINED = "UNDEFINED",
|
|
1971
|
+
BUSINESS = "BUSINESS",
|
|
1972
|
+
CUSTOMER = "CUSTOMER",
|
|
1973
|
+
SYSTEM = "SYSTEM"
|
|
1974
|
+
}
|
|
1975
|
+
export interface CancelSubscriptionResponse {
|
|
1976
|
+
subscription?: Subscription;
|
|
1977
|
+
}
|
|
1978
|
+
export interface PauseSubscriptionRequest {
|
|
1979
|
+
_id: string;
|
|
1980
|
+
pausePolicy?: PausePolicy;
|
|
1981
|
+
pauseAt?: PauseAt;
|
|
1982
|
+
/** contains additional scheduling information for certain pause_at options (for example: SPECIFIC_DATE & NUMBER_OF_CYCLES_FROM_TODAY) */
|
|
1983
|
+
pauseAtSchedule?: ScheduleAdditionalInfo;
|
|
1984
|
+
/** contains additional scheduling information for certain auto_resume_at either specific date */
|
|
1985
|
+
autoResumeAtSchedule?: ScheduleAdditionalInfo;
|
|
1986
|
+
actionContext: ActionContext;
|
|
1987
|
+
}
|
|
1988
|
+
export interface PauseSubscriptionResponse {
|
|
1989
|
+
subscription?: Subscription;
|
|
1990
|
+
}
|
|
1991
|
+
export interface ResumeSubscriptionRequest {
|
|
1992
|
+
_id: string;
|
|
1993
|
+
resumeAt?: ResumeAt;
|
|
1994
|
+
/** contains additional scheduling information for certain resume_at options (for example: SPECIFIC_DATE) */
|
|
1995
|
+
resumeAtSchedule?: ScheduleAdditionalInfo;
|
|
1996
|
+
actionContext: ActionContext;
|
|
1997
|
+
}
|
|
1998
|
+
export interface ResumeSubscriptionResponse {
|
|
1999
|
+
subscription?: Subscription;
|
|
2000
|
+
}
|
|
2001
|
+
export interface SearchSubscriptionsRequest extends SearchSubscriptionsRequestPagingMethodOneOf {
|
|
2002
|
+
/** Limit number of results and enable to skip rows. The default limit is 25. */
|
|
2003
|
+
paging?: Paging;
|
|
2004
|
+
/** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
|
|
2005
|
+
cursor?: CursorPaging;
|
|
2006
|
+
/** A filter object */
|
|
2007
|
+
filter?: any;
|
|
2008
|
+
/** A Sorting option by field name and order. */
|
|
2009
|
+
sorting?: SortingClauses;
|
|
2010
|
+
}
|
|
2011
|
+
/** @oneof */
|
|
2012
|
+
export interface SearchSubscriptionsRequestPagingMethodOneOf {
|
|
2013
|
+
/** Limit number of results and enable to skip rows. The default limit is 25. */
|
|
2014
|
+
paging?: Paging;
|
|
2015
|
+
/** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
|
|
2016
|
+
cursor?: CursorPaging;
|
|
2017
|
+
}
|
|
2018
|
+
export interface SortingClauses {
|
|
2019
|
+
sorting?: Sorting[];
|
|
2020
|
+
}
|
|
2021
|
+
export interface SearchSubscriptionsResponse {
|
|
2022
|
+
subscriptions?: Subscription[];
|
|
2023
|
+
cursor?: CursorPaging;
|
|
2024
|
+
}
|
|
2025
|
+
export interface TurnOnSubscriptionAutoRenewalRequest {
|
|
2026
|
+
_id: string;
|
|
2027
|
+
actionContext: ActionContext;
|
|
2028
|
+
}
|
|
2029
|
+
export interface TurnOnSubscriptionAutoRenewalResponse {
|
|
2030
|
+
subscription?: Subscription;
|
|
2031
|
+
}
|
|
2032
|
+
export interface TurnOffSubscriptionAutoRenewalRequest {
|
|
2033
|
+
_id: string;
|
|
2034
|
+
actionContext: ActionContext;
|
|
2035
|
+
}
|
|
2036
|
+
export interface TurnOffSubscriptionAutoRenewalResponse {
|
|
2037
|
+
subscription?: Subscription;
|
|
2038
|
+
}
|
|
2039
|
+
export interface MarkLatestInvoiceAsPaidRequest {
|
|
2040
|
+
/** The ID of the offline subscription to mark as paid its latest invoice */
|
|
2041
|
+
subscriptionId: string;
|
|
2042
|
+
}
|
|
2043
|
+
export interface MarkLatestInvoiceAsPaidResponse {
|
|
2044
|
+
subscription?: Subscription;
|
|
2045
|
+
}
|
|
2046
|
+
export interface MultipleSubscriptionsOnOrdersInvoice {
|
|
2047
|
+
/** the invoice id of the affected subscription */
|
|
2048
|
+
invoiceId?: string;
|
|
2049
|
+
/** the order id of the affected subscription */
|
|
2050
|
+
orderId?: string;
|
|
2051
|
+
}
|
|
2052
|
+
export interface MarkInvoiceAsPaidRequest {
|
|
2053
|
+
/** The ID of the subscription to mark as paid its invoice. */
|
|
2054
|
+
subscriptionId: string;
|
|
2055
|
+
/**
|
|
2056
|
+
* The subscription cycle for which the invoice is to be marked as paid.
|
|
2057
|
+
* If left empty, the most recent cycle will be selected.
|
|
2058
|
+
*/
|
|
2059
|
+
paidCycle?: number | null;
|
|
2060
|
+
}
|
|
2061
|
+
export interface MarkInvoiceAsPaidResponse {
|
|
2062
|
+
subscription?: Subscription;
|
|
2063
|
+
}
|
|
2064
|
+
export interface GetSubscriptionsStatsRequest {
|
|
2065
|
+
}
|
|
2066
|
+
export interface GetSubscriptionsStatsResponse {
|
|
2067
|
+
amountByStatuses?: AmountByStatus[];
|
|
2068
|
+
total?: number;
|
|
2069
|
+
}
|
|
2070
|
+
export interface AmountByStatus {
|
|
2071
|
+
status?: SubscriptionStatusEnumSubscriptionStatus;
|
|
2072
|
+
amount?: number;
|
|
2073
|
+
}
|
|
2074
|
+
export interface ExtendSubscriptionRequest extends ExtendSubscriptionRequestExtendPolicyOneOf {
|
|
2075
|
+
/** User won't be charged for additional period added on top of subscription end date. */
|
|
2076
|
+
extensionPeriod?: Duration;
|
|
2077
|
+
/** user will be charged for billing cycles added */
|
|
2078
|
+
extensionBillingCycles?: number;
|
|
2079
|
+
/** The ID of the subscription to be extended */
|
|
2080
|
+
_id: string;
|
|
2081
|
+
actionContext: ActionContext;
|
|
2082
|
+
}
|
|
2083
|
+
/** @oneof */
|
|
2084
|
+
export interface ExtendSubscriptionRequestExtendPolicyOneOf {
|
|
2085
|
+
/** User won't be charged for additional period added on top of subscription end date. */
|
|
2086
|
+
extensionPeriod?: Duration;
|
|
2087
|
+
/** user will be charged for billing cycles added */
|
|
2088
|
+
extensionBillingCycles?: number;
|
|
2089
|
+
}
|
|
2090
|
+
export interface ExtendSubscriptionResponse {
|
|
2091
|
+
/** The now extended subscription */
|
|
2092
|
+
subscription?: Subscription;
|
|
2093
|
+
}
|
|
2094
|
+
export interface AllowedActionsRequest {
|
|
2095
|
+
_id: string;
|
|
2096
|
+
/** List of additional fields to be included in the response. */
|
|
2097
|
+
fields?: RequestedFields[];
|
|
2098
|
+
}
|
|
2099
|
+
export declare enum RequestedFields {
|
|
2100
|
+
UNKNOWN_REQUESTED_FIELD = "UNKNOWN_REQUESTED_FIELD",
|
|
2101
|
+
/** Include unsupported action list, including the reasons for the lack of support */
|
|
2102
|
+
UNSUPPORTED_ACTION = "UNSUPPORTED_ACTION"
|
|
2103
|
+
}
|
|
2104
|
+
export interface AllowedActionsResponse {
|
|
2105
|
+
/** List of actions that are allowed. */
|
|
2106
|
+
actions?: Action[];
|
|
2107
|
+
/** List of actions that are not supported, included only if requested. Provides reasons for each unsupported action. */
|
|
2108
|
+
unsupportedActions?: UnsupportedAction[];
|
|
2109
|
+
}
|
|
2110
|
+
export interface UnsupportedAction {
|
|
2111
|
+
actionType?: ActionType;
|
|
2112
|
+
/** Provides detailed reasons for the unsupported action. Each `UnsupportedReason` includes a code and a message explaining why the action is not allowed. */
|
|
2113
|
+
reasons?: UnsupportedReason[];
|
|
2114
|
+
}
|
|
2115
|
+
export interface UnsupportedReason {
|
|
2116
|
+
code?: string;
|
|
2117
|
+
description?: string | null;
|
|
2118
|
+
}
|
|
2119
|
+
export interface ListUpcomingChargesRequest {
|
|
2120
|
+
/** Subscription id charges to be previewed for */
|
|
2121
|
+
subscriptionId: string;
|
|
2122
|
+
/** Period of time to provide charged for. If not provided,then only next charge will be returned. */
|
|
2123
|
+
customDuration?: Duration;
|
|
2124
|
+
/**
|
|
2125
|
+
* Date of the next billing cycle so that the upcoming charges will be calculated accordingly.
|
|
2126
|
+
* If not provided, the upcoming charges will be calculated according to the existing next billing date.
|
|
2127
|
+
*/
|
|
2128
|
+
nextBillingDate?: Date | null;
|
|
2129
|
+
}
|
|
2130
|
+
export interface ListUpcomingChargesResponse {
|
|
2131
|
+
upcomingCharges?: SubscriptionCharge[];
|
|
2132
|
+
}
|
|
2133
|
+
export interface PreviewSubscriptionChargesRequest extends PreviewSubscriptionChargesRequestSubscriptionOneOf {
|
|
2134
|
+
/** Information about a non-existing subscription. */
|
|
2135
|
+
subscriptionInfo?: SubscriptionInfo;
|
|
2136
|
+
}
|
|
2137
|
+
/** @oneof */
|
|
2138
|
+
export interface PreviewSubscriptionChargesRequestSubscriptionOneOf {
|
|
2139
|
+
/** Information about a non-existing subscription. */
|
|
2140
|
+
subscriptionInfo?: SubscriptionInfo;
|
|
2141
|
+
}
|
|
2142
|
+
/** Subscription information to use for calculating the preview of charges for a subscription. */
|
|
2143
|
+
export interface SubscriptionInfo {
|
|
2144
|
+
billingSettings?: BillingSettings;
|
|
2145
|
+
items?: Item[];
|
|
2146
|
+
startDate?: Date | null;
|
|
2147
|
+
}
|
|
2148
|
+
export interface PreviewSubscriptionChargesResponse {
|
|
2149
|
+
/** Charges for subscription. */
|
|
2150
|
+
charges?: Charge[];
|
|
2151
|
+
}
|
|
2152
|
+
/** Represents a charge applicable to a subscription. */
|
|
2153
|
+
export interface Charge {
|
|
2154
|
+
/** The cycle number from which the charge starts. */
|
|
2155
|
+
cycleFrom?: number;
|
|
2156
|
+
/** The number of cycles for which the charge is applicable. */
|
|
2157
|
+
cycleCount?: number | null;
|
|
2158
|
+
/** The breakdown of the charge */
|
|
2159
|
+
totals?: Totals;
|
|
2160
|
+
/** The billing date from which the charge starts */
|
|
2161
|
+
cycleBillingDate?: Date | null;
|
|
2162
|
+
}
|
|
2163
|
+
export interface PreviewSubscriptionsChargesRequest {
|
|
2164
|
+
/** Information required to calculate the preview charges for the subscriptions, including an identifier. */
|
|
2165
|
+
subscriptionsBillingDetails?: SubscriptionBillingDetails[];
|
|
2166
|
+
/**
|
|
2167
|
+
* Specifies the number of upcoming billing charges to preview for all subscriptions in the order.
|
|
2168
|
+
* For instance, if a subscription costs $10 for the first 3 cycles, $12 for cycles 4 through 7,
|
|
2169
|
+
* $15 for cycles 8 through 10, and $20 for cycle 11 onwards:
|
|
2170
|
+
* - Sending "1" will calculate and return charges for cycles 4 through 7 since it's the first charge in the future.
|
|
2171
|
+
* - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
|
|
2172
|
+
* - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
|
|
2173
|
+
* If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
|
|
2174
|
+
* in this case, charges for cycle 1 through 3.
|
|
2175
|
+
* If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
|
|
2176
|
+
* then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
|
|
2177
|
+
*/
|
|
2178
|
+
numberOfNextRecurringCharges?: number | null;
|
|
2179
|
+
}
|
|
2180
|
+
export interface SubscriptionBillingDetails {
|
|
2181
|
+
/** External identifier of the subscription */
|
|
2182
|
+
externalId?: string | null;
|
|
2183
|
+
/** Billing details parameters including schedule, currency, etc. */
|
|
2184
|
+
billingSettings?: BillingSettings;
|
|
2185
|
+
/** Items, minSize is 1, maxSize is 100 */
|
|
2186
|
+
items?: Item[];
|
|
2187
|
+
/** Subscription start date, now if not set */
|
|
2188
|
+
startDate?: Date | null;
|
|
2189
|
+
/** Shipping address associated with subscription. At the moment used only for payments. Optional. */
|
|
2190
|
+
shippingAddress?: FullAddressDetails;
|
|
2191
|
+
}
|
|
2192
|
+
export interface PreviewSubscriptionsChargesResponse {
|
|
2193
|
+
/** Charges for the subscriptions, including an identifier. */
|
|
2194
|
+
subscriptionsCharges?: SubscriptionCharges[];
|
|
2195
|
+
}
|
|
2196
|
+
export interface SubscriptionCharges {
|
|
2197
|
+
/** External identifier of the subscription */
|
|
2198
|
+
externalId?: string | null;
|
|
2199
|
+
/** Charges for subscription. */
|
|
2200
|
+
charges?: Charge[];
|
|
2201
|
+
}
|
|
2202
|
+
export interface CreateSubscriptionForOrderRequest {
|
|
2203
|
+
/** Subscription needs to be created */
|
|
2204
|
+
subscription?: Subscription;
|
|
2205
|
+
/** Optional unique identifier for this request in order to prevent subscription duplications */
|
|
2206
|
+
idempotencyKey?: string | null;
|
|
2207
|
+
}
|
|
2208
|
+
export interface CreateSubscriptionForOrderResponse {
|
|
2209
|
+
/** Created subscription */
|
|
2210
|
+
subscription?: Subscription;
|
|
2211
|
+
/** Non-persistent invoice */
|
|
2212
|
+
invoice?: Invoice;
|
|
2213
|
+
}
|
|
2214
|
+
/** An invoice includes information about the subscription and the customer. */
|
|
2215
|
+
export interface Invoice {
|
|
2216
|
+
/**
|
|
2217
|
+
* Invoice ID.
|
|
2218
|
+
* @readonly
|
|
2219
|
+
*/
|
|
2220
|
+
_id?: string | null;
|
|
2221
|
+
/**
|
|
2222
|
+
* Date and time the invoice was created.
|
|
2223
|
+
* @readonly
|
|
2224
|
+
*/
|
|
2225
|
+
_createdDate?: Date | null;
|
|
2226
|
+
/**
|
|
2227
|
+
* Date and time the invoice was last updated.
|
|
2228
|
+
* @readonly
|
|
2229
|
+
*/
|
|
2230
|
+
_updatedDate?: Date | null;
|
|
2231
|
+
/**
|
|
2232
|
+
* Revision number, which increments by 1 each time the invoice is updated.
|
|
2233
|
+
* To prevent conflicting changes,
|
|
2234
|
+
* the current revision must be passed when updating the invoice.
|
|
2235
|
+
*
|
|
2236
|
+
* Ignored when creating a invoice.
|
|
2237
|
+
* @readonly
|
|
2238
|
+
*/
|
|
2239
|
+
revision?: string | null;
|
|
2240
|
+
/** Information about the invoice origin. */
|
|
2241
|
+
origin?: BusinessOriginData;
|
|
2242
|
+
/**
|
|
2243
|
+
* Invoice status.
|
|
2244
|
+
*
|
|
2245
|
+
* + `"UNKNOWN"`: There is no information about the invoice status.
|
|
2246
|
+
* + `"OPEN"`: BASS has created the invoice but hasn't initiated the payment process.
|
|
2247
|
+
* + `"PAID"`: The customer has successfully paid for the invoice.
|
|
2248
|
+
* + `"ATTEMPT_FAILED"`: The payment process has started and there has been at least one unsuccessful payment attempt.
|
|
2249
|
+
* + `"FAILED"`: The payment process has failed and there are no more retries.
|
|
2250
|
+
* + `"CANCELED"`: The payment process has been stopped because the related subscription has been canceled.
|
|
2251
|
+
* @readonly
|
|
2252
|
+
*/
|
|
2253
|
+
status?: InvoiceStatus;
|
|
2254
|
+
/**
|
|
2255
|
+
* 3-letter currency code of the invoice in
|
|
2256
|
+
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format.
|
|
2257
|
+
*/
|
|
2258
|
+
currency?: string;
|
|
2259
|
+
/** Information about the customer. */
|
|
2260
|
+
customer?: Customer;
|
|
2261
|
+
/**
|
|
2262
|
+
* Whether the payment is processed through Wix and whether the customer must provide some input.
|
|
2263
|
+
*
|
|
2264
|
+
* + `"UNKNOWN"`: There is no information about the collection method.
|
|
2265
|
+
* + `"AUTO_CHARGE"`: The customer pays automatically through Wix.
|
|
2266
|
+
* + `"SEND_INVOICE"`: The customer pays through Wix, but some manual input is required.
|
|
2267
|
+
* + `"OFFLINE"`: The customer pays outside of Wix.
|
|
2268
|
+
*/
|
|
2269
|
+
collectionMethod?: CollectionMethod;
|
|
2270
|
+
/**
|
|
2271
|
+
* ID of the
|
|
2272
|
+
* [payment method](https://bo.wix.com/wix-docs/rest/wix-cashier/settings/payment-method-type/payment-method-type-object).
|
|
2273
|
+
* Not available for the first payment of a subscription and all offline
|
|
2274
|
+
* payments.
|
|
2275
|
+
*/
|
|
2276
|
+
paymentMethodId?: string | null;
|
|
2277
|
+
/**
|
|
2278
|
+
* Cashier [Order ID](https://dev.wix.com/docs/rest/payments/wix-cashier/pay/order#order-object)
|
|
2279
|
+
* for the corresponding payment.
|
|
2280
|
+
* @readonly
|
|
2281
|
+
*/
|
|
2282
|
+
paymentOrderId?: string | null;
|
|
2283
|
+
/** Information about a discount. Available only for invoices that include a discount. */
|
|
2284
|
+
discount?: InvoiceDiscount;
|
|
2285
|
+
/** Billing address. */
|
|
2286
|
+
billingAddress?: FullAddressDetails;
|
|
2287
|
+
/** Shipping address. Available only for `"PHYSICAL"` line items. */
|
|
2288
|
+
shippingAddress?: FullAddressDetails;
|
|
2289
|
+
/** Shipping fee in `0.00` format. */
|
|
2290
|
+
shippingFee?: string | null;
|
|
2291
|
+
/**
|
|
2292
|
+
* Information about the invoice's totals.
|
|
2293
|
+
* @readonly
|
|
2294
|
+
*/
|
|
2295
|
+
totals?: Totals;
|
|
2296
|
+
/** Line items belonging to the invoice. */
|
|
2297
|
+
invoiceItems?: InvoiceItem[];
|
|
2298
|
+
/**
|
|
2299
|
+
* Whether the invoice is used to validate payment details.
|
|
2300
|
+
*
|
|
2301
|
+
* + `true`: BASS uses the invoice to test payment details. Relevant for free trials. Ensures that Wix can collect the payment of the first billing cycle.
|
|
2302
|
+
* + `false`: Standard invoice.
|
|
2303
|
+
*/
|
|
2304
|
+
isAuthorization?: boolean | null;
|
|
2305
|
+
/** Whether the invoice's `totals.totalPrice` includes tax. */
|
|
2306
|
+
isTaxInclusive?: boolean | null;
|
|
2307
|
+
/** Details of the latest payment attempt. */
|
|
2308
|
+
latestPaymentAttempt?: LatestPaymentAttempt;
|
|
2309
|
+
/** List of charges and credits that adjust the invoice's `totals.totalPrice`. */
|
|
2310
|
+
adjustments?: PriceAdjustment[];
|
|
2311
|
+
/**
|
|
2312
|
+
* Invoice Number.
|
|
2313
|
+
* @readonly
|
|
2314
|
+
*/
|
|
2315
|
+
invoiceNumber?: string | null;
|
|
2316
|
+
/**
|
|
2317
|
+
* Shipping charges for the invoice.
|
|
2318
|
+
* Supports only one discount without cycles.
|
|
2319
|
+
* Discounts with cycles (repeated discounts across different billing cycles) are not supported for shipping
|
|
2320
|
+
*/
|
|
2321
|
+
shippingCharges?: InvoiceShippingCharges;
|
|
2322
|
+
/** Information about the invoice tax */
|
|
2323
|
+
taxData?: TaxData;
|
|
2324
|
+
/** Business address. */
|
|
2325
|
+
businessAddress?: Address;
|
|
2326
|
+
/** ID of the billing order that created this invoice. */
|
|
2327
|
+
orderId?: string | null;
|
|
2328
|
+
}
|
|
2329
|
+
export interface BusinessOriginData {
|
|
2330
|
+
/**
|
|
2331
|
+
* ID of the app for which BASS has created the invoice. For example,
|
|
2332
|
+
* `"1380b703-ce81-ff05-f115-39571d94dfcd"` for the Wix eCommerce app.
|
|
2333
|
+
*/
|
|
2334
|
+
appId?: string;
|
|
2335
|
+
/**
|
|
2336
|
+
* [Instance ID](https://dev.wix.com/api/rest/app-management/apps/app-instance/get-app-instance)
|
|
2337
|
+
* of the app for which BASS has created the invoice.
|
|
2338
|
+
*/
|
|
2339
|
+
instanceId?: string;
|
|
2340
|
+
/**
|
|
2341
|
+
* ID of the entity that triggered the invoice creation. For example, the ID of a
|
|
2342
|
+
* [pricing plan](https://dev.wix.com/docs/rest/payments/pricing-plans/pricing-plans/plan#plan-object).
|
|
2343
|
+
*/
|
|
2344
|
+
entityId?: string;
|
|
2345
|
+
}
|
|
2346
|
+
export declare enum InvoiceStatus {
|
|
2347
|
+
UNKNOWN = "UNKNOWN",
|
|
2348
|
+
OPEN = "OPEN",
|
|
2349
|
+
PAID = "PAID",
|
|
2350
|
+
FAILED = "FAILED",
|
|
2351
|
+
ATTEMPT_FAILED = "ATTEMPT_FAILED",
|
|
2352
|
+
CANCELED = "CANCELED"
|
|
2353
|
+
}
|
|
2354
|
+
export declare enum CollectionMethod {
|
|
2355
|
+
UNKNOWN = "UNKNOWN",
|
|
2356
|
+
AUTO_CHARGE = "AUTO_CHARGE",
|
|
2357
|
+
OFFLINE = "OFFLINE",
|
|
2358
|
+
SEND_INVOICE = "SEND_INVOICE"
|
|
2359
|
+
}
|
|
2360
|
+
export declare enum CreationMode {
|
|
2361
|
+
UNKNOWN = "UNKNOWN",
|
|
2362
|
+
SYSTEM = "SYSTEM",
|
|
2363
|
+
MANUAL = "MANUAL"
|
|
2364
|
+
}
|
|
2365
|
+
export interface LatestPaymentAttempt {
|
|
2366
|
+
/**
|
|
2367
|
+
* ID of the latest payment attempt.
|
|
2368
|
+
* @readonly
|
|
2369
|
+
*/
|
|
2370
|
+
paymentAttemptId?: string;
|
|
2371
|
+
/**
|
|
2372
|
+
* Date and time of the latest payment attempt in `YYYY-MM-DDThh:mm.sssZ` format.
|
|
2373
|
+
* @readonly
|
|
2374
|
+
*/
|
|
2375
|
+
dateAttempt?: Date | null;
|
|
2376
|
+
/** Number of the latest payment attempt. */
|
|
2377
|
+
attemptNumber?: number;
|
|
2378
|
+
/**
|
|
2379
|
+
* Status of the latest payment attempt.
|
|
2380
|
+
*
|
|
2381
|
+
* + `"UNKNOWN"`: There is no information about the status of the latest payment attempt.
|
|
2382
|
+
* + `"SCHEDULED"`: The latest payment attempt is scheduled but hasn't started yet.
|
|
2383
|
+
* + `"IN_PROGRESS"`: The latest payment attempt is in progress.
|
|
2384
|
+
* + `"PAID"`: The latest payment attempt resulted in a successful payment.
|
|
2385
|
+
* + `"DECLINED"`: The latest payment attempt has been declined.
|
|
2386
|
+
* + `"TECHNICAL_FAILURE"`: The latest payment attempt couldn't be process due to a technical failure.
|
|
2387
|
+
* + `"CANCELED"`: The latest payment attempt has been canceled by BASS.
|
|
2388
|
+
* @readonly
|
|
2389
|
+
*/
|
|
2390
|
+
status?: PaymentAttemptStatus;
|
|
2391
|
+
/**
|
|
2392
|
+
* Whether BASS tries to collect the payment another time. Available only when
|
|
2393
|
+
* `latestPaymentAttempt.status` is set to `"DECLINED"`.
|
|
2394
|
+
*/
|
|
2395
|
+
retryable?: boolean;
|
|
2396
|
+
}
|
|
2397
|
+
export declare enum PaymentAttemptStatus {
|
|
2398
|
+
UNKNOWN = "UNKNOWN",
|
|
2399
|
+
SCHEDULED = "SCHEDULED",
|
|
2400
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
2401
|
+
PAID = "PAID",
|
|
2402
|
+
DECLINED = "DECLINED",
|
|
2403
|
+
TECHNICAL_FAILURE = "TECHNICAL_FAILURE",
|
|
2404
|
+
CANCELED = "CANCELED",
|
|
2405
|
+
PENDING = "PENDING"
|
|
2406
|
+
}
|
|
2407
|
+
export interface PriceAdjustment extends PriceAdjustmentAdjustmentTypeOneOf {
|
|
2408
|
+
/** Adjustment that increases the price. */
|
|
2409
|
+
charge?: PriceAdjustmentValue;
|
|
2410
|
+
/** Adjustment that lowers the price. */
|
|
2411
|
+
credit?: PriceAdjustmentValue;
|
|
2412
|
+
}
|
|
2413
|
+
/** @oneof */
|
|
2414
|
+
export interface PriceAdjustmentAdjustmentTypeOneOf {
|
|
2415
|
+
/** Adjustment that increases the price. */
|
|
2416
|
+
charge?: PriceAdjustmentValue;
|
|
2417
|
+
/** Adjustment that lowers the price. */
|
|
2418
|
+
credit?: PriceAdjustmentValue;
|
|
2419
|
+
}
|
|
2420
|
+
export interface PriceAdjustmentValue extends PriceAdjustmentValueAdjustmentValueTypeOneOf {
|
|
2421
|
+
/**
|
|
2422
|
+
* Absolute amount that adjusts the price.
|
|
2423
|
+
*
|
|
2424
|
+
* Min: `0.01`
|
|
2425
|
+
*/
|
|
2426
|
+
amount?: string;
|
|
2427
|
+
/**
|
|
2428
|
+
* Relative factor that adjusts the price. For example, setting
|
|
2429
|
+
* `multiplier` to:
|
|
2430
|
+
* - `0.50` results in a price adjustment of 50% of the original value.
|
|
2431
|
+
* - `0.75` results in a price adjustment of 75% of the original value.
|
|
2432
|
+
* - `1.00` results in a price adjustment of 100% of the original value.
|
|
2433
|
+
*
|
|
2434
|
+
* Min: `0.01`
|
|
2435
|
+
* Max: `1.00`
|
|
2436
|
+
*/
|
|
2437
|
+
multiplier?: string;
|
|
2438
|
+
}
|
|
2439
|
+
/** @oneof */
|
|
2440
|
+
export interface PriceAdjustmentValueAdjustmentValueTypeOneOf {
|
|
2441
|
+
/**
|
|
2442
|
+
* Absolute amount that adjusts the price.
|
|
2443
|
+
*
|
|
2444
|
+
* Min: `0.01`
|
|
2445
|
+
*/
|
|
2446
|
+
amount?: string;
|
|
2447
|
+
/**
|
|
2448
|
+
* Relative factor that adjusts the price. For example, setting
|
|
2449
|
+
* `multiplier` to:
|
|
2450
|
+
* - `0.50` results in a price adjustment of 50% of the original value.
|
|
2451
|
+
* - `0.75` results in a price adjustment of 75% of the original value.
|
|
2452
|
+
* - `1.00` results in a price adjustment of 100% of the original value.
|
|
2453
|
+
*
|
|
2454
|
+
* Min: `0.01`
|
|
2455
|
+
* Max: `1.00`
|
|
2456
|
+
*/
|
|
2457
|
+
multiplier?: string;
|
|
2458
|
+
}
|
|
2459
|
+
export interface InvoiceShippingCharges {
|
|
2460
|
+
/**
|
|
2461
|
+
* Amount of the shipping fee in `0.00` format.
|
|
2462
|
+
*
|
|
2463
|
+
* Min: `0.01`
|
|
2464
|
+
*/
|
|
2465
|
+
amount?: string;
|
|
2466
|
+
/** Tax of the shipping fee */
|
|
2467
|
+
tax?: Tax;
|
|
2468
|
+
/** Information about the shipping charges tax data */
|
|
2469
|
+
taxData?: ItemTaxData;
|
|
2470
|
+
discount?: Discount;
|
|
2471
|
+
}
|
|
2472
|
+
/** Tax data from all items */
|
|
2473
|
+
export interface TaxData {
|
|
2474
|
+
/** Aggregated tax data from all items */
|
|
2475
|
+
taxSummary?: TaxSummary;
|
|
2476
|
+
}
|
|
2477
|
+
export interface TaxSummary {
|
|
2478
|
+
/** Aggregated from tax_breakdowns with exemptions excluded from amount */
|
|
2479
|
+
aggregatedTaxAmount?: string;
|
|
2480
|
+
/** Array of each tax applied, grouped by `"jurisdiction"`, `"jurisdiction_type"`, `"tax_type"`, `"tax_name"` and `"tax_rate"`. */
|
|
2481
|
+
aggregatedTaxBreakdowns?: AggregatedTaxBreakdown[];
|
|
2482
|
+
}
|
|
2483
|
+
export interface AggregatedTaxBreakdown {
|
|
2484
|
+
/** Name of the tax that was calculated. */
|
|
2485
|
+
taxName?: string;
|
|
2486
|
+
/** Type of tax that was calculated. */
|
|
2487
|
+
taxType?: string;
|
|
2488
|
+
/** Jurisdiction that taxes were calculated for. */
|
|
2489
|
+
jurisdiction?: string;
|
|
2490
|
+
/** Type of jurisdiction that taxes were calculated for. */
|
|
2491
|
+
jurisdictionType?: string;
|
|
2492
|
+
/** Tax rate used for this jurisdiction, as a decimal. For example, 10% tax is `"0.1000"` and 200% tax is `"2.0000"`. */
|
|
2493
|
+
rate?: string;
|
|
2494
|
+
/** Total amount of this tax for this jurisdiction. */
|
|
2495
|
+
aggregatedTaxAmount?: string;
|
|
2496
|
+
}
|
|
2497
|
+
export interface Task {
|
|
2498
|
+
key?: TaskKey;
|
|
2499
|
+
executeAt?: Date | null;
|
|
2500
|
+
payload?: string | null;
|
|
2501
|
+
}
|
|
2502
|
+
export interface TaskKey {
|
|
2503
|
+
appId?: string;
|
|
2504
|
+
instanceId?: string;
|
|
2505
|
+
subjectId?: string | null;
|
|
2506
|
+
}
|
|
2507
|
+
export interface TaskAction extends TaskActionActionOneOf {
|
|
2508
|
+
complete?: Complete;
|
|
2509
|
+
cancel?: Cancel;
|
|
2510
|
+
reschedule?: Reschedule;
|
|
2511
|
+
}
|
|
2512
|
+
/** @oneof */
|
|
2513
|
+
export interface TaskActionActionOneOf {
|
|
2514
|
+
complete?: Complete;
|
|
2515
|
+
cancel?: Cancel;
|
|
2516
|
+
reschedule?: Reschedule;
|
|
2517
|
+
}
|
|
2518
|
+
export interface Complete {
|
|
2519
|
+
}
|
|
2520
|
+
export interface Cancel {
|
|
2521
|
+
}
|
|
2522
|
+
export interface Reschedule {
|
|
2523
|
+
executeAt?: Date | null;
|
|
2524
|
+
payload?: string | null;
|
|
2525
|
+
}
|
|
2526
|
+
export interface Empty {
|
|
2527
|
+
}
|
|
2528
|
+
export interface V1SubscriptionEvent extends V1SubscriptionEventEventOneOf {
|
|
2529
|
+
/** A subscriptions was created */
|
|
2530
|
+
created?: V1SubscriptionCreated;
|
|
2531
|
+
/** Subscription is considered active and will be visible to site owners and members */
|
|
2532
|
+
activated?: V1SubscriptionActivated;
|
|
2533
|
+
/**
|
|
2534
|
+
* Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
|
|
2535
|
+
* If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
|
|
2536
|
+
*/
|
|
2537
|
+
canceled?: V1SubscriptionCanceled;
|
|
2538
|
+
/** Subscription was updated. Currently the only possible change is valid_until date */
|
|
2539
|
+
updated?: V1SubscriptionUpdated;
|
|
2540
|
+
/** Subscription cycle has started. Currently the cycle starts when a payment is received. */
|
|
2541
|
+
cycleTriggered?: SubscriptionCycleTriggered;
|
|
2542
|
+
/** Offline subscription was marked as paid */
|
|
2543
|
+
markedAsPaid?: SubscriptionMarkedAsPaid;
|
|
2544
|
+
/**
|
|
2545
|
+
* Subscription cancellation for the future date was requested.
|
|
2546
|
+
* Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
|
|
2547
|
+
*/
|
|
2548
|
+
cancellationRequested?: SubscriptionCancellationRequested;
|
|
2549
|
+
/** Subscription and it's payment schedule (for recurring) was suspended */
|
|
2550
|
+
suspended?: SubscriptionSuspended;
|
|
2551
|
+
/** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
|
|
2552
|
+
resumed?: V1SubscriptionResumed;
|
|
2553
|
+
/** Subscription expired according to valid_until expiration date. */
|
|
2554
|
+
expired?: SubscriptionExpired;
|
|
2555
|
+
/** Subscription initial purchase completed */
|
|
2556
|
+
initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
|
|
2557
|
+
}
|
|
2558
|
+
/** @oneof */
|
|
2559
|
+
export interface V1SubscriptionEventEventOneOf {
|
|
2560
|
+
/** A subscriptions was created */
|
|
2561
|
+
created?: V1SubscriptionCreated;
|
|
2562
|
+
/** Subscription is considered active and will be visible to site owners and members */
|
|
2563
|
+
activated?: V1SubscriptionActivated;
|
|
2564
|
+
/**
|
|
2565
|
+
* Subscription was canceled either by cancellation request with requested expiration date NOW or by payment provider.
|
|
2566
|
+
* If cancelled by payment provider subscription will be valid until the date calculated depending on how many cycles it was already paid for.
|
|
2567
|
+
*/
|
|
2568
|
+
canceled?: V1SubscriptionCanceled;
|
|
2569
|
+
/** Subscription was updated. Currently the only possible change is valid_until date */
|
|
2570
|
+
updated?: V1SubscriptionUpdated;
|
|
2571
|
+
/** Subscription cycle has started. Currently the cycle starts when a payment is received. */
|
|
2572
|
+
cycleTriggered?: SubscriptionCycleTriggered;
|
|
2573
|
+
/** Offline subscription was marked as paid */
|
|
2574
|
+
markedAsPaid?: SubscriptionMarkedAsPaid;
|
|
2575
|
+
/**
|
|
2576
|
+
* Subscription cancellation for the future date was requested.
|
|
2577
|
+
* Subscription will stay in pending cancellation status until the date calculated depending on free trial and the next payment date.
|
|
2578
|
+
*/
|
|
2579
|
+
cancellationRequested?: SubscriptionCancellationRequested;
|
|
2580
|
+
/** Subscription and it's payment schedule (for recurring) was suspended */
|
|
2581
|
+
suspended?: SubscriptionSuspended;
|
|
2582
|
+
/** Previously suspended subscription and it's payment schedule (for recurring) was resumed */
|
|
2583
|
+
resumed?: V1SubscriptionResumed;
|
|
2584
|
+
/** Subscription expired according to valid_until expiration date. */
|
|
2585
|
+
expired?: SubscriptionExpired;
|
|
2586
|
+
/** Subscription initial purchase completed */
|
|
2587
|
+
initialPurchaseCompleted?: V1SubscriptionInitialPurchaseCompleted;
|
|
2588
|
+
}
|
|
2589
|
+
export interface V1SubscriptionCreated {
|
|
2590
|
+
subscription?: V1Subscription;
|
|
2591
|
+
}
|
|
2592
|
+
export interface V1Subscription {
|
|
2593
|
+
/**
|
|
2594
|
+
* ID of the subscription
|
|
2595
|
+
* @readonly
|
|
2596
|
+
*/
|
|
2597
|
+
_id?: string;
|
|
2598
|
+
/** ID of the app which created the subscription */
|
|
2599
|
+
wixAppId?: string;
|
|
2600
|
+
/** Instance ID of the Subscriptions app */
|
|
2601
|
+
tenantId?: string;
|
|
2602
|
+
/** ID of entity in app (e.g. a cart in stores/order in paid plans) */
|
|
2603
|
+
originEntityId?: string;
|
|
2604
|
+
/** Site member or a contact who bought the subscription */
|
|
2605
|
+
subscriber?: Subscriber;
|
|
2606
|
+
/** Wix Pay order ID, is empty for free subscriptions */
|
|
2607
|
+
wixPayOrderId?: string | null;
|
|
2608
|
+
/** Subscription name (e.g. a product or subscription package name) */
|
|
2609
|
+
name?: string;
|
|
2610
|
+
/** Optional additional subscription description */
|
|
2611
|
+
description?: string;
|
|
2612
|
+
/** Amount to be paid for a single scheduled payment */
|
|
2613
|
+
price?: Money;
|
|
2614
|
+
/** True if the subscription is recurring, false for a single payment subscription */
|
|
2615
|
+
recurring?: boolean;
|
|
2616
|
+
/** Online (paid by subscriber using wix pay) or offline (need to manually mark as paid) */
|
|
2617
|
+
subscriptionType?: SubscriptionType;
|
|
2618
|
+
/** Active, expired, canceled, etc. */
|
|
2619
|
+
subscriptionStatus?: V1SubscriptionStatusEnumSubscriptionStatus;
|
|
2620
|
+
/** Subscription start date (may differ from creation date) */
|
|
2621
|
+
validFrom?: Date | null;
|
|
2622
|
+
/** Subscription expiration date */
|
|
2623
|
+
validUntil?: Date | null;
|
|
2624
|
+
/** Status of last payment associated with this subscription */
|
|
2625
|
+
lastPaymentStatus?: PaymentStatusEnumPaymentStatus;
|
|
2626
|
+
/** Payment schedule in the wix pay format. Exists for recurring subscriptions only. */
|
|
2627
|
+
billingProfile?: V2Subscription;
|
|
2628
|
+
/** Owner, member, etc. - present if subscription is canceled */
|
|
2629
|
+
cancellationInitiator?: CancellationInitiator;
|
|
2630
|
+
/** Optional, present if subscription is canceled */
|
|
2631
|
+
cancellationReason?: string | null;
|
|
2632
|
+
/** Can be used for arbitrary app-specific map<string, string> data */
|
|
2633
|
+
externalData?: Record<string, string>;
|
|
2634
|
+
/** Date when subscription was created (not related to payment dates) */
|
|
2635
|
+
dateCreated?: Date | null;
|
|
2636
|
+
/** Restrictions on possible subscription actions. Default policy has all restrictions enabled. */
|
|
2637
|
+
policy?: SubscriptionPolicy;
|
|
2638
|
+
/** List of subscription suspension periods */
|
|
2639
|
+
suspensions?: Suspension[];
|
|
2640
|
+
/** Initial subscription expiration date that was calculated on the subscription purchase plus duration of suspensions */
|
|
2641
|
+
validUntilDateWithSuspensions?: Date | null;
|
|
2642
|
+
/** Duration of single payment subscription (instead of billing_profile) */
|
|
2643
|
+
singlePaymentDuration?: V1Duration;
|
|
2644
|
+
originInstanceId?: string | null;
|
|
2645
|
+
}
|
|
2646
|
+
export interface Subscriber {
|
|
2647
|
+
/** Member or contact ID */
|
|
2648
|
+
_id?: string;
|
|
2649
|
+
/** Member or contact */
|
|
2650
|
+
identityType?: IdentityType;
|
|
2651
|
+
}
|
|
2652
|
+
export declare enum IdentityType {
|
|
2653
|
+
/** Identity type undefined */
|
|
2654
|
+
UNDEFINED = "UNDEFINED",
|
|
2655
|
+
/** Subscription is associated with a member ID */
|
|
2656
|
+
MEMBER = "MEMBER",
|
|
2657
|
+
/** Subscriptions is associated with a contact ID */
|
|
2658
|
+
CONTACT = "CONTACT"
|
|
2659
|
+
}
|
|
2660
|
+
/** Price of a payment. Includes amount and currency. */
|
|
2661
|
+
export interface Money {
|
|
2662
|
+
/** Monetary amount i.e. 3.99. */
|
|
2663
|
+
amount?: string;
|
|
2664
|
+
/** Currency in ISO 4217 format i.e. USD. */
|
|
2665
|
+
currency?: string;
|
|
2666
|
+
}
|
|
2667
|
+
export declare enum SubscriptionType {
|
|
2668
|
+
UNDEFINED = "UNDEFINED",
|
|
2669
|
+
/** Payments made by the subscriber */
|
|
2670
|
+
ONLINE = "ONLINE",
|
|
2671
|
+
/** Payments managed manually by the site owner */
|
|
2672
|
+
OFFLINE = "OFFLINE"
|
|
2673
|
+
}
|
|
2674
|
+
export declare enum V1SubscriptionStatusEnumSubscriptionStatus {
|
|
2675
|
+
/** Subscription status undefined */
|
|
2676
|
+
UNDEFINED = "UNDEFINED",
|
|
2677
|
+
/** Subscription created, but hasn't been paid for yet. This status if filtered out in ListSubscriptions response by default. */
|
|
2678
|
+
DRAFT = "DRAFT",
|
|
2679
|
+
/** Subscription has been paid for, but the start date is in the future */
|
|
2680
|
+
PENDING = "PENDING",
|
|
2681
|
+
/** Subscription is active */
|
|
2682
|
+
ACTIVE = "ACTIVE",
|
|
2683
|
+
/** Subscription has expired */
|
|
2684
|
+
EXPIRED = "EXPIRED",
|
|
2685
|
+
/** Subscription has been canceled */
|
|
2686
|
+
CANCELED = "CANCELED",
|
|
2687
|
+
/** Subscription has been set to be canceled at a future date */
|
|
2688
|
+
PENDING_CANCELLATION = "PENDING_CANCELLATION",
|
|
2689
|
+
/** Subscription is suspended */
|
|
2690
|
+
SUSPENDED = "SUSPENDED"
|
|
2691
|
+
}
|
|
2692
|
+
export declare enum PaymentStatusEnumPaymentStatus {
|
|
2693
|
+
/** Payment status undefined */
|
|
2694
|
+
UNDEFINED = "UNDEFINED",
|
|
2695
|
+
/** Payment has been paid */
|
|
2696
|
+
PAID = "PAID",
|
|
2697
|
+
/** Payment has been refunded */
|
|
2698
|
+
REFUNDED = "REFUNDED",
|
|
2699
|
+
/** Recurring payment has failed */
|
|
2700
|
+
FAILED = "FAILED",
|
|
2701
|
+
/** Payment has not been paid */
|
|
2702
|
+
UNPAID = "UNPAID",
|
|
2703
|
+
/** Billing has been initialized, but actual charge is yet to be made. Can happen for free trial and PayPal */
|
|
2704
|
+
PENDING = "PENDING"
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Recurring payment is described by `frequency` (day, week, month) and `interval`.
|
|
2708
|
+
*
|
|
2709
|
+
* For example, to create a recurring payment every 14 days, just set `interval` to 14 and frequency to `DAY`.
|
|
2710
|
+
*
|
|
2711
|
+
* In some cases there should be a trial period for the order, after which payments start to occur.
|
|
2712
|
+
* Trial period is also defined as `frequency` and `interval` pair.
|
|
2713
|
+
*
|
|
2714
|
+
* So one can define a monthly 'subscription' with a 14 days trial period.
|
|
2715
|
+
*/
|
|
2716
|
+
export interface V2Subscription {
|
|
2717
|
+
/** frequency of recurring payment (required) */
|
|
2718
|
+
frequency?: SubscriptionFrequency;
|
|
2719
|
+
/** interval of recurring payment (required) */
|
|
2720
|
+
interval?: number;
|
|
2721
|
+
/** trial period for recurring payment (optional) */
|
|
2722
|
+
trial?: SubscriptionTrialPeriod;
|
|
2723
|
+
/**
|
|
2724
|
+
* how many billing cycles should be done before subscription finishes
|
|
2725
|
+
* (optional, 0 by default means endless subscription)
|
|
2726
|
+
*/
|
|
2727
|
+
billingCycles?: number;
|
|
2728
|
+
/**
|
|
2729
|
+
* date in the future or in the past when the first billing cycle begins
|
|
2730
|
+
* (the first off-session payment is performed when it ends)
|
|
2731
|
+
*/
|
|
2732
|
+
firstCycleStartDate?: Date | null;
|
|
2733
|
+
}
|
|
2734
|
+
/** Frequency unit of recurring payment */
|
|
2735
|
+
export declare enum SubscriptionFrequency {
|
|
2736
|
+
UNDEFINED = "UNDEFINED",
|
|
2737
|
+
DAY = "DAY",
|
|
2738
|
+
WEEK = "WEEK",
|
|
2739
|
+
MONTH = "MONTH",
|
|
2740
|
+
YEAR = "YEAR"
|
|
2741
|
+
}
|
|
2742
|
+
/** Trial period of subscription */
|
|
2743
|
+
export interface SubscriptionTrialPeriod {
|
|
2744
|
+
/** trial period in units (required) */
|
|
2745
|
+
period?: number;
|
|
2746
|
+
/** units in which trial period is described (optional, default DAY) */
|
|
2747
|
+
unit?: SubscriptionFrequency;
|
|
2748
|
+
}
|
|
2749
|
+
export declare enum CancellationInitiator {
|
|
2750
|
+
/** Cancellation initiator undefined */
|
|
2751
|
+
UNDEFINED = "UNDEFINED",
|
|
2752
|
+
/** Subscription was canceled by site owner (default if canceled by user or service identity) */
|
|
2753
|
+
OWNER = "OWNER",
|
|
2754
|
+
/** Subscription was canceled by member (default if canceled by member identity) */
|
|
2755
|
+
MEMBER = "MEMBER",
|
|
2756
|
+
/** Subscription was canceled because of payment failure */
|
|
2757
|
+
PAYMENT_FAILURE = "PAYMENT_FAILURE",
|
|
2758
|
+
/** Subscription was canceled because of payment setup failure */
|
|
2759
|
+
SETUP_FAILURE = "SETUP_FAILURE"
|
|
2760
|
+
}
|
|
2761
|
+
export interface SubscriptionPolicy {
|
|
2762
|
+
/** Subscription expiration date can be updated */
|
|
2763
|
+
expiryDateChangeable?: boolean;
|
|
2764
|
+
/** Subscription can be cancelled by the member who bought it (when memberId == subscriberId) */
|
|
2765
|
+
cancellableByMember?: boolean;
|
|
2766
|
+
/** Subscription expiration date on cancellation can be set to next payment date */
|
|
2767
|
+
cancellableAtNextPaymentCycle?: boolean;
|
|
2768
|
+
}
|
|
2769
|
+
export interface Suspension {
|
|
2770
|
+
status?: Status;
|
|
2771
|
+
/** Beginning of the suspended period */
|
|
2772
|
+
startsAt?: Date | null;
|
|
2773
|
+
/** End of the suspended period */
|
|
2774
|
+
endsAt?: Date | null;
|
|
2775
|
+
}
|
|
2776
|
+
export declare enum Status {
|
|
2777
|
+
UNDEFINED = "UNDEFINED",
|
|
2778
|
+
ACTIVE = "ACTIVE",
|
|
2779
|
+
ENDED = "ENDED"
|
|
2780
|
+
}
|
|
2781
|
+
/** A duration expressed in amount of time units. */
|
|
2782
|
+
export interface V1Duration {
|
|
2783
|
+
/** Amount of the unit */
|
|
2784
|
+
amount?: number;
|
|
2785
|
+
/** Day, Week, Month, Year. */
|
|
2786
|
+
unit?: SubscriptionFrequency;
|
|
2787
|
+
}
|
|
2788
|
+
export interface V1SubscriptionActivated {
|
|
2789
|
+
subscription?: V1Subscription;
|
|
2790
|
+
}
|
|
2791
|
+
export interface V1SubscriptionCanceled {
|
|
2792
|
+
subscription?: V1Subscription;
|
|
2793
|
+
}
|
|
2794
|
+
export interface V1SubscriptionUpdated {
|
|
2795
|
+
subscription?: V1Subscription;
|
|
2796
|
+
}
|
|
2797
|
+
export interface SubscriptionCycleTriggered {
|
|
2798
|
+
subscription?: V1Subscription;
|
|
2799
|
+
billingCycle?: number;
|
|
2800
|
+
/** Wix Pay transaction id, optional. Exists if event was triggered by a payment. */
|
|
2801
|
+
transactionId?: string | null;
|
|
2802
|
+
}
|
|
2803
|
+
export interface SubscriptionMarkedAsPaid {
|
|
2804
|
+
subscription?: V1Subscription;
|
|
2805
|
+
/** A number indicating which payment (cycle) was marked as paid. For recurring subscriptions only. */
|
|
2806
|
+
billingCycle?: number | null;
|
|
2807
|
+
}
|
|
2808
|
+
export interface SubscriptionCancellationRequested {
|
|
2809
|
+
subscription?: V1Subscription;
|
|
2810
|
+
}
|
|
2811
|
+
export interface SubscriptionSuspended {
|
|
2812
|
+
subscription?: V1Subscription;
|
|
2813
|
+
}
|
|
2814
|
+
export interface V1SubscriptionResumed {
|
|
2815
|
+
subscription?: V1Subscription;
|
|
2816
|
+
}
|
|
2817
|
+
export interface SubscriptionExpired {
|
|
2818
|
+
subscription?: V1Subscription;
|
|
2819
|
+
}
|
|
2820
|
+
export interface V1SubscriptionInitialPurchaseCompleted {
|
|
2821
|
+
subscription?: V1Subscription;
|
|
2822
|
+
}
|
|
2823
|
+
export interface CreateSubscriptionInStateRequest extends CreateSubscriptionInStateRequestModeOneOf {
|
|
2824
|
+
activeSubscription?: CreateSubscriptionRequest;
|
|
2825
|
+
}
|
|
2826
|
+
/** @oneof */
|
|
2827
|
+
export interface CreateSubscriptionInStateRequestModeOneOf {
|
|
2828
|
+
activeSubscription?: CreateSubscriptionRequest;
|
|
2829
|
+
}
|
|
2830
|
+
export interface CreateSubscriptionInStateResponse {
|
|
2831
|
+
subscriptionId?: string;
|
|
2832
|
+
}
|
|
2833
|
+
export interface PayCycleRequest {
|
|
2834
|
+
subscriptionId: string;
|
|
2835
|
+
paymentTestMode?: PaymentTestMode;
|
|
2836
|
+
tenantId: string;
|
|
2837
|
+
}
|
|
2838
|
+
export declare enum PaymentTestMode {
|
|
2839
|
+
REGULAR = "REGULAR",
|
|
2840
|
+
FAIL_TECHNICAL = "FAIL_TECHNICAL",
|
|
2841
|
+
FAIL_DECLINE = "FAIL_DECLINE",
|
|
2842
|
+
FAIL_RETRYABLE_DECLINE = "FAIL_RETRYABLE_DECLINE"
|
|
2843
|
+
}
|
|
2844
|
+
export interface PayCycleResponse {
|
|
2845
|
+
invoiceId?: string;
|
|
2846
|
+
paymentOrderId?: string | null;
|
|
2847
|
+
subscription?: Subscription;
|
|
2848
|
+
}
|
|
2849
|
+
export interface GetFullSubscriptionDataRequest {
|
|
2850
|
+
_id?: string;
|
|
2851
|
+
}
|
|
2852
|
+
export interface GetFullSubscriptionDataResponse {
|
|
2853
|
+
subscription?: Subscription;
|
|
2854
|
+
internalSubscriptionData?: InternalSubscriptionData;
|
|
2855
|
+
}
|
|
2856
|
+
export interface InternalSubscriptionData {
|
|
2857
|
+
originInstanceId?: string;
|
|
2858
|
+
source?: string | null;
|
|
2859
|
+
billingType?: string;
|
|
2860
|
+
isOneTime?: boolean;
|
|
2861
|
+
migrationDetails?: MigrationDetails;
|
|
2862
|
+
pausePaidDuration?: string | null;
|
|
2863
|
+
authorizationPaymentData?: PaymentData;
|
|
2864
|
+
currentCyclePausePeriods?: PausePeriod[];
|
|
2865
|
+
}
|
|
2866
|
+
export interface MigrationDetails {
|
|
2867
|
+
/** system (application) where the Subscription has been created */
|
|
2868
|
+
originSystem?: string;
|
|
2869
|
+
/** date when the Subscription started to be managed in BASS */
|
|
2870
|
+
shiftManagementDate?: Date | null;
|
|
2871
|
+
}
|
|
2872
|
+
export interface PausePeriod {
|
|
2873
|
+
startDate?: Date | null;
|
|
2874
|
+
endDate?: Date | null;
|
|
2875
|
+
}
|
|
2876
|
+
export interface GetSubscriptionAndInternalDataRequest {
|
|
2877
|
+
subscriptionId?: string;
|
|
2878
|
+
tenantId?: string;
|
|
2879
|
+
}
|
|
2880
|
+
export interface GetSubscriptionAndInternalDataResponse {
|
|
2881
|
+
subscription?: Subscription;
|
|
2882
|
+
internalSubscriptionData?: InternalSubscriptionData;
|
|
2883
|
+
}
|
|
2884
|
+
export interface SearchSubscriptionRequest {
|
|
2885
|
+
_id?: string;
|
|
2886
|
+
tenantId?: string;
|
|
2887
|
+
}
|
|
2888
|
+
export interface SearchSubscriptionResponse {
|
|
2889
|
+
subscription?: Subscription;
|
|
2890
|
+
}
|
|
2891
|
+
export interface UpdatePausePaidDurationRequest {
|
|
2892
|
+
subscriptionId?: string;
|
|
2893
|
+
pausePaidDurationSeconds?: string;
|
|
2894
|
+
tenantId?: string;
|
|
2895
|
+
}
|
|
2896
|
+
export interface UpdatePausePaidDurationResponse {
|
|
2897
|
+
}
|
|
2898
|
+
export interface UpdateStatusRequest {
|
|
2899
|
+
subscriptionId?: string;
|
|
2900
|
+
tenantId?: string;
|
|
2901
|
+
status?: SubscriptionStatusEnumSubscriptionStatus;
|
|
2902
|
+
}
|
|
2903
|
+
export interface UpdateStatusResponse {
|
|
2904
|
+
subscription?: Subscription;
|
|
2905
|
+
}
|
|
2906
|
+
export interface UpdatePaymentStatusRequest {
|
|
2907
|
+
subscriptionId?: string;
|
|
2908
|
+
tenantId?: string;
|
|
2909
|
+
paymentStatus?: PaymentStatus;
|
|
2910
|
+
}
|
|
2911
|
+
export interface UpdatePaymentStatusResponse {
|
|
2912
|
+
subscription?: Subscription;
|
|
2913
|
+
}
|
|
2914
|
+
export interface ReviveSubscriptionRequest {
|
|
2915
|
+
tenantId?: string;
|
|
2916
|
+
subscriptionId?: string;
|
|
2917
|
+
revivePolicy?: RevivePolicy;
|
|
2918
|
+
isTestRun?: boolean;
|
|
2919
|
+
}
|
|
2920
|
+
export declare enum RevivePolicy {
|
|
2921
|
+
SIMPLE = "SIMPLE",
|
|
2922
|
+
RESUME = "RESUME"
|
|
2923
|
+
}
|
|
2924
|
+
export interface ReviveSubscriptionResponse {
|
|
2925
|
+
subscription?: Subscription;
|
|
2926
|
+
}
|
|
2927
|
+
export interface ConvertSapiRequest {
|
|
2928
|
+
subscriptionId?: string;
|
|
2929
|
+
}
|
|
2930
|
+
export interface ConvertSapiResponse {
|
|
2931
|
+
subscription?: Subscription;
|
|
2932
|
+
}
|
|
2933
|
+
export interface GetSubscriptionInvoicesRequest {
|
|
2934
|
+
_id?: string;
|
|
2935
|
+
}
|
|
2936
|
+
export interface GetSubscriptionInvoicesResponse {
|
|
2937
|
+
invoices?: SubscriptionInvoice[];
|
|
2938
|
+
}
|
|
2939
|
+
export interface SubscriptionInvoice {
|
|
2940
|
+
_id?: string;
|
|
2941
|
+
subscriptionCycle?: number;
|
|
2942
|
+
_createdDate?: Date | null;
|
|
2943
|
+
}
|
|
2944
|
+
export interface FinishFreeTrialNowRequest {
|
|
2945
|
+
subscriptionId?: string;
|
|
2946
|
+
tenantId?: string;
|
|
2947
|
+
}
|
|
2948
|
+
export interface FinishFreeTrialNowResponse {
|
|
2949
|
+
subscription?: Subscription;
|
|
2950
|
+
}
|
|
2951
|
+
export interface SendTimeCapsuleTaskCanceledBIRequest {
|
|
2952
|
+
tenantId?: string;
|
|
2953
|
+
subscriptionId?: string;
|
|
2954
|
+
taskType?: string;
|
|
2955
|
+
}
|
|
2956
|
+
export interface ScheduleTimeCapsuleTaskRequest {
|
|
2957
|
+
subscriptionId?: string;
|
|
2958
|
+
taskType?: string;
|
|
2959
|
+
executionTime?: Date | null;
|
|
2960
|
+
tenantId?: string;
|
|
2961
|
+
}
|
|
2962
|
+
export interface CancelTimeCapsuleTaskRequest {
|
|
2963
|
+
tenantId?: string;
|
|
2964
|
+
subscriptionId?: string;
|
|
2965
|
+
taskType?: string;
|
|
2966
|
+
}
|
|
2967
|
+
export interface UpdateFullSubscriptionRequest {
|
|
2968
|
+
tenantId?: string;
|
|
2969
|
+
subscription?: Subscription;
|
|
2970
|
+
}
|
|
2971
|
+
export interface UpdateFullSubscriptionResponse {
|
|
2972
|
+
subscription?: Subscription;
|
|
2973
|
+
}
|
|
2974
|
+
export interface UpdateSubscriptionInvoiceCycleRequest {
|
|
2975
|
+
subscriptionId?: string;
|
|
2976
|
+
tenantId?: string;
|
|
2977
|
+
invoiceId?: string;
|
|
2978
|
+
subscriptionCycle?: number;
|
|
2979
|
+
}
|
|
2980
|
+
export interface UpdateSubscriptionInvoiceCycleResponse {
|
|
2981
|
+
subscriptionInvoice?: SubscriptionInvoice;
|
|
2982
|
+
}
|
|
2983
|
+
export interface AddPausePeriodRequest {
|
|
2984
|
+
tenantId?: string;
|
|
2985
|
+
subscriptionId?: string;
|
|
2986
|
+
pauseStartDate?: Date | null;
|
|
2987
|
+
pauseEndDate?: Date | null;
|
|
2988
|
+
}
|
|
2989
|
+
export interface AddPausePeriodResponse {
|
|
2990
|
+
subscription?: Subscription;
|
|
2991
|
+
}
|
|
2992
|
+
export interface RunTimeCapsuleTaskNowRequest {
|
|
2993
|
+
tenantId?: string;
|
|
2994
|
+
subscriptionId?: string;
|
|
2995
|
+
taskType?: string;
|
|
2996
|
+
}
|
|
2997
|
+
export interface CreateRecurringInvoiceBORequest {
|
|
2998
|
+
subscriptionId?: string;
|
|
2999
|
+
tenantId?: string;
|
|
3000
|
+
cycleNumber?: number;
|
|
3001
|
+
}
|
|
3002
|
+
export interface CreateRecurringInvoiceBOResponse {
|
|
3003
|
+
invoiceId?: string;
|
|
3004
|
+
}
|
|
3005
|
+
export interface SetShiftingDataRequest {
|
|
3006
|
+
subscriptionId?: string;
|
|
3007
|
+
tenantId?: string;
|
|
3008
|
+
isBassManaged?: boolean;
|
|
3009
|
+
shiftManagementDate?: Date | null;
|
|
3010
|
+
}
|
|
3011
|
+
export interface SetShiftingDataResponse {
|
|
3012
|
+
subscription?: Subscription;
|
|
3013
|
+
}
|
|
3014
|
+
export interface FixSubscriptionInvoicesRequest extends FixSubscriptionInvoicesRequestModeOneOf {
|
|
3015
|
+
attachInvoice?: AttachInvoice;
|
|
3016
|
+
detachInvoice?: DetachInvoice;
|
|
3017
|
+
tenantId?: string;
|
|
3018
|
+
subscriptionId?: string;
|
|
3019
|
+
}
|
|
3020
|
+
/** @oneof */
|
|
3021
|
+
export interface FixSubscriptionInvoicesRequestModeOneOf {
|
|
3022
|
+
attachInvoice?: AttachInvoice;
|
|
3023
|
+
detachInvoice?: DetachInvoice;
|
|
3024
|
+
}
|
|
3025
|
+
export interface AttachInvoice {
|
|
3026
|
+
invoiceId?: string;
|
|
3027
|
+
}
|
|
3028
|
+
export interface DetachInvoice {
|
|
3029
|
+
invoiceId?: string;
|
|
3030
|
+
}
|
|
3031
|
+
export interface FixSubscriptionInvoicesResponse {
|
|
3032
|
+
invoices?: SubscriptionInvoice[];
|
|
3033
|
+
}
|
|
3034
|
+
export interface RestoreDraftSubscriptionRequest {
|
|
3035
|
+
tenantId?: string;
|
|
3036
|
+
subscriptionId?: string;
|
|
3037
|
+
}
|
|
3038
|
+
export interface RestoreDraftSubscriptionResponse {
|
|
3039
|
+
subscription?: Subscription;
|
|
3040
|
+
}
|
|
3041
|
+
export interface DeleteDraftSubscriptionRequest {
|
|
3042
|
+
tenantId?: string;
|
|
3043
|
+
subscriptionId?: string;
|
|
3044
|
+
}
|
|
3045
|
+
export interface DeleteDraftSubscriptionResponse {
|
|
3046
|
+
subscription?: Subscription;
|
|
3047
|
+
}
|
|
3048
|
+
export interface DeleteSubscriptionBORequest {
|
|
3049
|
+
tenantId?: string;
|
|
3050
|
+
subscriptionId?: string;
|
|
3051
|
+
}
|
|
3052
|
+
export interface DeleteSubscriptionBOResponse {
|
|
3053
|
+
subscription?: Subscription;
|
|
3054
|
+
}
|
|
3055
|
+
export interface CancelSubscriptionBORequest {
|
|
3056
|
+
tenantId?: string;
|
|
3057
|
+
subscriptionId?: string;
|
|
3058
|
+
initiator?: ActionInitiator;
|
|
3059
|
+
reason?: string | null;
|
|
3060
|
+
}
|
|
3061
|
+
export interface CancelSubscriptionBOResponse {
|
|
3062
|
+
subscription?: Subscription;
|
|
3063
|
+
}
|
|
3064
|
+
export interface UpdatePaymentMethodBORequest {
|
|
3065
|
+
tenantId?: string;
|
|
3066
|
+
subscriptionId?: string;
|
|
3067
|
+
paymentMethodId?: string;
|
|
3068
|
+
}
|
|
3069
|
+
export interface UpdatePaymentMethodBOResponse {
|
|
3070
|
+
subscription?: Subscription;
|
|
3071
|
+
}
|
|
3072
|
+
export interface SendSubscriptionActionEventBORequest extends SendSubscriptionActionEventBORequestEventOneOf {
|
|
3073
|
+
billingCycleStarted?: SubscriptionBillingCycleStarted;
|
|
3074
|
+
tenantId?: string;
|
|
3075
|
+
subscriptionId?: string;
|
|
3076
|
+
}
|
|
3077
|
+
/** @oneof */
|
|
3078
|
+
export interface SendSubscriptionActionEventBORequestEventOneOf {
|
|
3079
|
+
billingCycleStarted?: SubscriptionBillingCycleStarted;
|
|
3080
|
+
}
|
|
3081
|
+
export interface SendSubscriptionActionEventResponse {
|
|
3082
|
+
}
|
|
3083
|
+
export interface HandleSubscriptionAfterInvoiceMarkedAsPaidRequest {
|
|
3084
|
+
tenantId?: string;
|
|
3085
|
+
subscriptionId?: string;
|
|
3086
|
+
transactionId?: string;
|
|
3087
|
+
}
|
|
3088
|
+
export interface PauseSubscriptionBORequest {
|
|
3089
|
+
tenantId?: string;
|
|
3090
|
+
subscriptionId?: string;
|
|
3091
|
+
pausePolicy?: PausePolicy;
|
|
3092
|
+
pauseAt?: PauseAt;
|
|
3093
|
+
initiator?: ActionInitiator;
|
|
3094
|
+
reason?: string | null;
|
|
3095
|
+
}
|
|
3096
|
+
export interface PauseSubscriptionBOResponse {
|
|
3097
|
+
subscription?: Subscription;
|
|
3098
|
+
}
|
|
3099
|
+
interface CustomerNonNullableFields {
|
|
3100
|
+
visitorId: string;
|
|
3101
|
+
contactId: string;
|
|
3102
|
+
memberId: string;
|
|
3103
|
+
accountId: string;
|
|
3104
|
+
}
|
|
3105
|
+
interface PaymentMethodNonNullableFields {
|
|
3106
|
+
_id: string;
|
|
3107
|
+
}
|
|
3108
|
+
interface DurationNonNullableFields {
|
|
3109
|
+
unit: DurationUnit;
|
|
3110
|
+
}
|
|
3111
|
+
interface StreetAddressNonNullableFields {
|
|
3112
|
+
number: string;
|
|
3113
|
+
name: string;
|
|
3114
|
+
}
|
|
3115
|
+
interface AddressNonNullableFields {
|
|
3116
|
+
streetAddress?: StreetAddressNonNullableFields;
|
|
3117
|
+
}
|
|
3118
|
+
interface FullAddressDetailsNonNullableFields {
|
|
3119
|
+
address?: AddressNonNullableFields;
|
|
3120
|
+
}
|
|
3121
|
+
interface TaxSettingsNonNullableFields {
|
|
3122
|
+
inclusive: boolean;
|
|
3123
|
+
}
|
|
3124
|
+
interface DynamicTaxNonNullableFields {
|
|
3125
|
+
taxableAddressType: TaxableAddressType;
|
|
3126
|
+
}
|
|
3127
|
+
interface TaxNonNullableFields {
|
|
3128
|
+
amount: string;
|
|
3129
|
+
percentage: string;
|
|
3130
|
+
dynamic?: DynamicTaxNonNullableFields;
|
|
3131
|
+
}
|
|
3132
|
+
interface CyclesNonNullableFields {
|
|
3133
|
+
cycleFrom: number;
|
|
3134
|
+
}
|
|
3135
|
+
interface OriginNonNullableFields {
|
|
3136
|
+
appId: string;
|
|
3137
|
+
entityId: string;
|
|
3138
|
+
}
|
|
3139
|
+
interface AdditionalFeeNonNullableFields {
|
|
3140
|
+
name: string;
|
|
3141
|
+
amount: string;
|
|
3142
|
+
trigger: AdditionalFeeTrigger;
|
|
3143
|
+
tax?: TaxNonNullableFields;
|
|
3144
|
+
cycles?: CyclesNonNullableFields;
|
|
3145
|
+
origin?: OriginNonNullableFields;
|
|
3146
|
+
}
|
|
3147
|
+
interface DiscountCyclesNonNullableFields {
|
|
3148
|
+
cycleFrom: number;
|
|
3149
|
+
}
|
|
3150
|
+
interface DiscountOriginNonNullableFields {
|
|
3151
|
+
appId: string;
|
|
3152
|
+
entityId: string;
|
|
3153
|
+
}
|
|
3154
|
+
interface DiscountNonNullableFields {
|
|
3155
|
+
amount: string;
|
|
3156
|
+
percentage: string;
|
|
3157
|
+
cycles?: DiscountCyclesNonNullableFields;
|
|
3158
|
+
origin?: DiscountOriginNonNullableFields;
|
|
3159
|
+
}
|
|
3160
|
+
interface ShippingChargesNonNullableFields {
|
|
3161
|
+
amount: string;
|
|
3162
|
+
tax?: TaxNonNullableFields;
|
|
3163
|
+
discounts: DiscountNonNullableFields[];
|
|
3164
|
+
}
|
|
3165
|
+
interface ExternalCollectionDetailsNonNullableFields {
|
|
3166
|
+
collectorName: string;
|
|
3167
|
+
}
|
|
3168
|
+
interface BillingSettingsNonNullableFields {
|
|
3169
|
+
currency: string;
|
|
3170
|
+
paymentMethod?: PaymentMethodNonNullableFields;
|
|
3171
|
+
collectionMethod: CollectionMethodEnumCollectionMethod;
|
|
3172
|
+
cycleDuration?: DurationNonNullableFields;
|
|
3173
|
+
cycleAutoRenew: boolean;
|
|
3174
|
+
freeTrialDuration?: DurationNonNullableFields;
|
|
3175
|
+
billingAddress?: FullAddressDetailsNonNullableFields;
|
|
3176
|
+
taxSettings?: TaxSettingsNonNullableFields;
|
|
3177
|
+
additionalFees: AdditionalFeeNonNullableFields[];
|
|
3178
|
+
shippingCharges?: ShippingChargesNonNullableFields;
|
|
3179
|
+
discounts: DiscountNonNullableFields[];
|
|
3180
|
+
externalCollectionDetails?: ExternalCollectionDetailsNonNullableFields;
|
|
3181
|
+
}
|
|
3182
|
+
interface TotalsNonNullableFields {
|
|
3183
|
+
totalPrice: string;
|
|
3184
|
+
subtotal: string;
|
|
3185
|
+
}
|
|
3186
|
+
interface PaymentDataNonNullableFields {
|
|
3187
|
+
invoiceId: string;
|
|
3188
|
+
paymentStatus: PaymentStatus;
|
|
3189
|
+
totals?: TotalsNonNullableFields;
|
|
3190
|
+
}
|
|
3191
|
+
interface CustomProrationNonNullableFields {
|
|
3192
|
+
charge: string;
|
|
3193
|
+
credit: string;
|
|
3194
|
+
}
|
|
3195
|
+
interface ProrationNonNullableFields {
|
|
3196
|
+
custom?: CustomProrationNonNullableFields;
|
|
3197
|
+
}
|
|
3198
|
+
interface UpdateBillingDateDataNonNullableFields {
|
|
3199
|
+
proration?: ProrationNonNullableFields;
|
|
3200
|
+
}
|
|
3201
|
+
interface AutomaticRetryDataNonNullableFields {
|
|
3202
|
+
enabled: boolean;
|
|
3203
|
+
}
|
|
3204
|
+
interface GracePeriodDataNonNullableFields {
|
|
3205
|
+
automaticRetryData?: AutomaticRetryDataNonNullableFields;
|
|
3206
|
+
}
|
|
3207
|
+
interface BillingStatusNonNullableFields {
|
|
3208
|
+
currentCycle: number;
|
|
3209
|
+
latestPaymentData?: PaymentDataNonNullableFields;
|
|
3210
|
+
updateBillingDateData?: UpdateBillingDateDataNonNullableFields;
|
|
3211
|
+
gracePeriodData?: GracePeriodDataNonNullableFields;
|
|
3212
|
+
}
|
|
3213
|
+
interface SubscriptionPoliciesNonNullableFields {
|
|
3214
|
+
customerCanCancel: boolean;
|
|
3215
|
+
businessCanExtend: boolean;
|
|
3216
|
+
allowEndOfCycleCancellation: boolean;
|
|
3217
|
+
}
|
|
3218
|
+
interface PauseInfoNonNullableFields {
|
|
3219
|
+
pausePolicy: PausePolicy;
|
|
3220
|
+
pauseAt: PauseAt;
|
|
3221
|
+
resumeAt: ResumeAt;
|
|
3222
|
+
}
|
|
3223
|
+
interface CancellationInfoNonNullableFields {
|
|
3224
|
+
initiator: HistoryActionInitiator;
|
|
3225
|
+
}
|
|
3226
|
+
interface FixedPriceNonNullableFields {
|
|
3227
|
+
itemPrice: string;
|
|
3228
|
+
}
|
|
3229
|
+
interface PricingModelNonNullableFields {
|
|
3230
|
+
fixedPrice?: FixedPriceNonNullableFields;
|
|
3231
|
+
}
|
|
3232
|
+
interface ItemChangeNonNullableFields {
|
|
3233
|
+
_id: string;
|
|
3234
|
+
pricingModel?: PricingModelNonNullableFields;
|
|
3235
|
+
tax?: TaxNonNullableFields;
|
|
3236
|
+
}
|
|
3237
|
+
interface CatalogReferenceNonNullableFields {
|
|
3238
|
+
catalogItemId: string;
|
|
3239
|
+
}
|
|
3240
|
+
interface ApplicationFeeNonNullableFields {
|
|
3241
|
+
amount: string;
|
|
3242
|
+
discounts: DiscountNonNullableFields[];
|
|
3243
|
+
}
|
|
3244
|
+
interface ItemNonNullableFields {
|
|
3245
|
+
name: string;
|
|
3246
|
+
catalogReference?: CatalogReferenceNonNullableFields;
|
|
3247
|
+
category: ItemCategory;
|
|
3248
|
+
quantity: number;
|
|
3249
|
+
pricingModel?: PricingModelNonNullableFields;
|
|
3250
|
+
tax?: TaxNonNullableFields;
|
|
3251
|
+
discounts: DiscountNonNullableFields[];
|
|
3252
|
+
applicationFee?: ApplicationFeeNonNullableFields;
|
|
3253
|
+
}
|
|
3254
|
+
interface SubscriptionUpdateDataNonNullableFields {
|
|
3255
|
+
itemsToUpdate: ItemChangeNonNullableFields[];
|
|
3256
|
+
itemsToAdd: ItemNonNullableFields[];
|
|
3257
|
+
numberOfRequests: number;
|
|
3258
|
+
}
|
|
3259
|
+
interface SpecificDateSubscriptionUpdateDataNonNullableFields {
|
|
3260
|
+
updateData?: SubscriptionUpdateDataNonNullableFields;
|
|
3261
|
+
}
|
|
3262
|
+
interface SubscriptionNonNullableFields {
|
|
3263
|
+
name: string;
|
|
3264
|
+
customer?: CustomerNonNullableFields;
|
|
3265
|
+
status: SubscriptionStatusEnumSubscriptionStatus;
|
|
3266
|
+
billingSettings?: BillingSettingsNonNullableFields;
|
|
3267
|
+
billingStatus?: BillingStatusNonNullableFields;
|
|
3268
|
+
shippingAddress?: FullAddressDetailsNonNullableFields;
|
|
3269
|
+
policies?: SubscriptionPoliciesNonNullableFields;
|
|
3270
|
+
pauseInfo?: PauseInfoNonNullableFields;
|
|
3271
|
+
cancellationInfo?: CancellationInfoNonNullableFields;
|
|
3272
|
+
pendingUpdateData?: SubscriptionUpdateDataNonNullableFields;
|
|
3273
|
+
bassManaged: boolean;
|
|
3274
|
+
specificDatePendingUpdateData?: SpecificDateSubscriptionUpdateDataNonNullableFields;
|
|
3275
|
+
items: ItemNonNullableFields[];
|
|
3276
|
+
}
|
|
3277
|
+
interface SubscriptionCreatedNonNullableFields {
|
|
3278
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3279
|
+
}
|
|
3280
|
+
interface SubscriptionUpdatedNonNullableFields {
|
|
3281
|
+
current?: SubscriptionNonNullableFields;
|
|
3282
|
+
previous?: SubscriptionNonNullableFields;
|
|
3283
|
+
}
|
|
3284
|
+
interface SubscriptionDeletedNonNullableFields {
|
|
3285
|
+
subscriptionId: string;
|
|
3286
|
+
}
|
|
3287
|
+
interface SubscriptionActivatedNonNullableFields {
|
|
3288
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3289
|
+
}
|
|
3290
|
+
interface SubscriptionEndedNonNullableFields {
|
|
3291
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3292
|
+
}
|
|
3293
|
+
interface ActionDetailsNonNullableFields {
|
|
3294
|
+
initiator: HistoryActionInitiator;
|
|
3295
|
+
}
|
|
3296
|
+
interface SubscriptionCanceledNonNullableFields {
|
|
3297
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3298
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3299
|
+
}
|
|
3300
|
+
interface SubscriptionPausedNonNullableFields {
|
|
3301
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3302
|
+
pausePolicy: PausePolicy;
|
|
3303
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3304
|
+
}
|
|
3305
|
+
interface SubscriptionResumedNonNullableFields {
|
|
3306
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3307
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3308
|
+
}
|
|
3309
|
+
interface PauseSubscriptionRequestedNonNullableFields {
|
|
3310
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3311
|
+
pauseAt: PauseAt;
|
|
3312
|
+
pausePolicy: PausePolicy;
|
|
3313
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3314
|
+
}
|
|
3315
|
+
interface ResumeSubscriptionRequestedNonNullableFields {
|
|
3316
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3317
|
+
resumeAt: ResumeAt;
|
|
3318
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3319
|
+
}
|
|
3320
|
+
interface ScheduledPauseCanceledNonNullableFields {
|
|
3321
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3322
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3323
|
+
}
|
|
3324
|
+
interface ScheduledResumeCanceledNonNullableFields {
|
|
3325
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3326
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3327
|
+
}
|
|
3328
|
+
interface SubscriptionBillingCycleStartedNonNullableFields {
|
|
3329
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3330
|
+
}
|
|
3331
|
+
interface SubscriptionAutoRenewalTurnedOnNonNullableFields {
|
|
3332
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3333
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3334
|
+
}
|
|
3335
|
+
interface SubscriptionAutoRenewalTurnedOffNonNullableFields {
|
|
3336
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3337
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3338
|
+
}
|
|
3339
|
+
interface SubscriptionCycleReadyToPayNonNullableFields {
|
|
3340
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3341
|
+
}
|
|
3342
|
+
interface SubscriptionExtendedNonNullableFields {
|
|
3343
|
+
extensionPeriod?: DurationNonNullableFields;
|
|
3344
|
+
extensionBillingCycles: number;
|
|
3345
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3346
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3347
|
+
}
|
|
3348
|
+
interface SubscriptionInitialPurchaseCompletedNonNullableFields {
|
|
3349
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3350
|
+
actionDetails?: ActionDetailsNonNullableFields;
|
|
3351
|
+
}
|
|
3352
|
+
interface LatestInvoiceMarkedAsPaidNonNullableFields {
|
|
3353
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3354
|
+
}
|
|
3355
|
+
interface SubscriptionRevivedNonNullableFields {
|
|
3356
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3357
|
+
}
|
|
3358
|
+
interface SubscriptionBillingDateUpdatedNonNullableFields {
|
|
3359
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3360
|
+
proration?: ProrationNonNullableFields;
|
|
3361
|
+
}
|
|
3362
|
+
interface FutureUpdatesRequestedNonNullableFields {
|
|
3363
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3364
|
+
requestedUpdateData?: SubscriptionUpdateDataNonNullableFields;
|
|
3365
|
+
}
|
|
3366
|
+
interface UpdatesAppliedNonNullableFields {
|
|
3367
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3368
|
+
updateAction: UpdateAction;
|
|
3369
|
+
appliedUpdateData?: SubscriptionUpdateDataNonNullableFields;
|
|
3370
|
+
}
|
|
3371
|
+
interface ResetPendingUpdatesNonNullableFields {
|
|
3372
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3373
|
+
}
|
|
3374
|
+
interface GracePeriodStartedNonNullableFields {
|
|
3375
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3376
|
+
}
|
|
3377
|
+
interface GracePeriodEndedNonNullableFields {
|
|
3378
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3379
|
+
paymentSettlementMethod: PaymentSettlementMethod;
|
|
3380
|
+
}
|
|
3381
|
+
interface PaymentMethodUpdatedNonNullableFields {
|
|
3382
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3383
|
+
initiator: HistoryActionInitiator;
|
|
3384
|
+
paymentMode: PaymentMode;
|
|
3385
|
+
}
|
|
3386
|
+
interface SubscriptionCollectionMethodUpdatedNonNullableFields {
|
|
3387
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3388
|
+
newCollectionMethod: CollectionMethodEnumCollectionMethod;
|
|
3389
|
+
previousCollectionMethod: CollectionMethodEnumCollectionMethod;
|
|
3390
|
+
}
|
|
3391
|
+
interface FreeTrailStartedNonNullableFields {
|
|
3392
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3393
|
+
}
|
|
3394
|
+
interface FreeTrailEndedNonNullableFields {
|
|
3395
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3396
|
+
}
|
|
3397
|
+
interface InvoiceMarkedAsPaidNonNullableFields {
|
|
3398
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3399
|
+
paidCycle: number;
|
|
3400
|
+
invoiceId: string;
|
|
3401
|
+
}
|
|
3402
|
+
interface InitiatedPaymentMethodSetupNonNullableFields {
|
|
3403
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3404
|
+
}
|
|
3405
|
+
interface SubscriptionBackOfficeActionNonNullableFields {
|
|
3406
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3407
|
+
name: string;
|
|
3408
|
+
params: string;
|
|
3409
|
+
}
|
|
3410
|
+
interface SubscriptionEventNonNullableFields {
|
|
3411
|
+
created?: SubscriptionCreatedNonNullableFields;
|
|
3412
|
+
updated?: SubscriptionUpdatedNonNullableFields;
|
|
3413
|
+
deleted?: SubscriptionDeletedNonNullableFields;
|
|
3414
|
+
activated?: SubscriptionActivatedNonNullableFields;
|
|
3415
|
+
ended?: SubscriptionEndedNonNullableFields;
|
|
3416
|
+
canceled?: SubscriptionCanceledNonNullableFields;
|
|
3417
|
+
paused?: SubscriptionPausedNonNullableFields;
|
|
3418
|
+
resumed?: SubscriptionResumedNonNullableFields;
|
|
3419
|
+
pauseRequested?: PauseSubscriptionRequestedNonNullableFields;
|
|
3420
|
+
resumeRequested?: ResumeSubscriptionRequestedNonNullableFields;
|
|
3421
|
+
scheduledPauseCanceled?: ScheduledPauseCanceledNonNullableFields;
|
|
3422
|
+
scheduledResumeCanceled?: ScheduledResumeCanceledNonNullableFields;
|
|
3423
|
+
billingCycleStarted?: SubscriptionBillingCycleStartedNonNullableFields;
|
|
3424
|
+
autoRenewalTurnedOn?: SubscriptionAutoRenewalTurnedOnNonNullableFields;
|
|
3425
|
+
autoRenewalTurnedOff?: SubscriptionAutoRenewalTurnedOffNonNullableFields;
|
|
3426
|
+
cycleReadyToPay?: SubscriptionCycleReadyToPayNonNullableFields;
|
|
3427
|
+
extended?: SubscriptionExtendedNonNullableFields;
|
|
3428
|
+
initialPurchaseCompleted?: SubscriptionInitialPurchaseCompletedNonNullableFields;
|
|
3429
|
+
latestInvoiceMarkedAsPaid?: LatestInvoiceMarkedAsPaidNonNullableFields;
|
|
3430
|
+
revived?: SubscriptionRevivedNonNullableFields;
|
|
3431
|
+
billingDateUpdated?: SubscriptionBillingDateUpdatedNonNullableFields;
|
|
3432
|
+
futureUpdatesRequested?: FutureUpdatesRequestedNonNullableFields;
|
|
3433
|
+
updatesApplied?: UpdatesAppliedNonNullableFields;
|
|
3434
|
+
resetPendingUpdates?: ResetPendingUpdatesNonNullableFields;
|
|
3435
|
+
gracePeriodStarted?: GracePeriodStartedNonNullableFields;
|
|
3436
|
+
gracePeriodEnded?: GracePeriodEndedNonNullableFields;
|
|
3437
|
+
paymentMethodUpdated?: PaymentMethodUpdatedNonNullableFields;
|
|
3438
|
+
collectionMethodUpdated?: SubscriptionCollectionMethodUpdatedNonNullableFields;
|
|
3439
|
+
freeTrailStarted?: FreeTrailStartedNonNullableFields;
|
|
3440
|
+
freeTrailEnded?: FreeTrailEndedNonNullableFields;
|
|
3441
|
+
invoiceMarkedAsPaid?: InvoiceMarkedAsPaidNonNullableFields;
|
|
3442
|
+
initiatePaymentMethodSetup?: InitiatedPaymentMethodSetupNonNullableFields;
|
|
3443
|
+
subscriptionBoAction?: SubscriptionBackOfficeActionNonNullableFields;
|
|
3444
|
+
}
|
|
3445
|
+
interface SubscriptionHistoryEntryNonNullableFields {
|
|
3446
|
+
entryId: string;
|
|
3447
|
+
slug: string;
|
|
3448
|
+
event?: SubscriptionEventNonNullableFields;
|
|
3449
|
+
}
|
|
3450
|
+
export interface ListSubscriptionHistoryResponseNonNullableFields {
|
|
3451
|
+
historyEntries: SubscriptionHistoryEntryNonNullableFields[];
|
|
3452
|
+
}
|
|
3453
|
+
export interface GetSubscriptionResponseNonNullableFields {
|
|
3454
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3455
|
+
}
|
|
3456
|
+
export interface CustomerCancelSubscriptionResponseNonNullableFields {
|
|
3457
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3458
|
+
}
|
|
3459
|
+
export interface CustomerTurnOnAutoRenewalResponseNonNullableFields {
|
|
3460
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3461
|
+
}
|
|
3462
|
+
export interface CustomerTurnOffAutoRenewalResponseNonNullableFields {
|
|
3463
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3464
|
+
}
|
|
3465
|
+
export interface CustomerExtendSubscriptionResponseNonNullableFields {
|
|
3466
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3467
|
+
}
|
|
3468
|
+
export interface QuerySubscriptionsResponseNonNullableFields {
|
|
3469
|
+
subscriptions: SubscriptionNonNullableFields[];
|
|
3470
|
+
}
|
|
3471
|
+
export interface UpdateSubscriptionPaymentMethodResponseNonNullableFields {
|
|
3472
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3473
|
+
}
|
|
3474
|
+
interface ActionNonNullableFields {
|
|
3475
|
+
actionType: ActionType;
|
|
3476
|
+
pausePolicies: PausePolicy[];
|
|
3477
|
+
pauseAt: PauseAt[];
|
|
3478
|
+
resumeAt: ResumeAt[];
|
|
3479
|
+
extendPolicies: ExtendPolicyType[];
|
|
3480
|
+
}
|
|
3481
|
+
export interface CustomerAllowedActionsResponseNonNullableFields {
|
|
3482
|
+
actions: ActionNonNullableFields[];
|
|
3483
|
+
}
|
|
3484
|
+
interface RecurringNonNullableFields {
|
|
3485
|
+
cycleNumber: number;
|
|
3486
|
+
}
|
|
3487
|
+
interface InvoiceDiscountNonNullableFields {
|
|
3488
|
+
amount: string;
|
|
3489
|
+
percentage: string;
|
|
3490
|
+
origin?: DiscountOriginNonNullableFields;
|
|
3491
|
+
}
|
|
3492
|
+
interface InvoiceApplicationFeeNonNullableFields {
|
|
3493
|
+
amount: string;
|
|
3494
|
+
discount?: InvoiceDiscountNonNullableFields;
|
|
3495
|
+
}
|
|
3496
|
+
interface PriceDetailsNonNullableFields {
|
|
3497
|
+
price: string;
|
|
3498
|
+
tax?: TaxNonNullableFields;
|
|
3499
|
+
discount?: InvoiceDiscountNonNullableFields;
|
|
3500
|
+
applicationFeeDetails?: InvoiceApplicationFeeNonNullableFields;
|
|
3501
|
+
}
|
|
3502
|
+
interface LineItemTaxSummaryNonNullableFields {
|
|
3503
|
+
aggregatedTaxAmount: string;
|
|
3504
|
+
aggregatedTaxRate: string;
|
|
3505
|
+
taxableAmount: string;
|
|
3506
|
+
}
|
|
3507
|
+
interface TaxBreakdownNonNullableFields {
|
|
3508
|
+
taxType: string;
|
|
3509
|
+
taxRate: string;
|
|
3510
|
+
jurisdictionType: string;
|
|
3511
|
+
}
|
|
3512
|
+
interface ItemTaxDataNonNullableFields {
|
|
3513
|
+
lineItemTaxSummary?: LineItemTaxSummaryNonNullableFields;
|
|
3514
|
+
taxBreakdowns: TaxBreakdownNonNullableFields[];
|
|
3515
|
+
}
|
|
3516
|
+
interface InvoiceItemNonNullableFields {
|
|
3517
|
+
recurring?: RecurringNonNullableFields;
|
|
3518
|
+
_id: string;
|
|
3519
|
+
name: string;
|
|
3520
|
+
catalogReference?: CatalogReferenceNonNullableFields;
|
|
3521
|
+
category: ItemCategory;
|
|
3522
|
+
quantity: number;
|
|
3523
|
+
priceDetails?: PriceDetailsNonNullableFields;
|
|
3524
|
+
totals?: TotalsNonNullableFields;
|
|
3525
|
+
taxData?: ItemTaxDataNonNullableFields;
|
|
3526
|
+
}
|
|
3527
|
+
interface SubscriptionChargeNonNullableFields {
|
|
3528
|
+
cycle: number;
|
|
3529
|
+
totals?: TotalsNonNullableFields;
|
|
3530
|
+
invoiceItems: InvoiceItemNonNullableFields[];
|
|
3531
|
+
discount?: InvoiceDiscountNonNullableFields;
|
|
3532
|
+
}
|
|
3533
|
+
export interface CustomerListUpcomingChargesResponseNonNullableFields {
|
|
3534
|
+
upcomingCharge?: SubscriptionChargeNonNullableFields;
|
|
3535
|
+
}
|
|
3536
|
+
export interface InitiatePaymentMethodSetupResponseNonNullableFields {
|
|
3537
|
+
paymentOrderId: string;
|
|
3538
|
+
}
|
|
3539
|
+
export interface UpdateSubscriptionBillingDateResponseNonNullableFields {
|
|
3540
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3541
|
+
}
|
|
3542
|
+
export interface CancelSubscriptionResponseNonNullableFields {
|
|
3543
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3544
|
+
}
|
|
3545
|
+
export interface PauseSubscriptionResponseNonNullableFields {
|
|
3546
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3547
|
+
}
|
|
3548
|
+
export interface ResumeSubscriptionResponseNonNullableFields {
|
|
3549
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3550
|
+
}
|
|
3551
|
+
export interface SearchSubscriptionsResponseNonNullableFields {
|
|
3552
|
+
subscriptions: SubscriptionNonNullableFields[];
|
|
3553
|
+
}
|
|
3554
|
+
interface CountByStatusNonNullableFields {
|
|
3555
|
+
status: SubscriptionStatusEnumSubscriptionStatus;
|
|
3556
|
+
count: number;
|
|
3557
|
+
}
|
|
3558
|
+
export interface CountSubscriptionsResponseNonNullableFields {
|
|
3559
|
+
countByStatus: CountByStatusNonNullableFields[];
|
|
3560
|
+
total: number;
|
|
3561
|
+
}
|
|
3562
|
+
export interface TurnOnSubscriptionAutoRenewalResponseNonNullableFields {
|
|
3563
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3564
|
+
}
|
|
3565
|
+
export interface TurnOffSubscriptionAutoRenewalResponseNonNullableFields {
|
|
3566
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3567
|
+
}
|
|
3568
|
+
export interface MarkLatestInvoiceAsPaidResponseNonNullableFields {
|
|
3569
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3570
|
+
}
|
|
3571
|
+
export interface MarkInvoiceAsPaidResponseNonNullableFields {
|
|
3572
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3573
|
+
}
|
|
3574
|
+
interface AmountByStatusNonNullableFields {
|
|
3575
|
+
status: SubscriptionStatusEnumSubscriptionStatus;
|
|
3576
|
+
amount: number;
|
|
3577
|
+
}
|
|
3578
|
+
export interface GetSubscriptionsStatsResponseNonNullableFields {
|
|
3579
|
+
amountByStatuses: AmountByStatusNonNullableFields[];
|
|
3580
|
+
total: number;
|
|
3581
|
+
}
|
|
3582
|
+
export interface ExtendSubscriptionResponseNonNullableFields {
|
|
3583
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3584
|
+
}
|
|
3585
|
+
interface UnsupportedReasonNonNullableFields {
|
|
3586
|
+
code: string;
|
|
3587
|
+
}
|
|
3588
|
+
interface UnsupportedActionNonNullableFields {
|
|
3589
|
+
actionType: ActionType;
|
|
3590
|
+
reasons: UnsupportedReasonNonNullableFields[];
|
|
3591
|
+
}
|
|
3592
|
+
export interface AllowedActionsResponseNonNullableFields {
|
|
3593
|
+
actions: ActionNonNullableFields[];
|
|
3594
|
+
unsupportedActions: UnsupportedActionNonNullableFields[];
|
|
3595
|
+
}
|
|
3596
|
+
export interface ListUpcomingChargesResponseNonNullableFields {
|
|
3597
|
+
upcomingCharges: SubscriptionChargeNonNullableFields[];
|
|
3598
|
+
}
|
|
3599
|
+
interface ChargeNonNullableFields {
|
|
3600
|
+
cycleFrom: number;
|
|
3601
|
+
totals?: TotalsNonNullableFields;
|
|
3602
|
+
}
|
|
3603
|
+
export interface PreviewSubscriptionChargesResponseNonNullableFields {
|
|
3604
|
+
charges: ChargeNonNullableFields[];
|
|
3605
|
+
}
|
|
3606
|
+
interface SubscriptionChargesNonNullableFields {
|
|
3607
|
+
charges: ChargeNonNullableFields[];
|
|
3608
|
+
}
|
|
3609
|
+
export interface PreviewSubscriptionsChargesResponseNonNullableFields {
|
|
3610
|
+
subscriptionsCharges: SubscriptionChargesNonNullableFields[];
|
|
3611
|
+
}
|
|
3612
|
+
export interface PayCycleResponseNonNullableFields {
|
|
3613
|
+
invoiceId: string;
|
|
3614
|
+
subscription?: SubscriptionNonNullableFields;
|
|
3615
|
+
}
|
|
3616
|
+
export interface BaseEventMetadata {
|
|
3617
|
+
/** App instance ID. */
|
|
3618
|
+
instanceId?: string | null;
|
|
3619
|
+
/** Event type. */
|
|
3620
|
+
eventType?: string;
|
|
3621
|
+
/** The identification type and identity data. */
|
|
3622
|
+
identity?: IdentificationData;
|
|
3623
|
+
}
|
|
3624
|
+
export interface EventMetadata extends BaseEventMetadata {
|
|
3625
|
+
/**
|
|
3626
|
+
* Unique event ID.
|
|
3627
|
+
* Allows clients to ignore duplicate webhooks.
|
|
3628
|
+
*/
|
|
3629
|
+
_id?: string;
|
|
3630
|
+
/**
|
|
3631
|
+
* Assumes actions are also always typed to an entity_type
|
|
3632
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
3633
|
+
*/
|
|
3634
|
+
entityFqdn?: string;
|
|
3635
|
+
/**
|
|
3636
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
3637
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
3638
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
3639
|
+
*/
|
|
3640
|
+
slug?: string;
|
|
3641
|
+
/** ID of the entity associated with the event. */
|
|
3642
|
+
entityId?: string;
|
|
3643
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
3644
|
+
eventTime?: Date | null;
|
|
3645
|
+
/**
|
|
3646
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
3647
|
+
* (for example, GDPR).
|
|
3648
|
+
*/
|
|
3649
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
3650
|
+
/** If present, indicates the action that triggered the event. */
|
|
3651
|
+
originatedFrom?: string | null;
|
|
3652
|
+
/**
|
|
3653
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
3654
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
3655
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
3656
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
3657
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
3658
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
3659
|
+
*/
|
|
3660
|
+
entityEventSequence?: string | null;
|
|
3661
|
+
}
|
|
3662
|
+
export interface SubscriptionCanceledEnvelope {
|
|
3663
|
+
data: SubscriptionCanceled;
|
|
3664
|
+
metadata: EventMetadata;
|
|
3665
|
+
}
|
|
3666
|
+
/**
|
|
3667
|
+
* Triggered when a subscription is canceled.
|
|
3668
|
+
* @permissionScope Manage Events
|
|
3669
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3670
|
+
* @permissionId subscriptions.view
|
|
3671
|
+
* @webhook
|
|
3672
|
+
* @eventType wix.billing.v1.subscription_canceled
|
|
3673
|
+
* @documentationMaturity preview
|
|
3674
|
+
*/
|
|
3675
|
+
export declare function onSubscriptionCanceled(handler: (event: SubscriptionCanceledEnvelope) => void | Promise<void>): void;
|
|
3676
|
+
export interface SubscriptionExtendedEnvelope {
|
|
3677
|
+
data: SubscriptionExtended;
|
|
3678
|
+
metadata: EventMetadata;
|
|
3679
|
+
}
|
|
3680
|
+
/**
|
|
3681
|
+
* Triggered when subscription has been extended
|
|
3682
|
+
* @permissionScope Manage Events
|
|
3683
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3684
|
+
* @permissionId subscriptions.view
|
|
3685
|
+
* @webhook
|
|
3686
|
+
* @eventType wix.billing.v1.subscription_extended
|
|
3687
|
+
* @documentationMaturity preview
|
|
3688
|
+
*/
|
|
3689
|
+
export declare function onSubscriptionExtended(handler: (event: SubscriptionExtendedEnvelope) => void | Promise<void>): void;
|
|
3690
|
+
export interface SubscriptionUpdatedEnvelope {
|
|
3691
|
+
entity: Subscription;
|
|
3692
|
+
metadata: EventMetadata;
|
|
3693
|
+
}
|
|
3694
|
+
/**
|
|
3695
|
+
* Triggered when a subscription is updated.
|
|
3696
|
+
* @permissionScope Manage Events
|
|
3697
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3698
|
+
* @permissionId subscriptions.view
|
|
3699
|
+
* @webhook
|
|
3700
|
+
* @eventType wix.billing.v1.subscription_updated
|
|
3701
|
+
* @documentationMaturity preview
|
|
3702
|
+
*/
|
|
3703
|
+
export declare function onSubscriptionUpdated(handler: (event: SubscriptionUpdatedEnvelope) => void | Promise<void>): void;
|
|
3704
|
+
export interface SubscriptionAutoRenewalTurnedOffEnvelope {
|
|
3705
|
+
data: SubscriptionAutoRenewalTurnedOff;
|
|
3706
|
+
metadata: EventMetadata;
|
|
3707
|
+
}
|
|
3708
|
+
/**
|
|
3709
|
+
* Triggered when a subscription cycleAutoRenew was turned off.
|
|
3710
|
+
* @permissionScope Manage Events
|
|
3711
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3712
|
+
* @permissionId subscriptions.view
|
|
3713
|
+
* @webhook
|
|
3714
|
+
* @eventType wix.billing.v1.subscription_auto_renewal_turned_off
|
|
3715
|
+
* @documentationMaturity preview
|
|
3716
|
+
*/
|
|
3717
|
+
export declare function onSubscriptionAutoRenewalTurnedOff(handler: (event: SubscriptionAutoRenewalTurnedOffEnvelope) => void | Promise<void>): void;
|
|
3718
|
+
export interface SubscriptionAutoRenewalTurnedOnEnvelope {
|
|
3719
|
+
data: SubscriptionAutoRenewalTurnedOn;
|
|
3720
|
+
metadata: EventMetadata;
|
|
3721
|
+
}
|
|
3722
|
+
/**
|
|
3723
|
+
* Triggered when a subscription cycleAutoRenew was turned on.
|
|
3724
|
+
* @permissionScope Manage Events
|
|
3725
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3726
|
+
* @permissionId subscriptions.view
|
|
3727
|
+
* @webhook
|
|
3728
|
+
* @eventType wix.billing.v1.subscription_auto_renewal_turned_on
|
|
3729
|
+
* @documentationMaturity preview
|
|
3730
|
+
*/
|
|
3731
|
+
export declare function onSubscriptionAutoRenewalTurnedOn(handler: (event: SubscriptionAutoRenewalTurnedOnEnvelope) => void | Promise<void>): void;
|
|
3732
|
+
export interface SubscriptionBillingDateUpdatedEnvelope {
|
|
3733
|
+
data: SubscriptionBillingDateUpdated;
|
|
3734
|
+
metadata: EventMetadata;
|
|
3735
|
+
}
|
|
3736
|
+
/**
|
|
3737
|
+
* Triggered when subscription has been extended
|
|
3738
|
+
* @permissionScope Manage Events
|
|
3739
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3740
|
+
* @permissionId subscriptions.view
|
|
3741
|
+
* @webhook
|
|
3742
|
+
* @eventType wix.billing.v1.subscription_billing_date_updated
|
|
3743
|
+
* @documentationMaturity preview
|
|
3744
|
+
*/
|
|
3745
|
+
export declare function onSubscriptionBillingDateUpdated(handler: (event: SubscriptionBillingDateUpdatedEnvelope) => void | Promise<void>): void;
|
|
3746
|
+
export interface SubscriptionLatestInvoiceMarkedAsPaidEnvelope {
|
|
3747
|
+
data: LatestInvoiceMarkedAsPaid;
|
|
3748
|
+
metadata: EventMetadata;
|
|
3749
|
+
}
|
|
3750
|
+
/** @permissionScope Manage Events
|
|
3751
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3752
|
+
* @permissionId subscriptions.view
|
|
3753
|
+
* @webhook
|
|
3754
|
+
* @eventType wix.billing.v1.subscription_latest_invoice_marked_as_paid
|
|
3755
|
+
* @documentationMaturity preview
|
|
3756
|
+
*/
|
|
3757
|
+
export declare function onSubscriptionLatestInvoiceMarkedAsPaid(handler: (event: SubscriptionLatestInvoiceMarkedAsPaidEnvelope) => void | Promise<void>): void;
|
|
3758
|
+
export interface SubscriptionPauseScheduleCanceledEnvelope {
|
|
3759
|
+
data: ScheduledPauseCanceled;
|
|
3760
|
+
metadata: EventMetadata;
|
|
3761
|
+
}
|
|
3762
|
+
/**
|
|
3763
|
+
* Triggered when scheduled pause canceled
|
|
3764
|
+
* @permissionScope Manage Events
|
|
3765
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3766
|
+
* @permissionId subscriptions.view
|
|
3767
|
+
* @webhook
|
|
3768
|
+
* @eventType wix.billing.v1.subscription_pause_schedule_canceled
|
|
3769
|
+
* @documentationMaturity preview
|
|
3770
|
+
*/
|
|
3771
|
+
export declare function onSubscriptionPauseScheduleCanceled(handler: (event: SubscriptionPauseScheduleCanceledEnvelope) => void | Promise<void>): void;
|
|
3772
|
+
export interface SubscriptionPauseScheduledEnvelope {
|
|
3773
|
+
data: PauseSubscriptionRequested;
|
|
3774
|
+
metadata: EventMetadata;
|
|
3775
|
+
}
|
|
3776
|
+
/**
|
|
3777
|
+
* Triggered when pause subscription requested
|
|
3778
|
+
* @permissionScope Manage Events
|
|
3779
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3780
|
+
* @permissionId subscriptions.view
|
|
3781
|
+
* @webhook
|
|
3782
|
+
* @eventType wix.billing.v1.subscription_pause_scheduled
|
|
3783
|
+
* @documentationMaturity preview
|
|
3784
|
+
*/
|
|
3785
|
+
export declare function onSubscriptionPauseScheduled(handler: (event: SubscriptionPauseScheduledEnvelope) => void | Promise<void>): void;
|
|
3786
|
+
export interface SubscriptionPausedEnvelope {
|
|
3787
|
+
data: SubscriptionPaused;
|
|
3788
|
+
metadata: EventMetadata;
|
|
3789
|
+
}
|
|
3790
|
+
/**
|
|
3791
|
+
* Triggered when a subscription is paused.
|
|
3792
|
+
* @permissionScope Manage Events
|
|
3793
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3794
|
+
* @permissionId subscriptions.view
|
|
3795
|
+
* @webhook
|
|
3796
|
+
* @eventType wix.billing.v1.subscription_paused
|
|
3797
|
+
* @documentationMaturity preview
|
|
3798
|
+
*/
|
|
3799
|
+
export declare function onSubscriptionPaused(handler: (event: SubscriptionPausedEnvelope) => void | Promise<void>): void;
|
|
3800
|
+
export interface SubscriptionResumeScheduleCanceledEnvelope {
|
|
3801
|
+
data: ScheduledResumeCanceled;
|
|
3802
|
+
metadata: EventMetadata;
|
|
3803
|
+
}
|
|
3804
|
+
/**
|
|
3805
|
+
* Triggered when scheduled pause canceled
|
|
3806
|
+
* @permissionScope Manage Events
|
|
3807
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3808
|
+
* @permissionId subscriptions.view
|
|
3809
|
+
* @webhook
|
|
3810
|
+
* @eventType wix.billing.v1.subscription_resume_schedule_canceled
|
|
3811
|
+
* @documentationMaturity preview
|
|
3812
|
+
*/
|
|
3813
|
+
export declare function onSubscriptionResumeScheduleCanceled(handler: (event: SubscriptionResumeScheduleCanceledEnvelope) => void | Promise<void>): void;
|
|
3814
|
+
export interface SubscriptionResumeScheduledEnvelope {
|
|
3815
|
+
data: ResumeSubscriptionRequested;
|
|
3816
|
+
metadata: EventMetadata;
|
|
3817
|
+
}
|
|
3818
|
+
/**
|
|
3819
|
+
* Triggered when resume subscription requested
|
|
3820
|
+
* @permissionScope Manage Events
|
|
3821
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3822
|
+
* @permissionId subscriptions.view
|
|
3823
|
+
* @webhook
|
|
3824
|
+
* @eventType wix.billing.v1.subscription_resume_scheduled
|
|
3825
|
+
* @documentationMaturity preview
|
|
3826
|
+
*/
|
|
3827
|
+
export declare function onSubscriptionResumeScheduled(handler: (event: SubscriptionResumeScheduledEnvelope) => void | Promise<void>): void;
|
|
3828
|
+
export interface SubscriptionResumedEnvelope {
|
|
3829
|
+
data: SubscriptionResumed;
|
|
3830
|
+
metadata: EventMetadata;
|
|
3831
|
+
}
|
|
3832
|
+
/**
|
|
3833
|
+
* Triggered when a subscription is resumed.
|
|
3834
|
+
* @permissionScope Manage Events
|
|
3835
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3836
|
+
* @permissionId subscriptions.view
|
|
3837
|
+
* @webhook
|
|
3838
|
+
* @eventType wix.billing.v1.subscription_resumed
|
|
3839
|
+
* @documentationMaturity preview
|
|
3840
|
+
*/
|
|
3841
|
+
export declare function onSubscriptionResumed(handler: (event: SubscriptionResumedEnvelope) => void | Promise<void>): void;
|
|
3842
|
+
/** @public
|
|
3843
|
+
* @documentationMaturity preview
|
|
3844
|
+
* @requiredField subscriptionId
|
|
3845
|
+
* @permissionId subscriptions.view
|
|
3846
|
+
* @permissionScope Manage Events
|
|
3847
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3848
|
+
* @applicableIdentity APP
|
|
3849
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionHistoryService.ListSubscriptionHistory
|
|
3850
|
+
*/
|
|
3851
|
+
export declare function listSubscriptionHistory(subscriptionId: string, options?: ListSubscriptionHistoryOptions): Promise<ListSubscriptionHistoryResponse & ListSubscriptionHistoryResponseNonNullableFields>;
|
|
3852
|
+
export interface ListSubscriptionHistoryOptions {
|
|
3853
|
+
/** Determines the type of view for the history: either a comprehensive backoffice view or a user-centric view. */
|
|
3854
|
+
mode?: HistoryViewMode;
|
|
3855
|
+
/** Cursor for efficient paging. If paging through results, pass this field from the previous search response to continue to the next page. */
|
|
3856
|
+
cursor?: CursorPaging;
|
|
3857
|
+
}
|
|
3858
|
+
/**
|
|
3859
|
+
* Identity must be a site member and customer subscription belongs to
|
|
3860
|
+
* @public
|
|
3861
|
+
* @documentationMaturity preview
|
|
3862
|
+
* @requiredField _id
|
|
3863
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.GetSubscription
|
|
3864
|
+
*/
|
|
3865
|
+
export declare function customerGetSubscription(_id: string): Promise<GetSubscriptionResponse & GetSubscriptionResponseNonNullableFields>;
|
|
3866
|
+
/**
|
|
3867
|
+
* Identity must be a site member and customer subscription belongs to
|
|
3868
|
+
* @public
|
|
3869
|
+
* @documentationMaturity preview
|
|
3870
|
+
* @requiredField _id
|
|
3871
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.CancelSubscription
|
|
3872
|
+
*/
|
|
3873
|
+
export declare function customerCancelSubscription(_id: string, options?: CustomerCancelSubscriptionOptions): Promise<CustomerCancelSubscriptionResponse & CustomerCancelSubscriptionResponseNonNullableFields>;
|
|
3874
|
+
export interface CustomerCancelSubscriptionOptions {
|
|
3875
|
+
/** Optional action reason message */
|
|
3876
|
+
reason?: string | null;
|
|
3877
|
+
}
|
|
3878
|
+
/**
|
|
3879
|
+
* Identity must be a site member and customer subscription belongs to
|
|
3880
|
+
* @public
|
|
3881
|
+
* @documentationMaturity preview
|
|
3882
|
+
* @requiredField _id
|
|
3883
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOnSubscriptionAutoRenewal
|
|
3884
|
+
*/
|
|
3885
|
+
export declare function customerTurnOnSubscriptionAutoRenewal(_id: string, options?: CustomerTurnOnSubscriptionAutoRenewalOptions): Promise<CustomerTurnOnAutoRenewalResponse & CustomerTurnOnAutoRenewalResponseNonNullableFields>;
|
|
3886
|
+
export interface CustomerTurnOnSubscriptionAutoRenewalOptions {
|
|
3887
|
+
/** Optional action reason message */
|
|
3888
|
+
reason?: string | null;
|
|
3889
|
+
}
|
|
3890
|
+
/**
|
|
3891
|
+
* Identity must be a site member and customer subscription belongs to
|
|
3892
|
+
* @public
|
|
3893
|
+
* @documentationMaturity preview
|
|
3894
|
+
* @requiredField _id
|
|
3895
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.TurnOffSubscriptionAutoRenewal
|
|
3896
|
+
*/
|
|
3897
|
+
export declare function customerTurnOffSubscriptionAutoRenewal(_id: string, options?: CustomerTurnOffSubscriptionAutoRenewalOptions): Promise<CustomerTurnOffAutoRenewalResponse & CustomerTurnOffAutoRenewalResponseNonNullableFields>;
|
|
3898
|
+
export interface CustomerTurnOffSubscriptionAutoRenewalOptions {
|
|
3899
|
+
/** Optional action reason message */
|
|
3900
|
+
reason?: string | null;
|
|
3901
|
+
}
|
|
3902
|
+
/** @param _id - The ID of the subscription to be extended
|
|
3903
|
+
* @public
|
|
3904
|
+
* @documentationMaturity preview
|
|
3905
|
+
* @requiredField _id
|
|
3906
|
+
* @requiredField options.billingCyclesToAdd
|
|
3907
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ExtendSubscription
|
|
3908
|
+
*/
|
|
3909
|
+
export declare function customerExtendSubscription(_id: string, options?: CustomerExtendSubscriptionOptions): Promise<CustomerExtendSubscriptionResponse & CustomerExtendSubscriptionResponseNonNullableFields>;
|
|
3910
|
+
export interface CustomerExtendSubscriptionOptions {
|
|
3911
|
+
/** Optional action reason message */
|
|
3912
|
+
reason?: string | null;
|
|
3913
|
+
/** For termed - Subscription end date will be updated with the extension period and number of cycles will be added */
|
|
3914
|
+
billingCyclesToAdd: number | null;
|
|
3915
|
+
}
|
|
3916
|
+
/**
|
|
3917
|
+
* identity must be a site member
|
|
3918
|
+
* @public
|
|
3919
|
+
* @documentationMaturity preview
|
|
3920
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.QuerySubscriptions
|
|
3921
|
+
*/
|
|
3922
|
+
export declare function customerQuerySubscriptions(options?: CustomerQuerySubscriptionsOptions): Promise<QuerySubscriptionsResponse & QuerySubscriptionsResponseNonNullableFields>;
|
|
3923
|
+
export interface CustomerQuerySubscriptionsOptions {
|
|
3924
|
+
query?: QueryV2;
|
|
3925
|
+
}
|
|
3926
|
+
/**
|
|
3927
|
+
* Update subscription's payment method.
|
|
3928
|
+
* Supported only for recurring subscriptions or one time subscriptions during free trial.
|
|
3929
|
+
* @param _id - Subscription ID
|
|
3930
|
+
* @public
|
|
3931
|
+
* @documentationMaturity preview
|
|
3932
|
+
* @requiredField _id
|
|
3933
|
+
* @requiredField paymentMethodId
|
|
3934
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.UpdateSubscriptionPaymentMethod
|
|
3935
|
+
*/
|
|
3936
|
+
export declare function customerUpdateSubscriptionPaymentMethod(_id: string, paymentMethodId: string): Promise<UpdateSubscriptionPaymentMethodResponse & UpdateSubscriptionPaymentMethodResponseNonNullableFields>;
|
|
3937
|
+
/** @public
|
|
3938
|
+
* @documentationMaturity preview
|
|
3939
|
+
* @requiredField _id
|
|
3940
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.AllowedActions
|
|
3941
|
+
*/
|
|
3942
|
+
export declare function customerAllowedActions(_id: string): Promise<CustomerAllowedActionsResponse & CustomerAllowedActionsResponseNonNullableFields>;
|
|
3943
|
+
/**
|
|
3944
|
+
* List future subscriptions charges.
|
|
3945
|
+
* @param _id - Subscription id upcoming charge to be previewed for
|
|
3946
|
+
* @public
|
|
3947
|
+
* @documentationMaturity preview
|
|
3948
|
+
* @requiredField _id
|
|
3949
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.ListUpcomingCharges
|
|
3950
|
+
*/
|
|
3951
|
+
export declare function customerListUpcomingCharges(_id: string): Promise<CustomerListUpcomingChargesResponse & CustomerListUpcomingChargesResponseNonNullableFields>;
|
|
3952
|
+
/**
|
|
3953
|
+
* Creates auto-charge order that can be paid by customer
|
|
3954
|
+
* @public
|
|
3955
|
+
* @documentationMaturity preview
|
|
3956
|
+
* @requiredField _id
|
|
3957
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.CustomerSubscriptionsService.InitiatePaymentMethodSetup
|
|
3958
|
+
*/
|
|
3959
|
+
export declare function customerInitiatePaymentMethodSetup(_id: string, options?: CustomerInitiatePaymentMethodSetupOptions): Promise<InitiatePaymentMethodSetupResponse & InitiatePaymentMethodSetupResponseNonNullableFields>;
|
|
3960
|
+
export interface CustomerInitiatePaymentMethodSetupOptions {
|
|
3961
|
+
paymentMode?: PaymentMode;
|
|
3962
|
+
paymentSettings?: PaymentSettings;
|
|
3963
|
+
}
|
|
3964
|
+
/**
|
|
3965
|
+
* Returns a single subscription by its id
|
|
3966
|
+
* @public
|
|
3967
|
+
* @documentationMaturity preview
|
|
3968
|
+
* @requiredField _id
|
|
3969
|
+
* @permissionId subscriptions.view
|
|
3970
|
+
* @permissionScope Manage Events
|
|
3971
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
3972
|
+
* @applicableIdentity APP
|
|
3973
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscription
|
|
3974
|
+
*/
|
|
3975
|
+
export declare function getSubscription(_id: string): Promise<GetSubscriptionResponse & GetSubscriptionResponseNonNullableFields>;
|
|
3976
|
+
/**
|
|
3977
|
+
* Update subscription's payment method.
|
|
3978
|
+
* Supported only for recurring subscriptions or one time subscriptions during free trial.
|
|
3979
|
+
* @param _id - Subscription ID
|
|
3980
|
+
* @public
|
|
3981
|
+
* @documentationMaturity preview
|
|
3982
|
+
* @requiredField _id
|
|
3983
|
+
* @requiredField paymentMethodId
|
|
3984
|
+
* @permissionId subscriptions.manage
|
|
3985
|
+
* @permissionScope Manage Orders
|
|
3986
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
3987
|
+
* @applicableIdentity APP
|
|
3988
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionPaymentMethod
|
|
3989
|
+
*/
|
|
3990
|
+
export declare function updateSubscriptionPaymentMethod(_id: string, paymentMethodId: string): Promise<UpdateSubscriptionPaymentMethodResponse & UpdateSubscriptionPaymentMethodResponseNonNullableFields>;
|
|
3991
|
+
/**
|
|
3992
|
+
* Updates the next billing date for a subscription.
|
|
3993
|
+
*
|
|
3994
|
+
*
|
|
3995
|
+
* Updating the billing date may add a proration charge or credit to the next
|
|
3996
|
+
* invoice. The customer must pay more in case you extend the current billing
|
|
3997
|
+
* cycle. They pay less in case you shorten the current billing cycle. You can
|
|
3998
|
+
* choose whether BASS automatically calculates the proration amount based on
|
|
3999
|
+
* the number of days added to or removed from the current billing cycle.
|
|
4000
|
+
* Alternatively, you can pass a proration amount based on your own custom
|
|
4001
|
+
* calculation. The custom proration amount can't exceed the total of the
|
|
4002
|
+
* current billing cycle.
|
|
4003
|
+
* @param _id - ID of the subscription to update the billing date for.
|
|
4004
|
+
* @param billingDate - New billing date in `YYYY-MM-DDThh:mm:ss:sssZ` format.
|
|
4005
|
+
* @public
|
|
4006
|
+
* @documentationMaturity preview
|
|
4007
|
+
* @requiredField _id
|
|
4008
|
+
* @requiredField billingDate
|
|
4009
|
+
* @permissionId subscriptions.manage
|
|
4010
|
+
* @permissionScope Manage Orders
|
|
4011
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4012
|
+
* @applicableIdentity APP
|
|
4013
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.UpdateSubscriptionBillingDate
|
|
4014
|
+
*/
|
|
4015
|
+
export declare function updateSubscriptionBillingDate(_id: string, billingDate: Date | null, options?: UpdateSubscriptionBillingDateOptions): Promise<UpdateSubscriptionBillingDateResponse & UpdateSubscriptionBillingDateResponseNonNullableFields>;
|
|
4016
|
+
export interface UpdateSubscriptionBillingDateOptions {
|
|
4017
|
+
/**
|
|
4018
|
+
* Information about how BASS adjusts the total of the next invoice. Extending
|
|
4019
|
+
* the current billing cycle results in a higher payment, while shortening it
|
|
4020
|
+
* leads to a lower payment. BASS offers automatic calculation of the proration
|
|
4021
|
+
* amount based on the number of days added to or removed from the current billing
|
|
4022
|
+
* cycle. Alternatively, you can use your own custom method to calculate the
|
|
4023
|
+
* proration amount. The custom proration amount can't exceed the total of the
|
|
4024
|
+
* current billing cycle.
|
|
4025
|
+
*/
|
|
4026
|
+
proration?: Proration;
|
|
4027
|
+
}
|
|
4028
|
+
/**
|
|
4029
|
+
* Cancels subscription immediately. Can be canceled by member if subscription policy allows it
|
|
4030
|
+
* Only PENDING, ACTIVE or PAUSED subscriptions can be canceled
|
|
4031
|
+
* @public
|
|
4032
|
+
* @documentationMaturity preview
|
|
4033
|
+
* @requiredField _id
|
|
4034
|
+
* @requiredField actionContext
|
|
4035
|
+
* @permissionId subscriptions.manage
|
|
4036
|
+
* @permissionScope Manage Orders
|
|
4037
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4038
|
+
* @applicableIdentity APP
|
|
4039
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CancelSubscription
|
|
4040
|
+
*/
|
|
4041
|
+
export declare function cancelSubscription(_id: string, actionContext: ActionContext): Promise<CancelSubscriptionResponse & CancelSubscriptionResponseNonNullableFields>;
|
|
4042
|
+
/**
|
|
4043
|
+
* Pauses subscription now or in future. Possible to pause also payments schedule.
|
|
4044
|
+
* @public
|
|
4045
|
+
* @documentationMaturity preview
|
|
4046
|
+
* @requiredField _id
|
|
4047
|
+
* @requiredField options.actionContext
|
|
4048
|
+
* @permissionId subscriptions.manage
|
|
4049
|
+
* @permissionScope Manage Orders
|
|
4050
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4051
|
+
* @applicableIdentity APP
|
|
4052
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PauseSubscription
|
|
4053
|
+
*/
|
|
4054
|
+
export declare function pauseSubscription(_id: string, options?: PauseSubscriptionOptions): Promise<PauseSubscriptionResponse & PauseSubscriptionResponseNonNullableFields>;
|
|
4055
|
+
export interface PauseSubscriptionOptions {
|
|
4056
|
+
pausePolicy?: PausePolicy;
|
|
4057
|
+
pauseAt?: PauseAt;
|
|
4058
|
+
/** contains additional scheduling information for certain pause_at options (for example: SPECIFIC_DATE & NUMBER_OF_CYCLES_FROM_TODAY) */
|
|
4059
|
+
pauseAtSchedule?: ScheduleAdditionalInfo;
|
|
4060
|
+
/** contains additional scheduling information for certain auto_resume_at either specific date */
|
|
4061
|
+
autoResumeAtSchedule?: ScheduleAdditionalInfo;
|
|
4062
|
+
actionContext: ActionContext;
|
|
4063
|
+
}
|
|
4064
|
+
/**
|
|
4065
|
+
* Resumes paused subscription now or in future.
|
|
4066
|
+
* @public
|
|
4067
|
+
* @documentationMaturity preview
|
|
4068
|
+
* @requiredField _id
|
|
4069
|
+
* @requiredField options.actionContext
|
|
4070
|
+
* @permissionId subscriptions.manage
|
|
4071
|
+
* @permissionScope Manage Orders
|
|
4072
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4073
|
+
* @applicableIdentity APP
|
|
4074
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ResumeSubscription
|
|
4075
|
+
*/
|
|
4076
|
+
export declare function resumeSubscription(_id: string, options?: ResumeSubscriptionOptions): Promise<ResumeSubscriptionResponse & ResumeSubscriptionResponseNonNullableFields>;
|
|
4077
|
+
export interface ResumeSubscriptionOptions {
|
|
4078
|
+
resumeAt?: ResumeAt;
|
|
4079
|
+
/** contains additional scheduling information for certain resume_at options (for example: SPECIFIC_DATE) */
|
|
4080
|
+
resumeAtSchedule?: ScheduleAdditionalInfo;
|
|
4081
|
+
actionContext: ActionContext;
|
|
4082
|
+
}
|
|
4083
|
+
/**
|
|
4084
|
+
* Lists subscriptions based on specified filters.
|
|
4085
|
+
* By default non-draft subscriptions returned.
|
|
4086
|
+
* @public
|
|
4087
|
+
* @documentationMaturity preview
|
|
4088
|
+
* @requiredField query
|
|
4089
|
+
* @permissionId subscriptions.view
|
|
4090
|
+
* @permissionScope Manage Events
|
|
4091
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
4092
|
+
* @applicableIdentity APP
|
|
4093
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.QuerySubscriptions
|
|
4094
|
+
*/
|
|
4095
|
+
export declare function querySubscriptions(query: QueryV2): Promise<QuerySubscriptionsResponse & QuerySubscriptionsResponseNonNullableFields>;
|
|
4096
|
+
/** @public
|
|
4097
|
+
* @documentationMaturity preview
|
|
4098
|
+
* @permissionId subscriptions.view
|
|
4099
|
+
* @permissionScope Manage Events
|
|
4100
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
4101
|
+
* @applicableIdentity APP
|
|
4102
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.SearchSubscriptions
|
|
4103
|
+
*/
|
|
4104
|
+
export declare function searchSubscriptions(options?: SearchSubscriptionsOptions): Promise<SearchSubscriptionsResponse & SearchSubscriptionsResponseNonNullableFields>;
|
|
4105
|
+
export interface SearchSubscriptionsOptions extends SearchSubscriptionsRequestPagingMethodOneOf {
|
|
4106
|
+
/** A filter object */
|
|
4107
|
+
filter?: any;
|
|
4108
|
+
/** Limit number of results and enable to skip rows. The default limit is 25. */
|
|
4109
|
+
paging?: Paging;
|
|
4110
|
+
/** A Cursor option for efficient paging. Pass this field from the previous search response to continue to the next page. */
|
|
4111
|
+
cursor?: CursorPaging;
|
|
4112
|
+
/** A Sorting option by field name and order. */
|
|
4113
|
+
sorting?: SortingClauses;
|
|
4114
|
+
}
|
|
4115
|
+
/**
|
|
4116
|
+
* Counts subscriptions given the provided filters. Returns the total number
|
|
4117
|
+
* of subscriptions matching the filters and a count per status.
|
|
4118
|
+
*
|
|
4119
|
+
*
|
|
4120
|
+
* You can either pass a list of statuses or a `statusGroup`, which is a
|
|
4121
|
+
* pre-defined combination of statuses.
|
|
4122
|
+
*
|
|
4123
|
+
* If you don't provide any filters, all subscription statuses with the
|
|
4124
|
+
* exception of `"DRAFT"` are counted.
|
|
4125
|
+
*
|
|
4126
|
+
* You may also specify a `customerId` as filter. Then, only subscriptions for
|
|
4127
|
+
* this customer are counted. When providing a `customerId`, you must also
|
|
4128
|
+
* specify a `paymentMethodId`.
|
|
4129
|
+
* @public
|
|
4130
|
+
* @documentationMaturity preview
|
|
4131
|
+
* @permissionId subscriptions.view
|
|
4132
|
+
* @permissionScope Manage Events
|
|
4133
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
4134
|
+
* @applicableIdentity APP
|
|
4135
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.CountSubscriptions
|
|
4136
|
+
*/
|
|
4137
|
+
export declare function countSubscriptions(options?: CountSubscriptionsOptions): Promise<CountSubscriptionsResponse & CountSubscriptionsResponseNonNullableFields>;
|
|
4138
|
+
export interface CountSubscriptionsOptions {
|
|
4139
|
+
/** Filters to specify which subscriptions are counted. */
|
|
4140
|
+
filter?: CountSubscriptionFilter;
|
|
4141
|
+
}
|
|
4142
|
+
/**
|
|
4143
|
+
* Turn on auto-renew subscription in case auto-renew was turned off. The operation changes back cycle_auto_renew
|
|
4144
|
+
* to true, which will ensure subscription billing will continue. Also cancellation info holding information about
|
|
4145
|
+
* auto renew off will be cleared.
|
|
4146
|
+
* @public
|
|
4147
|
+
* @documentationMaturity preview
|
|
4148
|
+
* @requiredField _id
|
|
4149
|
+
* @requiredField actionContext
|
|
4150
|
+
* @permissionId subscriptions.manage
|
|
4151
|
+
* @permissionScope Manage Orders
|
|
4152
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4153
|
+
* @applicableIdentity APP
|
|
4154
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOnSubscriptionAutoRenewal
|
|
4155
|
+
*/
|
|
4156
|
+
export declare function turnOnSubscriptionAutoRenewal(_id: string, actionContext: ActionContext): Promise<TurnOnSubscriptionAutoRenewalResponse & TurnOnSubscriptionAutoRenewalResponseNonNullableFields>;
|
|
4157
|
+
/**
|
|
4158
|
+
* Turn off auto-renew of subscription. At next billing date subscription will be canceled.
|
|
4159
|
+
* Billing settings flag cycle_auto_renew is set to false and information about this operation stored
|
|
4160
|
+
* in cancellation info for future usage in cancellation.
|
|
4161
|
+
* @public
|
|
4162
|
+
* @documentationMaturity preview
|
|
4163
|
+
* @requiredField _id
|
|
4164
|
+
* @requiredField actionContext
|
|
4165
|
+
* @permissionId subscriptions.manage
|
|
4166
|
+
* @permissionScope Manage Orders
|
|
4167
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4168
|
+
* @applicableIdentity APP
|
|
4169
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.TurnOffSubscriptionAutoRenewal
|
|
4170
|
+
*/
|
|
4171
|
+
export declare function turnOffSubscriptionAutoRenewal(_id: string, actionContext: ActionContext): Promise<TurnOffSubscriptionAutoRenewalResponse & TurnOffSubscriptionAutoRenewalResponseNonNullableFields>;
|
|
4172
|
+
/**
|
|
4173
|
+
* Marks the last invoice as paid used for the following scenarios:
|
|
4174
|
+
* * Offline subscriptions.
|
|
4175
|
+
* * Online subscriptions during grace period. The operation will convert invoice to offline, remove grace period
|
|
4176
|
+
* and will send BillingCycleStarted event after invoice closing.
|
|
4177
|
+
* * Online one time payment subscription with total price of zero during purchase flow.
|
|
4178
|
+
* Activated event will be sent after invoice closing and subscription will be activated.
|
|
4179
|
+
* @param subscriptionId - The ID of the offline subscription to mark as paid its latest invoice
|
|
4180
|
+
* @public
|
|
4181
|
+
* @documentationMaturity preview
|
|
4182
|
+
* @requiredField subscriptionId
|
|
4183
|
+
* @permissionId subscriptions.manage
|
|
4184
|
+
* @permissionScope Manage Orders
|
|
4185
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4186
|
+
* @applicableIdentity APP
|
|
4187
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkLatestInvoiceAsPaid
|
|
4188
|
+
* @deprecated
|
|
4189
|
+
* @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
|
|
4190
|
+
* @targetRemovalDate 2025-09-30
|
|
4191
|
+
*/
|
|
4192
|
+
export declare function markLatestInvoiceAsPaid(subscriptionId: string): Promise<MarkLatestInvoiceAsPaidResponse & MarkLatestInvoiceAsPaidResponseNonNullableFields>;
|
|
4193
|
+
/**
|
|
4194
|
+
* Marks the invoice associated with the subscription in the specified cycle as paid.
|
|
4195
|
+
* If `paid_cycle` is left empty, the most recent invoice will be marked as paid.
|
|
4196
|
+
* If the invoice contains items other than subscription items, an error will be thrown.
|
|
4197
|
+
*
|
|
4198
|
+
* Marks the invoice as paid for the following scenarios:
|
|
4199
|
+
* 1. Offline subscriptions.
|
|
4200
|
+
* 2. Online subscriptions during the grace period.
|
|
4201
|
+
* This operation will convert the invoice to offline, remove the grace period,
|
|
4202
|
+
* and send a BillingCycleStarted event after the invoice is closed.
|
|
4203
|
+
* 3. Online one-time payment subscriptions with a total price of zero during the purchase flow.
|
|
4204
|
+
* An Activated event will be sent after the invoice is closed, and the subscription will be activated.
|
|
4205
|
+
* 4. For external subscriptions, where the payment occurs outside of BASS, an invoice is created and marked as paid
|
|
4206
|
+
* @param subscriptionId - The ID of the subscription to mark as paid its invoice.
|
|
4207
|
+
* @internal
|
|
4208
|
+
* @documentationMaturity preview
|
|
4209
|
+
* @requiredField subscriptionId
|
|
4210
|
+
* @permissionId subscriptions.manage
|
|
4211
|
+
* @permissionScope Manage Orders
|
|
4212
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4213
|
+
* @applicableIdentity APP
|
|
4214
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.MarkInvoiceAsPaid
|
|
4215
|
+
*/
|
|
4216
|
+
export declare function markInvoiceAsPaid(subscriptionId: string, options?: MarkInvoiceAsPaidOptions): Promise<MarkInvoiceAsPaidResponse & MarkInvoiceAsPaidResponseNonNullableFields>;
|
|
4217
|
+
export interface MarkInvoiceAsPaidOptions {
|
|
4218
|
+
/**
|
|
4219
|
+
* The subscription cycle for which the invoice is to be marked as paid.
|
|
4220
|
+
* If left empty, the most recent cycle will be selected.
|
|
4221
|
+
*/
|
|
4222
|
+
paidCycle?: number | null;
|
|
4223
|
+
}
|
|
4224
|
+
/**
|
|
4225
|
+
* Returns number of subscriptions in each state.
|
|
4226
|
+
* @public
|
|
4227
|
+
* @documentationMaturity preview
|
|
4228
|
+
* @permissionId subscriptions.view
|
|
4229
|
+
* @permissionScope Manage Events
|
|
4230
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
4231
|
+
* @applicableIdentity APP
|
|
4232
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.GetSubscriptionsStats
|
|
4233
|
+
*/
|
|
4234
|
+
export declare function getSubscriptionsStats(): Promise<GetSubscriptionsStatsResponse & GetSubscriptionsStatsResponseNonNullableFields>;
|
|
4235
|
+
/**
|
|
4236
|
+
* Extends subscription by moving end date with or without billing cycles addition.
|
|
4237
|
+
* @param _id - The ID of the subscription to be extended
|
|
4238
|
+
* @public
|
|
4239
|
+
* @documentationMaturity preview
|
|
4240
|
+
* @requiredField _id
|
|
4241
|
+
* @requiredField actionContext
|
|
4242
|
+
* @permissionId subscriptions.manage
|
|
4243
|
+
* @permissionScope Manage Orders
|
|
4244
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4245
|
+
* @applicableIdentity APP
|
|
4246
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ExtendSubscription
|
|
4247
|
+
*/
|
|
4248
|
+
export declare function extendSubscription(_id: string, actionContext: ActionContext, options?: ExtendSubscriptionOptions): Promise<ExtendSubscriptionResponse & ExtendSubscriptionResponseNonNullableFields>;
|
|
4249
|
+
export interface ExtendSubscriptionOptions extends ExtendSubscriptionRequestExtendPolicyOneOf {
|
|
4250
|
+
/** User won't be charged for additional period added on top of subscription end date. */
|
|
4251
|
+
extensionPeriod?: Duration;
|
|
4252
|
+
/** user will be charged for billing cycles added */
|
|
4253
|
+
extensionBillingCycles?: number;
|
|
4254
|
+
}
|
|
4255
|
+
/** @public
|
|
4256
|
+
* @documentationMaturity preview
|
|
4257
|
+
* @requiredField _id
|
|
4258
|
+
* @permissionId subscriptions.manage
|
|
4259
|
+
* @permissionScope Manage Orders
|
|
4260
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4261
|
+
* @applicableIdentity APP
|
|
4262
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.AllowedActions
|
|
4263
|
+
*/
|
|
4264
|
+
export declare function allowedActions(_id: string, options?: AllowedActionsOptions): Promise<AllowedActionsResponse & AllowedActionsResponseNonNullableFields>;
|
|
4265
|
+
export interface AllowedActionsOptions {
|
|
4266
|
+
/** List of additional fields to be included in the response. */
|
|
4267
|
+
fields?: RequestedFields[];
|
|
4268
|
+
}
|
|
4269
|
+
/**
|
|
4270
|
+
* List future subscriptions charges
|
|
4271
|
+
* @param subscriptionId - Subscription id charges to be previewed for
|
|
4272
|
+
* @public
|
|
4273
|
+
* @documentationMaturity preview
|
|
4274
|
+
* @requiredField subscriptionId
|
|
4275
|
+
* @permissionId subscriptions.view
|
|
4276
|
+
* @permissionScope Manage Events
|
|
4277
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
4278
|
+
* @applicableIdentity APP
|
|
4279
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.ListUpcomingCharges
|
|
4280
|
+
*/
|
|
4281
|
+
export declare function listUpcomingCharges(subscriptionId: string, options?: ListUpcomingChargesOptions): Promise<ListUpcomingChargesResponse & ListUpcomingChargesResponseNonNullableFields>;
|
|
4282
|
+
export interface ListUpcomingChargesOptions {
|
|
4283
|
+
/** Period of time to provide charged for. If not provided,then only next charge will be returned. */
|
|
4284
|
+
customDuration?: Duration;
|
|
4285
|
+
/**
|
|
4286
|
+
* Date of the next billing cycle so that the upcoming charges will be calculated accordingly.
|
|
4287
|
+
* If not provided, the upcoming charges will be calculated according to the existing next billing date.
|
|
4288
|
+
*/
|
|
4289
|
+
nextBillingDate?: Date | null;
|
|
4290
|
+
}
|
|
4291
|
+
/**
|
|
4292
|
+
* Retrieves the preview of subscription charges.
|
|
4293
|
+
* Returns all the charges applicable to a subscription based on the provided subscription information.
|
|
4294
|
+
* @public
|
|
4295
|
+
* @documentationMaturity preview
|
|
4296
|
+
* @requiredField options
|
|
4297
|
+
* @requiredField options.subscriptionInfo
|
|
4298
|
+
* @requiredField options.subscriptionInfo.billingSettings
|
|
4299
|
+
* @requiredField options.subscriptionInfo.items
|
|
4300
|
+
* @requiredField options.subscriptionInfo.items.pricingModel
|
|
4301
|
+
* @permissionId subscriptions.view
|
|
4302
|
+
* @permissionScope Manage Events
|
|
4303
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
4304
|
+
* @applicableIdentity APP
|
|
4305
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionCharges
|
|
4306
|
+
* @deprecated
|
|
4307
|
+
* @replacedBy com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges
|
|
4308
|
+
* @targetRemovalDate 2025-06-30
|
|
4309
|
+
*/
|
|
4310
|
+
export declare function previewSubscriptionCharges(options: PreviewSubscriptionChargesOptions): Promise<PreviewSubscriptionChargesResponse & PreviewSubscriptionChargesResponseNonNullableFields>;
|
|
4311
|
+
export interface PreviewSubscriptionChargesOptions extends PreviewSubscriptionChargesRequestSubscriptionOneOf {
|
|
4312
|
+
/** Information about a non-existing subscription. */
|
|
4313
|
+
subscriptionInfo?: SubscriptionInfo;
|
|
4314
|
+
}
|
|
4315
|
+
/**
|
|
4316
|
+
* Retrieves the preview of subscription charges for a bulk of subscriptions.
|
|
4317
|
+
* Returns all the charges applicable to all subscriptions, based on the provided subscriptions information.
|
|
4318
|
+
* @public
|
|
4319
|
+
* @documentationMaturity preview
|
|
4320
|
+
* @requiredField options.subscriptionsBillingDetails.billingSettings
|
|
4321
|
+
* @requiredField options.subscriptionsBillingDetails.billingSettings.shippingCharges.tax
|
|
4322
|
+
* @requiredField options.subscriptionsBillingDetails.externalId
|
|
4323
|
+
* @requiredField options.subscriptionsBillingDetails.items
|
|
4324
|
+
* @requiredField options.subscriptionsBillingDetails.items.pricingModel
|
|
4325
|
+
* @requiredField options.subscriptionsBillingDetails.items.tax
|
|
4326
|
+
* @permissionId subscriptions.view
|
|
4327
|
+
* @permissionScope Manage Events
|
|
4328
|
+
* @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS
|
|
4329
|
+
* @applicableIdentity APP
|
|
4330
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.PreviewSubscriptionsCharges
|
|
4331
|
+
*/
|
|
4332
|
+
export declare function previewSubscriptionsCharges(options?: PreviewSubscriptionsChargesOptions): Promise<PreviewSubscriptionsChargesResponse & PreviewSubscriptionsChargesResponseNonNullableFields>;
|
|
4333
|
+
export interface PreviewSubscriptionsChargesOptions {
|
|
4334
|
+
/** Information required to calculate the preview charges for the subscriptions, including an identifier. */
|
|
4335
|
+
subscriptionsBillingDetails?: SubscriptionBillingDetails[];
|
|
4336
|
+
/**
|
|
4337
|
+
* Specifies the number of upcoming billing charges to preview for all subscriptions in the order.
|
|
4338
|
+
* For instance, if a subscription costs $10 for the first 3 cycles, $12 for cycles 4 through 7,
|
|
4339
|
+
* $15 for cycles 8 through 10, and $20 for cycle 11 onwards:
|
|
4340
|
+
* - Sending "1" will calculate and return charges for cycles 4 through 7 since it's the first charge in the future.
|
|
4341
|
+
* - Sending "2" will provide a response with charges for cycles 4 through 7 and cycles 8 through 10.
|
|
4342
|
+
* - Sending "3" or more will include totals for cycles 4 through 7, cycles 8 through 10, and from cycle 11 onwards.
|
|
4343
|
+
* If no value is provided, the response will include charges for all upcoming cycles, including the existing one,
|
|
4344
|
+
* in this case, charges for cycle 1 through 3.
|
|
4345
|
+
* If there is a single charge for a subscription, meaning that subscription price remains consistent across all cycles,
|
|
4346
|
+
* then even if future_charges_count is set, it will be ignored and the only charge this subscription has will be returned.
|
|
4347
|
+
*/
|
|
4348
|
+
numberOfNextRecurringCharges?: number | null;
|
|
4349
|
+
}
|
|
4350
|
+
/**
|
|
4351
|
+
* Creates authorization invoice with Moto settings in order to create
|
|
4352
|
+
* @public
|
|
4353
|
+
* @documentationMaturity preview
|
|
4354
|
+
* @requiredField _id
|
|
4355
|
+
* @permissionId subscriptions.manage
|
|
4356
|
+
* @permissionScope Manage Orders
|
|
4357
|
+
* @permissionScopeId SCOPE.DC-PAIDPLANS.MANAGE-ORDERS
|
|
4358
|
+
* @applicableIdentity APP
|
|
4359
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsService.InitiatePaymentMethodSetup
|
|
4360
|
+
*/
|
|
4361
|
+
export declare function initiatePaymentMethodSetup(_id: string, options?: InitiatePaymentMethodSetupOptions): Promise<InitiatePaymentMethodSetupResponse & InitiatePaymentMethodSetupResponseNonNullableFields>;
|
|
4362
|
+
export interface InitiatePaymentMethodSetupOptions {
|
|
4363
|
+
paymentMode?: PaymentMode;
|
|
4364
|
+
paymentSettings?: PaymentSettings;
|
|
4365
|
+
}
|
|
4366
|
+
/**
|
|
4367
|
+
* This used only for automation and permitted tenants (QA & testing)
|
|
4368
|
+
* @public
|
|
4369
|
+
* @documentationMaturity preview
|
|
4370
|
+
* @requiredField options.tenantId
|
|
4371
|
+
* @requiredField subscriptionId
|
|
4372
|
+
* @fqn com.wixpress.billing.subscriptions.api.v1.SubscriptionsBackOfficeService.PayCycle
|
|
4373
|
+
*/
|
|
4374
|
+
export declare function payCycle(subscriptionId: string, options?: PayCycleOptions): Promise<PayCycleResponse & PayCycleResponseNonNullableFields>;
|
|
4375
|
+
export interface PayCycleOptions {
|
|
4376
|
+
paymentTestMode?: PaymentTestMode;
|
|
4377
|
+
tenantId: string;
|
|
4378
|
+
}
|
|
4379
|
+
export {};
|