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