@gofynd/fdk-client-javascript 1.4.2-beta.2 → 1.4.2-beta.4
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/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationModel.d.ts +1742 -1726
- package/sdk/application/Cart/CartApplicationModel.js +1497 -1481
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1611 -1611
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1614 -1614
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1151 -1151
- package/sdk/application/Content/ContentApplicationModel.d.ts +797 -797
- package/sdk/application/Content/ContentApplicationModel.js +757 -757
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +666 -666
- package/sdk/application/Logistic/LogisticApplicationModel.js +601 -601
- package/sdk/application/Order/OrderApplicationModel.d.ts +852 -846
- package/sdk/application/Order/OrderApplicationModel.js +828 -822
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -10
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2176 -2145
- package/sdk/application/Payment/PaymentApplicationModel.js +1474 -1453
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1462 -1462
- package/sdk/application/PosCart/PosCartApplicationModel.js +1260 -1260
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +895 -895
- package/sdk/application/Theme/ThemeApplicationModel.js +684 -684
- package/sdk/application/User/UserApplicationClient.d.ts +2 -2
- package/sdk/application/User/UserApplicationClient.js +4 -7
- package/sdk/application/User/UserApplicationModel.d.ts +769 -764
- package/sdk/application/User/UserApplicationModel.js +731 -741
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +63 -63
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +65 -65
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +661 -661
- package/sdk/partner/Lead/LeadPartnerModel.js +491 -491
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +223 -223
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +235 -235
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1087 -1087
- package/sdk/partner/Theme/ThemePartnerModel.js +819 -819
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +386 -386
- package/sdk/partner/Webhook/WebhookPartnerModel.js +342 -342
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +801 -801
- package/sdk/platform/Billing/BillingPlatformModel.js +783 -783
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3333 -3317
- package/sdk/platform/Cart/CartPlatformModel.js +2936 -2920
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +26 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +182 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +70 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +44 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1013 -980
- package/sdk/platform/Catalog/CatalogPlatformModel.js +977 -933
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1238 -1238
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1273 -1273
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +661 -661
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +692 -692
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +3198 -3198
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2247 -2247
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1842 -1825
- package/sdk/platform/Content/ContentPlatformModel.js +1868 -1848
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +245 -245
- package/sdk/platform/Discount/DiscountPlatformModel.js +248 -248
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +4 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +2 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +2 -0
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +2 -2
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +7 -4
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +882 -869
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +894 -878
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1044 -1044
- package/sdk/platform/Finance/FinancePlatformModel.js +974 -974
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +608 -608
- package/sdk/platform/Lead/LeadPlatformModel.js +465 -465
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5192 -5176
- package/sdk/platform/Order/OrderPlatformModel.js +4752 -4736
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2693 -2657
- package/sdk/platform/Payment/PaymentPlatformModel.js +1842 -1819
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +7 -6
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +11 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1674 -1539
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1663 -1534
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +4 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationClient.js +19 -6
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +13 -3
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -2
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1046 -1046
- package/sdk/platform/Theme/ThemePlatformModel.js +789 -789
- package/sdk/platform/User/UserPlatformModel.d.ts +823 -753
- package/sdk/platform/User/UserPlatformModel.js +731 -661
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +439 -439
- package/sdk/platform/Webhook/WebhookPlatformModel.js +364 -364
- package/sdk/public/Billing/BillingPublicModel.d.ts +55 -55
- package/sdk/public/Billing/BillingPublicModel.js +51 -51
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Content/ContentPublicModel.d.ts +26 -26
- package/sdk/public/Content/ContentPublicModel.js +28 -28
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +87 -87
- package/sdk/public/Webhook/WebhookPublicModel.js +93 -93
|
@@ -6,587 +6,587 @@ const Joi = require("joi");
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @typedef
|
|
10
|
-
* @property {string} [
|
|
11
|
-
* @property {string} [subscription_id]
|
|
12
|
-
* @property {string} [type]
|
|
13
|
-
* @property {string} [unique_id]
|
|
9
|
+
* @typedef ResourceNotFound
|
|
10
|
+
* @property {string} [message] - Resource not found with {id}
|
|
14
11
|
*/
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
|
-
* @typedef
|
|
18
|
-
* @property {
|
|
19
|
-
* @property {
|
|
14
|
+
* @typedef InternalServerError
|
|
15
|
+
* @property {string} [message] - Internal server Server error
|
|
16
|
+
* @property {string} [code] - Error code
|
|
20
17
|
*/
|
|
21
18
|
|
|
22
19
|
/**
|
|
23
|
-
* @typedef
|
|
24
|
-
* @property {
|
|
25
|
-
* @property {
|
|
26
|
-
* @property {Object} [metadata]
|
|
27
|
-
* @property {string} name
|
|
28
|
-
* @property {EntityChargePrice} price
|
|
29
|
-
* @property {string} pricing_type
|
|
30
|
-
* @property {EntityChargeRecurring} [recurring]
|
|
31
|
-
* @property {string} term
|
|
32
|
-
* @property {number} [trial_days]
|
|
20
|
+
* @typedef CheckValidityResponse
|
|
21
|
+
* @property {boolean} [is_valid]
|
|
22
|
+
* @property {number} [discount_amount]
|
|
33
23
|
*/
|
|
34
24
|
|
|
35
25
|
/**
|
|
36
|
-
* @typedef
|
|
37
|
-
* @property {
|
|
38
|
-
* @property {
|
|
26
|
+
* @typedef PlanRecurring
|
|
27
|
+
* @property {string} [interval]
|
|
28
|
+
* @property {number} [interval_count]
|
|
39
29
|
*/
|
|
40
30
|
|
|
41
31
|
/**
|
|
42
|
-
* @typedef
|
|
43
|
-
* @property {
|
|
44
|
-
* @property {boolean} [
|
|
45
|
-
* @property {string}
|
|
46
|
-
* @property {string}
|
|
32
|
+
* @typedef Plan
|
|
33
|
+
* @property {PlanRecurring} [recurring]
|
|
34
|
+
* @property {boolean} [is_trial_plan]
|
|
35
|
+
* @property {string} [plan_group]
|
|
36
|
+
* @property {string[]} [tag_lines]
|
|
37
|
+
* @property {string} [currency]
|
|
38
|
+
* @property {boolean} [is_active]
|
|
39
|
+
* @property {boolean} [is_visible]
|
|
40
|
+
* @property {number} [trial_period]
|
|
41
|
+
* @property {string[]} [addons]
|
|
42
|
+
* @property {string[]} [tags]
|
|
43
|
+
* @property {string} [type]
|
|
44
|
+
* @property {string} [country]
|
|
45
|
+
* @property {string} [_id]
|
|
46
|
+
* @property {string} [name]
|
|
47
|
+
* @property {string} [description]
|
|
48
|
+
* @property {number} [amount]
|
|
49
|
+
* @property {string} [product_suite_id]
|
|
50
|
+
* @property {string} [created_at]
|
|
51
|
+
* @property {string} [modified_at]
|
|
47
52
|
*/
|
|
48
53
|
|
|
49
54
|
/**
|
|
50
|
-
* @typedef
|
|
51
|
-
* @property {
|
|
52
|
-
* @property {string} [
|
|
55
|
+
* @typedef SubscriptionTrialPeriod
|
|
56
|
+
* @property {string} [start_date]
|
|
57
|
+
* @property {string} [end_date]
|
|
53
58
|
*/
|
|
54
59
|
|
|
55
60
|
/**
|
|
56
|
-
* @typedef
|
|
57
|
-
* @property {
|
|
58
|
-
* @property {
|
|
59
|
-
* @property {string} name
|
|
60
|
-
* @property {string} return_url
|
|
61
|
-
* @property {number} [trial_days]
|
|
61
|
+
* @typedef EntityChargePrice
|
|
62
|
+
* @property {number} amount - Amount for price. Minimum value 1
|
|
63
|
+
* @property {string} currency_code
|
|
62
64
|
*/
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
|
-
* @typedef
|
|
66
|
-
* @property {string}
|
|
67
|
-
* @property {EntitySubscription} [subscription]
|
|
67
|
+
* @typedef EntityChargeRecurring
|
|
68
|
+
* @property {string} interval
|
|
68
69
|
*/
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
|
-
* @typedef
|
|
72
|
-
* @property {string}
|
|
73
|
-
* @property {string}
|
|
72
|
+
* @typedef ChargeLineItem
|
|
73
|
+
* @property {string} name
|
|
74
|
+
* @property {string} term
|
|
75
|
+
* @property {string} pricing_type
|
|
76
|
+
* @property {EntityChargePrice} price
|
|
77
|
+
* @property {EntityChargeRecurring} [recurring]
|
|
78
|
+
* @property {number} [capped_amount]
|
|
79
|
+
* @property {number} [trial_days]
|
|
80
|
+
* @property {boolean} [is_test]
|
|
81
|
+
* @property {Object} [metadata]
|
|
74
82
|
*/
|
|
75
83
|
|
|
76
84
|
/**
|
|
77
|
-
* @typedef
|
|
78
|
-
* @property {
|
|
79
|
-
* @property {
|
|
85
|
+
* @typedef CreateSubscriptionCharge
|
|
86
|
+
* @property {string} name
|
|
87
|
+
* @property {number} [trial_days]
|
|
88
|
+
* @property {ChargeLineItem[]} line_items
|
|
89
|
+
* @property {boolean} [is_test]
|
|
90
|
+
* @property {string} return_url
|
|
80
91
|
*/
|
|
81
92
|
|
|
82
93
|
/**
|
|
83
|
-
* @typedef
|
|
84
|
-
* @property {
|
|
85
|
-
* @property {string}
|
|
94
|
+
* @typedef OneTimeChargeItem
|
|
95
|
+
* @property {string} name
|
|
96
|
+
* @property {string} [term]
|
|
97
|
+
* @property {string} pricing_type
|
|
98
|
+
* @property {EntityChargePrice} price
|
|
99
|
+
* @property {number} [capped_amount]
|
|
100
|
+
* @property {boolean} [is_test]
|
|
101
|
+
* @property {Object} [metadata]
|
|
86
102
|
*/
|
|
87
103
|
|
|
88
104
|
/**
|
|
89
|
-
* @typedef
|
|
90
|
-
* @property {string}
|
|
105
|
+
* @typedef CreateOneTimeCharge
|
|
106
|
+
* @property {string} name
|
|
107
|
+
* @property {OneTimeChargeItem} charge
|
|
108
|
+
* @property {boolean} [is_test]
|
|
109
|
+
* @property {string} return_url
|
|
91
110
|
*/
|
|
92
111
|
|
|
93
112
|
/**
|
|
94
|
-
* @typedef
|
|
95
|
-
* @property {
|
|
96
|
-
* @property {
|
|
97
|
-
* @property {number} [page_size]
|
|
98
|
-
* @property {boolean} [success]
|
|
113
|
+
* @typedef CurrentPeriod
|
|
114
|
+
* @property {string} [start_date]
|
|
115
|
+
* @property {string} [end_date]
|
|
99
116
|
*/
|
|
100
117
|
|
|
101
118
|
/**
|
|
102
|
-
* @typedef
|
|
119
|
+
* @typedef SubscriptionCharge
|
|
103
120
|
* @property {string} [_id]
|
|
121
|
+
* @property {string} [name]
|
|
122
|
+
* @property {string} [term] - Brief description for a charge
|
|
123
|
+
* @property {string} [pricing_type]
|
|
124
|
+
* @property {EntityChargePrice} [price]
|
|
125
|
+
* @property {EntityChargeRecurring} [recurring]
|
|
126
|
+
* @property {number} [capped_amount]
|
|
104
127
|
* @property {string} [activated_on]
|
|
105
128
|
* @property {string} [cancelled_on]
|
|
106
|
-
* @property {
|
|
107
|
-
* @property {
|
|
129
|
+
* @property {string} [billing_date]
|
|
130
|
+
* @property {CurrentPeriod} [current_period]
|
|
131
|
+
* @property {string} [status]
|
|
132
|
+
* @property {boolean} [is_test]
|
|
108
133
|
* @property {Object} [metadata]
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @typedef EntitySubscription
|
|
138
|
+
* @property {string} [_id]
|
|
109
139
|
* @property {string} [name]
|
|
110
140
|
* @property {string} [status]
|
|
141
|
+
* @property {number} [company_id]
|
|
142
|
+
* @property {string} [activated_on]
|
|
143
|
+
* @property {string} [cancelled_on]
|
|
111
144
|
* @property {number} [trial_days]
|
|
112
145
|
* @property {SubscriptionTrialPeriod} [trial_period]
|
|
146
|
+
* @property {Object} [metadata]
|
|
147
|
+
* @property {SubscriptionCharge[]} [line_items]
|
|
113
148
|
*/
|
|
114
149
|
|
|
115
150
|
/**
|
|
116
|
-
* @typedef
|
|
117
|
-
* @property {string} [
|
|
118
|
-
* @property {string} [display_text]
|
|
119
|
-
* @property {boolean} [enabled]
|
|
120
|
-
* @property {string} [group]
|
|
151
|
+
* @typedef OneTimeChargeEntity
|
|
152
|
+
* @property {string} [_id]
|
|
121
153
|
* @property {string} [name]
|
|
122
|
-
* @property {string} [
|
|
154
|
+
* @property {string} [status]
|
|
155
|
+
* @property {string} [activated_on]
|
|
156
|
+
* @property {string} [cancelled_on]
|
|
157
|
+
* @property {Object} [metadata]
|
|
158
|
+
* @property {string} [return_url]
|
|
159
|
+
* @property {boolean} [is_test]
|
|
160
|
+
* @property {string} [pricing_type]
|
|
161
|
+
* @property {string} [subscriber_id]
|
|
162
|
+
* @property {string} [entity_type]
|
|
163
|
+
* @property {string} [entity_id]
|
|
164
|
+
* @property {Object} [meta]
|
|
165
|
+
* @property {EntityChargePrice} [price]
|
|
123
166
|
*/
|
|
124
167
|
|
|
125
168
|
/**
|
|
126
|
-
* @typedef
|
|
127
|
-
* @property {
|
|
128
|
-
* @property {string} [
|
|
129
|
-
* @property {Object[]} [channel]
|
|
130
|
-
* @property {Object[]} [components]
|
|
131
|
-
* @property {string[]} [location]
|
|
132
|
-
* @property {Object} [settle_cycle_period]
|
|
133
|
-
* @property {string} [settlement_type]
|
|
169
|
+
* @typedef CreateOneTimeChargeResponse
|
|
170
|
+
* @property {OneTimeChargeEntity} [charge]
|
|
171
|
+
* @property {string} [confirm_url]
|
|
134
172
|
*/
|
|
135
173
|
|
|
136
174
|
/**
|
|
137
|
-
* @typedef
|
|
138
|
-
* @property {
|
|
139
|
-
* @property {string} [
|
|
175
|
+
* @typedef CreateSubscriptionResponse
|
|
176
|
+
* @property {EntitySubscription} [subscription]
|
|
177
|
+
* @property {string} [confirm_url]
|
|
140
178
|
*/
|
|
141
179
|
|
|
142
180
|
/**
|
|
143
|
-
* @typedef
|
|
144
|
-
* @property {
|
|
145
|
-
* @property {
|
|
181
|
+
* @typedef InvoiceDetailsPeriod
|
|
182
|
+
* @property {string} [start]
|
|
183
|
+
* @property {string} [end]
|
|
146
184
|
*/
|
|
147
185
|
|
|
148
186
|
/**
|
|
149
|
-
* @typedef
|
|
187
|
+
* @typedef InvoiceDetailsClient
|
|
188
|
+
* @property {string[]} [address_lines]
|
|
189
|
+
* @property {string} [name]
|
|
190
|
+
* @property {string} [email]
|
|
191
|
+
* @property {string} [phone]
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @typedef InvoiceDetailsStatusTrail
|
|
150
196
|
* @property {string} [_id]
|
|
151
|
-
* @property {
|
|
152
|
-
* @property {
|
|
197
|
+
* @property {string} [value]
|
|
198
|
+
* @property {string} [timestamp]
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @typedef InvoicePaymentMethod
|
|
203
|
+
* @property {string} [pg_payment_method_id]
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @typedef InvoiceDetails
|
|
208
|
+
* @property {InvoiceDetailsPeriod} [period]
|
|
153
209
|
* @property {InvoiceDetailsClient} [client]
|
|
154
|
-
* @property {
|
|
155
|
-
* @property {string} [created_at]
|
|
210
|
+
* @property {boolean} [auto_advance]
|
|
156
211
|
* @property {string} [currency]
|
|
157
|
-
* @property {
|
|
158
|
-
* @property {
|
|
212
|
+
* @property {boolean} [paid]
|
|
213
|
+
* @property {number} [attemp]
|
|
214
|
+
* @property {string} [_id]
|
|
215
|
+
* @property {string} [collection_method]
|
|
216
|
+
* @property {string} [subscriber_id]
|
|
159
217
|
* @property {string} [invoice_url]
|
|
160
|
-
* @property {string} [modified_at]
|
|
161
|
-
* @property {string} [next_action_time]
|
|
162
218
|
* @property {string} [number]
|
|
163
|
-
* @property {boolean} [paid]
|
|
164
|
-
* @property {InvoicePaymentMethod} [payment_method]
|
|
165
|
-
* @property {InvoiceDetailsPeriod} [period]
|
|
166
219
|
* @property {Object} [pg_data]
|
|
167
220
|
* @property {string} [receipt_number]
|
|
168
221
|
* @property {string} [statement_descriptor]
|
|
222
|
+
* @property {string} [current_status]
|
|
169
223
|
* @property {InvoiceDetailsStatusTrail[]} [status_trail]
|
|
170
|
-
* @property {string} [subscriber_id]
|
|
171
|
-
* @property {string} [subscription]
|
|
172
224
|
* @property {number} [subtotal]
|
|
173
225
|
* @property {number} [total]
|
|
226
|
+
* @property {string} [subscription]
|
|
227
|
+
* @property {string} [next_action_time]
|
|
228
|
+
* @property {string} [created_at]
|
|
229
|
+
* @property {string} [modified_at]
|
|
230
|
+
* @property {string} [hash_identifier]
|
|
231
|
+
* @property {InvoicePaymentMethod} [payment_method]
|
|
174
232
|
*/
|
|
175
233
|
|
|
176
234
|
/**
|
|
177
|
-
* @typedef
|
|
178
|
-
* @property {string
|
|
179
|
-
* @property {
|
|
180
|
-
* @property {string} [name]
|
|
181
|
-
* @property {string} [phone]
|
|
182
|
-
*/
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* @typedef InvoiceDetailsPeriod
|
|
186
|
-
* @property {string} [end]
|
|
187
|
-
* @property {string} [start]
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @typedef InvoiceDetailsStatusTrail
|
|
192
|
-
* @property {string} [_id]
|
|
193
|
-
* @property {string} [timestamp]
|
|
194
|
-
* @property {string} [value]
|
|
235
|
+
* @typedef InvoiceItemsPlanRecurring
|
|
236
|
+
* @property {string} [interval]
|
|
237
|
+
* @property {number} [interval_count]
|
|
195
238
|
*/
|
|
196
239
|
|
|
197
240
|
/**
|
|
198
|
-
* @typedef
|
|
199
|
-
* @property {
|
|
200
|
-
* @property {
|
|
201
|
-
* @property {string} [
|
|
241
|
+
* @typedef InvoiceItemsPlan
|
|
242
|
+
* @property {InvoiceItemsPlanRecurring} [recurring]
|
|
243
|
+
* @property {boolean} [is_trial_plan]
|
|
244
|
+
* @property {string} [plan_group]
|
|
245
|
+
* @property {string[]} [tag_lines]
|
|
202
246
|
* @property {string} [currency]
|
|
203
|
-
* @property {
|
|
204
|
-
* @property {
|
|
205
|
-
* @property {
|
|
206
|
-
* @property {string} [
|
|
207
|
-
* @property {
|
|
208
|
-
* @property {InvoiceItemsPlan} [plan]
|
|
209
|
-
* @property {number} [quantity]
|
|
247
|
+
* @property {boolean} [is_active]
|
|
248
|
+
* @property {boolean} [is_visible]
|
|
249
|
+
* @property {number} [trial_period]
|
|
250
|
+
* @property {string[]} [addons]
|
|
251
|
+
* @property {string[]} [tags]
|
|
210
252
|
* @property {string} [type]
|
|
211
|
-
* @property {
|
|
253
|
+
* @property {string} [country]
|
|
254
|
+
* @property {string} [_id]
|
|
255
|
+
* @property {string} [name]
|
|
256
|
+
* @property {string} [description]
|
|
257
|
+
* @property {number} [amount]
|
|
258
|
+
* @property {string} [product_suite_id]
|
|
259
|
+
* @property {string} [created_at]
|
|
260
|
+
* @property {string} [modified_at]
|
|
212
261
|
*/
|
|
213
262
|
|
|
214
263
|
/**
|
|
215
264
|
* @typedef InvoiceItemsPeriod
|
|
216
|
-
* @property {string} [end]
|
|
217
265
|
* @property {string} [start]
|
|
266
|
+
* @property {string} [end]
|
|
218
267
|
*/
|
|
219
268
|
|
|
220
269
|
/**
|
|
221
|
-
* @typedef
|
|
270
|
+
* @typedef InvoiceItems
|
|
222
271
|
* @property {string} [_id]
|
|
223
|
-
* @property {string[]} [addons]
|
|
224
|
-
* @property {number} [amount]
|
|
225
|
-
* @property {string} [country]
|
|
226
|
-
* @property {string} [created_at]
|
|
227
272
|
* @property {string} [currency]
|
|
228
|
-
* @property {
|
|
229
|
-
* @property {boolean} [is_active]
|
|
230
|
-
* @property {boolean} [is_trial_plan]
|
|
231
|
-
* @property {boolean} [is_visible]
|
|
232
|
-
* @property {string} [modified_at]
|
|
273
|
+
* @property {InvoiceItemsPlan} [plan]
|
|
233
274
|
* @property {string} [name]
|
|
234
|
-
* @property {
|
|
235
|
-
* @property {string} [
|
|
236
|
-
* @property {
|
|
237
|
-
* @property {
|
|
238
|
-
* @property {
|
|
239
|
-
* @property {number} [trial_period]
|
|
275
|
+
* @property {number} [quantity]
|
|
276
|
+
* @property {string} [description]
|
|
277
|
+
* @property {InvoiceItemsPeriod} [period]
|
|
278
|
+
* @property {number} [unit_amount]
|
|
279
|
+
* @property {number} [amount]
|
|
240
280
|
* @property {string} [type]
|
|
281
|
+
* @property {string} [invoice_id]
|
|
282
|
+
* @property {string} [created_at]
|
|
283
|
+
* @property {string} [modified_at]
|
|
241
284
|
*/
|
|
242
285
|
|
|
243
286
|
/**
|
|
244
|
-
* @typedef
|
|
245
|
-
* @property {
|
|
246
|
-
* @property {
|
|
287
|
+
* @typedef Invoice
|
|
288
|
+
* @property {InvoiceDetails} [invoice]
|
|
289
|
+
* @property {InvoiceItems[]} [invoice_items]
|
|
247
290
|
*/
|
|
248
291
|
|
|
249
292
|
/**
|
|
250
|
-
* @typedef
|
|
251
|
-
* @property {string} [
|
|
293
|
+
* @typedef InvoicesDataClient
|
|
294
|
+
* @property {string} [name]
|
|
295
|
+
* @property {string} [email]
|
|
296
|
+
* @property {string} [phone]
|
|
297
|
+
* @property {string[]} [address_lines]
|
|
252
298
|
*/
|
|
253
299
|
|
|
254
300
|
/**
|
|
255
|
-
* @typedef
|
|
256
|
-
* @property {
|
|
257
|
-
* @property {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
* @
|
|
301
|
+
* @typedef InvoicesDataPeriod
|
|
302
|
+
* @property {string} [start]
|
|
303
|
+
* @property {string} [end]
|
|
304
|
+
*/
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @typedef InvoicesDataPaymentMethod
|
|
308
|
+
* @property {string} [pg_payment_method_id]
|
|
262
309
|
*/
|
|
263
310
|
|
|
264
311
|
/**
|
|
265
312
|
* @typedef InvoicesData
|
|
266
313
|
* @property {string} [_id]
|
|
267
|
-
* @property {number} [attemp]
|
|
268
|
-
* @property {boolean} [auto_advance]
|
|
269
314
|
* @property {InvoicesDataClient} [client]
|
|
270
|
-
* @property {
|
|
271
|
-
* @property {string} [created_at]
|
|
315
|
+
* @property {boolean} [auto_advance]
|
|
272
316
|
* @property {string} [currency]
|
|
273
|
-
* @property {
|
|
274
|
-
* @property {
|
|
275
|
-
* @property {
|
|
317
|
+
* @property {boolean} [paid]
|
|
318
|
+
* @property {number} [attemp]
|
|
319
|
+
* @property {string} [collection_method]
|
|
320
|
+
* @property {string} [subscriber_id]
|
|
276
321
|
* @property {string} [invoice_url]
|
|
277
|
-
* @property {string} [modified_at]
|
|
278
|
-
* @property {string} [next_action_time]
|
|
279
322
|
* @property {string} [number]
|
|
280
|
-
* @property {boolean} [paid]
|
|
281
|
-
* @property {InvoicesDataPaymentMethod} [payment_method]
|
|
282
|
-
* @property {InvoicesDataPeriod} [period]
|
|
283
323
|
* @property {Object} [pg_data]
|
|
324
|
+
* @property {InvoicesDataPeriod} [period]
|
|
284
325
|
* @property {string} [receipt_number]
|
|
285
326
|
* @property {string} [statement_descriptor]
|
|
327
|
+
* @property {string} [current_status]
|
|
286
328
|
* @property {InvoiceDetailsStatusTrail[]} [status_trail]
|
|
287
|
-
* @property {string} [subscriber_id]
|
|
288
|
-
* @property {string} [subscription]
|
|
289
329
|
* @property {number} [subtotal]
|
|
290
330
|
* @property {number} [total]
|
|
331
|
+
* @property {string} [subscription]
|
|
332
|
+
* @property {string} [next_action_time]
|
|
333
|
+
* @property {string} [created_at]
|
|
334
|
+
* @property {string} [modified_at]
|
|
335
|
+
* @property {string} [hash_identifier]
|
|
336
|
+
* @property {InvoicesDataPaymentMethod} [payment_method]
|
|
337
|
+
* @property {InvoiceItems[]} [invoice_items]
|
|
291
338
|
*/
|
|
292
339
|
|
|
293
340
|
/**
|
|
294
|
-
* @typedef
|
|
295
|
-
* @property {
|
|
296
|
-
* @property {
|
|
297
|
-
* @property {
|
|
298
|
-
* @property {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* @typedef InvoicesDataPaymentMethod
|
|
303
|
-
* @property {string} [pg_payment_method_id]
|
|
341
|
+
* @typedef Invoices
|
|
342
|
+
* @property {InvoicesData[]} [data]
|
|
343
|
+
* @property {number} [start]
|
|
344
|
+
* @property {number} [end]
|
|
345
|
+
* @property {number} [limit]
|
|
346
|
+
* @property {number} [page]
|
|
347
|
+
* @property {number} [total]
|
|
304
348
|
*/
|
|
305
349
|
|
|
306
350
|
/**
|
|
307
|
-
* @typedef
|
|
308
|
-
* @property {string} [
|
|
309
|
-
* @property {string} [
|
|
351
|
+
* @typedef Phone
|
|
352
|
+
* @property {string} [phone_number]
|
|
353
|
+
* @property {string} [phone_country_code]
|
|
310
354
|
*/
|
|
311
355
|
|
|
312
356
|
/**
|
|
313
|
-
* @typedef
|
|
314
|
-
* @property {
|
|
315
|
-
* @property {
|
|
316
|
-
* @property {
|
|
357
|
+
* @typedef SubscriptionBillingAddress
|
|
358
|
+
* @property {string} [country]
|
|
359
|
+
* @property {string} [state]
|
|
360
|
+
* @property {string} [city]
|
|
361
|
+
* @property {string} [line1]
|
|
362
|
+
* @property {string} [line2]
|
|
363
|
+
* @property {string} [postal_code]
|
|
317
364
|
*/
|
|
318
365
|
|
|
319
366
|
/**
|
|
320
|
-
* @typedef
|
|
367
|
+
* @typedef SubscriptionCustomer
|
|
368
|
+
* @property {Phone} [phone]
|
|
369
|
+
* @property {SubscriptionBillingAddress} [billing_address]
|
|
321
370
|
* @property {string} [_id]
|
|
322
|
-
* @property {string} [
|
|
323
|
-
* @property {string} [
|
|
324
|
-
* @property {string} [entity_id]
|
|
325
|
-
* @property {string} [entity_type]
|
|
326
|
-
* @property {boolean} [is_test]
|
|
327
|
-
* @property {Object} [meta]
|
|
328
|
-
* @property {Object} [metadata]
|
|
371
|
+
* @property {string} [unique_id]
|
|
372
|
+
* @property {string} [type]
|
|
329
373
|
* @property {string} [name]
|
|
330
|
-
* @property {
|
|
331
|
-
* @property {string} [
|
|
332
|
-
* @property {string} [
|
|
333
|
-
* @property {
|
|
334
|
-
* @property {string} [subscriber_id]
|
|
335
|
-
*/
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* @typedef OneTimeChargeItem
|
|
339
|
-
* @property {number} [capped_amount]
|
|
340
|
-
* @property {boolean} [is_test]
|
|
341
|
-
* @property {Object} [metadata]
|
|
342
|
-
* @property {string} name
|
|
343
|
-
* @property {EntityChargePrice} price
|
|
344
|
-
* @property {string} pricing_type
|
|
345
|
-
* @property {string} [term]
|
|
346
|
-
*/
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* @typedef Phone
|
|
350
|
-
* @property {string} [phone_country_code]
|
|
351
|
-
* @property {string} [phone_number]
|
|
374
|
+
* @property {string} [email]
|
|
375
|
+
* @property {string} [created_at]
|
|
376
|
+
* @property {string} [modified_at]
|
|
377
|
+
* @property {Object} [data]
|
|
352
378
|
*/
|
|
353
379
|
|
|
354
380
|
/**
|
|
355
|
-
* @typedef
|
|
356
|
-
* @property {
|
|
357
|
-
* @property {
|
|
358
|
-
* @property {
|
|
359
|
-
* @property {string} [country]
|
|
360
|
-
* @property {string} [created_at]
|
|
361
|
-
* @property {string} [currency]
|
|
362
|
-
* @property {string} [description]
|
|
363
|
-
* @property {boolean} [is_active]
|
|
364
|
-
* @property {boolean} [is_trial_plan]
|
|
365
|
-
* @property {boolean} [is_visible]
|
|
366
|
-
* @property {string} [modified_at]
|
|
367
|
-
* @property {string} [name]
|
|
368
|
-
* @property {string} [plan_group]
|
|
369
|
-
* @property {string} [product_suite_id]
|
|
370
|
-
* @property {PlanRecurring} [recurring]
|
|
371
|
-
* @property {string[]} [tag_lines]
|
|
372
|
-
* @property {string[]} [tags]
|
|
373
|
-
* @property {number} [trial_period]
|
|
381
|
+
* @typedef SubscriptionCustomerCreate
|
|
382
|
+
* @property {Phone} [phone]
|
|
383
|
+
* @property {SubscriptionBillingAddress} [billing_address]
|
|
384
|
+
* @property {string} [unique_id]
|
|
374
385
|
* @property {string} [type]
|
|
386
|
+
* @property {string} [name]
|
|
387
|
+
* @property {string} [email]
|
|
375
388
|
*/
|
|
376
389
|
|
|
377
390
|
/**
|
|
378
|
-
* @typedef
|
|
379
|
-
* @property {string} [
|
|
380
|
-
* @property {
|
|
391
|
+
* @typedef SubscriptionCurrentPeriod
|
|
392
|
+
* @property {string} [start]
|
|
393
|
+
* @property {string} [end]
|
|
381
394
|
*/
|
|
382
395
|
|
|
383
396
|
/**
|
|
384
|
-
* @typedef
|
|
385
|
-
* @property {string} [
|
|
386
|
-
* @property {string} [
|
|
387
|
-
* @property {string} [seller_status]
|
|
397
|
+
* @typedef SubscriptionPauseCollection
|
|
398
|
+
* @property {string} [behavior]
|
|
399
|
+
* @property {string} [resume_at]
|
|
388
400
|
*/
|
|
389
401
|
|
|
390
402
|
/**
|
|
391
|
-
* @typedef
|
|
392
|
-
* @property {string} [
|
|
403
|
+
* @typedef SubscriptionTrial
|
|
404
|
+
* @property {string} [start]
|
|
405
|
+
* @property {string} [end]
|
|
393
406
|
*/
|
|
394
407
|
|
|
395
408
|
/**
|
|
396
|
-
* @typedef
|
|
397
|
-
* @property {
|
|
398
|
-
* @property {
|
|
399
|
-
* @property {string} [redirect_url]
|
|
400
|
-
* @property {string} [transaction_id]
|
|
409
|
+
* @typedef SubscriptionInvoiceSettings
|
|
410
|
+
* @property {boolean} [generation]
|
|
411
|
+
* @property {boolean} [charging]
|
|
401
412
|
*/
|
|
402
413
|
|
|
403
414
|
/**
|
|
404
415
|
* @typedef Subscription
|
|
405
|
-
* @property {string} [_id]
|
|
406
|
-
* @property {boolean} [cancel_at_period_end]
|
|
407
|
-
* @property {string} [channel_type]
|
|
408
|
-
* @property {string} [collection_method]
|
|
409
|
-
* @property {string} [created_at]
|
|
410
416
|
* @property {SubscriptionCurrentPeriod} [current_period]
|
|
411
|
-
* @property {
|
|
417
|
+
* @property {SubscriptionPauseCollection} [pause_collection]
|
|
418
|
+
* @property {SubscriptionTrial} [trial]
|
|
412
419
|
* @property {SubscriptionInvoiceSettings} [invoice_settings]
|
|
413
420
|
* @property {boolean} [is_active]
|
|
414
|
-
* @property {
|
|
415
|
-
* @property {string} [
|
|
416
|
-
* @property {
|
|
417
|
-
* @property {Plan} [plan_data]
|
|
421
|
+
* @property {boolean} [cancel_at_period_end]
|
|
422
|
+
* @property {string} [_id]
|
|
423
|
+
* @property {string} [subscriber_id]
|
|
418
424
|
* @property {string} [plan_id]
|
|
419
425
|
* @property {string} [product_suite_id]
|
|
420
|
-
* @property {
|
|
421
|
-
* @property {
|
|
426
|
+
* @property {Plan} [plan_data]
|
|
427
|
+
* @property {string} [current_status]
|
|
428
|
+
* @property {string} [collection_method]
|
|
429
|
+
* @property {string} [created_at]
|
|
430
|
+
* @property {string} [modified_at]
|
|
431
|
+
* @property {string} [latest_invoice]
|
|
432
|
+
* @property {string} [channel_type]
|
|
422
433
|
*/
|
|
423
434
|
|
|
424
435
|
/**
|
|
425
|
-
* @typedef
|
|
426
|
-
* @property {
|
|
427
|
-
* @property {
|
|
428
|
-
* @property {
|
|
429
|
-
* @property {
|
|
430
|
-
* @property {
|
|
436
|
+
* @typedef SubscriptionStatus
|
|
437
|
+
* @property {boolean} [is_enabled]
|
|
438
|
+
* @property {Subscription} [subscription]
|
|
439
|
+
* @property {InvoicesData} [latest_invoice]
|
|
440
|
+
* @property {Plan} [next_plan]
|
|
441
|
+
* @property {Subscription[]} [current_subscriptions]
|
|
442
|
+
* @property {string} [mandate_amount]
|
|
431
443
|
*/
|
|
432
444
|
|
|
433
445
|
/**
|
|
434
|
-
* @typedef
|
|
435
|
-
* @property {
|
|
436
|
-
* @property {
|
|
446
|
+
* @typedef SubscriptionLimitApplication
|
|
447
|
+
* @property {boolean} [enabled]
|
|
448
|
+
* @property {number} [hard_limit]
|
|
449
|
+
* @property {number} [soft_limit]
|
|
437
450
|
*/
|
|
438
451
|
|
|
439
452
|
/**
|
|
440
|
-
* @typedef
|
|
441
|
-
* @property {
|
|
442
|
-
* @property {string} [country]
|
|
443
|
-
* @property {string} [line1]
|
|
444
|
-
* @property {string} [line2]
|
|
445
|
-
* @property {string} [postal_code]
|
|
446
|
-
* @property {string} [state]
|
|
453
|
+
* @typedef SubscriptionLimitMarketplace
|
|
454
|
+
* @property {boolean} [enabled]
|
|
447
455
|
*/
|
|
448
456
|
|
|
449
457
|
/**
|
|
450
|
-
* @typedef
|
|
451
|
-
* @property {
|
|
452
|
-
* @property {string} [activated_on]
|
|
453
|
-
* @property {string} [billing_date]
|
|
454
|
-
* @property {string} [cancelled_on]
|
|
455
|
-
* @property {number} [capped_amount]
|
|
456
|
-
* @property {CurrentPeriod} [current_period]
|
|
457
|
-
* @property {boolean} [is_test]
|
|
458
|
-
* @property {Object} [metadata]
|
|
459
|
-
* @property {string} [name]
|
|
460
|
-
* @property {EntityChargePrice} [price]
|
|
461
|
-
* @property {string} [pricing_type]
|
|
462
|
-
* @property {EntityChargeRecurring} [recurring]
|
|
463
|
-
* @property {string} [status]
|
|
464
|
-
* @property {string} [term] - Brief description for a charge
|
|
458
|
+
* @typedef SubscriptionLimitOtherPlatform
|
|
459
|
+
* @property {boolean} [enabled]
|
|
465
460
|
*/
|
|
466
461
|
|
|
467
462
|
/**
|
|
468
|
-
* @typedef
|
|
469
|
-
* @property {
|
|
470
|
-
* @property {string} [start]
|
|
463
|
+
* @typedef SubscriptionLimitTeam
|
|
464
|
+
* @property {number} [limit]
|
|
471
465
|
*/
|
|
472
466
|
|
|
473
467
|
/**
|
|
474
|
-
* @typedef
|
|
475
|
-
* @property {
|
|
476
|
-
* @property {
|
|
477
|
-
* @property {string} [created_at]
|
|
478
|
-
* @property {Object} [data]
|
|
479
|
-
* @property {string} [email]
|
|
480
|
-
* @property {string} [modified_at]
|
|
481
|
-
* @property {string} [name]
|
|
482
|
-
* @property {Phone} [phone]
|
|
483
|
-
* @property {string} [type]
|
|
484
|
-
* @property {string} [unique_id]
|
|
468
|
+
* @typedef SubscriptionLimitProducts
|
|
469
|
+
* @property {boolean} [bulk]
|
|
470
|
+
* @property {number} [limit]
|
|
485
471
|
*/
|
|
486
472
|
|
|
487
473
|
/**
|
|
488
|
-
* @typedef
|
|
489
|
-
* @property {
|
|
490
|
-
* @property {
|
|
491
|
-
* @property {string} [name]
|
|
492
|
-
* @property {Phone} [phone]
|
|
493
|
-
* @property {string} [type]
|
|
494
|
-
* @property {string} [unique_id]
|
|
474
|
+
* @typedef SubscriptionLimitExtensions
|
|
475
|
+
* @property {boolean} [enabled]
|
|
476
|
+
* @property {number} [limit]
|
|
495
477
|
*/
|
|
496
478
|
|
|
497
479
|
/**
|
|
498
|
-
* @typedef
|
|
499
|
-
* @property {boolean} [
|
|
500
|
-
* @property {
|
|
480
|
+
* @typedef SubscriptionLimitIntegrations
|
|
481
|
+
* @property {boolean} [enabled]
|
|
482
|
+
* @property {number} [limit]
|
|
501
483
|
*/
|
|
502
484
|
|
|
503
485
|
/**
|
|
504
486
|
* @typedef SubscriptionLimit
|
|
505
487
|
* @property {SubscriptionLimitApplication} [application]
|
|
506
|
-
* @property {SubscriptionLimitExtensions} [extensions]
|
|
507
|
-
* @property {SubscriptionLimitIntegrations} [integrations]
|
|
508
|
-
* @property {boolean} [is_trial_plan]
|
|
509
488
|
* @property {SubscriptionLimitMarketplace} [marketplace]
|
|
510
489
|
* @property {SubscriptionLimitOtherPlatform} [other_platform]
|
|
511
|
-
* @property {SubscriptionLimitProducts} [products]
|
|
512
490
|
* @property {SubscriptionLimitTeam} [team]
|
|
491
|
+
* @property {SubscriptionLimitProducts} [products]
|
|
492
|
+
* @property {SubscriptionLimitExtensions} [extensions]
|
|
493
|
+
* @property {SubscriptionLimitIntegrations} [integrations]
|
|
494
|
+
* @property {boolean} [is_trial_plan]
|
|
513
495
|
*/
|
|
514
496
|
|
|
515
497
|
/**
|
|
516
|
-
* @typedef
|
|
517
|
-
* @property {
|
|
518
|
-
* @property {
|
|
519
|
-
* @property {
|
|
498
|
+
* @typedef SubscriptionActivateReq
|
|
499
|
+
* @property {string} [unique_id]
|
|
500
|
+
* @property {string} [type]
|
|
501
|
+
* @property {string} [product_suite]
|
|
502
|
+
* @property {string} [plan_id]
|
|
503
|
+
* @property {string} [payment_method]
|
|
520
504
|
*/
|
|
521
505
|
|
|
522
506
|
/**
|
|
523
|
-
* @typedef
|
|
524
|
-
* @property {boolean} [
|
|
525
|
-
* @property {
|
|
507
|
+
* @typedef SubscriptionActivateRes
|
|
508
|
+
* @property {boolean} [success]
|
|
509
|
+
* @property {Subscription} [data]
|
|
526
510
|
*/
|
|
527
511
|
|
|
528
512
|
/**
|
|
529
|
-
* @typedef
|
|
530
|
-
* @property {
|
|
531
|
-
* @property {
|
|
513
|
+
* @typedef CancelSubscriptionReq
|
|
514
|
+
* @property {string} [unique_id]
|
|
515
|
+
* @property {string} [type]
|
|
516
|
+
* @property {string} [product_suite]
|
|
517
|
+
* @property {string} [subscription_id]
|
|
532
518
|
*/
|
|
533
519
|
|
|
534
520
|
/**
|
|
535
|
-
* @typedef
|
|
536
|
-
* @property {boolean} [
|
|
521
|
+
* @typedef CancelSubscriptionRes
|
|
522
|
+
* @property {boolean} [success]
|
|
523
|
+
* @property {Subscription} [data]
|
|
537
524
|
*/
|
|
538
525
|
|
|
539
526
|
/**
|
|
540
|
-
* @typedef
|
|
541
|
-
* @property {
|
|
527
|
+
* @typedef PlanStatusUpdateReq
|
|
528
|
+
* @property {string} [plan_id]
|
|
529
|
+
* @property {string} [reason]
|
|
530
|
+
* @property {string} [seller_status]
|
|
542
531
|
*/
|
|
543
532
|
|
|
544
533
|
/**
|
|
545
|
-
* @typedef
|
|
546
|
-
* @property {
|
|
547
|
-
* @property {
|
|
534
|
+
* @typedef SunscribePlan
|
|
535
|
+
* @property {string} [entity_type]
|
|
536
|
+
* @property {string} [collection_type]
|
|
537
|
+
* @property {string} [plan_id]
|
|
538
|
+
* @property {string} [callback_url]
|
|
539
|
+
* @property {Meta} [meta]
|
|
548
540
|
*/
|
|
549
541
|
|
|
550
542
|
/**
|
|
551
|
-
* @typedef
|
|
552
|
-
* @property {
|
|
543
|
+
* @typedef Meta
|
|
544
|
+
* @property {boolean} [subscribe]
|
|
545
|
+
* @property {boolean} [is_custom_plan]
|
|
546
|
+
* @property {boolean} [is_plan_upgrade]
|
|
553
547
|
*/
|
|
554
548
|
|
|
555
549
|
/**
|
|
556
|
-
* @typedef
|
|
557
|
-
* @property {string} [
|
|
558
|
-
* @property {string} [
|
|
550
|
+
* @typedef SubscribePlanRes
|
|
551
|
+
* @property {string} [redirect_url]
|
|
552
|
+
* @property {string} [transaction_id]
|
|
553
|
+
* @property {string} [current_status]
|
|
554
|
+
* @property {Meta} [meta]
|
|
559
555
|
*/
|
|
560
556
|
|
|
561
557
|
/**
|
|
562
|
-
* @typedef
|
|
563
|
-
* @property {
|
|
564
|
-
* @property {
|
|
565
|
-
* @property {
|
|
566
|
-
* @property {string} [
|
|
567
|
-
* @property {
|
|
568
|
-
* @property {
|
|
558
|
+
* @typedef Features
|
|
559
|
+
* @property {string} [name]
|
|
560
|
+
* @property {string} [slug]
|
|
561
|
+
* @property {string} [description]
|
|
562
|
+
* @property {string} [group]
|
|
563
|
+
* @property {boolean} [enabled]
|
|
564
|
+
* @property {string} [display_text]
|
|
569
565
|
*/
|
|
570
566
|
|
|
571
567
|
/**
|
|
572
|
-
* @typedef
|
|
573
|
-
* @property {string} [
|
|
574
|
-
* @property {string} [
|
|
568
|
+
* @typedef FeeComponents
|
|
569
|
+
* @property {string[]} [brand]
|
|
570
|
+
* @property {string[]} [location]
|
|
571
|
+
* @property {Object[]} [channel]
|
|
572
|
+
* @property {string} [business_lead]
|
|
573
|
+
* @property {string} [settlement_type]
|
|
574
|
+
* @property {Object} [settle_cycle_period]
|
|
575
|
+
* @property {Object[]} [components]
|
|
575
576
|
*/
|
|
576
577
|
|
|
577
578
|
/**
|
|
578
|
-
* @typedef
|
|
579
|
-
* @property {
|
|
580
|
-
* @property {
|
|
579
|
+
* @typedef Details
|
|
580
|
+
* @property {FeeComponents[]} [fee_components]
|
|
581
|
+
* @property {Features[]} [features]
|
|
581
582
|
*/
|
|
582
583
|
|
|
583
584
|
/**
|
|
584
|
-
* @typedef
|
|
585
|
-
* @property {
|
|
586
|
-
* @property {
|
|
587
|
-
* @property {
|
|
588
|
-
* @property {
|
|
589
|
-
* @property {string} [plan_id]
|
|
585
|
+
* @typedef EntityResponse
|
|
586
|
+
* @property {boolean} [success]
|
|
587
|
+
* @property {number} [page]
|
|
588
|
+
* @property {number} [page_size]
|
|
589
|
+
* @property {Details[]} [items]
|
|
590
590
|
*/
|
|
591
591
|
|
|
592
592
|
class BillingPlatformModel {
|
|
@@ -597,319 +597,372 @@ class BillingPlatformModel {
|
|
|
597
597
|
});
|
|
598
598
|
}
|
|
599
599
|
|
|
600
|
-
/** @returns {
|
|
601
|
-
static
|
|
600
|
+
/** @returns {ResourceNotFound} */
|
|
601
|
+
static ResourceNotFound() {
|
|
602
602
|
return Joi.object({
|
|
603
|
-
|
|
604
|
-
subscription_id: Joi.string().allow(""),
|
|
605
|
-
type: Joi.string().allow(""),
|
|
606
|
-
unique_id: Joi.string().allow(""),
|
|
603
|
+
message: Joi.string().allow(""),
|
|
607
604
|
});
|
|
608
605
|
}
|
|
609
606
|
|
|
610
|
-
/** @returns {
|
|
611
|
-
static
|
|
607
|
+
/** @returns {InternalServerError} */
|
|
608
|
+
static InternalServerError() {
|
|
612
609
|
return Joi.object({
|
|
613
|
-
|
|
614
|
-
|
|
610
|
+
message: Joi.string().allow(""),
|
|
611
|
+
code: Joi.string().allow(""),
|
|
615
612
|
});
|
|
616
613
|
}
|
|
617
614
|
|
|
618
|
-
/** @returns {
|
|
619
|
-
static
|
|
615
|
+
/** @returns {CheckValidityResponse} */
|
|
616
|
+
static CheckValidityResponse() {
|
|
620
617
|
return Joi.object({
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
metadata: Joi.any(),
|
|
624
|
-
name: Joi.string().allow("").required(),
|
|
625
|
-
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
626
|
-
pricing_type: Joi.string().allow("").required(),
|
|
627
|
-
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
628
|
-
term: Joi.string().allow("").required(),
|
|
629
|
-
trial_days: Joi.number(),
|
|
618
|
+
is_valid: Joi.boolean(),
|
|
619
|
+
discount_amount: Joi.number(),
|
|
630
620
|
});
|
|
631
621
|
}
|
|
632
622
|
|
|
633
|
-
/** @returns {
|
|
634
|
-
static
|
|
623
|
+
/** @returns {PlanRecurring} */
|
|
624
|
+
static PlanRecurring() {
|
|
635
625
|
return Joi.object({
|
|
636
|
-
|
|
637
|
-
|
|
626
|
+
interval: Joi.string().allow(""),
|
|
627
|
+
interval_count: Joi.number(),
|
|
638
628
|
});
|
|
639
629
|
}
|
|
640
630
|
|
|
641
|
-
/** @returns {
|
|
642
|
-
static
|
|
631
|
+
/** @returns {Plan} */
|
|
632
|
+
static Plan() {
|
|
643
633
|
return Joi.object({
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
634
|
+
recurring: BillingPlatformModel.PlanRecurring(),
|
|
635
|
+
is_trial_plan: Joi.boolean(),
|
|
636
|
+
plan_group: Joi.string().allow(""),
|
|
637
|
+
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
638
|
+
currency: Joi.string().allow(""),
|
|
639
|
+
is_active: Joi.boolean(),
|
|
640
|
+
is_visible: Joi.boolean(),
|
|
641
|
+
trial_period: Joi.number(),
|
|
642
|
+
addons: Joi.array().items(Joi.string().allow("")),
|
|
643
|
+
tags: Joi.array().items(Joi.string().allow("")),
|
|
644
|
+
type: Joi.string().allow(""),
|
|
645
|
+
country: Joi.string().allow(""),
|
|
646
|
+
_id: Joi.string().allow(""),
|
|
647
|
+
name: Joi.string().allow(""),
|
|
648
|
+
description: Joi.string().allow(""),
|
|
649
|
+
amount: Joi.number(),
|
|
650
|
+
product_suite_id: Joi.string().allow(""),
|
|
651
|
+
created_at: Joi.string().allow(""),
|
|
652
|
+
modified_at: Joi.string().allow(""),
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/** @returns {SubscriptionTrialPeriod} */
|
|
657
|
+
static SubscriptionTrialPeriod() {
|
|
658
|
+
return Joi.object({
|
|
659
|
+
start_date: Joi.string().allow(""),
|
|
660
|
+
end_date: Joi.string().allow(""),
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** @returns {EntityChargePrice} */
|
|
665
|
+
static EntityChargePrice() {
|
|
666
|
+
return Joi.object({
|
|
667
|
+
amount: Joi.number().required(),
|
|
668
|
+
currency_code: Joi.string().allow("").required(),
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/** @returns {EntityChargeRecurring} */
|
|
673
|
+
static EntityChargeRecurring() {
|
|
674
|
+
return Joi.object({
|
|
675
|
+
interval: Joi.string().allow("").required(),
|
|
648
676
|
});
|
|
649
677
|
}
|
|
650
678
|
|
|
651
|
-
/** @returns {
|
|
652
|
-
static
|
|
679
|
+
/** @returns {ChargeLineItem} */
|
|
680
|
+
static ChargeLineItem() {
|
|
653
681
|
return Joi.object({
|
|
654
|
-
|
|
655
|
-
|
|
682
|
+
name: Joi.string().allow("").required(),
|
|
683
|
+
term: Joi.string().allow("").required(),
|
|
684
|
+
pricing_type: Joi.string().allow("").required(),
|
|
685
|
+
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
686
|
+
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
687
|
+
capped_amount: Joi.number(),
|
|
688
|
+
trial_days: Joi.number(),
|
|
689
|
+
is_test: Joi.boolean(),
|
|
690
|
+
metadata: Joi.any(),
|
|
656
691
|
});
|
|
657
692
|
}
|
|
658
693
|
|
|
659
694
|
/** @returns {CreateSubscriptionCharge} */
|
|
660
695
|
static CreateSubscriptionCharge() {
|
|
661
696
|
return Joi.object({
|
|
662
|
-
|
|
697
|
+
name: Joi.string().allow("").required(),
|
|
698
|
+
trial_days: Joi.number(),
|
|
663
699
|
line_items: Joi.array()
|
|
664
700
|
.items(BillingPlatformModel.ChargeLineItem())
|
|
665
701
|
.required(),
|
|
666
|
-
|
|
702
|
+
is_test: Joi.boolean(),
|
|
667
703
|
return_url: Joi.string().allow("").required(),
|
|
668
|
-
trial_days: Joi.number(),
|
|
669
704
|
});
|
|
670
705
|
}
|
|
671
706
|
|
|
672
|
-
/** @returns {
|
|
673
|
-
static
|
|
707
|
+
/** @returns {OneTimeChargeItem} */
|
|
708
|
+
static OneTimeChargeItem() {
|
|
674
709
|
return Joi.object({
|
|
675
|
-
|
|
676
|
-
|
|
710
|
+
name: Joi.string().allow("").required(),
|
|
711
|
+
term: Joi.string().allow(""),
|
|
712
|
+
pricing_type: Joi.string().allow("").required(),
|
|
713
|
+
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
714
|
+
capped_amount: Joi.number(),
|
|
715
|
+
is_test: Joi.boolean(),
|
|
716
|
+
metadata: Joi.any(),
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/** @returns {CreateOneTimeCharge} */
|
|
721
|
+
static CreateOneTimeCharge() {
|
|
722
|
+
return Joi.object({
|
|
723
|
+
name: Joi.string().allow("").required(),
|
|
724
|
+
charge: BillingPlatformModel.OneTimeChargeItem().required(),
|
|
725
|
+
is_test: Joi.boolean(),
|
|
726
|
+
return_url: Joi.string().allow("").required(),
|
|
677
727
|
});
|
|
678
728
|
}
|
|
679
729
|
|
|
680
730
|
/** @returns {CurrentPeriod} */
|
|
681
731
|
static CurrentPeriod() {
|
|
682
732
|
return Joi.object({
|
|
683
|
-
end_date: Joi.string().allow(""),
|
|
684
733
|
start_date: Joi.string().allow(""),
|
|
734
|
+
end_date: Joi.string().allow(""),
|
|
685
735
|
});
|
|
686
736
|
}
|
|
687
737
|
|
|
688
|
-
/** @returns {
|
|
689
|
-
static
|
|
738
|
+
/** @returns {SubscriptionCharge} */
|
|
739
|
+
static SubscriptionCharge() {
|
|
690
740
|
return Joi.object({
|
|
691
|
-
|
|
692
|
-
|
|
741
|
+
_id: Joi.string().allow(""),
|
|
742
|
+
name: Joi.string().allow(""),
|
|
743
|
+
term: Joi.string().allow(""),
|
|
744
|
+
pricing_type: Joi.string().allow(""),
|
|
745
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
746
|
+
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
747
|
+
capped_amount: Joi.number(),
|
|
748
|
+
activated_on: Joi.string().allow(""),
|
|
749
|
+
cancelled_on: Joi.string().allow(""),
|
|
750
|
+
billing_date: Joi.string().allow(""),
|
|
751
|
+
current_period: BillingPlatformModel.CurrentPeriod(),
|
|
752
|
+
status: Joi.string().allow(""),
|
|
753
|
+
is_test: Joi.boolean(),
|
|
754
|
+
metadata: Joi.any(),
|
|
693
755
|
});
|
|
694
756
|
}
|
|
695
757
|
|
|
696
|
-
/** @returns {
|
|
697
|
-
static
|
|
758
|
+
/** @returns {EntitySubscription} */
|
|
759
|
+
static EntitySubscription() {
|
|
698
760
|
return Joi.object({
|
|
699
|
-
|
|
700
|
-
|
|
761
|
+
_id: Joi.string().allow(""),
|
|
762
|
+
name: Joi.string().allow(""),
|
|
763
|
+
status: Joi.string().allow(""),
|
|
764
|
+
company_id: Joi.number(),
|
|
765
|
+
activated_on: Joi.string().allow(""),
|
|
766
|
+
cancelled_on: Joi.string().allow(""),
|
|
767
|
+
trial_days: Joi.number(),
|
|
768
|
+
trial_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
769
|
+
metadata: Joi.any(),
|
|
770
|
+
line_items: Joi.array().items(BillingPlatformModel.SubscriptionCharge()),
|
|
701
771
|
});
|
|
702
772
|
}
|
|
703
773
|
|
|
704
|
-
/** @returns {
|
|
705
|
-
static
|
|
774
|
+
/** @returns {OneTimeChargeEntity} */
|
|
775
|
+
static OneTimeChargeEntity() {
|
|
706
776
|
return Joi.object({
|
|
707
|
-
|
|
777
|
+
_id: Joi.string().allow(""),
|
|
778
|
+
name: Joi.string().allow(""),
|
|
779
|
+
status: Joi.string().allow(""),
|
|
780
|
+
activated_on: Joi.string().allow(""),
|
|
781
|
+
cancelled_on: Joi.string().allow(""),
|
|
782
|
+
metadata: Joi.any(),
|
|
783
|
+
return_url: Joi.string().allow(""),
|
|
784
|
+
is_test: Joi.boolean(),
|
|
785
|
+
pricing_type: Joi.string().allow(""),
|
|
786
|
+
subscriber_id: Joi.string().allow(""),
|
|
787
|
+
entity_type: Joi.string().allow(""),
|
|
788
|
+
entity_id: Joi.string().allow(""),
|
|
789
|
+
meta: Joi.any(),
|
|
790
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
708
791
|
});
|
|
709
792
|
}
|
|
710
793
|
|
|
711
|
-
/** @returns {
|
|
712
|
-
static
|
|
794
|
+
/** @returns {CreateOneTimeChargeResponse} */
|
|
795
|
+
static CreateOneTimeChargeResponse() {
|
|
713
796
|
return Joi.object({
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
page_size: Joi.number(),
|
|
717
|
-
success: Joi.boolean(),
|
|
797
|
+
charge: BillingPlatformModel.OneTimeChargeEntity(),
|
|
798
|
+
confirm_url: Joi.string().allow(""),
|
|
718
799
|
});
|
|
719
800
|
}
|
|
720
801
|
|
|
721
|
-
/** @returns {
|
|
722
|
-
static
|
|
802
|
+
/** @returns {CreateSubscriptionResponse} */
|
|
803
|
+
static CreateSubscriptionResponse() {
|
|
723
804
|
return Joi.object({
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
cancelled_on: Joi.string().allow(""),
|
|
727
|
-
company_id: Joi.number(),
|
|
728
|
-
line_items: Joi.array().items(BillingPlatformModel.SubscriptionCharge()),
|
|
729
|
-
metadata: Joi.any(),
|
|
730
|
-
name: Joi.string().allow(""),
|
|
731
|
-
status: Joi.string().allow(""),
|
|
732
|
-
trial_days: Joi.number(),
|
|
733
|
-
trial_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
805
|
+
subscription: BillingPlatformModel.EntitySubscription(),
|
|
806
|
+
confirm_url: Joi.string().allow(""),
|
|
734
807
|
});
|
|
735
808
|
}
|
|
736
809
|
|
|
737
|
-
/** @returns {
|
|
738
|
-
static
|
|
810
|
+
/** @returns {InvoiceDetailsPeriod} */
|
|
811
|
+
static InvoiceDetailsPeriod() {
|
|
739
812
|
return Joi.object({
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
enabled: Joi.boolean(),
|
|
743
|
-
group: Joi.string().allow(""),
|
|
744
|
-
name: Joi.string().allow(""),
|
|
745
|
-
slug: Joi.string().allow(""),
|
|
813
|
+
start: Joi.string().allow(""),
|
|
814
|
+
end: Joi.string().allow(""),
|
|
746
815
|
});
|
|
747
816
|
}
|
|
748
817
|
|
|
749
|
-
/** @returns {
|
|
750
|
-
static
|
|
818
|
+
/** @returns {InvoiceDetailsClient} */
|
|
819
|
+
static InvoiceDetailsClient() {
|
|
751
820
|
return Joi.object({
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
location: Joi.array().items(Joi.string().allow("")),
|
|
757
|
-
settle_cycle_period: Joi.any(),
|
|
758
|
-
settlement_type: Joi.string().allow(""),
|
|
821
|
+
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
822
|
+
name: Joi.string().allow(""),
|
|
823
|
+
email: Joi.string().allow(""),
|
|
824
|
+
phone: Joi.string().allow(""),
|
|
759
825
|
});
|
|
760
826
|
}
|
|
761
827
|
|
|
762
|
-
/** @returns {
|
|
763
|
-
static
|
|
828
|
+
/** @returns {InvoiceDetailsStatusTrail} */
|
|
829
|
+
static InvoiceDetailsStatusTrail() {
|
|
764
830
|
return Joi.object({
|
|
765
|
-
|
|
766
|
-
|
|
831
|
+
_id: Joi.string().allow(""),
|
|
832
|
+
value: Joi.string().allow(""),
|
|
833
|
+
timestamp: Joi.string().allow(""),
|
|
767
834
|
});
|
|
768
835
|
}
|
|
769
836
|
|
|
770
|
-
/** @returns {
|
|
771
|
-
static
|
|
837
|
+
/** @returns {InvoicePaymentMethod} */
|
|
838
|
+
static InvoicePaymentMethod() {
|
|
772
839
|
return Joi.object({
|
|
773
|
-
|
|
774
|
-
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
840
|
+
pg_payment_method_id: Joi.string().allow(""),
|
|
775
841
|
});
|
|
776
842
|
}
|
|
777
843
|
|
|
778
844
|
/** @returns {InvoiceDetails} */
|
|
779
845
|
static InvoiceDetails() {
|
|
780
846
|
return Joi.object({
|
|
781
|
-
|
|
782
|
-
attemp: Joi.number(),
|
|
783
|
-
auto_advance: Joi.boolean(),
|
|
847
|
+
period: BillingPlatformModel.InvoiceDetailsPeriod(),
|
|
784
848
|
client: BillingPlatformModel.InvoiceDetailsClient(),
|
|
785
|
-
|
|
786
|
-
created_at: Joi.string().allow(""),
|
|
849
|
+
auto_advance: Joi.boolean(),
|
|
787
850
|
currency: Joi.string().allow(""),
|
|
788
|
-
|
|
789
|
-
|
|
851
|
+
paid: Joi.boolean(),
|
|
852
|
+
attemp: Joi.number(),
|
|
853
|
+
_id: Joi.string().allow(""),
|
|
854
|
+
collection_method: Joi.string().allow(""),
|
|
855
|
+
subscriber_id: Joi.string().allow(""),
|
|
790
856
|
invoice_url: Joi.string().allow(""),
|
|
791
|
-
modified_at: Joi.string().allow(""),
|
|
792
|
-
next_action_time: Joi.string().allow(""),
|
|
793
857
|
number: Joi.string().allow(""),
|
|
794
|
-
paid: Joi.boolean(),
|
|
795
|
-
payment_method: BillingPlatformModel.InvoicePaymentMethod(),
|
|
796
|
-
period: BillingPlatformModel.InvoiceDetailsPeriod(),
|
|
797
858
|
pg_data: Joi.any(),
|
|
798
859
|
receipt_number: Joi.string().allow(""),
|
|
799
860
|
statement_descriptor: Joi.string().allow(""),
|
|
861
|
+
current_status: Joi.string().allow(""),
|
|
800
862
|
status_trail: Joi.array().items(
|
|
801
863
|
BillingPlatformModel.InvoiceDetailsStatusTrail()
|
|
802
864
|
),
|
|
803
|
-
subscriber_id: Joi.string().allow(""),
|
|
804
|
-
subscription: Joi.string().allow(""),
|
|
805
865
|
subtotal: Joi.number(),
|
|
806
866
|
total: Joi.number(),
|
|
867
|
+
subscription: Joi.string().allow(""),
|
|
868
|
+
next_action_time: Joi.string().allow(""),
|
|
869
|
+
created_at: Joi.string().allow(""),
|
|
870
|
+
modified_at: Joi.string().allow(""),
|
|
871
|
+
hash_identifier: Joi.string().allow(""),
|
|
872
|
+
payment_method: BillingPlatformModel.InvoicePaymentMethod(),
|
|
807
873
|
});
|
|
808
874
|
}
|
|
809
875
|
|
|
810
|
-
/** @returns {
|
|
811
|
-
static
|
|
812
|
-
return Joi.object({
|
|
813
|
-
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
814
|
-
email: Joi.string().allow(""),
|
|
815
|
-
name: Joi.string().allow(""),
|
|
816
|
-
phone: Joi.string().allow(""),
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
/** @returns {InvoiceDetailsPeriod} */
|
|
821
|
-
static InvoiceDetailsPeriod() {
|
|
822
|
-
return Joi.object({
|
|
823
|
-
end: Joi.string().allow(""),
|
|
824
|
-
start: Joi.string().allow(""),
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
/** @returns {InvoiceDetailsStatusTrail} */
|
|
829
|
-
static InvoiceDetailsStatusTrail() {
|
|
876
|
+
/** @returns {InvoiceItemsPlanRecurring} */
|
|
877
|
+
static InvoiceItemsPlanRecurring() {
|
|
830
878
|
return Joi.object({
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
value: Joi.string().allow(""),
|
|
879
|
+
interval: Joi.string().allow(""),
|
|
880
|
+
interval_count: Joi.number(),
|
|
834
881
|
});
|
|
835
882
|
}
|
|
836
883
|
|
|
837
|
-
/** @returns {
|
|
838
|
-
static
|
|
884
|
+
/** @returns {InvoiceItemsPlan} */
|
|
885
|
+
static InvoiceItemsPlan() {
|
|
839
886
|
return Joi.object({
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
887
|
+
recurring: BillingPlatformModel.InvoiceItemsPlanRecurring(),
|
|
888
|
+
is_trial_plan: Joi.boolean(),
|
|
889
|
+
plan_group: Joi.string().allow(""),
|
|
890
|
+
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
843
891
|
currency: Joi.string().allow(""),
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
plan: BillingPlatformModel.InvoiceItemsPlan(),
|
|
850
|
-
quantity: Joi.number(),
|
|
892
|
+
is_active: Joi.boolean(),
|
|
893
|
+
is_visible: Joi.boolean(),
|
|
894
|
+
trial_period: Joi.number(),
|
|
895
|
+
addons: Joi.array().items(Joi.string().allow("")),
|
|
896
|
+
tags: Joi.array().items(Joi.string().allow("")),
|
|
851
897
|
type: Joi.string().allow(""),
|
|
852
|
-
|
|
898
|
+
country: Joi.string().allow(""),
|
|
899
|
+
_id: Joi.string().allow(""),
|
|
900
|
+
name: Joi.string().allow(""),
|
|
901
|
+
description: Joi.string().allow(""),
|
|
902
|
+
amount: Joi.number(),
|
|
903
|
+
product_suite_id: Joi.string().allow(""),
|
|
904
|
+
created_at: Joi.string().allow(""),
|
|
905
|
+
modified_at: Joi.string().allow(""),
|
|
853
906
|
});
|
|
854
907
|
}
|
|
855
908
|
|
|
856
909
|
/** @returns {InvoiceItemsPeriod} */
|
|
857
910
|
static InvoiceItemsPeriod() {
|
|
858
911
|
return Joi.object({
|
|
859
|
-
end: Joi.string().allow(""),
|
|
860
912
|
start: Joi.string().allow(""),
|
|
913
|
+
end: Joi.string().allow(""),
|
|
861
914
|
});
|
|
862
915
|
}
|
|
863
916
|
|
|
864
|
-
/** @returns {
|
|
865
|
-
static
|
|
917
|
+
/** @returns {InvoiceItems} */
|
|
918
|
+
static InvoiceItems() {
|
|
866
919
|
return Joi.object({
|
|
867
920
|
_id: Joi.string().allow(""),
|
|
868
|
-
addons: Joi.array().items(Joi.string().allow("")),
|
|
869
|
-
amount: Joi.number(),
|
|
870
|
-
country: Joi.string().allow(""),
|
|
871
|
-
created_at: Joi.string().allow(""),
|
|
872
921
|
currency: Joi.string().allow(""),
|
|
873
|
-
|
|
874
|
-
is_active: Joi.boolean(),
|
|
875
|
-
is_trial_plan: Joi.boolean(),
|
|
876
|
-
is_visible: Joi.boolean(),
|
|
877
|
-
modified_at: Joi.string().allow(""),
|
|
922
|
+
plan: BillingPlatformModel.InvoiceItemsPlan(),
|
|
878
923
|
name: Joi.string().allow(""),
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
trial_period: Joi.number(),
|
|
924
|
+
quantity: Joi.number(),
|
|
925
|
+
description: Joi.string().allow(""),
|
|
926
|
+
period: BillingPlatformModel.InvoiceItemsPeriod(),
|
|
927
|
+
unit_amount: Joi.number(),
|
|
928
|
+
amount: Joi.number(),
|
|
885
929
|
type: Joi.string().allow(""),
|
|
930
|
+
invoice_id: Joi.string().allow(""),
|
|
931
|
+
created_at: Joi.string().allow(""),
|
|
932
|
+
modified_at: Joi.string().allow(""),
|
|
886
933
|
});
|
|
887
934
|
}
|
|
888
935
|
|
|
889
|
-
/** @returns {
|
|
890
|
-
static
|
|
936
|
+
/** @returns {Invoice} */
|
|
937
|
+
static Invoice() {
|
|
891
938
|
return Joi.object({
|
|
892
|
-
|
|
893
|
-
|
|
939
|
+
invoice: BillingPlatformModel.InvoiceDetails(),
|
|
940
|
+
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
894
941
|
});
|
|
895
942
|
}
|
|
896
943
|
|
|
897
|
-
/** @returns {
|
|
898
|
-
static
|
|
944
|
+
/** @returns {InvoicesDataClient} */
|
|
945
|
+
static InvoicesDataClient() {
|
|
899
946
|
return Joi.object({
|
|
900
|
-
|
|
947
|
+
name: Joi.string().allow(""),
|
|
948
|
+
email: Joi.string().allow(""),
|
|
949
|
+
phone: Joi.string().allow(""),
|
|
950
|
+
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
901
951
|
});
|
|
902
952
|
}
|
|
903
953
|
|
|
904
|
-
/** @returns {
|
|
905
|
-
static
|
|
954
|
+
/** @returns {InvoicesDataPeriod} */
|
|
955
|
+
static InvoicesDataPeriod() {
|
|
906
956
|
return Joi.object({
|
|
907
|
-
|
|
908
|
-
end: Joi.
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
957
|
+
start: Joi.string().allow(""),
|
|
958
|
+
end: Joi.string().allow(""),
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/** @returns {InvoicesDataPaymentMethod} */
|
|
963
|
+
static InvoicesDataPaymentMethod() {
|
|
964
|
+
return Joi.object({
|
|
965
|
+
pg_payment_method_id: Joi.string().allow(""),
|
|
913
966
|
});
|
|
914
967
|
}
|
|
915
968
|
|
|
@@ -917,284 +970,215 @@ class BillingPlatformModel {
|
|
|
917
970
|
static InvoicesData() {
|
|
918
971
|
return Joi.object({
|
|
919
972
|
_id: Joi.string().allow(""),
|
|
920
|
-
attemp: Joi.number(),
|
|
921
|
-
auto_advance: Joi.boolean(),
|
|
922
973
|
client: BillingPlatformModel.InvoicesDataClient(),
|
|
923
|
-
|
|
924
|
-
created_at: Joi.string().allow(""),
|
|
974
|
+
auto_advance: Joi.boolean(),
|
|
925
975
|
currency: Joi.string().allow(""),
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
976
|
+
paid: Joi.boolean(),
|
|
977
|
+
attemp: Joi.number(),
|
|
978
|
+
collection_method: Joi.string().allow(""),
|
|
979
|
+
subscriber_id: Joi.string().allow(""),
|
|
929
980
|
invoice_url: Joi.string().allow(""),
|
|
930
|
-
modified_at: Joi.string().allow(""),
|
|
931
|
-
next_action_time: Joi.string().allow(""),
|
|
932
981
|
number: Joi.string().allow(""),
|
|
933
|
-
paid: Joi.boolean(),
|
|
934
|
-
payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
|
|
935
|
-
period: BillingPlatformModel.InvoicesDataPeriod(),
|
|
936
982
|
pg_data: Joi.any(),
|
|
983
|
+
period: BillingPlatformModel.InvoicesDataPeriod(),
|
|
937
984
|
receipt_number: Joi.string().allow(""),
|
|
938
985
|
statement_descriptor: Joi.string().allow(""),
|
|
986
|
+
current_status: Joi.string().allow(""),
|
|
939
987
|
status_trail: Joi.array().items(
|
|
940
988
|
BillingPlatformModel.InvoiceDetailsStatusTrail()
|
|
941
989
|
),
|
|
942
|
-
subscriber_id: Joi.string().allow(""),
|
|
943
|
-
subscription: Joi.string().allow(""),
|
|
944
990
|
subtotal: Joi.number(),
|
|
945
991
|
total: Joi.number(),
|
|
992
|
+
subscription: Joi.string().allow(""),
|
|
993
|
+
next_action_time: Joi.string().allow(""),
|
|
994
|
+
created_at: Joi.string().allow(""),
|
|
995
|
+
modified_at: Joi.string().allow(""),
|
|
996
|
+
hash_identifier: Joi.string().allow(""),
|
|
997
|
+
payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
|
|
998
|
+
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
946
999
|
});
|
|
947
1000
|
}
|
|
948
1001
|
|
|
949
|
-
/** @returns {
|
|
950
|
-
static
|
|
951
|
-
return Joi.object({
|
|
952
|
-
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
953
|
-
email: Joi.string().allow(""),
|
|
954
|
-
name: Joi.string().allow(""),
|
|
955
|
-
phone: Joi.string().allow(""),
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
/** @returns {InvoicesDataPaymentMethod} */
|
|
960
|
-
static InvoicesDataPaymentMethod() {
|
|
1002
|
+
/** @returns {Invoices} */
|
|
1003
|
+
static Invoices() {
|
|
961
1004
|
return Joi.object({
|
|
962
|
-
|
|
1005
|
+
data: Joi.array().items(BillingPlatformModel.InvoicesData()),
|
|
1006
|
+
start: Joi.number(),
|
|
1007
|
+
end: Joi.number(),
|
|
1008
|
+
limit: Joi.number(),
|
|
1009
|
+
page: Joi.number(),
|
|
1010
|
+
total: Joi.number(),
|
|
963
1011
|
});
|
|
964
1012
|
}
|
|
965
1013
|
|
|
966
|
-
/** @returns {
|
|
967
|
-
static
|
|
1014
|
+
/** @returns {Phone} */
|
|
1015
|
+
static Phone() {
|
|
968
1016
|
return Joi.object({
|
|
969
|
-
|
|
970
|
-
|
|
1017
|
+
phone_number: Joi.string().allow(""),
|
|
1018
|
+
phone_country_code: Joi.string().allow(""),
|
|
971
1019
|
});
|
|
972
1020
|
}
|
|
973
1021
|
|
|
974
|
-
/** @returns {
|
|
975
|
-
static
|
|
1022
|
+
/** @returns {SubscriptionBillingAddress} */
|
|
1023
|
+
static SubscriptionBillingAddress() {
|
|
976
1024
|
return Joi.object({
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1025
|
+
country: Joi.string().allow(""),
|
|
1026
|
+
state: Joi.string().allow(""),
|
|
1027
|
+
city: Joi.string().allow(""),
|
|
1028
|
+
line1: Joi.string().allow(""),
|
|
1029
|
+
line2: Joi.string().allow(""),
|
|
1030
|
+
postal_code: Joi.string().allow(""),
|
|
980
1031
|
});
|
|
981
1032
|
}
|
|
982
1033
|
|
|
983
|
-
/** @returns {
|
|
984
|
-
static
|
|
1034
|
+
/** @returns {SubscriptionCustomer} */
|
|
1035
|
+
static SubscriptionCustomer() {
|
|
985
1036
|
return Joi.object({
|
|
1037
|
+
phone: BillingPlatformModel.Phone(),
|
|
1038
|
+
billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
|
|
986
1039
|
_id: Joi.string().allow(""),
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
entity_id: Joi.string().allow(""),
|
|
990
|
-
entity_type: Joi.string().allow(""),
|
|
991
|
-
is_test: Joi.boolean(),
|
|
992
|
-
meta: Joi.any(),
|
|
993
|
-
metadata: Joi.any(),
|
|
1040
|
+
unique_id: Joi.string().allow(""),
|
|
1041
|
+
type: Joi.string().allow(""),
|
|
994
1042
|
name: Joi.string().allow(""),
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
subscriber_id: Joi.string().allow(""),
|
|
1000
|
-
});
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
/** @returns {OneTimeChargeItem} */
|
|
1004
|
-
static OneTimeChargeItem() {
|
|
1005
|
-
return Joi.object({
|
|
1006
|
-
capped_amount: Joi.number(),
|
|
1007
|
-
is_test: Joi.boolean(),
|
|
1008
|
-
metadata: Joi.any(),
|
|
1009
|
-
name: Joi.string().allow("").required(),
|
|
1010
|
-
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
1011
|
-
pricing_type: Joi.string().allow("").required(),
|
|
1012
|
-
term: Joi.string().allow(""),
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
/** @returns {Phone} */
|
|
1017
|
-
static Phone() {
|
|
1018
|
-
return Joi.object({
|
|
1019
|
-
phone_country_code: Joi.string().allow(""),
|
|
1020
|
-
phone_number: Joi.string().allow(""),
|
|
1043
|
+
email: Joi.string().allow(""),
|
|
1044
|
+
created_at: Joi.string().allow(""),
|
|
1045
|
+
modified_at: Joi.string().allow(""),
|
|
1046
|
+
data: Joi.any(),
|
|
1021
1047
|
});
|
|
1022
1048
|
}
|
|
1023
1049
|
|
|
1024
|
-
/** @returns {
|
|
1025
|
-
static
|
|
1050
|
+
/** @returns {SubscriptionCustomerCreate} */
|
|
1051
|
+
static SubscriptionCustomerCreate() {
|
|
1026
1052
|
return Joi.object({
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
country: Joi.string().allow(""),
|
|
1031
|
-
created_at: Joi.string().allow(""),
|
|
1032
|
-
currency: Joi.string().allow(""),
|
|
1033
|
-
description: Joi.string().allow(""),
|
|
1034
|
-
is_active: Joi.boolean(),
|
|
1035
|
-
is_trial_plan: Joi.boolean(),
|
|
1036
|
-
is_visible: Joi.boolean(),
|
|
1037
|
-
modified_at: Joi.string().allow(""),
|
|
1038
|
-
name: Joi.string().allow(""),
|
|
1039
|
-
plan_group: Joi.string().allow(""),
|
|
1040
|
-
product_suite_id: Joi.string().allow(""),
|
|
1041
|
-
recurring: BillingPlatformModel.PlanRecurring(),
|
|
1042
|
-
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
1043
|
-
tags: Joi.array().items(Joi.string().allow("")),
|
|
1044
|
-
trial_period: Joi.number(),
|
|
1053
|
+
phone: BillingPlatformModel.Phone(),
|
|
1054
|
+
billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
|
|
1055
|
+
unique_id: Joi.string().allow(""),
|
|
1045
1056
|
type: Joi.string().allow(""),
|
|
1057
|
+
name: Joi.string().allow(""),
|
|
1058
|
+
email: Joi.string().allow(""),
|
|
1046
1059
|
});
|
|
1047
1060
|
}
|
|
1048
1061
|
|
|
1049
|
-
/** @returns {
|
|
1050
|
-
static
|
|
1062
|
+
/** @returns {SubscriptionCurrentPeriod} */
|
|
1063
|
+
static SubscriptionCurrentPeriod() {
|
|
1051
1064
|
return Joi.object({
|
|
1052
|
-
|
|
1053
|
-
|
|
1065
|
+
start: Joi.string().allow(""),
|
|
1066
|
+
end: Joi.string().allow(""),
|
|
1054
1067
|
});
|
|
1055
1068
|
}
|
|
1056
1069
|
|
|
1057
|
-
/** @returns {
|
|
1058
|
-
static
|
|
1070
|
+
/** @returns {SubscriptionPauseCollection} */
|
|
1071
|
+
static SubscriptionPauseCollection() {
|
|
1059
1072
|
return Joi.object({
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
seller_status: Joi.string().allow(""),
|
|
1073
|
+
behavior: Joi.string().allow(""),
|
|
1074
|
+
resume_at: Joi.string().allow(""),
|
|
1063
1075
|
});
|
|
1064
1076
|
}
|
|
1065
1077
|
|
|
1066
|
-
/** @returns {
|
|
1067
|
-
static
|
|
1078
|
+
/** @returns {SubscriptionTrial} */
|
|
1079
|
+
static SubscriptionTrial() {
|
|
1068
1080
|
return Joi.object({
|
|
1069
|
-
|
|
1081
|
+
start: Joi.string().allow(""),
|
|
1082
|
+
end: Joi.string().allow(""),
|
|
1070
1083
|
});
|
|
1071
1084
|
}
|
|
1072
1085
|
|
|
1073
|
-
/** @returns {
|
|
1074
|
-
static
|
|
1086
|
+
/** @returns {SubscriptionInvoiceSettings} */
|
|
1087
|
+
static SubscriptionInvoiceSettings() {
|
|
1075
1088
|
return Joi.object({
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
redirect_url: Joi.string().allow(""),
|
|
1079
|
-
transaction_id: Joi.string().allow(""),
|
|
1089
|
+
generation: Joi.boolean(),
|
|
1090
|
+
charging: Joi.boolean(),
|
|
1080
1091
|
});
|
|
1081
1092
|
}
|
|
1082
|
-
|
|
1083
|
-
/** @returns {Subscription} */
|
|
1084
|
-
static Subscription() {
|
|
1085
|
-
return Joi.object({
|
|
1086
|
-
_id: Joi.string().allow(""),
|
|
1087
|
-
cancel_at_period_end: Joi.boolean(),
|
|
1088
|
-
channel_type: Joi.string().allow(""),
|
|
1089
|
-
collection_method: Joi.string().allow(""),
|
|
1090
|
-
created_at: Joi.string().allow(""),
|
|
1093
|
+
|
|
1094
|
+
/** @returns {Subscription} */
|
|
1095
|
+
static Subscription() {
|
|
1096
|
+
return Joi.object({
|
|
1091
1097
|
current_period: BillingPlatformModel.SubscriptionCurrentPeriod(),
|
|
1092
|
-
|
|
1098
|
+
pause_collection: BillingPlatformModel.SubscriptionPauseCollection(),
|
|
1099
|
+
trial: BillingPlatformModel.SubscriptionTrial(),
|
|
1093
1100
|
invoice_settings: BillingPlatformModel.SubscriptionInvoiceSettings(),
|
|
1094
1101
|
is_active: Joi.boolean(),
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
plan_data: BillingPlatformModel.Plan(),
|
|
1102
|
+
cancel_at_period_end: Joi.boolean(),
|
|
1103
|
+
_id: Joi.string().allow(""),
|
|
1104
|
+
subscriber_id: Joi.string().allow(""),
|
|
1099
1105
|
plan_id: Joi.string().allow(""),
|
|
1100
1106
|
product_suite_id: Joi.string().allow(""),
|
|
1101
|
-
|
|
1102
|
-
|
|
1107
|
+
plan_data: BillingPlatformModel.Plan(),
|
|
1108
|
+
current_status: Joi.string().allow(""),
|
|
1109
|
+
collection_method: Joi.string().allow(""),
|
|
1110
|
+
created_at: Joi.string().allow(""),
|
|
1111
|
+
modified_at: Joi.string().allow(""),
|
|
1112
|
+
latest_invoice: Joi.string().allow(""),
|
|
1113
|
+
channel_type: Joi.string().allow(""),
|
|
1103
1114
|
});
|
|
1104
1115
|
}
|
|
1105
1116
|
|
|
1106
|
-
/** @returns {
|
|
1107
|
-
static
|
|
1117
|
+
/** @returns {SubscriptionStatus} */
|
|
1118
|
+
static SubscriptionStatus() {
|
|
1108
1119
|
return Joi.object({
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1120
|
+
is_enabled: Joi.boolean(),
|
|
1121
|
+
subscription: BillingPlatformModel.Subscription(),
|
|
1122
|
+
latest_invoice: BillingPlatformModel.InvoicesData(),
|
|
1123
|
+
next_plan: BillingPlatformModel.Plan(),
|
|
1124
|
+
current_subscriptions: Joi.array().items(
|
|
1125
|
+
BillingPlatformModel.Subscription()
|
|
1126
|
+
),
|
|
1127
|
+
mandate_amount: Joi.string().allow(""),
|
|
1114
1128
|
});
|
|
1115
1129
|
}
|
|
1116
1130
|
|
|
1117
|
-
/** @returns {
|
|
1118
|
-
static
|
|
1131
|
+
/** @returns {SubscriptionLimitApplication} */
|
|
1132
|
+
static SubscriptionLimitApplication() {
|
|
1119
1133
|
return Joi.object({
|
|
1120
|
-
|
|
1121
|
-
|
|
1134
|
+
enabled: Joi.boolean(),
|
|
1135
|
+
hard_limit: Joi.number(),
|
|
1136
|
+
soft_limit: Joi.number(),
|
|
1122
1137
|
});
|
|
1123
1138
|
}
|
|
1124
1139
|
|
|
1125
|
-
/** @returns {
|
|
1126
|
-
static
|
|
1140
|
+
/** @returns {SubscriptionLimitMarketplace} */
|
|
1141
|
+
static SubscriptionLimitMarketplace() {
|
|
1127
1142
|
return Joi.object({
|
|
1128
|
-
|
|
1129
|
-
country: Joi.string().allow(""),
|
|
1130
|
-
line1: Joi.string().allow(""),
|
|
1131
|
-
line2: Joi.string().allow(""),
|
|
1132
|
-
postal_code: Joi.string().allow(""),
|
|
1133
|
-
state: Joi.string().allow(""),
|
|
1143
|
+
enabled: Joi.boolean(),
|
|
1134
1144
|
});
|
|
1135
1145
|
}
|
|
1136
1146
|
|
|
1137
|
-
/** @returns {
|
|
1138
|
-
static
|
|
1147
|
+
/** @returns {SubscriptionLimitOtherPlatform} */
|
|
1148
|
+
static SubscriptionLimitOtherPlatform() {
|
|
1139
1149
|
return Joi.object({
|
|
1140
|
-
|
|
1141
|
-
activated_on: Joi.string().allow(""),
|
|
1142
|
-
billing_date: Joi.string().allow(""),
|
|
1143
|
-
cancelled_on: Joi.string().allow(""),
|
|
1144
|
-
capped_amount: Joi.number(),
|
|
1145
|
-
current_period: BillingPlatformModel.CurrentPeriod(),
|
|
1146
|
-
is_test: Joi.boolean(),
|
|
1147
|
-
metadata: Joi.any(),
|
|
1148
|
-
name: Joi.string().allow(""),
|
|
1149
|
-
price: BillingPlatformModel.EntityChargePrice(),
|
|
1150
|
-
pricing_type: Joi.string().allow(""),
|
|
1151
|
-
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
1152
|
-
status: Joi.string().allow(""),
|
|
1153
|
-
term: Joi.string().allow(""),
|
|
1150
|
+
enabled: Joi.boolean(),
|
|
1154
1151
|
});
|
|
1155
1152
|
}
|
|
1156
1153
|
|
|
1157
|
-
/** @returns {
|
|
1158
|
-
static
|
|
1154
|
+
/** @returns {SubscriptionLimitTeam} */
|
|
1155
|
+
static SubscriptionLimitTeam() {
|
|
1159
1156
|
return Joi.object({
|
|
1160
|
-
|
|
1161
|
-
start: Joi.string().allow(""),
|
|
1157
|
+
limit: Joi.number(),
|
|
1162
1158
|
});
|
|
1163
1159
|
}
|
|
1164
1160
|
|
|
1165
|
-
/** @returns {
|
|
1166
|
-
static
|
|
1161
|
+
/** @returns {SubscriptionLimitProducts} */
|
|
1162
|
+
static SubscriptionLimitProducts() {
|
|
1167
1163
|
return Joi.object({
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
created_at: Joi.string().allow(""),
|
|
1171
|
-
data: Joi.any(),
|
|
1172
|
-
email: Joi.string().allow(""),
|
|
1173
|
-
modified_at: Joi.string().allow(""),
|
|
1174
|
-
name: Joi.string().allow(""),
|
|
1175
|
-
phone: BillingPlatformModel.Phone(),
|
|
1176
|
-
type: Joi.string().allow(""),
|
|
1177
|
-
unique_id: Joi.string().allow(""),
|
|
1164
|
+
bulk: Joi.boolean(),
|
|
1165
|
+
limit: Joi.number(),
|
|
1178
1166
|
});
|
|
1179
1167
|
}
|
|
1180
1168
|
|
|
1181
|
-
/** @returns {
|
|
1182
|
-
static
|
|
1169
|
+
/** @returns {SubscriptionLimitExtensions} */
|
|
1170
|
+
static SubscriptionLimitExtensions() {
|
|
1183
1171
|
return Joi.object({
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
name: Joi.string().allow(""),
|
|
1187
|
-
phone: BillingPlatformModel.Phone(),
|
|
1188
|
-
type: Joi.string().allow(""),
|
|
1189
|
-
unique_id: Joi.string().allow(""),
|
|
1172
|
+
enabled: Joi.boolean(),
|
|
1173
|
+
limit: Joi.number(),
|
|
1190
1174
|
});
|
|
1191
1175
|
}
|
|
1192
1176
|
|
|
1193
|
-
/** @returns {
|
|
1194
|
-
static
|
|
1177
|
+
/** @returns {SubscriptionLimitIntegrations} */
|
|
1178
|
+
static SubscriptionLimitIntegrations() {
|
|
1195
1179
|
return Joi.object({
|
|
1196
|
-
|
|
1197
|
-
|
|
1180
|
+
enabled: Joi.boolean(),
|
|
1181
|
+
limit: Joi.number(),
|
|
1198
1182
|
});
|
|
1199
1183
|
}
|
|
1200
1184
|
|
|
@@ -1202,116 +1186,132 @@ class BillingPlatformModel {
|
|
|
1202
1186
|
static SubscriptionLimit() {
|
|
1203
1187
|
return Joi.object({
|
|
1204
1188
|
application: BillingPlatformModel.SubscriptionLimitApplication(),
|
|
1205
|
-
extensions: BillingPlatformModel.SubscriptionLimitExtensions(),
|
|
1206
|
-
integrations: BillingPlatformModel.SubscriptionLimitIntegrations(),
|
|
1207
|
-
is_trial_plan: Joi.boolean(),
|
|
1208
1189
|
marketplace: BillingPlatformModel.SubscriptionLimitMarketplace(),
|
|
1209
1190
|
other_platform: BillingPlatformModel.SubscriptionLimitOtherPlatform(),
|
|
1210
|
-
products: BillingPlatformModel.SubscriptionLimitProducts(),
|
|
1211
1191
|
team: BillingPlatformModel.SubscriptionLimitTeam(),
|
|
1192
|
+
products: BillingPlatformModel.SubscriptionLimitProducts(),
|
|
1193
|
+
extensions: BillingPlatformModel.SubscriptionLimitExtensions(),
|
|
1194
|
+
integrations: BillingPlatformModel.SubscriptionLimitIntegrations(),
|
|
1195
|
+
is_trial_plan: Joi.boolean(),
|
|
1212
1196
|
});
|
|
1213
1197
|
}
|
|
1214
1198
|
|
|
1215
|
-
/** @returns {
|
|
1216
|
-
static
|
|
1199
|
+
/** @returns {SubscriptionActivateReq} */
|
|
1200
|
+
static SubscriptionActivateReq() {
|
|
1217
1201
|
return Joi.object({
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1202
|
+
unique_id: Joi.string().allow(""),
|
|
1203
|
+
type: Joi.string().allow(""),
|
|
1204
|
+
product_suite: Joi.string().allow(""),
|
|
1205
|
+
plan_id: Joi.string().allow(""),
|
|
1206
|
+
payment_method: Joi.string().allow(""),
|
|
1221
1207
|
});
|
|
1222
1208
|
}
|
|
1223
1209
|
|
|
1224
|
-
/** @returns {
|
|
1225
|
-
static
|
|
1210
|
+
/** @returns {SubscriptionActivateRes} */
|
|
1211
|
+
static SubscriptionActivateRes() {
|
|
1226
1212
|
return Joi.object({
|
|
1227
|
-
|
|
1228
|
-
|
|
1213
|
+
success: Joi.boolean(),
|
|
1214
|
+
data: BillingPlatformModel.Subscription(),
|
|
1229
1215
|
});
|
|
1230
1216
|
}
|
|
1231
1217
|
|
|
1232
|
-
/** @returns {
|
|
1233
|
-
static
|
|
1218
|
+
/** @returns {CancelSubscriptionReq} */
|
|
1219
|
+
static CancelSubscriptionReq() {
|
|
1234
1220
|
return Joi.object({
|
|
1235
|
-
|
|
1236
|
-
|
|
1221
|
+
unique_id: Joi.string().allow(""),
|
|
1222
|
+
type: Joi.string().allow(""),
|
|
1223
|
+
product_suite: Joi.string().allow(""),
|
|
1224
|
+
subscription_id: Joi.string().allow(""),
|
|
1237
1225
|
});
|
|
1238
1226
|
}
|
|
1239
1227
|
|
|
1240
|
-
/** @returns {
|
|
1241
|
-
static
|
|
1228
|
+
/** @returns {CancelSubscriptionRes} */
|
|
1229
|
+
static CancelSubscriptionRes() {
|
|
1242
1230
|
return Joi.object({
|
|
1243
|
-
|
|
1231
|
+
success: Joi.boolean(),
|
|
1232
|
+
data: BillingPlatformModel.Subscription(),
|
|
1244
1233
|
});
|
|
1245
1234
|
}
|
|
1246
1235
|
|
|
1247
|
-
/** @returns {
|
|
1248
|
-
static
|
|
1236
|
+
/** @returns {PlanStatusUpdateReq} */
|
|
1237
|
+
static PlanStatusUpdateReq() {
|
|
1249
1238
|
return Joi.object({
|
|
1250
|
-
|
|
1239
|
+
plan_id: Joi.string().allow(""),
|
|
1240
|
+
reason: Joi.string().allow(""),
|
|
1241
|
+
seller_status: Joi.string().allow(""),
|
|
1251
1242
|
});
|
|
1252
1243
|
}
|
|
1253
1244
|
|
|
1254
|
-
/** @returns {
|
|
1255
|
-
static
|
|
1245
|
+
/** @returns {SunscribePlan} */
|
|
1246
|
+
static SunscribePlan() {
|
|
1256
1247
|
return Joi.object({
|
|
1257
|
-
|
|
1258
|
-
|
|
1248
|
+
entity_type: Joi.string().allow(""),
|
|
1249
|
+
collection_type: Joi.string().allow(""),
|
|
1250
|
+
plan_id: Joi.string().allow(""),
|
|
1251
|
+
callback_url: Joi.string().allow(""),
|
|
1252
|
+
meta: BillingPlatformModel.Meta(),
|
|
1259
1253
|
});
|
|
1260
1254
|
}
|
|
1261
1255
|
|
|
1262
|
-
/** @returns {
|
|
1263
|
-
static
|
|
1256
|
+
/** @returns {Meta} */
|
|
1257
|
+
static Meta() {
|
|
1264
1258
|
return Joi.object({
|
|
1265
|
-
|
|
1259
|
+
subscribe: Joi.boolean(),
|
|
1260
|
+
is_custom_plan: Joi.boolean(),
|
|
1261
|
+
is_plan_upgrade: Joi.boolean(),
|
|
1266
1262
|
});
|
|
1267
1263
|
}
|
|
1268
1264
|
|
|
1269
|
-
/** @returns {
|
|
1270
|
-
static
|
|
1265
|
+
/** @returns {SubscribePlanRes} */
|
|
1266
|
+
static SubscribePlanRes() {
|
|
1271
1267
|
return Joi.object({
|
|
1272
|
-
|
|
1273
|
-
|
|
1268
|
+
redirect_url: Joi.string().allow(""),
|
|
1269
|
+
transaction_id: Joi.string().allow(""),
|
|
1270
|
+
current_status: Joi.string().allow(""),
|
|
1271
|
+
meta: BillingPlatformModel.Meta(),
|
|
1274
1272
|
});
|
|
1275
1273
|
}
|
|
1276
1274
|
|
|
1277
|
-
/** @returns {
|
|
1278
|
-
static
|
|
1275
|
+
/** @returns {Features} */
|
|
1276
|
+
static Features() {
|
|
1279
1277
|
return Joi.object({
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
),
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
next_plan: BillingPlatformModel.Plan(),
|
|
1287
|
-
subscription: BillingPlatformModel.Subscription(),
|
|
1278
|
+
name: Joi.string().allow(""),
|
|
1279
|
+
slug: Joi.string().allow(""),
|
|
1280
|
+
description: Joi.string().allow(""),
|
|
1281
|
+
group: Joi.string().allow(""),
|
|
1282
|
+
enabled: Joi.boolean(),
|
|
1283
|
+
display_text: Joi.string().allow(""),
|
|
1288
1284
|
});
|
|
1289
1285
|
}
|
|
1290
1286
|
|
|
1291
|
-
/** @returns {
|
|
1292
|
-
static
|
|
1287
|
+
/** @returns {FeeComponents} */
|
|
1288
|
+
static FeeComponents() {
|
|
1293
1289
|
return Joi.object({
|
|
1294
|
-
|
|
1295
|
-
|
|
1290
|
+
brand: Joi.array().items(Joi.string().allow("")),
|
|
1291
|
+
location: Joi.array().items(Joi.string().allow("")),
|
|
1292
|
+
channel: Joi.array().items(Joi.any()),
|
|
1293
|
+
business_lead: Joi.string().allow(""),
|
|
1294
|
+
settlement_type: Joi.string().allow(""),
|
|
1295
|
+
settle_cycle_period: Joi.any(),
|
|
1296
|
+
components: Joi.array().items(Joi.any()),
|
|
1296
1297
|
});
|
|
1297
1298
|
}
|
|
1298
1299
|
|
|
1299
|
-
/** @returns {
|
|
1300
|
-
static
|
|
1300
|
+
/** @returns {Details} */
|
|
1301
|
+
static Details() {
|
|
1301
1302
|
return Joi.object({
|
|
1302
|
-
|
|
1303
|
-
|
|
1303
|
+
fee_components: Joi.array().items(BillingPlatformModel.FeeComponents()),
|
|
1304
|
+
features: Joi.array().items(BillingPlatformModel.Features()),
|
|
1304
1305
|
});
|
|
1305
1306
|
}
|
|
1306
1307
|
|
|
1307
|
-
/** @returns {
|
|
1308
|
-
static
|
|
1308
|
+
/** @returns {EntityResponse} */
|
|
1309
|
+
static EntityResponse() {
|
|
1309
1310
|
return Joi.object({
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
plan_id: Joi.string().allow(""),
|
|
1311
|
+
success: Joi.boolean(),
|
|
1312
|
+
page: Joi.number(),
|
|
1313
|
+
page_size: Joi.number(),
|
|
1314
|
+
items: Joi.array().items(BillingPlatformModel.Details()),
|
|
1315
1315
|
});
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|