@gofynd/fdk-client-javascript 3.0.0-beta.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +2 -0
- package/sdk/application/ApplicationClient.js +2 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +93 -113
- package/sdk/application/Cart/CartApplicationClient.js +157 -530
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +110 -110
- package/sdk/application/Catalog/CatalogApplicationClient.js +214 -447
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
- package/sdk/application/Common/CommonApplicationClient.js +4 -19
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +3 -43
- package/sdk/application/Communication/CommunicationApplicationClient.js +4 -214
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +41 -54
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +39 -192
- package/sdk/application/Content/ContentApplicationClient.d.ts +65 -55
- package/sdk/application/Content/ContentApplicationClient.js +211 -341
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -6
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +14 -33
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +29 -0
- package/sdk/application/Finance/FinanceApplicationClient.js +111 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +6 -6
- package/sdk/application/Lead/LeadApplicationClient.js +24 -55
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +32 -87
- package/sdk/application/Logistic/LogisticApplicationClient.js +126 -383
- package/sdk/application/Order/OrderApplicationClient.d.ts +31 -51
- package/sdk/application/Order/OrderApplicationClient.js +89 -293
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +108 -218
- package/sdk/application/Payment/PaymentApplicationClient.js +100 -1081
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationClient.js +13 -66
- package/sdk/application/Share/ShareApplicationClient.d.ts +11 -11
- package/sdk/application/Share/ShareApplicationClient.js +35 -89
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +5 -25
- package/sdk/application/Theme/ThemeApplicationClient.js +24 -150
- package/sdk/application/User/UserApplicationClient.d.ts +23 -13
- package/sdk/application/User/UserApplicationClient.js +49 -407
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
- package/sdk/application/Webhook/WebhookApplicationClient.js +4 -11
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +18 -62
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +40 -372
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +99 -33
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +84 -25
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -5
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +7 -38
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +5 -5
- package/sdk/partner/Lead/LeadPartnerClient.js +4 -4
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +52 -98
- package/sdk/partner/Lead/LeadPartnerModel.js +76 -100
- package/sdk/partner/Lead/LeadPartnerValidator.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +172 -41
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +1222 -85
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1921 -297
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +973 -258
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +13 -1
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +148 -16
- package/sdk/partner/PartnerClient.d.ts +0 -6
- package/sdk/partner/PartnerClient.js +0 -9
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +21 -63
- package/sdk/partner/Theme/ThemePartnerClient.js +67 -392
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +72 -104
- package/sdk/partner/Theme/ThemePartnerModel.js +75 -101
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +1 -5
- package/sdk/partner/Theme/ThemePartnerValidator.js +12 -42
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -18
- package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -18
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +673 -189
- package/sdk/partner/Webhook/WebhookPartnerModel.js +270 -159
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -3
- package/sdk/partner/index.d.ts +0 -3
- package/sdk/partner/index.js +0 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +4 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +3 -3
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +3 -3
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +2 -32
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +3 -243
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +49 -145
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +20 -171
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -39
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +0 -35
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +15 -406
- package/sdk/platform/Billing/BillingPlatformClient.js +76 -3214
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +459 -3798
- package/sdk/platform/Billing/BillingPlatformModel.js +338 -2573
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +24 -465
- package/sdk/platform/Billing/BillingPlatformValidator.js +14 -490
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +205 -284
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +554 -672
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +165 -165
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +132 -108
- package/sdk/platform/Cart/CartPlatformModel.d.ts +4865 -3148
- package/sdk/platform/Cart/CartPlatformModel.js +2071 -2854
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +419 -1015
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2004 -6444
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +226 -1117
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +127 -919
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +574 -372
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1315 -1238
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +9334 -7634
- package/sdk/platform/Catalog/CatalogPlatformModel.js +6980 -9652
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +239 -294
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +186 -246
- package/sdk/platform/Common/CommonPlatformClient.d.ts +6 -5
- package/sdk/platform/Common/CommonPlatformClient.js +6 -5
- package/sdk/platform/Common/CommonPlatformModel.d.ts +19 -25
- package/sdk/platform/Common/CommonPlatformModel.js +11 -14
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +236 -376
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +579 -868
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +139 -170
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +126 -145
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +3 -56
- package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -307
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +314 -422
- package/sdk/platform/Communication/CommunicationPlatformModel.js +382 -538
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +3 -62
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +2 -48
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +72 -68
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +88 -84
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +270 -241
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +248 -226
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +20 -20
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +20 -20
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +118 -333
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +409 -1470
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +55 -158
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +41 -163
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +65 -142
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +103 -568
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +565 -1282
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +369 -1034
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +34 -80
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +24 -79
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +302 -246
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1297 -776
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +330 -218
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +325 -208
- package/sdk/platform/Content/ContentPlatformClient.d.ts +279 -118
- package/sdk/platform/Content/ContentPlatformClient.js +1617 -492
- package/sdk/platform/Content/ContentPlatformModel.d.ts +2374 -877
- package/sdk/platform/Content/ContentPlatformModel.js +1304 -930
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +272 -134
- package/sdk/platform/Content/ContentPlatformValidator.js +295 -118
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +53 -43
- package/sdk/platform/Discount/DiscountPlatformClient.js +53 -43
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +383 -110
- package/sdk/platform/Discount/DiscountPlatformModel.js +117 -108
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +56 -36
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -19
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +4 -163
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +4 -1078
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +5 -141
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +4 -177
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +30 -1123
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +24 -1135
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +17 -17
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +33 -33
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +19 -19
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +14 -14
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +24 -4
- package/sdk/platform/Lead/LeadPlatformClient.js +160 -4
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +60 -140
- package/sdk/platform/Lead/LeadPlatformModel.js +81 -162
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +29 -3
- package/sdk/platform/Lead/LeadPlatformValidator.js +28 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +19 -98
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +27 -662
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +91 -118
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +32 -127
- package/sdk/platform/Order/OrderPlatformClient.d.ts +421 -418
- package/sdk/platform/Order/OrderPlatformClient.js +1194 -1350
- package/sdk/platform/Order/OrderPlatformModel.d.ts +9145 -4107
- package/sdk/platform/Order/OrderPlatformModel.js +4257 -3197
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +641 -442
- package/sdk/platform/Order/OrderPlatformValidator.js +341 -311
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +6 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +9 -7
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +67 -19
- package/sdk/platform/Partner/PartnerPlatformModel.js +26 -17
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +135 -382
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +934 -2452
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +93 -306
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +70 -305
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +56 -66
- package/sdk/platform/Payment/PaymentPlatformClient.js +124 -269
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +1327 -3529
- package/sdk/platform/Payment/PaymentPlatformModel.js +1397 -3693
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +35 -64
- package/sdk/platform/Payment/PaymentPlatformValidator.js +34 -60
- package/sdk/platform/PlatformClient.d.ts +0 -2
- package/sdk/platform/PlatformClient.js +0 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +2 -2
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +2 -2
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +12 -12
- package/sdk/platform/Rewards/RewardsPlatformModel.js +10 -10
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +64 -136
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +111 -513
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +75 -103
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +50 -99
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +162 -127
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +775 -435
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +6250 -3861
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3178 -3798
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +295 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +205 -133
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +86 -8
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +23 -6
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +16 -3
- package/sdk/platform/Share/SharePlatformModel.d.ts +53 -4
- package/sdk/platform/Share/SharePlatformModel.js +45 -3
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +4 -26
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +10 -157
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +10 -21
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +6 -23
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +8 -18
- package/sdk/platform/Theme/ThemePlatformClient.js +8 -85
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +17 -425
- package/sdk/platform/Theme/ThemePlatformModel.js +23 -329
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +3 -7
- package/sdk/platform/Theme/ThemePlatformValidator.js +2 -9
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +81 -18
- package/sdk/platform/User/UserPlatformApplicationClient.js +491 -27
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +126 -10
- package/sdk/platform/User/UserPlatformApplicationValidator.js +92 -7
- package/sdk/platform/User/UserPlatformModel.d.ts +317 -218
- package/sdk/platform/User/UserPlatformModel.js +253 -210
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +25 -78
- package/sdk/platform/Webhook/WebhookPlatformClient.js +75 -470
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +813 -426
- package/sdk/platform/Webhook/WebhookPlatformModel.js +446 -395
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -55
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +12 -72
- package/sdk/platform/index.d.ts +0 -1
- package/sdk/platform/index.js +0 -2
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +22 -0
- package/sdk/public/Catalog/CatalogPublicClient.js +133 -0
- package/sdk/public/Catalog/CatalogPublicModel.d.ts +158 -0
- package/sdk/public/Catalog/CatalogPublicModel.js +116 -0
- package/sdk/public/Catalog/CatalogPublicValidator.d.ts +55 -0
- package/sdk/public/Catalog/CatalogPublicValidator.js +35 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +4 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.js +10 -113
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +46 -114
- package/sdk/public/Configuration/ConfigurationPublicModel.js +32 -117
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -11
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +0 -12
- package/sdk/public/Content/ContentPublicClient.d.ts +36 -25
- package/sdk/public/Content/ContentPublicClient.js +254 -280
- package/sdk/public/Content/ContentPublicModel.d.ts +151 -38
- package/sdk/public/Content/ContentPublicModel.js +98 -44
- package/sdk/public/Content/ContentPublicValidator.d.ts +18 -17
- package/sdk/public/Content/ContentPublicValidator.js +26 -19
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +6 -11
- package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
- package/sdk/public/Partner/PartnerPublicModel.js +81 -71
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
- package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
- package/sdk/public/PublicClient.d.ts +2 -2
- package/sdk/public/PublicClient.js +2 -2
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +8 -8
- package/sdk/public/Webhook/WebhookPublicClient.js +9 -48
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +215 -67
- package/sdk/public/Webhook/WebhookPublicModel.js +66 -61
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
- package/sdk/public/index.d.ts +1 -1
- package/sdk/public/index.js +1 -1
- package/sdk/partner/Authorization/AuthorizationPartnerClient.d.ts +0 -66
- package/sdk/partner/Authorization/AuthorizationPartnerClient.js +0 -431
- package/sdk/partner/Authorization/AuthorizationPartnerModel.d.ts +0 -231
- package/sdk/partner/Authorization/AuthorizationPartnerModel.js +0 -152
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.d.ts +0 -8
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.js +0 -39
- package/sdk/partner/Catalog/CatalogPartnerClient.d.ts +0 -26
- package/sdk/partner/Catalog/CatalogPartnerClient.js +0 -173
- package/sdk/partner/Catalog/CatalogPartnerModel.d.ts +0 -238
- package/sdk/partner/Catalog/CatalogPartnerModel.js +0 -248
- package/sdk/partner/Catalog/CatalogPartnerValidator.d.ts +0 -5
- package/sdk/partner/Catalog/CatalogPartnerValidator.js +0 -19
- package/sdk/partner/Payment/PaymentPartnerClient.d.ts +0 -116
- package/sdk/partner/Payment/PaymentPartnerClient.js +0 -857
- package/sdk/partner/Payment/PaymentPartnerModel.d.ts +0 -388
- package/sdk/partner/Payment/PaymentPartnerModel.js +0 -442
- package/sdk/partner/Payment/PaymentPartnerValidator.d.ts +0 -14
- package/sdk/partner/Payment/PaymentPartnerValidator.js +0 -74
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -320
- package/sdk/platform/Finance/FinancePlatformClient.js +0 -2333
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +0 -2895
- package/sdk/platform/Finance/FinancePlatformModel.js +0 -2150
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +0 -284
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -354
- package/sdk/public/Billing/BillingPublicClient.d.ts +0 -56
- package/sdk/public/Billing/BillingPublicClient.js +0 -397
- package/sdk/public/Billing/BillingPublicModel.d.ts +0 -919
- package/sdk/public/Billing/BillingPublicModel.js +0 -560
- package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -43
- package/sdk/public/Billing/BillingPublicValidator.js +0 -50
|
@@ -1,257 +1,37 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @typedef CompanyInfo
|
|
5
|
-
* @property {string} [company_name] - Name of the company
|
|
6
|
-
* @property {string} [gstin] - Goods and Services Tax Identification Number
|
|
7
|
-
* @property {string} [address] - Main address of the company
|
|
8
|
-
* @property {AddressDetails} [address_details]
|
|
9
|
-
* @property {string} [pan] - Permanent Account Number of the company
|
|
10
|
-
* @property {string} [phone] - Contact phone number for the company
|
|
11
|
-
* @property {string} [email] - Contact email address for the company
|
|
12
|
-
* @property {string} [cin] - Corporate Identification Number
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @typedef AddressDetails
|
|
17
|
-
* @property {string} [address_line_1] - First line of the address
|
|
18
|
-
* @property {string} [address_line_2] - Second line of the address (optional)
|
|
19
|
-
* @property {string} [city] - Company city
|
|
20
|
-
* @property {string} [pincode] - Company pincode
|
|
21
|
-
* @property {string} [state] - Company state
|
|
22
|
-
* @property {string} [country] - Company country
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @typedef InvoiceData
|
|
27
|
-
* @property {InvoiceDetailsData} [invoice]
|
|
28
|
-
* @property {InvoiceItems[]} [invoice_items]
|
|
29
|
-
* @property {CompanyInfo} [shopsense_details]
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @typedef InvoiceDetailsData
|
|
34
|
-
* @property {number} [attemp] - Number of attempts made to collect the invoice payment
|
|
35
|
-
* @property {Object} [documents] - Documents associated with the invoice
|
|
36
|
-
* @property {Object} [payment] - Payment details related to the invoice
|
|
37
|
-
* @property {Period} [period]
|
|
38
|
-
* @property {Client} [client]
|
|
39
|
-
* @property {Object} [discount] - Discount applied to the invoice
|
|
40
|
-
* @property {Object} [taxation] - Taxation applied to the invoice
|
|
41
|
-
* @property {string} [_id] - Unique identifier for the invoice
|
|
42
|
-
* @property {boolean} [auto_advance] - Indicates if the invoice will
|
|
43
|
-
* automatically advance to the next stage of collection
|
|
44
|
-
* @property {string} [collection_method] - Method of collection (e.g.,
|
|
45
|
-
* charge_automatically, send_invoice)
|
|
46
|
-
* @property {string} [subscriber_id] - Identifier for the subscriber associated
|
|
47
|
-
* with the invoice
|
|
48
|
-
* @property {string} [currency] - Currency in which the invoice is issued
|
|
49
|
-
* @property {string} [invoice_url] - URL to view the invoice pdf
|
|
50
|
-
* @property {string} [number] - Invoice number
|
|
51
|
-
* @property {boolean} [paid] - Indicates if the invoice has been paid
|
|
52
|
-
* @property {Object} [pg_data] - Payment gateway data related to the invoice
|
|
53
|
-
* @property {string} [receipt_number] - Receipt number for the invoice payment
|
|
54
|
-
* @property {string} [statement_descriptor] - Statement descriptor for the invoice
|
|
55
|
-
* @property {string} [current_status] - Current status of the invoice (e.g., paid, open)
|
|
56
|
-
* @property {StatusTrail[]} [status_trail] - Trail of status changes for the invoice
|
|
57
|
-
* @property {number} [subtotal] - Subtotal amount of the invoice
|
|
58
|
-
* @property {number} [total] - Total amount of the invoice
|
|
59
|
-
* @property {number} [old_settlement] - Previous settlement amount (if any)
|
|
60
|
-
* @property {number} [credit_balance] - Credit balance applied to the invoice
|
|
61
|
-
* @property {string} [subscription] - Subscription associated with the invoice
|
|
62
|
-
* @property {number} [attempt] - Number of attempts made to pay the invoice
|
|
63
|
-
* @property {string} [next_action_time] - Timestamp for the next action on the invoice
|
|
64
|
-
* @property {number} [credit_note_amount] - Amount of credit notes applied to the invoice
|
|
65
|
-
* @property {string} [created_at] - Timestamp when the invoice was created
|
|
66
|
-
* @property {string} [modified_at] - Timestamp when the invoice was last modified
|
|
67
|
-
* @property {string} [invoice_type] - Type of invoice (e.g., subscription, extension)
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @typedef Client
|
|
72
|
-
* @property {string} [name] - Name of the client
|
|
73
|
-
* @property {string} [email] - Email address of the client
|
|
74
|
-
* @property {string} [phone] - Phone number of the client
|
|
75
|
-
* @property {string[]} [address_lines] - List of address lines for the client's address
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @typedef Period
|
|
80
|
-
* @property {string} [start] - Start date of the period
|
|
81
|
-
* @property {string} [end] - End date of the period
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @typedef StatusTrail
|
|
86
|
-
* @property {string} [value] - The status value of the invoice at a particular
|
|
87
|
-
* timestamp (e.g., open, paid, payment_due)
|
|
88
|
-
* @property {string} [timestamp] - The date and time when the status was
|
|
89
|
-
* recorded, in ISO 8601 format
|
|
90
|
-
* @property {string} [_id] - Unique identifier for the status trail entry
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @typedef PaymentCollectRes
|
|
95
|
-
* @property {string} [transaction_id] - Unique identifier for the transaction
|
|
96
|
-
* @property {string} [current_status] - Current status of the payment
|
|
97
|
-
* collection (e.g., pending, completed, failed)
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
3
|
/**
|
|
101
4
|
* @typedef SubscriptionChargeRes
|
|
102
5
|
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
103
|
-
* @property {string} [product_suit_id] -
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* @property {string} [
|
|
107
|
-
* @property {string} [
|
|
108
|
-
*
|
|
109
|
-
* @property {
|
|
6
|
+
* @property {string} [product_suit_id] - A unique identifier for a product
|
|
7
|
+
* suite, which represents a specific collection or group of products within
|
|
8
|
+
* the system.
|
|
9
|
+
* @property {string} [entity_id] - Unique identifier for the entity (eg. extension)
|
|
10
|
+
* @property {string} [entity_type] - Specifies the type of entity related to
|
|
11
|
+
* the operation, such as 'extension' or 'subscription'
|
|
12
|
+
* @property {string} [name] - The name of the extension plan
|
|
13
|
+
* @property {string} [status] - Current status of the extension subscription
|
|
14
|
+
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
110
15
|
* @property {string} [activated_on] - Date when the charge was activated
|
|
111
16
|
* @property {string} [cancelled_on] - Date when the charge was cancelled
|
|
112
|
-
* @property {boolean} [is_test] - Indicates
|
|
17
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
18
|
+
* a test mode.
|
|
113
19
|
* @property {string} [created_at] - Timestamp when the charge was created
|
|
114
20
|
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
115
|
-
* @property {string} [company_id] -
|
|
21
|
+
* @property {string} [company_id] - The unique identifier of the company.
|
|
116
22
|
* @property {Object[]} [line_items] - List of line items associated with the charge
|
|
117
23
|
*/
|
|
118
24
|
|
|
119
25
|
/**
|
|
120
|
-
* @typedef
|
|
121
|
-
* @property {boolean} [success]
|
|
122
|
-
* @property {DowngradeRes} [data]
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @typedef DowngradeRes
|
|
127
|
-
* @property {string} [_id] - Unique identifier for the downgrade request
|
|
128
|
-
* @property {string} [status] - Current status of the downgrade request (e.g.,
|
|
129
|
-
* pending, completed)
|
|
130
|
-
* @property {string} [subscriber_id] - Unique identifier for the subscriber
|
|
131
|
-
* making the downgrade request
|
|
132
|
-
* @property {boolean} [activated] - Indicates if the downgrade has been activated
|
|
133
|
-
* @property {string} [created_at] - Timestamp when the downgrade request was created
|
|
134
|
-
* @property {string} [modified_at] - Timestamp when the downgrade request was
|
|
135
|
-
* last modified
|
|
136
|
-
* @property {string} [plan_id] - ID of the plan to which the subscriber is downgrading
|
|
137
|
-
* @property {string} [reason] - Reason provided for the downgrade request
|
|
138
|
-
* @property {string} [request_user_id] - ID of the user who initiated the
|
|
139
|
-
* downgrade request
|
|
140
|
-
* @property {string} [subscription_id] - ID of the subscription associated with
|
|
141
|
-
* the downgrade request
|
|
142
|
-
*/
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* @typedef PaymentStatusData
|
|
146
|
-
* @property {string} [_id] - Unique identifier for the payment status data
|
|
147
|
-
* @property {string} [journey] - Payment journey status, such as 'forward' or 'backward'
|
|
148
|
-
* @property {Object[]} [webhook_response] - List of responses received from
|
|
149
|
-
* webhooks related to the payment
|
|
150
|
-
* @property {string} [aggregator_status] - Status of the payment as provided by
|
|
151
|
-
* the aggregator (e.g., succeeded, failed)
|
|
152
|
-
* @property {string} [current_status] - Current status of the payment (e.g.,
|
|
153
|
-
* paid, pending)
|
|
154
|
-
* @property {string} [created_at] - Timestamp when the payment status data was created
|
|
155
|
-
* @property {string} [modified_at] - Timestamp when the payment status data was
|
|
156
|
-
* last modified
|
|
157
|
-
* @property {number} [__v] - Version key for the payment status data (typically
|
|
158
|
-
* used for versioning in databases)
|
|
159
|
-
* @property {string} [aggregator_order_id] - Unique identifier for the order
|
|
160
|
-
* provided by the payment aggregator
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* @typedef PaymentStatusResponse
|
|
165
|
-
* @property {string} [status] - The status of the payment.
|
|
166
|
-
* @property {PaymentStatusData} [data]
|
|
167
|
-
*/
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* @typedef BadRequest
|
|
26
|
+
* @typedef BadRequestSchema
|
|
171
27
|
* @property {string} [message] - Failure message.
|
|
172
28
|
*/
|
|
173
29
|
|
|
174
30
|
/**
|
|
175
31
|
* @typedef ResourceNotFound
|
|
176
32
|
* @property {string} [message] - Resource not found with {id}
|
|
177
|
-
* @property {
|
|
178
|
-
* @property {
|
|
179
|
-
*/
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* @typedef InternalServerError
|
|
183
|
-
* @property {string} [message] - Internal server error
|
|
184
|
-
* @property {string} [code] - Error code
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* @typedef CheckValidityResponse
|
|
189
|
-
* @property {boolean} [is_valid] - Indicates whether the request is valid.
|
|
190
|
-
* @property {number} [discount_amount] - The amount of discount applicable.
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* @typedef PlanRecurring
|
|
195
|
-
* @property {string} [interval] - The interval at which the plan recurs.
|
|
196
|
-
* @property {number} [interval_count]
|
|
197
|
-
*/
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* @typedef PlanMeta
|
|
201
|
-
* @property {string} [seller_status] - Status of the seller associated with the plan.
|
|
202
|
-
* @property {string} [company] - Name of the company offering the plan.
|
|
203
|
-
* @property {string} [plan_platform_display_name] - Display name for platform slug.
|
|
204
|
-
* @property {string[]} [tags] - Tags associated with the plan for
|
|
205
|
-
* categorization or identification.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* @typedef CountryRes
|
|
210
|
-
* @property {string} [name] - Name of the country.
|
|
211
|
-
* @property {string} [code] - Country code.
|
|
212
|
-
*/
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* @typedef Plan
|
|
216
|
-
* @property {Object[]} [fee_components] - List of fee components associated
|
|
217
|
-
* with the plan. Each component may be represented as a string or an object.
|
|
218
|
-
* @property {PlanRecurring} [recurring]
|
|
219
|
-
* @property {boolean} [is_trial_plan] - Indicates whether the plan is a trial plan.
|
|
220
|
-
* @property {string} [plan_group] - Group or category of the plan.
|
|
221
|
-
* @property {string[]} [tag_lines] - List of tag lines or descriptions
|
|
222
|
-
* associated with the plan.
|
|
223
|
-
* @property {string} [currency] - Currency code used for the plan's pricing.
|
|
224
|
-
* @property {string} [approved_by] - Identifier of the user or system that
|
|
225
|
-
* approved the plan.
|
|
226
|
-
* @property {boolean} [is_active] - Indicates if the plan is currently active.
|
|
227
|
-
* @property {boolean} [is_visible] - Indicates if the plan is visible to users.
|
|
228
|
-
* @property {number} [trial_period] - Number of days for the trial period, if applicable.
|
|
229
|
-
* @property {string[]} [addons] - List of add-ons available for the plan.
|
|
230
|
-
* @property {string[]} [tags] - List of tags associated with the plan.
|
|
231
|
-
* @property {string} [type] - Type of the plan (e.g., public, private).
|
|
232
|
-
* @property {CountryRes} [country]
|
|
233
|
-
* @property {string} [_id] - Unique identifier for the plan.
|
|
234
|
-
* @property {string} [name] - Name of the plan.
|
|
235
|
-
* @property {string} [description] - Description of the plan.
|
|
236
|
-
* @property {number} [amount] - Amount to be charged for the plan.
|
|
237
|
-
* @property {string} [product_suite_id] - Identifier of the product suite to
|
|
238
|
-
* which the plan belongs.
|
|
239
|
-
* @property {string} [created_at] - Timestamp when the plan was created.
|
|
240
|
-
* @property {string} [modified_at] - Timestamp when the plan was last modified.
|
|
241
|
-
* @property {Taxation} [taxation]
|
|
242
|
-
* @property {OneTimeFees} [one_time_fees]
|
|
243
|
-
* @property {CreditLine} [credit_line]
|
|
244
|
-
* @property {string} [current_status] - Current status of the plan (e.g.,
|
|
245
|
-
* active, inactive).
|
|
246
|
-
* @property {string} [channel_type] - Type of channel where the plan is offered
|
|
247
|
-
* (e.g., ecomm, retail).
|
|
248
|
-
* @property {string[]} [company_ids] - List of company IDs associated with the
|
|
249
|
-
* plan. Can be null.
|
|
250
|
-
* @property {string} [platform] - Platform where the plan is available (e.g.,
|
|
251
|
-
* web, mobile). Can be null.
|
|
252
|
-
* @property {string} [activated_on] - Timestamp when the plan was activated.
|
|
253
|
-
* @property {PlanMeta} [meta]
|
|
254
|
-
* @property {string} [created_by] - Identifier of the user who created the plan.
|
|
33
|
+
* @property {number} [code] - The HTTP status code associated with the error
|
|
34
|
+
* @property {boolean} [success] - Indicates if the request was successful
|
|
255
35
|
*/
|
|
256
36
|
|
|
257
37
|
/**
|
|
@@ -273,9 +53,9 @@ const Joi = require("joi");
|
|
|
273
53
|
* @property {string} [pricing_type] - The type of pricing for the charge item.
|
|
274
54
|
* @property {EntityChargePrice} [price]
|
|
275
55
|
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
276
|
-
* for
|
|
277
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
278
|
-
*
|
|
56
|
+
* for a particular service or item
|
|
57
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
58
|
+
* a test mode.
|
|
279
59
|
* @property {Object} [metadata] - Additional metadata associated with the charge item.
|
|
280
60
|
*/
|
|
281
61
|
|
|
@@ -283,26 +63,26 @@ const Joi = require("joi");
|
|
|
283
63
|
* @typedef CreateOneTimeCharge
|
|
284
64
|
* @property {string} [name] - The name of the one-time charge to be created.
|
|
285
65
|
* @property {OneTimeChargeItem} [charge]
|
|
286
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
287
|
-
*
|
|
66
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
67
|
+
* a test mode.
|
|
288
68
|
* @property {string} [return_url] - URL to which the user will be redirected
|
|
289
69
|
* after creating the charge.
|
|
290
70
|
*/
|
|
291
71
|
|
|
292
72
|
/**
|
|
293
73
|
* @typedef ChargeRecurring
|
|
294
|
-
* @property {string} [interval]
|
|
74
|
+
* @property {string} [interval] - The interval at which the recurring charge is
|
|
75
|
+
* applied. Examples include "month", "year", etc.
|
|
295
76
|
* @property {number} [interval_time]
|
|
296
77
|
*/
|
|
297
78
|
|
|
298
79
|
/**
|
|
299
80
|
* @typedef ChargeDetails
|
|
300
81
|
* @property {string} [_id] - Unique identifier for the charge.
|
|
301
|
-
* @property {string} [entity_type] -
|
|
302
|
-
*
|
|
303
|
-
* @property {string} [entity_id] - Unique identifier for the entity
|
|
304
|
-
*
|
|
305
|
-
* @property {string} [name] - The name of the charge.
|
|
82
|
+
* @property {string} [entity_type] - Specifies the type of entity related to
|
|
83
|
+
* the operation, such as 'extension' or 'subscription'
|
|
84
|
+
* @property {string} [entity_id] - Unique identifier for the entity (eg. extension)
|
|
85
|
+
* @property {string} [name] - The name of the extension plan
|
|
306
86
|
* @property {string} [term] - Description of the charge term.
|
|
307
87
|
* @property {string} [charge_type] - The type of charge (e.g., 'standalone',
|
|
308
88
|
* 'recurring').
|
|
@@ -311,16 +91,19 @@ const Joi = require("joi");
|
|
|
311
91
|
* @property {EntityChargePrice} [price]
|
|
312
92
|
* @property {ChargeRecurring} [recurring]
|
|
313
93
|
* @property {string} [status] - Current status of the charge.
|
|
314
|
-
* @property {number} [capped_amount] -
|
|
94
|
+
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
95
|
+
* for a particular service or item
|
|
315
96
|
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
316
97
|
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
317
|
-
* @property {string} [billing_date] -
|
|
98
|
+
* @property {string} [billing_date] - The date when the billing occurred. This
|
|
99
|
+
* field is optional and may be null if the billing date is not specified.
|
|
318
100
|
* @property {SubscriptionTrialPeriod} [current_period]
|
|
319
101
|
* @property {string} [modified_at] - Date and time when the charge details were
|
|
320
102
|
* last modified.
|
|
321
103
|
* @property {string} [created_at] - Date and time when the charge was created.
|
|
322
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
323
|
-
*
|
|
104
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
105
|
+
* a test mode.
|
|
106
|
+
* @property {string} [company_id] - The unique identifier of the company.
|
|
324
107
|
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
325
108
|
* @property {number} [__v] - Internal version key for the charge record.
|
|
326
109
|
*/
|
|
@@ -330,38 +113,37 @@ const Joi = require("joi");
|
|
|
330
113
|
* @property {string} [term] - Description of the charge term or usage.
|
|
331
114
|
* @property {string} [charge_type] - Type of the charge (e.g., 'subscription',
|
|
332
115
|
* 'extension').
|
|
333
|
-
* @property {number} [capped_amount] -
|
|
334
|
-
*
|
|
335
|
-
* @property {string} [billing_date] -
|
|
336
|
-
* not
|
|
116
|
+
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
117
|
+
* for a particular service or item
|
|
118
|
+
* @property {string} [billing_date] - The date when the billing occurred. This
|
|
119
|
+
* field is optional and may be null if the billing date is not specified.
|
|
337
120
|
* @property {string} [created_at] - Date and time when the charge entity was created.
|
|
338
121
|
* @property {string} [modified_at] - Date and time when the charge entity was
|
|
339
122
|
* last modified.
|
|
340
123
|
* @property {number} [__v] - Internal version key for the charge record.
|
|
341
124
|
* @property {string} [_id] - Unique identifier for the charge entity.
|
|
342
125
|
* @property {string} [name] - The name of the one-time charge.
|
|
343
|
-
* @property {string} [status] - Current status of the charge (e.g., 'pending'
|
|
344
|
-
* 'completed').
|
|
126
|
+
* @property {string} [status] - Current status of the charge (e.g., 'pending').
|
|
345
127
|
* @property {string} [activated_on] - Date and time when the charge was
|
|
346
128
|
* activated. Null if not yet activated.
|
|
347
129
|
* @property {string} [cancelled_on] - Date and time when the charge was
|
|
348
130
|
* cancelled. Null if not cancelled.
|
|
349
131
|
* @property {Object} [metadata] - Additional metadata associated with the charge.
|
|
350
132
|
* @property {string} [return_url] - URL to redirect to after processing the charge.
|
|
351
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
133
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
134
|
+
* a test mode.
|
|
352
135
|
* @property {string} [pricing_type] - Pricing model for the charge (e.g., 'one_time').
|
|
353
|
-
* @property {string} [subscriber_id] -
|
|
354
|
-
*
|
|
355
|
-
* @property {string} [entity_type] -
|
|
356
|
-
*
|
|
357
|
-
* @property {string} [entity_id] - Unique identifier for the entity
|
|
358
|
-
* with the charge.
|
|
136
|
+
* @property {string} [subscriber_id] - The unique identifier for the company in
|
|
137
|
+
* the system.
|
|
138
|
+
* @property {string} [entity_type] - Specifies the type of entity related to
|
|
139
|
+
* the operation, such as 'extension' or 'subscription'
|
|
140
|
+
* @property {string} [entity_id] - Unique identifier for the entity (eg. extension)
|
|
359
141
|
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
360
142
|
* @property {EntityChargePrice} [price]
|
|
361
143
|
*/
|
|
362
144
|
|
|
363
145
|
/**
|
|
364
|
-
* @typedef
|
|
146
|
+
* @typedef CreateOneTimeChargeResponseSchemas
|
|
365
147
|
* @property {Charge} [charge]
|
|
366
148
|
* @property {string} [confirm_url] - URL to which users are redirected to
|
|
367
149
|
* confirm or complete the payment or subscription process.
|
|
@@ -373,2363 +155,346 @@ const Joi = require("joi");
|
|
|
373
155
|
*/
|
|
374
156
|
|
|
375
157
|
/**
|
|
376
|
-
* @typedef
|
|
377
|
-
* @property {string}
|
|
378
|
-
*
|
|
379
|
-
* point in time.
|
|
380
|
-
* @property {string} [timestamp] - The date and time when this status was recorded.
|
|
381
|
-
*/
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* @typedef InvoiceItemsPlanRecurring
|
|
385
|
-
* @property {string} [interval] - The interval at which the plan recurs (e.g.,
|
|
386
|
-
* month, year).
|
|
387
|
-
* @property {number} [interval_count] - The number of intervals for the recurring plan.
|
|
388
|
-
*/
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* @typedef InvoiceItemsPlan
|
|
392
|
-
* @property {InvoiceItemsPlanRecurring} [recurring]
|
|
393
|
-
* @property {boolean} [is_trial_plan] - Indicates whether the plan is a trial plan.
|
|
394
|
-
* @property {string} [plan_group] - Group or category to which the plan belongs.
|
|
395
|
-
* @property {string[]} [tag_lines] - List of tag lines or short descriptions
|
|
396
|
-
* for the plan.
|
|
397
|
-
* @property {string} [currency] - Currency code for the pricing of the plan.
|
|
398
|
-
* @property {boolean} [is_active] - Indicates whether the plan is currently active.
|
|
399
|
-
* @property {boolean} [is_visible] - Indicates whether the plan is visible to users.
|
|
400
|
-
* @property {number} [trial_period] - The number of days for the trial period.
|
|
401
|
-
* @property {string[]} [addons] - List of add-ons available with the plan.
|
|
402
|
-
* @property {string[]} [tags] - Tags associated with the plan for categorization.
|
|
403
|
-
* @property {string} [type] - Type of the plan (e.g., public, private).
|
|
404
|
-
* @property {string} [country] - Country for which plan is created
|
|
405
|
-
* @property {string} [_id] - Unique identifier for the plan.
|
|
406
|
-
* @property {string} [name] - Name of the plan.
|
|
407
|
-
* @property {string} [description] - Detailed description of the plan.
|
|
408
|
-
* @property {number} [amount] - Price of the plan in the specified currency.
|
|
409
|
-
* @property {string} [product_suite_id] - Identifier for the product suite to
|
|
410
|
-
* which the plan belongs.
|
|
411
|
-
* @property {string} [created_at] - Timestamp when the plan was created.
|
|
412
|
-
* @property {string} [modified_at] - Timestamp when the plan was last modified.
|
|
158
|
+
* @typedef EntityChargeRecurring
|
|
159
|
+
* @property {string} interval - The interval at which the recurring charge is
|
|
160
|
+
* applied. Examples include "month", "year", etc.
|
|
413
161
|
*/
|
|
414
162
|
|
|
415
163
|
/**
|
|
416
|
-
* @typedef
|
|
417
|
-
* @property {string}
|
|
418
|
-
* @property {string}
|
|
164
|
+
* @typedef ChargeLineItem
|
|
165
|
+
* @property {string} name - Its name of the extension plan.
|
|
166
|
+
* @property {string} term - It indicates how it will be charged.
|
|
167
|
+
* @property {string} pricing_type - Specifies the type of pricing for the
|
|
168
|
+
* extension subscription. It indicates whether the subscription will be
|
|
169
|
+
* automatically renewed, charged once, or based on usage.
|
|
170
|
+
* @property {EntityChargePrice} price
|
|
171
|
+
* @property {EntityChargeRecurring} [recurring]
|
|
172
|
+
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
173
|
+
* for a particular service or item
|
|
174
|
+
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
175
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
176
|
+
* a test mode.
|
|
177
|
+
* @property {Object} [metadata]
|
|
178
|
+
*/
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @typedef CreateSubscriptionCharge
|
|
182
|
+
* @property {string} name - The name of the extension plan
|
|
183
|
+
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
184
|
+
* @property {ChargeLineItem[]} line_items
|
|
185
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
186
|
+
* a test mode.
|
|
187
|
+
* @property {string} return_url - The URL to which the user will be redirected
|
|
188
|
+
* after the subscription process is complete.
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @typedef EntityChargeDetails
|
|
193
|
+
* @property {string} [_id] - The unique identifier for the charge.
|
|
194
|
+
* @property {string} [subscription_id] - The unique identifier of the subscription.
|
|
195
|
+
* @property {string} [subscriber_id] - The unique identifier for the company in
|
|
196
|
+
* the system.
|
|
197
|
+
* @property {string} [entity_type] - Specifies the type of entity related to
|
|
198
|
+
* the operation, such as 'extension' or 'subscription'
|
|
199
|
+
* @property {string} [entity_id] - Unique identifier for the entity (eg. extension)
|
|
200
|
+
* @property {string} [name] - The name of the extension plan
|
|
201
|
+
* @property {string} [term] - Detailed description of the terms and conditions
|
|
202
|
+
* associated with the charge.
|
|
203
|
+
* @property {string} [charge_type] - The type of charge (e.g., 'standalone',
|
|
204
|
+
* 'recurring').
|
|
205
|
+
* @property {string} [pricing_type] - The pricing model for the charge (e.g.,
|
|
206
|
+
* 'one_time', 'recurring').
|
|
207
|
+
* @property {EntityChargePrice} [price]
|
|
208
|
+
* @property {ChargeRecurring} [recurring]
|
|
209
|
+
* @property {string} [status] - Current status of the charge.
|
|
210
|
+
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
211
|
+
* for a particular service or item
|
|
212
|
+
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
213
|
+
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
214
|
+
* @property {string} [billing_date] - The date when the billing occurred. This
|
|
215
|
+
* field is optional and may be null if the billing date is not specified.
|
|
216
|
+
* @property {SubscriptionTrialPeriod} [current_period]
|
|
217
|
+
* @property {string} [modified_at] - Date and time when the charge details were
|
|
218
|
+
* last modified.
|
|
219
|
+
* @property {string} [created_at] - Date and time when the charge was created.
|
|
220
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
221
|
+
* a test mode.
|
|
222
|
+
* @property {string} [company_id] - The unique identifier of the company.
|
|
223
|
+
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
224
|
+
* @property {number} [__v] - Internal version key for the charge record.
|
|
419
225
|
*/
|
|
420
226
|
|
|
421
227
|
/**
|
|
422
|
-
* @typedef
|
|
423
|
-
* @property {string} [_id] - Unique identifier for the
|
|
424
|
-
* @property {string} [
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* @property {
|
|
428
|
-
* @property {string} [
|
|
429
|
-
*
|
|
430
|
-
* @property {
|
|
431
|
-
* @property {
|
|
432
|
-
* @property {
|
|
433
|
-
* @property {
|
|
434
|
-
*
|
|
435
|
-
* @property {string} [
|
|
228
|
+
* @typedef EntitySubscription
|
|
229
|
+
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
230
|
+
* @property {string} [product_suit_id] - A unique identifier for a product
|
|
231
|
+
* suite, which represents a specific collection or group of products within
|
|
232
|
+
* the system.
|
|
233
|
+
* @property {string} [entity_id] - Unique identifier for the entity (eg. extension)
|
|
234
|
+
* @property {string} [entity_type] - Specifies the type of entity related to
|
|
235
|
+
* the operation, such as 'extension' or 'subscription'
|
|
236
|
+
* @property {string} [name] - The name of the extension plan
|
|
237
|
+
* @property {string} [status] - Current status of the subscription charge
|
|
238
|
+
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
239
|
+
* @property {boolean} [is_test] - Indicates whether the operation or data is in
|
|
240
|
+
* a test mode.
|
|
241
|
+
* @property {string} [created_at] - Timestamp when the charge was created
|
|
242
|
+
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
243
|
+
* @property {string} [subscriber_id] - The unique identifier for the company in
|
|
244
|
+
* the system.
|
|
245
|
+
* @property {EntityChargeDetails[]} [line_items]
|
|
246
|
+
* @property {string} [return_url] - The URL passed in request which extension
|
|
247
|
+
* expects in return.
|
|
436
248
|
*/
|
|
437
249
|
|
|
438
250
|
/**
|
|
439
|
-
* @typedef
|
|
440
|
-
* @property {
|
|
441
|
-
* @property {string} [
|
|
442
|
-
*
|
|
443
|
-
* @property {string[]} [address_lines] - Array of address lines for the client’s address.
|
|
251
|
+
* @typedef CreateSubscription
|
|
252
|
+
* @property {EntitySubscription} [subscription]
|
|
253
|
+
* @property {string} [confirm_url] - URL to which users are redirected to post
|
|
254
|
+
* initiation of extension installation.
|
|
444
255
|
*/
|
|
445
256
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
257
|
+
class BillingPlatformModel {
|
|
258
|
+
/** @returns {SubscriptionChargeRes} */
|
|
259
|
+
static SubscriptionChargeRes() {
|
|
260
|
+
return Joi.object({
|
|
261
|
+
_id: Joi.string().allow(""),
|
|
262
|
+
product_suit_id: Joi.string().allow(""),
|
|
263
|
+
entity_id: Joi.string().allow(""),
|
|
264
|
+
entity_type: Joi.string().allow(""),
|
|
265
|
+
name: Joi.string().allow(""),
|
|
266
|
+
status: Joi.string().allow(""),
|
|
267
|
+
trial_days: Joi.number(),
|
|
268
|
+
activated_on: Joi.string().allow(""),
|
|
269
|
+
cancelled_on: Joi.string().allow(""),
|
|
270
|
+
is_test: Joi.boolean(),
|
|
271
|
+
created_at: Joi.string().allow(""),
|
|
272
|
+
modified_at: Joi.string().allow(""),
|
|
273
|
+
company_id: Joi.string().allow(""),
|
|
274
|
+
line_items: Joi.array().items(Joi.any()),
|
|
275
|
+
});
|
|
276
|
+
}
|
|
451
277
|
|
|
452
|
-
/**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
278
|
+
/** @returns {BadRequestSchema} */
|
|
279
|
+
static BadRequestSchema() {
|
|
280
|
+
return Joi.object({
|
|
281
|
+
message: Joi.string().allow(""),
|
|
282
|
+
});
|
|
283
|
+
}
|
|
457
284
|
|
|
458
|
-
/**
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
* @property {Object} [discount] - Details of any discounts applied to the invoice.
|
|
467
|
-
* @property {Object} [taxation] - Taxation details associated with the invoice.
|
|
468
|
-
* @property {number} [credit_note_amount] - Amount covered by credit notes, if any.
|
|
469
|
-
* @property {InvoicesDataClient} [client]
|
|
470
|
-
* @property {boolean} [auto_advance] - Indicates if the invoice should be
|
|
471
|
-
* auto-advanced in the billing process.
|
|
472
|
-
* @property {string} [currency] - Currency code used for the invoice amount.
|
|
473
|
-
* @property {boolean} [paid] - Indicates if the invoice has been paid.
|
|
474
|
-
* @property {number} [attemp] - Number of payment attempts made for the invoice.
|
|
475
|
-
* @property {string} [collection_method] - Method used to collect payment for
|
|
476
|
-
* the invoice.
|
|
477
|
-
* @property {string} [subscriber_id] - Identifier for the subscriber associated
|
|
478
|
-
* with the invoice.
|
|
479
|
-
* @property {string} [invoice_url] - URL to view or download the invoice.
|
|
480
|
-
* "null" if not available.
|
|
481
|
-
* @property {string} [number] - Unique invoice number.
|
|
482
|
-
* @property {Object} [pg_data] - Payment gateway-related data for the invoice.
|
|
483
|
-
* @property {InvoicesDataPeriod} [period]
|
|
484
|
-
* @property {string} [receipt_number] - Receipt number for the invoice payment.
|
|
485
|
-
* @property {string} [statement_descriptor] - Descriptor that appears on the
|
|
486
|
-
* client's statement for the invoice.
|
|
487
|
-
* @property {string} [current_status] - Current status of the invoice (e.g.,
|
|
488
|
-
* paid, pending).
|
|
489
|
-
* @property {InvoiceDetailsStatusTrail[]} [status_trail] - History of status
|
|
490
|
-
* changes for the invoice.
|
|
491
|
-
* @property {number} [subtotal] - Subtotal amount before taxes and discounts.
|
|
492
|
-
* @property {number} [total] - Total amount including taxes and discounts.
|
|
493
|
-
* @property {string} [subscription] - Identifier for the subscription
|
|
494
|
-
* associated with the invoice.
|
|
495
|
-
* @property {string} [next_action_time] - Scheduled time for the next action
|
|
496
|
-
* related to the invoice.
|
|
497
|
-
* @property {string} [created_at] - Timestamp when the invoice was created.
|
|
498
|
-
* @property {string} [modified_at] - Timestamp when the invoice was last modified.
|
|
499
|
-
* @property {string} [hash_identifier] - Unique hash identifier for the invoice.
|
|
500
|
-
* @property {InvoicesDataPaymentMethod} [payment_method]
|
|
501
|
-
* @property {InvoiceItems[]} [invoice_items] - List of items included in the invoice.
|
|
502
|
-
* @property {string} [invoice_type] - Type of invoice (e.g., extension, subscription).
|
|
503
|
-
*/
|
|
285
|
+
/** @returns {ResourceNotFound} */
|
|
286
|
+
static ResourceNotFound() {
|
|
287
|
+
return Joi.object({
|
|
288
|
+
message: Joi.string().allow(""),
|
|
289
|
+
code: Joi.number(),
|
|
290
|
+
success: Joi.boolean(),
|
|
291
|
+
});
|
|
292
|
+
}
|
|
504
293
|
|
|
505
|
-
/**
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
* @property {number} [total] - Total number of items available.
|
|
513
|
-
*/
|
|
294
|
+
/** @returns {SubscriptionTrialPeriod} */
|
|
295
|
+
static SubscriptionTrialPeriod() {
|
|
296
|
+
return Joi.object({
|
|
297
|
+
start_date: Joi.string().allow(""),
|
|
298
|
+
end_date: Joi.string().allow(""),
|
|
299
|
+
});
|
|
300
|
+
}
|
|
514
301
|
|
|
515
|
-
/**
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
302
|
+
/** @returns {EntityChargePrice} */
|
|
303
|
+
static EntityChargePrice() {
|
|
304
|
+
return Joi.object({
|
|
305
|
+
amount: Joi.number(),
|
|
306
|
+
currency_code: Joi.string().allow(""),
|
|
307
|
+
});
|
|
308
|
+
}
|
|
520
309
|
|
|
521
|
-
/**
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
310
|
+
/** @returns {OneTimeChargeItem} */
|
|
311
|
+
static OneTimeChargeItem() {
|
|
312
|
+
return Joi.object({
|
|
313
|
+
name: Joi.string().allow(""),
|
|
314
|
+
term: Joi.string().allow(""),
|
|
315
|
+
pricing_type: Joi.string().allow(""),
|
|
316
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
317
|
+
capped_amount: Joi.number(),
|
|
318
|
+
is_test: Joi.boolean(),
|
|
319
|
+
metadata: Joi.object().pattern(/\S/, Joi.any()),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
531
322
|
|
|
532
|
-
/**
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
* @property {string} [created_at] - Timestamp when the customer record was created.
|
|
542
|
-
* @property {string} [modified_at] - Timestamp when the customer record was
|
|
543
|
-
* last modified.
|
|
544
|
-
* @property {Object} [data] - Additional data related to the customer.
|
|
545
|
-
* @property {Object} [documents] - Associated documents related to the customer.
|
|
546
|
-
* @property {boolean} [consent] - Indicates whether the customer has given consent.
|
|
547
|
-
* @property {boolean} [comms] - Indicates whether the customer has opted in for
|
|
548
|
-
* communications.
|
|
549
|
-
* @property {number} [credit_balance] - Current credit balance for the customer, if any.
|
|
550
|
-
* @property {BusinessCountryInfo} [business_country_info]
|
|
551
|
-
*/
|
|
323
|
+
/** @returns {CreateOneTimeCharge} */
|
|
324
|
+
static CreateOneTimeCharge() {
|
|
325
|
+
return Joi.object({
|
|
326
|
+
name: Joi.string().allow(""),
|
|
327
|
+
charge: BillingPlatformModel.OneTimeChargeItem(),
|
|
328
|
+
is_test: Joi.boolean(),
|
|
329
|
+
return_url: Joi.string().allow(""),
|
|
330
|
+
});
|
|
331
|
+
}
|
|
552
332
|
|
|
553
|
-
/**
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
* @property {string} [email] - Email address of the company
|
|
561
|
-
*/
|
|
333
|
+
/** @returns {ChargeRecurring} */
|
|
334
|
+
static ChargeRecurring() {
|
|
335
|
+
return Joi.object({
|
|
336
|
+
interval: Joi.string().allow(""),
|
|
337
|
+
interval_time: Joi.number(),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
562
340
|
|
|
563
|
-
/**
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
341
|
+
/** @returns {ChargeDetails} */
|
|
342
|
+
static ChargeDetails() {
|
|
343
|
+
return Joi.object({
|
|
344
|
+
_id: Joi.string().allow(""),
|
|
345
|
+
entity_type: Joi.string().allow(""),
|
|
346
|
+
entity_id: Joi.string().allow(""),
|
|
347
|
+
name: Joi.string().allow(""),
|
|
348
|
+
term: Joi.string().allow(""),
|
|
349
|
+
charge_type: Joi.string().allow(""),
|
|
350
|
+
pricing_type: Joi.string().allow(""),
|
|
351
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
352
|
+
recurring: BillingPlatformModel.ChargeRecurring(),
|
|
353
|
+
status: Joi.string().allow(""),
|
|
354
|
+
capped_amount: Joi.number(),
|
|
355
|
+
activated_on: Joi.string().allow(""),
|
|
356
|
+
cancelled_on: Joi.string().allow(""),
|
|
357
|
+
billing_date: Joi.string().allow(""),
|
|
358
|
+
current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
359
|
+
modified_at: Joi.string().allow(""),
|
|
360
|
+
created_at: Joi.string().allow(""),
|
|
361
|
+
is_test: Joi.boolean(),
|
|
362
|
+
company_id: Joi.string().allow(""),
|
|
363
|
+
meta: Joi.object().pattern(/\S/, Joi.any()),
|
|
364
|
+
__v: Joi.number(),
|
|
365
|
+
});
|
|
366
|
+
}
|
|
569
367
|
|
|
570
|
-
/**
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
368
|
+
/** @returns {OneTimeChargeEntity} */
|
|
369
|
+
static OneTimeChargeEntity() {
|
|
370
|
+
return Joi.object({
|
|
371
|
+
term: Joi.string().allow(""),
|
|
372
|
+
charge_type: Joi.string().allow(""),
|
|
373
|
+
capped_amount: Joi.number(),
|
|
374
|
+
billing_date: Joi.string().allow("").allow(null),
|
|
375
|
+
created_at: Joi.string().allow(""),
|
|
376
|
+
modified_at: Joi.string().allow(""),
|
|
377
|
+
__v: Joi.number(),
|
|
378
|
+
_id: Joi.string().allow(""),
|
|
379
|
+
name: Joi.string().allow(""),
|
|
380
|
+
status: Joi.string().allow(""),
|
|
381
|
+
activated_on: Joi.string().allow("").allow(null),
|
|
382
|
+
cancelled_on: Joi.string().allow("").allow(null),
|
|
383
|
+
metadata: Joi.object().pattern(/\S/, Joi.any()),
|
|
384
|
+
return_url: Joi.string().allow(""),
|
|
385
|
+
is_test: Joi.boolean(),
|
|
386
|
+
pricing_type: Joi.string().allow(""),
|
|
387
|
+
subscriber_id: Joi.string().allow(""),
|
|
388
|
+
entity_type: Joi.string().allow(""),
|
|
389
|
+
entity_id: Joi.string().allow(""),
|
|
390
|
+
meta: Joi.object().pattern(/\S/, Joi.any()),
|
|
391
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
577
394
|
|
|
578
|
-
/**
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
395
|
+
/** @returns {CreateOneTimeChargeResponseSchemas} */
|
|
396
|
+
static CreateOneTimeChargeResponseSchemas() {
|
|
397
|
+
return Joi.object({
|
|
398
|
+
charge: BillingPlatformModel.Charge(),
|
|
399
|
+
confirm_url: Joi.string().allow(""),
|
|
400
|
+
});
|
|
401
|
+
}
|
|
583
402
|
|
|
584
|
-
/**
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
* the invoice settings.
|
|
591
|
-
*/
|
|
403
|
+
/** @returns {Charge} */
|
|
404
|
+
static Charge() {
|
|
405
|
+
return Joi.object({
|
|
406
|
+
final_charge: BillingPlatformModel.OneTimeChargeEntity(),
|
|
407
|
+
});
|
|
408
|
+
}
|
|
592
409
|
|
|
593
|
-
/**
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
* @property {SubscriptionInvoiceSettings} [invoice_settings]
|
|
600
|
-
* @property {boolean} [is_active] - Indicates whether the subscription is
|
|
601
|
-
* currently active.
|
|
602
|
-
* @property {boolean} [cancel_at_period_end] - Indicates whether the
|
|
603
|
-
* subscription will be canceled at the end of the current period.
|
|
604
|
-
* @property {string} [_id] - Unique identifier for the subscription.
|
|
605
|
-
* @property {string} [subscriber_id] - Unique identifier for the subscriber
|
|
606
|
-
* associated with the subscription.
|
|
607
|
-
* @property {string} [plan_id] - Unique identifier for the plan associated with
|
|
608
|
-
* the subscription.
|
|
609
|
-
* @property {string} [product_suite_id] - Unique identifier for the product
|
|
610
|
-
* suite associated with the subscription.
|
|
611
|
-
* @property {boolean} [is_eligible_for_plan_change] - Indicates whether the
|
|
612
|
-
* subscriber is eligible to change their subscription plan.
|
|
613
|
-
* @property {Plan} [plan_data]
|
|
614
|
-
* @property {string} [current_status] - The current status of the subscription
|
|
615
|
-
* (e.g., active, canceled).
|
|
616
|
-
* @property {string} [collection_method] - Method used to collect payments for
|
|
617
|
-
* the subscription (e.g., charge_automatically, invoice).
|
|
618
|
-
* @property {string} [created_at] - The date and time when the subscription was created.
|
|
619
|
-
* @property {string} [modified_at] - The date and time when the subscription
|
|
620
|
-
* was last modified.
|
|
621
|
-
* @property {string} [latest_invoice] - Unique identifier for the most recent
|
|
622
|
-
* invoice related to the subscription.
|
|
623
|
-
* @property {string} [channel_type] - Ordering channel for which the
|
|
624
|
-
* subscription was created (e.g., ecomm, fynd).
|
|
625
|
-
* @property {boolean} [freezed] - Indicates whether the subscription is
|
|
626
|
-
* currently freezed.
|
|
627
|
-
* @property {string} [cancel_at] - The date and time when the subscription is
|
|
628
|
-
* scheduled to be canceled, if applicable.
|
|
629
|
-
* @property {string} [canceled_at] - The date and time when the subscription
|
|
630
|
-
* was actually canceled.
|
|
631
|
-
*/
|
|
410
|
+
/** @returns {EntityChargeRecurring} */
|
|
411
|
+
static EntityChargeRecurring() {
|
|
412
|
+
return Joi.object({
|
|
413
|
+
interval: Joi.string().allow("").required(),
|
|
414
|
+
});
|
|
415
|
+
}
|
|
632
416
|
|
|
633
|
-
/**
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
417
|
+
/** @returns {ChargeLineItem} */
|
|
418
|
+
static ChargeLineItem() {
|
|
419
|
+
return Joi.object({
|
|
420
|
+
name: Joi.string().allow("").required(),
|
|
421
|
+
term: Joi.string().allow("").required(),
|
|
422
|
+
pricing_type: Joi.string().allow("").required(),
|
|
423
|
+
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
424
|
+
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
425
|
+
capped_amount: Joi.number(),
|
|
426
|
+
trial_days: Joi.number(),
|
|
427
|
+
is_test: Joi.boolean(),
|
|
428
|
+
metadata: Joi.object().pattern(/\S/, Joi.any()),
|
|
429
|
+
});
|
|
430
|
+
}
|
|
647
431
|
|
|
648
|
-
/**
|
|
649
|
-
|
|
650
|
-
* @property {boolean} [enabled] - Indicates whether the application limit is enabled.
|
|
651
|
-
* @property {number} [hard_limit] - The maximum number of applications allowed.
|
|
652
|
-
* @property {number} [soft_limit] - The soft limit of applications allowed,
|
|
653
|
-
* typically a warning threshold before reaching the hard limit.
|
|
654
|
-
*/
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* @typedef SubscriptionLimitMarketplace
|
|
658
|
-
* @property {boolean} [enabled] - Indicates whether the marketplace limit is enabled.
|
|
659
|
-
*/
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* @typedef SubscriptionLimitOtherPlatform
|
|
663
|
-
* @property {boolean} [enabled] - Indicates whether the other platform limit is enabled.
|
|
664
|
-
*/
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* @typedef SubscriptionLimitTeam
|
|
668
|
-
* @property {number} [limit] - The limit for team-related features.
|
|
669
|
-
*/
|
|
670
|
-
|
|
671
|
-
/**
|
|
672
|
-
* @typedef SubscriptionLimitProducts
|
|
673
|
-
* @property {boolean} [bulk] - Indicates whether bulk product limits are enabled.
|
|
674
|
-
* @property {number} [limit] - The limit for products.
|
|
675
|
-
*/
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* @typedef SubscriptionLimitExtensions
|
|
679
|
-
* @property {boolean} [enabled] - Indicates whether the extensions limit is enabled.
|
|
680
|
-
* @property {number} [limit] - The limit for extensions.
|
|
681
|
-
*/
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* @typedef SubscriptionLimitIntegrations
|
|
685
|
-
* @property {boolean} [enabled] - Indicates whether the integrations limit is enabled.
|
|
686
|
-
* @property {number} [limit] - The limit for integrations. A value of `-1`
|
|
687
|
-
* usually indicates no limit.
|
|
688
|
-
*/
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* @typedef SubscriptionLimit
|
|
692
|
-
* @property {SubscriptionLimitApplication} [application]
|
|
693
|
-
* @property {SubscriptionLimitMarketplace} [marketplace]
|
|
694
|
-
* @property {SubscriptionLimitOtherPlatform} [other_platform]
|
|
695
|
-
* @property {SubscriptionLimitTeam} [team]
|
|
696
|
-
* @property {SubscriptionLimitProducts} [products]
|
|
697
|
-
* @property {SubscriptionLimitExtensions} [extensions]
|
|
698
|
-
* @property {SubscriptionLimitIntegrations} [integrations]
|
|
699
|
-
* @property {boolean} [is_trial_plan] - Indicates whether the subscription is
|
|
700
|
-
* for a trial plan.
|
|
701
|
-
*/
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* @typedef IntentReq
|
|
705
|
-
* @property {string} [unique_external_id] - A unique identifier for the
|
|
706
|
-
* external resource, used to track and reference the request like company id.
|
|
707
|
-
* @property {string} [plan_id] - The identifier for the plan associated with the intent.
|
|
708
|
-
*/
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* @typedef PutIntentReq
|
|
712
|
-
* @property {string} [unique_external_id] - A unique identifier for the
|
|
713
|
-
* external resource, used to track and reference the request like company id.
|
|
714
|
-
* @property {string} [setup_intent_id] - The ID of the setup intent for payment
|
|
715
|
-
* methods, if applicable.
|
|
716
|
-
* @property {string} [payment_method_id] - The ID of the payment method to use
|
|
717
|
-
* for the intent.
|
|
718
|
-
* @property {boolean} [set_default] - Indicates whether the payment method
|
|
719
|
-
* should be set as default.
|
|
720
|
-
*/
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* @typedef SubscriptionActivateReq
|
|
724
|
-
* @property {string} [unique_id] - A unique identifier for the subscription
|
|
725
|
-
* activation request.
|
|
726
|
-
* @property {string} [type] - The type of subscriber account, e.g., company or developer.
|
|
727
|
-
* @property {string} [product_suite] - The product suite associated with the
|
|
728
|
-
* subscription.
|
|
729
|
-
* @property {string} [plan_id] - The ID of the plan to be activated for the subscription.
|
|
730
|
-
* @property {string} [payment_method] - The payment method ID to be used for
|
|
731
|
-
* this subscription.
|
|
732
|
-
* @property {string} [subscription_id] - The ID of the subscription to be
|
|
733
|
-
* activated, if applicable.
|
|
734
|
-
* @property {string} [coupon] - A coupon code for applying discounts, if applicable.
|
|
735
|
-
* @property {Object} [meta] - Additional metadata related to the subscription
|
|
736
|
-
* activation request.
|
|
737
|
-
*/
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
* @typedef SubscriptionActivateRes
|
|
741
|
-
* @property {boolean} [success] - Indicates whether the subscription activation
|
|
742
|
-
* was successful.
|
|
743
|
-
* @property {Subscription} [data]
|
|
744
|
-
*/
|
|
745
|
-
|
|
746
|
-
/**
|
|
747
|
-
* @typedef CancelSubscriptionReq
|
|
748
|
-
* @property {string} [unique_id] - A unique identifier for the subscription
|
|
749
|
-
* cancellation request like company id.
|
|
750
|
-
* @property {string} [type] - The type of subscription to be canceled, e.g.,
|
|
751
|
-
* company or developer.
|
|
752
|
-
* @property {string} [product_suite] - The product suite associated with the
|
|
753
|
-
* subscription to be canceled.
|
|
754
|
-
* @property {string} [subscription_id] - The ID of the subscription to be canceled.
|
|
755
|
-
*/
|
|
756
|
-
|
|
757
|
-
/**
|
|
758
|
-
* @typedef CancelSubscriptionRes
|
|
759
|
-
* @property {boolean} [success]
|
|
760
|
-
* @property {Subscription} [data]
|
|
761
|
-
*/
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* @typedef PlanStatusUpdateReq
|
|
765
|
-
* @property {string} [plan_id] - The identifier of the plan whose status is
|
|
766
|
-
* being updated.
|
|
767
|
-
* @property {string} [reason] - The reason for updating the plan status.
|
|
768
|
-
* @property {string} [seller_status] - The new status of the plan as set by the
|
|
769
|
-
* seller (e.g., approved, rejected, pending).
|
|
770
|
-
*/
|
|
771
|
-
|
|
772
|
-
/**
|
|
773
|
-
* @typedef SubscribePlan
|
|
774
|
-
* @property {string} [entity_type] - The type of entity for which the plan is
|
|
775
|
-
* being subscribed (e.g., subscription, extension).
|
|
776
|
-
* @property {string} [collection_type] - The method of collection for the
|
|
777
|
-
* subscription (e.g., online, offline).
|
|
778
|
-
* @property {string} [plan_id] - The identifier of the plan to subscribe to.
|
|
779
|
-
* @property {string} [callback_url] - URL to which the payment result will be sent
|
|
780
|
-
* @property {Meta} [meta]
|
|
781
|
-
*/
|
|
782
|
-
|
|
783
|
-
/**
|
|
784
|
-
* @typedef Meta
|
|
785
|
-
* @property {boolean} [subscribe] - Indicates whether the subscription is being
|
|
786
|
-
* initiated.
|
|
787
|
-
* @property {boolean} [is_custom_plan] - Indicates if the plan is a custom plan
|
|
788
|
-
* rather than a standard one.
|
|
789
|
-
* @property {boolean} [is_plan_upgrade] - Indicates whether this subscription
|
|
790
|
-
* is an upgrade from a previous plan.
|
|
791
|
-
*/
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* @typedef SubscribePlanRes
|
|
795
|
-
* @property {string} [redirect_url] - The URL to which the user should be
|
|
796
|
-
* redirected after completion of subscription process.
|
|
797
|
-
* @property {string} [transaction_id] - The unique identifier for the
|
|
798
|
-
* subscription transaction.
|
|
799
|
-
* @property {string} [current_status] - The current status of the subscription
|
|
800
|
-
* process (e.g., initiated, success, failed).
|
|
801
|
-
* @property {Meta} [meta]
|
|
802
|
-
*/
|
|
803
|
-
|
|
804
|
-
/**
|
|
805
|
-
* @typedef EntityDetail
|
|
806
|
-
* @property {string} [entity] - Specifies the type of entity (e.g., subscription, user).
|
|
807
|
-
* @property {Subscription} [item]
|
|
808
|
-
*/
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* @typedef PaymentOptions
|
|
812
|
-
* @property {string} [_id] - Unique identifier for the payment option.
|
|
813
|
-
* @property {string} [name] - Name of the payment option.
|
|
814
|
-
* @property {string} [description] - Brief description of the payment option's
|
|
815
|
-
* functionality.
|
|
816
|
-
* @property {string} [logo] - URL of the payment option's logo like upi logo.
|
|
817
|
-
* @property {string} [aggregator_id] - Unique identifier for the payment aggregator.
|
|
818
|
-
* @property {string} [aggregator] - Identifier for the payment aggregator system.
|
|
819
|
-
* @property {string} [created_at] - Date and time when the payment option was created.
|
|
820
|
-
* @property {string} [modified_at] - Date and time when the payment option was
|
|
821
|
-
* last modified.
|
|
822
|
-
* @property {number} [__v] - Version key for document revision control.
|
|
823
|
-
*/
|
|
824
|
-
|
|
825
|
-
/**
|
|
826
|
-
* @typedef VerifyPaymentReq
|
|
827
|
-
* @property {string} [razorpay_payment_id] - Unique identifier for the Razorpay payment.
|
|
828
|
-
* @property {string} [razorpay_order_id] - Unique identifier for the Razorpay order.
|
|
829
|
-
* @property {string} [razorpay_signature] - Signature generated by Razorpay to
|
|
830
|
-
* verify the payment.
|
|
831
|
-
* @property {number} [status_code] - HTTP status code of the payment
|
|
832
|
-
* verification response.
|
|
833
|
-
* @property {string} [provider_type] - The payment provider used for the transaction.
|
|
834
|
-
*/
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
* @typedef Documents
|
|
838
|
-
* @property {string} [pan] - Permanent Account Number (PAN) used for tax purposes.
|
|
839
|
-
* @property {string} [gst] - Goods and Services Tax (GST) number for business taxation.
|
|
840
|
-
*/
|
|
841
|
-
|
|
842
|
-
/**
|
|
843
|
-
* @typedef BillingAddress
|
|
844
|
-
* @property {string} [country] - The country where the billing address is located.
|
|
845
|
-
* @property {string} [state] - The state or region within the country.
|
|
846
|
-
* @property {string} [city] - The city of the billing address.
|
|
847
|
-
* @property {string} [line1] - The first line of the billing address.
|
|
848
|
-
* @property {string} [line2] - The second line of the billing address (if applicable).
|
|
849
|
-
* @property {string} [postal_code] - The ZIP code of the billing address.
|
|
850
|
-
* @property {string} [country_code] - ISO country code for the country of the
|
|
851
|
-
* billing address.
|
|
852
|
-
*/
|
|
853
|
-
|
|
854
|
-
/**
|
|
855
|
-
* @typedef Currency
|
|
856
|
-
* @property {string} [code] - Currency code as per ISO 4217.
|
|
857
|
-
* @property {string} [symbol] - Symbol representing the currency.
|
|
858
|
-
* @property {string} [name] - Full name of the currency.
|
|
859
|
-
*/
|
|
860
|
-
|
|
861
|
-
/**
|
|
862
|
-
* @typedef BusinessCountryInfo
|
|
863
|
-
* @property {string} [country] - The country where the business is registered.
|
|
864
|
-
* @property {string} [country_code] - ISO country code for the business's country.
|
|
865
|
-
* @property {Currency} [currency]
|
|
866
|
-
* @property {string} [timezone] - Timezone in which the business operates.
|
|
867
|
-
*/
|
|
868
|
-
|
|
869
|
-
/**
|
|
870
|
-
* @typedef SubscriberData
|
|
871
|
-
* @property {boolean} [pg_user_exists] - Indicates if the user exists in the
|
|
872
|
-
* payment gateway system.
|
|
873
|
-
* @property {string} [id] - Unique identifier for the subscriber.
|
|
874
|
-
* @property {string} [pg_customer_id] - Unique customer ID assigned by the
|
|
875
|
-
* payment gateway.
|
|
876
|
-
* @property {string} [default_payment_method] - Identifier for the default
|
|
877
|
-
* payment method used by the subscriber.
|
|
878
|
-
*/
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* @typedef Subscriber
|
|
882
|
-
* @property {Documents} [documents]
|
|
883
|
-
* @property {Object} [phone] - Contact information for the subscriber, such as
|
|
884
|
-
* phone number.
|
|
885
|
-
* @property {BillingAddress} [billing_address]
|
|
886
|
-
* @property {boolean} [consent] - Indicates whether the subscriber has given
|
|
887
|
-
* consent for processing.
|
|
888
|
-
* @property {boolean} [comms] - Indicates whether the subscriber has opted in
|
|
889
|
-
* for communications.
|
|
890
|
-
* @property {string} [_id] - Unique identifier for the subscriber in the system.
|
|
891
|
-
* @property {string} [type] - The type of the subscriber, such as 'individual'
|
|
892
|
-
* or 'company'.
|
|
893
|
-
* @property {string} [unique_id] - A unique identifier assigned to the subscriber.
|
|
894
|
-
* @property {string} [name] - The name of the subscriber.
|
|
895
|
-
* @property {string} [email] - Email address of the subscriber.
|
|
896
|
-
* @property {BusinessCountryInfo} [business_country_info]
|
|
897
|
-
* @property {string} [created_at] - The date and time when the subscriber was created.
|
|
898
|
-
* @property {string} [modified_at] - The date and time when the subscriber
|
|
899
|
-
* details were last modified.
|
|
900
|
-
* @property {number} [credit_balance] - The current credit balance for the
|
|
901
|
-
* subscriber, if any.
|
|
902
|
-
* @property {SubscriberData} [data]
|
|
903
|
-
*/
|
|
904
|
-
|
|
905
|
-
/**
|
|
906
|
-
* @typedef AuthorModifiedDetails
|
|
907
|
-
* @property {string} [first_name] - The first name of the author who made modifications.
|
|
908
|
-
* @property {string} [last_name] - The last name of the author who made modifications.
|
|
909
|
-
* @property {boolean} [is_admin] - Indicates whether the author has
|
|
910
|
-
* administrative privileges.
|
|
911
|
-
*/
|
|
912
|
-
|
|
913
|
-
/**
|
|
914
|
-
* @typedef Author
|
|
915
|
-
* @property {AuthorModifiedDetails} [modified_by_details]
|
|
916
|
-
* @property {string} [created_by] - Identifier of the user who created the record.
|
|
917
|
-
* @property {string} [modified_by] - Identifier of the user who last modified the record.
|
|
918
|
-
*/
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* @typedef EndingBalance
|
|
922
|
-
* @property {number} [amount] - The ending balance amount.
|
|
923
|
-
* @property {string} [old_entry_ref] - Reference to the previous entry if applicable.
|
|
924
|
-
*/
|
|
925
|
-
|
|
926
|
-
/**
|
|
927
|
-
* @typedef PaymentData
|
|
928
|
-
* @property {string} [transaction_id] - The unique identifier for the transaction.
|
|
929
|
-
* @property {string} [aggregator] - The payment aggregator used for the transaction.
|
|
930
|
-
* @property {string} [aggregator_order_id] - The order ID generated by the
|
|
931
|
-
* payment aggregator.
|
|
932
|
-
* @property {string} [receipt_date] - The date and time when the receipt was generated.
|
|
933
|
-
* @property {string} [unique_transaction_reference] - A unique reference for
|
|
934
|
-
* the transaction.
|
|
935
|
-
*/
|
|
936
|
-
|
|
937
|
-
/**
|
|
938
|
-
* @typedef CreditTransaction
|
|
939
|
-
* @property {Object} [entity] - The entity associated with the transaction.
|
|
940
|
-
* @property {Author} [author]
|
|
941
|
-
* @property {string} [_id] - The unique identifier for the credit transaction.
|
|
942
|
-
* @property {number} [amount] - The amount credited in the transaction.
|
|
943
|
-
* @property {string} [currency] - The currency of the transaction amount.
|
|
944
|
-
* @property {string} [subscriber_id] - The unique identifier of the subscriber
|
|
945
|
-
* involved in the transaction.
|
|
946
|
-
* @property {string} [description] - A brief description of the transaction.
|
|
947
|
-
* @property {string} [is_test] - Indicates if the transaction is a test transaction.
|
|
948
|
-
* @property {EndingBalance} [ending_balance]
|
|
949
|
-
* @property {PaymentData} [payment]
|
|
950
|
-
* @property {string} [type] - The type of credit transaction.
|
|
951
|
-
* @property {string} [created_at] - The date and time when the transaction was created.
|
|
952
|
-
* @property {string} [modified_at] - The date and time when the transaction was
|
|
953
|
-
* last modified.
|
|
954
|
-
*/
|
|
955
|
-
|
|
956
|
-
/**
|
|
957
|
-
* @typedef VerifyPaymentData
|
|
958
|
-
* @property {boolean} [success] - Indicates if the payment verification was successful.
|
|
959
|
-
* @property {Subscriber} [subscriber]
|
|
960
|
-
* @property {CreditTransaction} [credit_transaction]
|
|
961
|
-
*/
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* @typedef VerifyPaymentRes
|
|
965
|
-
* @property {string} [status] - The status of the payment verification.
|
|
966
|
-
* @property {VerifyPaymentData} [data]
|
|
967
|
-
*/
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* @typedef DefaultMerchants
|
|
971
|
-
* @property {string} [stripe] - The default Stripe merchant identifier.
|
|
972
|
-
*/
|
|
973
|
-
|
|
974
|
-
/**
|
|
975
|
-
* @typedef GlobalSettingsPayment
|
|
976
|
-
* @property {DefaultMerchants} [default_merchants]
|
|
977
|
-
*/
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* @typedef GlobalSettingsData
|
|
981
|
-
* @property {GlobalSettingsPayment} [payment]
|
|
982
|
-
* @property {boolean} [freeze_panel] - Indicates if the panel is frozen.
|
|
983
|
-
* @property {string} [_id] - Unique identifier for the global settings.
|
|
984
|
-
* @property {string} [created_at] - The date and time when the global settings
|
|
985
|
-
* were created.
|
|
986
|
-
* @property {string} [modified_at] - The date and time when the global settings
|
|
987
|
-
* were last modified.
|
|
988
|
-
*/
|
|
989
|
-
|
|
990
|
-
/**
|
|
991
|
-
* @typedef GlobalSettings
|
|
992
|
-
* @property {string} [status] - The status of the global settings retrieval.
|
|
993
|
-
* @property {GlobalSettingsData} [data]
|
|
994
|
-
*/
|
|
995
|
-
|
|
996
|
-
/**
|
|
997
|
-
* @typedef MethodChecks
|
|
998
|
-
* @property {string} [address_line1_check] - Result of the address line 1 check.
|
|
999
|
-
* @property {string} [address_postal_code_check] - Result of the address postal
|
|
1000
|
-
* code check.
|
|
1001
|
-
* @property {string} [cvc_check] - Result of the CVC check.
|
|
1002
|
-
*/
|
|
1003
|
-
|
|
1004
|
-
/**
|
|
1005
|
-
* @typedef MethodNetworks
|
|
1006
|
-
* @property {string[]} [available] - List of available networks for the payment method.
|
|
1007
|
-
* @property {string} [preferred] - Preferred network for the payment method.
|
|
1008
|
-
*/
|
|
1009
|
-
|
|
1010
|
-
/**
|
|
1011
|
-
* @typedef MethodSecureUsage
|
|
1012
|
-
* @property {boolean} [supported] - Indicates if 3D Secure is supported for the
|
|
1013
|
-
* payment method.
|
|
1014
|
-
*/
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* @typedef MethodDetails
|
|
1018
|
-
* @property {string} [id] - Unique identifier for the payment method.
|
|
1019
|
-
* @property {string} [type] - Type of payment method.
|
|
1020
|
-
* @property {boolean} [mandate_available] - Indicates if a mandate is available
|
|
1021
|
-
* for the payment method.
|
|
1022
|
-
* @property {number} [mandate_amount] - Mandate amount for the payment method.
|
|
1023
|
-
* @property {string} [pg_payment_method_id] - Payment gateway's payment method
|
|
1024
|
-
* identifier.
|
|
1025
|
-
* @property {boolean} [is_default] - Indicates if the payment method is the default.
|
|
1026
|
-
* @property {SubscriptionMethodData} [data]
|
|
1027
|
-
*/
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
* @typedef SubscriptionMethodData
|
|
1031
|
-
* @property {string} [brand] - Brand of the payment method.
|
|
1032
|
-
* @property {MethodChecks} [checks]
|
|
1033
|
-
* @property {string} [country] - Country of the payment method.
|
|
1034
|
-
* @property {number} [exp_month] - Expiration month of the payment method.
|
|
1035
|
-
* @property {number} [exp_year] - Expiration year of the payment method.
|
|
1036
|
-
* @property {string} [fingerprint] - Fingerprint of the payment method.
|
|
1037
|
-
* @property {string} [funding] - Funding type of the payment method.
|
|
1038
|
-
* @property {string} [generated_from] - Source from which the payment method
|
|
1039
|
-
* was generated.
|
|
1040
|
-
* @property {string} [last4] - Last 4 digits of the payment method.
|
|
1041
|
-
* @property {MethodNetworks} [networks]
|
|
1042
|
-
* @property {MethodSecureUsage} [three_d_secure_usage]
|
|
1043
|
-
* @property {string} [wallet] - Wallet associated with the payment method.
|
|
1044
|
-
* @property {string} [name] - Name associated with the payment method.
|
|
1045
|
-
* @property {boolean} [is_default] - Indicates if the payment method is the default.
|
|
1046
|
-
*/
|
|
1047
|
-
|
|
1048
|
-
/**
|
|
1049
|
-
* @typedef SubscriptionMethods
|
|
1050
|
-
* @property {boolean} [success] - Indicates if the retrieval of subscription
|
|
1051
|
-
* methods was successful.
|
|
1052
|
-
* @property {MethodDetails[]} [data] - List of subscription methods.
|
|
1053
|
-
*/
|
|
1054
|
-
|
|
1055
|
-
/**
|
|
1056
|
-
* @typedef ConfigPublicKey
|
|
1057
|
-
* @property {string} [public_key] - Public key for the payment aggregator.
|
|
1058
|
-
*/
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
* @typedef ConfigRes
|
|
1062
|
-
* @property {boolean} [success] - Indicates if the retrieval of configuration
|
|
1063
|
-
* was successful.
|
|
1064
|
-
* @property {string} [aggregator] - The payment aggregator.
|
|
1065
|
-
* @property {ConfigPublicKey} [config]
|
|
1066
|
-
*/
|
|
1067
|
-
|
|
1068
|
-
/**
|
|
1069
|
-
* @typedef PlanChangeData
|
|
1070
|
-
* @property {number} [total] - The total amount after the plan change.
|
|
1071
|
-
* @property {number} [credit_note_amount] - The amount credited due to the plan change.
|
|
1072
|
-
* @property {number} [settlement] - The settlement amount for the plan change.
|
|
1073
|
-
* @property {number} [taxable_amount] - The taxable amount for the plan change.
|
|
1074
|
-
* @property {number} [gst_amount] - The GST amount for the plan change.
|
|
1075
|
-
* @property {number} [gross_total] - The gross total amount for the plan change.
|
|
1076
|
-
* @property {number} [gst] - The GST for the plan change.
|
|
1077
|
-
* @property {number} [discount] - The discount amount applied to the plan change.
|
|
1078
|
-
*/
|
|
1079
|
-
|
|
1080
|
-
/**
|
|
1081
|
-
* @typedef PlanChangeDetails
|
|
1082
|
-
* @property {string} [status] - Status of the plan change.
|
|
1083
|
-
* @property {PlanChangeData} [data]
|
|
1084
|
-
*/
|
|
1085
|
-
|
|
1086
|
-
/**
|
|
1087
|
-
* @typedef TransactionMeta
|
|
1088
|
-
* @property {string} [invoice_id] - Invoice ID associated with the transaction.
|
|
1089
|
-
*/
|
|
1090
|
-
|
|
1091
|
-
/**
|
|
1092
|
-
* @typedef PaymentTransactionDetails
|
|
1093
|
-
* @property {Object} [aggregator] - Payment aggregator details.
|
|
1094
|
-
* @property {string} [currency] - Currency used in the transaction.
|
|
1095
|
-
* @property {string} [current_status] - Current status of the transaction.
|
|
1096
|
-
* @property {string} [_id] - Unique identifier for the payment transaction.
|
|
1097
|
-
* @property {string} [subscriber_id] - Unique identifier for the subscriber.
|
|
1098
|
-
* @property {number} [amount] - Amount involved in the transaction.
|
|
1099
|
-
* @property {string} [entity_type] - Type of entity involved in the transaction.
|
|
1100
|
-
* @property {string} [collection_type] - Type of collection for the transaction.
|
|
1101
|
-
* @property {TransactionMeta} [meta]
|
|
1102
|
-
* @property {string} [created_at] - Timestamp when the transaction was created.
|
|
1103
|
-
* @property {string} [modified_at] - Timestamp when the transaction was last modified.
|
|
1104
|
-
*/
|
|
1105
|
-
|
|
1106
|
-
/**
|
|
1107
|
-
* @typedef PaymentItems
|
|
1108
|
-
* @property {string} [name] - Name of the payment option.
|
|
1109
|
-
* @property {string} [code] - Code for the payment option
|
|
1110
|
-
* @property {string} [aggregator] - Aggregator used for the payment option.
|
|
1111
|
-
*/
|
|
1112
|
-
|
|
1113
|
-
/**
|
|
1114
|
-
* @typedef GetPaymentOptions
|
|
1115
|
-
* @property {PaymentItems[]} [payment_options] - List of available payment options.
|
|
1116
|
-
*/
|
|
1117
|
-
|
|
1118
|
-
/**
|
|
1119
|
-
* @typedef TopupReq
|
|
1120
|
-
* @property {number} [amount] - Amount to be topped up.
|
|
1121
|
-
* @property {string} [currency] - Currency in which the top-up is made.
|
|
1122
|
-
* @property {string} [provider_type] - Provider type for the top-up.
|
|
1123
|
-
*/
|
|
1124
|
-
|
|
1125
|
-
/**
|
|
1126
|
-
* @typedef SetupMandateReq
|
|
1127
|
-
* @property {string} [intent_id] - ID of the setup intent.
|
|
1128
|
-
* @property {string} [payment_method_id] - ID of the payment method.
|
|
1129
|
-
*/
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* @typedef SetupPaymentReq
|
|
1133
|
-
* @property {string} [payment_method] - Payment method to be used.
|
|
1134
|
-
* @property {string} [payment_id] - ID of the payment.
|
|
1135
|
-
* @property {string} [plan_id] - ID of the plan.
|
|
1136
|
-
* @property {string} [invoice_id] - ID of the invoice.
|
|
1137
|
-
*/
|
|
1138
|
-
|
|
1139
|
-
/**
|
|
1140
|
-
* @typedef SubscriptionRenewReq
|
|
1141
|
-
* @property {string} [invoice_id] - ID of the invoice for renewal.
|
|
1142
|
-
* @property {string} [entity_type] - Type of entity for the renewal.
|
|
1143
|
-
* @property {string} [collection_type] - Collection type for the renewal.
|
|
1144
|
-
* @property {string} [callback_url] - URL to which the payment result will be sent
|
|
1145
|
-
* @property {RenewMeta} [meta]
|
|
1146
|
-
*/
|
|
1147
|
-
|
|
1148
|
-
/**
|
|
1149
|
-
* @typedef RenewMeta
|
|
1150
|
-
* @property {boolean} [invoice_payment] - Indicates whether the invoice payment
|
|
1151
|
-
* is involved in the renewal.
|
|
1152
|
-
* @property {boolean} [renew] - Indicates whether the subscription is being renewed.
|
|
1153
|
-
*/
|
|
1154
|
-
|
|
1155
|
-
/**
|
|
1156
|
-
* @typedef SubscriptionMethodsReq
|
|
1157
|
-
* @property {string} [unique_external_id] - The unique external identifier for
|
|
1158
|
-
* the subscription method.
|
|
1159
|
-
* @property {string} [setup_intent_id] - The setup intent ID for the subscription method.
|
|
1160
|
-
* @property {string} [pg_payment_method_id] - The payment gateway payment method ID.
|
|
1161
|
-
* @property {boolean} [set_default] - Indicates whether this payment method
|
|
1162
|
-
* should be set as the default.
|
|
1163
|
-
*/
|
|
1164
|
-
|
|
1165
|
-
/**
|
|
1166
|
-
* @typedef CreditTransactionResponse
|
|
1167
|
-
* @property {number} [total] - Total number of transactions.
|
|
1168
|
-
* @property {number} [limit] - Maximum number of transactions per page.
|
|
1169
|
-
* @property {number} [page] - Current page number.
|
|
1170
|
-
* @property {number} [pages] - Total number of pages.
|
|
1171
|
-
* @property {CreditTransaction[]} [items] - List of credit transactions.
|
|
1172
|
-
*/
|
|
1173
|
-
|
|
1174
|
-
/**
|
|
1175
|
-
* @typedef DowngradePlanReq
|
|
1176
|
-
* @property {string} [unique_id] - Unique identifier for the request.
|
|
1177
|
-
* @property {string} [type] - Type of entity requesting the downgrade.
|
|
1178
|
-
* @property {string} [product_suite] - Product suite for the plan.
|
|
1179
|
-
* @property {string} [plan_id] - Plan ID for the downgrade request.
|
|
1180
|
-
* @property {string} [reason] - Reason for downgrading the plan.
|
|
1181
|
-
* @property {string} [platform] - Platform from which the request is made.
|
|
1182
|
-
*/
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* @typedef Taxation
|
|
1186
|
-
* @property {number} [gst] - GST percentage.
|
|
1187
|
-
*/
|
|
1188
|
-
|
|
1189
|
-
/**
|
|
1190
|
-
* @typedef OneTimeFees
|
|
1191
|
-
* @property {number} [developement] - One-time development fee.
|
|
1192
|
-
* @property {number} [marketing] - One-time marketing fee.
|
|
1193
|
-
*/
|
|
1194
|
-
|
|
1195
|
-
/**
|
|
1196
|
-
* @typedef CreditLine
|
|
1197
|
-
* @property {boolean} [is_active] - Indicates whether the credit line is active.
|
|
1198
|
-
*/
|
|
1199
|
-
|
|
1200
|
-
/**
|
|
1201
|
-
* @typedef StatusMessage
|
|
1202
|
-
* @property {string} [status] - Status of the request.
|
|
1203
|
-
* @property {string} [message] - Detailed message regarding the status.
|
|
1204
|
-
* @property {boolean} [success] - Indicates whether the operation was successful.
|
|
1205
|
-
* @property {string} [code] - Status code of the operation.
|
|
1206
|
-
*/
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* @typedef PaymentCollectReq
|
|
1210
|
-
* @property {string} [transaction_id] - ID of the transaction to collect payment for.
|
|
1211
|
-
* @property {boolean} [credit_balance] - Indicates whether to use credit
|
|
1212
|
-
* balance for the payment.
|
|
1213
|
-
* @property {string} [payment_mode] - Mode of payment.
|
|
1214
|
-
* @property {string} [payment_method] - Payment method to be used.
|
|
1215
|
-
* @property {string} [invoice_id] - ID of the invoice for which the payment is collected.
|
|
1216
|
-
*/
|
|
1217
|
-
|
|
1218
|
-
/**
|
|
1219
|
-
* @typedef SubscriptionRenewResMeta
|
|
1220
|
-
* @property {boolean} [invoice_payment] - Indicates whether the invoice payment
|
|
1221
|
-
* is involved in the renewal.
|
|
1222
|
-
* @property {boolean} [renew] - Indicates whether the subscription is being renewed.
|
|
1223
|
-
*/
|
|
1224
|
-
|
|
1225
|
-
/**
|
|
1226
|
-
* @typedef SubscriptionRenewRes
|
|
1227
|
-
* @property {string} [redirect_url] - URL to redirect the user for completing
|
|
1228
|
-
* the renewal.
|
|
1229
|
-
* @property {string} [transaction_id] - ID of the renewal transaction.
|
|
1230
|
-
* @property {string} [current_status] - Current status of the renewal process.
|
|
1231
|
-
* @property {SubscriptionRenewResMeta} [meta]
|
|
1232
|
-
*/
|
|
1233
|
-
|
|
1234
|
-
/**
|
|
1235
|
-
* @typedef SetupIntentRes
|
|
1236
|
-
* @property {boolean} [success] - Indicates if the setup intent was successful.
|
|
1237
|
-
* @property {SetupIntentData} [data]
|
|
1238
|
-
*/
|
|
1239
|
-
|
|
1240
|
-
/**
|
|
1241
|
-
* @typedef SetupIntentData
|
|
1242
|
-
* @property {string} [id] - The ID of the setup intent.
|
|
1243
|
-
* @property {string} [client_secret] - The client secret of the setup intent.
|
|
1244
|
-
* @property {string} [customer] - The customer associated with the setup intent.
|
|
1245
|
-
* @property {string} [status] - The status of the setup intent.
|
|
1246
|
-
*/
|
|
1247
|
-
|
|
1248
|
-
/**
|
|
1249
|
-
* @typedef SetupPayment
|
|
1250
|
-
* @property {string} [id] - The ID of the setup payment.
|
|
1251
|
-
* @property {string} [status] - The status of the setup payment.
|
|
1252
|
-
* @property {string} [customer] - The customer associated with the setup payment.
|
|
1253
|
-
* @property {string} [client_secret] - The client secret of the setup payment.
|
|
1254
|
-
* @property {string} [payment_method] - The payment method used for the setup payment.
|
|
1255
|
-
* @property {string} [mandate] - The mandate ID associated with the setup payment.
|
|
1256
|
-
* @property {PaymentMethodOptions} [payment_method_options]
|
|
1257
|
-
*/
|
|
1258
|
-
|
|
1259
|
-
/**
|
|
1260
|
-
* @typedef PaymentMethodOptions
|
|
1261
|
-
* @property {Card} [card]
|
|
1262
|
-
*/
|
|
1263
|
-
|
|
1264
|
-
/**
|
|
1265
|
-
* @typedef Card
|
|
1266
|
-
* @property {MandateOptions} [mandate_options]
|
|
1267
|
-
*/
|
|
1268
|
-
|
|
1269
|
-
/**
|
|
1270
|
-
* @typedef MandateOptions
|
|
1271
|
-
* @property {number} [amount] - The mandate amount.
|
|
1272
|
-
*/
|
|
1273
|
-
|
|
1274
|
-
/**
|
|
1275
|
-
* @typedef Message
|
|
1276
|
-
* @property {string} [message] - A message providing details about the operation status.
|
|
1277
|
-
*/
|
|
1278
|
-
|
|
1279
|
-
/**
|
|
1280
|
-
* @typedef TopupRes
|
|
1281
|
-
* @property {string} [status] - The status of the top-up request.
|
|
1282
|
-
* @property {string} [aggregator_order_id] - The order ID from the aggregator.
|
|
1283
|
-
* @property {number} [amount] - The amount of the top-up.
|
|
1284
|
-
* @property {string} [currency] - The currency of the top-up.
|
|
1285
|
-
* @property {string} [transaction_id] - The transaction ID for the top-up.
|
|
1286
|
-
*/
|
|
1287
|
-
|
|
1288
|
-
/**
|
|
1289
|
-
* @typedef CancelTopupReq
|
|
1290
|
-
* @property {string} [order_id] - The order ID of the top-up to cancel.
|
|
1291
|
-
*/
|
|
1292
|
-
|
|
1293
|
-
/**
|
|
1294
|
-
* @typedef CancelTopupRes
|
|
1295
|
-
* @property {string} [_id] - The ID of the canceled top-up.
|
|
1296
|
-
* @property {string} [subscriber_id] - The subscriber ID associated with the top-up.
|
|
1297
|
-
* @property {number} [amount] - The amount of the canceled top-up.
|
|
1298
|
-
* @property {string} [currency] - The currency of the canceled top-up.
|
|
1299
|
-
* @property {string} [aggregator] - The aggregator used for the top-up.
|
|
1300
|
-
* @property {string} [aggregator_order_id] - The order ID from the aggregator.
|
|
1301
|
-
* @property {string} [created_at] - The date and time when the top-up was created.
|
|
1302
|
-
* @property {string} [modified_at] - The date and time when the top-up was modified.
|
|
1303
|
-
* @property {number} [__v] - The version key, used for internal purposes.
|
|
1304
|
-
* @property {string} [aggregator_status] - The status of the top-up with the aggregator.
|
|
1305
|
-
* @property {string} [current_status] - The current status of the top-up.
|
|
1306
|
-
*/
|
|
1307
|
-
|
|
1308
|
-
/**
|
|
1309
|
-
* @typedef DefaultReq
|
|
1310
|
-
* @property {string} [payment_method_id] - The ID of the payment method to set
|
|
1311
|
-
* as default.
|
|
1312
|
-
*/
|
|
1313
|
-
|
|
1314
|
-
class BillingPlatformModel {
|
|
1315
|
-
/** @returns {CompanyInfo} */
|
|
1316
|
-
static CompanyInfo() {
|
|
1317
|
-
return Joi.object({
|
|
1318
|
-
company_name: Joi.string().allow(""),
|
|
1319
|
-
gstin: Joi.string().allow(""),
|
|
1320
|
-
address: Joi.string().allow(""),
|
|
1321
|
-
address_details: BillingPlatformModel.AddressDetails(),
|
|
1322
|
-
pan: Joi.string().allow(""),
|
|
1323
|
-
phone: Joi.string().allow(""),
|
|
1324
|
-
email: Joi.string().allow(""),
|
|
1325
|
-
cin: Joi.string().allow(""),
|
|
1326
|
-
});
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
/** @returns {AddressDetails} */
|
|
1330
|
-
static AddressDetails() {
|
|
1331
|
-
return Joi.object({
|
|
1332
|
-
address_line_1: Joi.string().allow(""),
|
|
1333
|
-
address_line_2: Joi.string().allow(""),
|
|
1334
|
-
city: Joi.string().allow(""),
|
|
1335
|
-
pincode: Joi.string().allow(""),
|
|
1336
|
-
state: Joi.string().allow(""),
|
|
1337
|
-
country: Joi.string().allow(""),
|
|
1338
|
-
});
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
/** @returns {InvoiceData} */
|
|
1342
|
-
static InvoiceData() {
|
|
1343
|
-
return Joi.object({
|
|
1344
|
-
invoice: BillingPlatformModel.InvoiceDetailsData(),
|
|
1345
|
-
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
1346
|
-
shopsense_details: BillingPlatformModel.CompanyInfo(),
|
|
1347
|
-
});
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
/** @returns {InvoiceDetailsData} */
|
|
1351
|
-
static InvoiceDetailsData() {
|
|
1352
|
-
return Joi.object({
|
|
1353
|
-
attemp: Joi.number().allow(null),
|
|
1354
|
-
documents: Joi.any(),
|
|
1355
|
-
payment: Joi.any(),
|
|
1356
|
-
period: BillingPlatformModel.Period(),
|
|
1357
|
-
client: BillingPlatformModel.Client(),
|
|
1358
|
-
discount: Joi.any(),
|
|
1359
|
-
taxation: Joi.any(),
|
|
1360
|
-
_id: Joi.string().allow(""),
|
|
1361
|
-
auto_advance: Joi.boolean(),
|
|
1362
|
-
collection_method: Joi.string().allow(""),
|
|
1363
|
-
subscriber_id: Joi.string().allow(""),
|
|
1364
|
-
currency: Joi.string().allow(""),
|
|
1365
|
-
invoice_url: Joi.string().allow(""),
|
|
1366
|
-
number: Joi.string().allow(""),
|
|
1367
|
-
paid: Joi.boolean(),
|
|
1368
|
-
pg_data: Joi.any(),
|
|
1369
|
-
receipt_number: Joi.string().allow(""),
|
|
1370
|
-
statement_descriptor: Joi.string().allow(""),
|
|
1371
|
-
current_status: Joi.string().allow(""),
|
|
1372
|
-
status_trail: Joi.array().items(BillingPlatformModel.StatusTrail()),
|
|
1373
|
-
subtotal: Joi.number(),
|
|
1374
|
-
total: Joi.number(),
|
|
1375
|
-
old_settlement: Joi.number().allow(null),
|
|
1376
|
-
credit_balance: Joi.number().allow(null),
|
|
1377
|
-
subscription: Joi.string().allow(""),
|
|
1378
|
-
attempt: Joi.number(),
|
|
1379
|
-
next_action_time: Joi.string().allow(""),
|
|
1380
|
-
credit_note_amount: Joi.number(),
|
|
1381
|
-
created_at: Joi.string().allow(""),
|
|
1382
|
-
modified_at: Joi.string().allow(""),
|
|
1383
|
-
invoice_type: Joi.string().allow(""),
|
|
1384
|
-
});
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
/** @returns {Client} */
|
|
1388
|
-
static Client() {
|
|
1389
|
-
return Joi.object({
|
|
1390
|
-
name: Joi.string().allow(""),
|
|
1391
|
-
email: Joi.string().allow(""),
|
|
1392
|
-
phone: Joi.string().allow(""),
|
|
1393
|
-
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
1394
|
-
});
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
/** @returns {Period} */
|
|
1398
|
-
static Period() {
|
|
1399
|
-
return Joi.object({
|
|
1400
|
-
start: Joi.string().allow(""),
|
|
1401
|
-
end: Joi.string().allow(""),
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
|
-
/** @returns {StatusTrail} */
|
|
1406
|
-
static StatusTrail() {
|
|
1407
|
-
return Joi.object({
|
|
1408
|
-
value: Joi.string().allow(""),
|
|
1409
|
-
timestamp: Joi.string().allow(""),
|
|
1410
|
-
_id: Joi.string().allow(""),
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
/** @returns {PaymentCollectRes} */
|
|
1415
|
-
static PaymentCollectRes() {
|
|
1416
|
-
return Joi.object({
|
|
1417
|
-
transaction_id: Joi.string().allow(""),
|
|
1418
|
-
current_status: Joi.string().allow(""),
|
|
1419
|
-
});
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
/** @returns {SubscriptionChargeRes} */
|
|
1423
|
-
static SubscriptionChargeRes() {
|
|
1424
|
-
return Joi.object({
|
|
1425
|
-
_id: Joi.string().allow(""),
|
|
1426
|
-
product_suit_id: Joi.string().allow(""),
|
|
1427
|
-
entity_id: Joi.string().allow(""),
|
|
1428
|
-
entity_type: Joi.string().allow(""),
|
|
1429
|
-
name: Joi.string().allow(""),
|
|
1430
|
-
status: Joi.string().allow(""),
|
|
1431
|
-
trial_days: Joi.number(),
|
|
1432
|
-
activated_on: Joi.string().allow(""),
|
|
1433
|
-
cancelled_on: Joi.string().allow(""),
|
|
1434
|
-
is_test: Joi.boolean(),
|
|
1435
|
-
created_at: Joi.string().allow(""),
|
|
1436
|
-
modified_at: Joi.string().allow(""),
|
|
1437
|
-
company_id: Joi.string().allow(""),
|
|
1438
|
-
line_items: Joi.array().items(Joi.any()),
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
/** @returns {PostDowngradeRes} */
|
|
1443
|
-
static PostDowngradeRes() {
|
|
1444
|
-
return Joi.object({
|
|
1445
|
-
success: Joi.boolean(),
|
|
1446
|
-
data: BillingPlatformModel.DowngradeRes(),
|
|
1447
|
-
});
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
/** @returns {DowngradeRes} */
|
|
1451
|
-
static DowngradeRes() {
|
|
1452
|
-
return Joi.object({
|
|
1453
|
-
_id: Joi.string().allow(""),
|
|
1454
|
-
status: Joi.string().allow(""),
|
|
1455
|
-
subscriber_id: Joi.string().allow(""),
|
|
1456
|
-
activated: Joi.boolean(),
|
|
1457
|
-
created_at: Joi.string().allow(""),
|
|
1458
|
-
modified_at: Joi.string().allow(""),
|
|
1459
|
-
plan_id: Joi.string().allow(""),
|
|
1460
|
-
reason: Joi.string().allow(""),
|
|
1461
|
-
request_user_id: Joi.string().allow(""),
|
|
1462
|
-
subscription_id: Joi.string().allow(""),
|
|
1463
|
-
});
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
/** @returns {PaymentStatusData} */
|
|
1467
|
-
static PaymentStatusData() {
|
|
1468
|
-
return Joi.object({
|
|
1469
|
-
_id: Joi.string().allow(""),
|
|
1470
|
-
journey: Joi.string().allow(""),
|
|
1471
|
-
webhook_response: Joi.array().items(Joi.any()),
|
|
1472
|
-
aggregator_status: Joi.string().allow(""),
|
|
1473
|
-
current_status: Joi.string().allow(""),
|
|
1474
|
-
created_at: Joi.string().allow(""),
|
|
1475
|
-
modified_at: Joi.string().allow(""),
|
|
1476
|
-
__v: Joi.number(),
|
|
1477
|
-
aggregator_order_id: Joi.string().allow(""),
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
/** @returns {PaymentStatusResponse} */
|
|
1482
|
-
static PaymentStatusResponse() {
|
|
1483
|
-
return Joi.object({
|
|
1484
|
-
status: Joi.string().allow(""),
|
|
1485
|
-
data: BillingPlatformModel.PaymentStatusData(),
|
|
1486
|
-
});
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
/** @returns {BadRequest} */
|
|
1490
|
-
static BadRequest() {
|
|
1491
|
-
return Joi.object({
|
|
1492
|
-
message: Joi.string().allow(""),
|
|
1493
|
-
});
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
/** @returns {ResourceNotFound} */
|
|
1497
|
-
static ResourceNotFound() {
|
|
1498
|
-
return Joi.object({
|
|
1499
|
-
message: Joi.string().allow(""),
|
|
1500
|
-
code: Joi.any(),
|
|
1501
|
-
success: Joi.any(),
|
|
1502
|
-
});
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
/** @returns {InternalServerError} */
|
|
1506
|
-
static InternalServerError() {
|
|
1507
|
-
return Joi.object({
|
|
1508
|
-
message: Joi.string().allow(""),
|
|
1509
|
-
code: Joi.string().allow(""),
|
|
1510
|
-
});
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
/** @returns {CheckValidityResponse} */
|
|
1514
|
-
static CheckValidityResponse() {
|
|
1515
|
-
return Joi.object({
|
|
1516
|
-
is_valid: Joi.boolean(),
|
|
1517
|
-
discount_amount: Joi.number(),
|
|
1518
|
-
});
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1521
|
-
/** @returns {PlanRecurring} */
|
|
1522
|
-
static PlanRecurring() {
|
|
1523
|
-
return Joi.object({
|
|
1524
|
-
interval: Joi.string().allow(""),
|
|
1525
|
-
interval_count: Joi.number(),
|
|
1526
|
-
});
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
/** @returns {PlanMeta} */
|
|
1530
|
-
static PlanMeta() {
|
|
1531
|
-
return Joi.object({
|
|
1532
|
-
seller_status: Joi.string().allow(""),
|
|
1533
|
-
company: Joi.string().allow(""),
|
|
1534
|
-
plan_platform_display_name: Joi.string().allow("").allow(null),
|
|
1535
|
-
tags: Joi.array().items(Joi.string().allow("")),
|
|
1536
|
-
});
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
/** @returns {CountryRes} */
|
|
1540
|
-
static CountryRes() {
|
|
1541
|
-
return Joi.object({
|
|
1542
|
-
name: Joi.string().allow(""),
|
|
1543
|
-
code: Joi.string().allow(""),
|
|
1544
|
-
});
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
/** @returns {Plan} */
|
|
1548
|
-
static Plan() {
|
|
1549
|
-
return Joi.object({
|
|
1550
|
-
fee_components: Joi.array().items(Joi.any()).allow(null, ""),
|
|
1551
|
-
recurring: BillingPlatformModel.PlanRecurring(),
|
|
1552
|
-
is_trial_plan: Joi.boolean(),
|
|
1553
|
-
plan_group: Joi.string().allow(""),
|
|
1554
|
-
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
1555
|
-
currency: Joi.string().allow(""),
|
|
1556
|
-
approved_by: Joi.string().allow(""),
|
|
1557
|
-
is_active: Joi.boolean(),
|
|
1558
|
-
is_visible: Joi.boolean(),
|
|
1559
|
-
trial_period: Joi.number(),
|
|
1560
|
-
addons: Joi.array().items(Joi.string().allow("")),
|
|
1561
|
-
tags: Joi.array().items(Joi.string().allow("")),
|
|
1562
|
-
type: Joi.string().allow(""),
|
|
1563
|
-
country: BillingPlatformModel.CountryRes(),
|
|
1564
|
-
_id: Joi.string().allow(""),
|
|
1565
|
-
name: Joi.string().allow(""),
|
|
1566
|
-
description: Joi.string().allow(""),
|
|
1567
|
-
amount: Joi.number(),
|
|
1568
|
-
product_suite_id: Joi.string().allow(""),
|
|
1569
|
-
created_at: Joi.string().allow(""),
|
|
1570
|
-
modified_at: Joi.string().allow(""),
|
|
1571
|
-
taxation: BillingPlatformModel.Taxation(),
|
|
1572
|
-
one_time_fees: BillingPlatformModel.OneTimeFees(),
|
|
1573
|
-
credit_line: BillingPlatformModel.CreditLine(),
|
|
1574
|
-
current_status: Joi.string().allow(""),
|
|
1575
|
-
channel_type: Joi.string().allow(""),
|
|
1576
|
-
company_ids: Joi.array().items(Joi.string().allow("").allow(null)),
|
|
1577
|
-
platform: Joi.string().allow("").allow(null),
|
|
1578
|
-
activated_on: Joi.string().allow(""),
|
|
1579
|
-
meta: BillingPlatformModel.PlanMeta(),
|
|
1580
|
-
created_by: Joi.string().allow(""),
|
|
1581
|
-
});
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
/** @returns {SubscriptionTrialPeriod} */
|
|
1585
|
-
static SubscriptionTrialPeriod() {
|
|
1586
|
-
return Joi.object({
|
|
1587
|
-
start_date: Joi.string().allow(""),
|
|
1588
|
-
end_date: Joi.string().allow(""),
|
|
1589
|
-
});
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
/** @returns {EntityChargePrice} */
|
|
1593
|
-
static EntityChargePrice() {
|
|
1594
|
-
return Joi.object({
|
|
1595
|
-
amount: Joi.number(),
|
|
1596
|
-
currency_code: Joi.string().allow(""),
|
|
1597
|
-
});
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
/** @returns {OneTimeChargeItem} */
|
|
1601
|
-
static OneTimeChargeItem() {
|
|
1602
|
-
return Joi.object({
|
|
1603
|
-
name: Joi.string().allow(""),
|
|
1604
|
-
term: Joi.string().allow(""),
|
|
1605
|
-
pricing_type: Joi.string().allow(""),
|
|
1606
|
-
price: BillingPlatformModel.EntityChargePrice(),
|
|
1607
|
-
capped_amount: Joi.number(),
|
|
1608
|
-
is_test: Joi.boolean(),
|
|
1609
|
-
metadata: Joi.any(),
|
|
1610
|
-
});
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
/** @returns {CreateOneTimeCharge} */
|
|
1614
|
-
static CreateOneTimeCharge() {
|
|
1615
|
-
return Joi.object({
|
|
1616
|
-
name: Joi.string().allow(""),
|
|
1617
|
-
charge: BillingPlatformModel.OneTimeChargeItem(),
|
|
1618
|
-
is_test: Joi.boolean(),
|
|
1619
|
-
return_url: Joi.string().allow(""),
|
|
1620
|
-
});
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
/** @returns {ChargeRecurring} */
|
|
1624
|
-
static ChargeRecurring() {
|
|
1625
|
-
return Joi.object({
|
|
1626
|
-
interval: Joi.string().allow(""),
|
|
1627
|
-
interval_time: Joi.number(),
|
|
1628
|
-
});
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
/** @returns {ChargeDetails} */
|
|
1632
|
-
static ChargeDetails() {
|
|
1633
|
-
return Joi.object({
|
|
1634
|
-
_id: Joi.string().allow(""),
|
|
1635
|
-
entity_type: Joi.string().allow(""),
|
|
1636
|
-
entity_id: Joi.string().allow(""),
|
|
1637
|
-
name: Joi.string().allow(""),
|
|
1638
|
-
term: Joi.string().allow(""),
|
|
1639
|
-
charge_type: Joi.string().allow(""),
|
|
1640
|
-
pricing_type: Joi.string().allow(""),
|
|
1641
|
-
price: BillingPlatformModel.EntityChargePrice(),
|
|
1642
|
-
recurring: BillingPlatformModel.ChargeRecurring(),
|
|
1643
|
-
status: Joi.string().allow(""),
|
|
1644
|
-
capped_amount: Joi.number(),
|
|
1645
|
-
activated_on: Joi.string().allow(""),
|
|
1646
|
-
cancelled_on: Joi.string().allow(""),
|
|
1647
|
-
billing_date: Joi.string().allow(""),
|
|
1648
|
-
current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
1649
|
-
modified_at: Joi.string().allow(""),
|
|
1650
|
-
created_at: Joi.string().allow(""),
|
|
1651
|
-
is_test: Joi.boolean(),
|
|
1652
|
-
company_id: Joi.string().allow(""),
|
|
1653
|
-
meta: Joi.any(),
|
|
1654
|
-
__v: Joi.number(),
|
|
1655
|
-
});
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
/** @returns {OneTimeChargeEntity} */
|
|
1659
|
-
static OneTimeChargeEntity() {
|
|
1660
|
-
return Joi.object({
|
|
1661
|
-
term: Joi.string().allow(""),
|
|
1662
|
-
charge_type: Joi.string().allow(""),
|
|
1663
|
-
capped_amount: Joi.number(),
|
|
1664
|
-
billing_date: Joi.string().allow("").allow(null),
|
|
1665
|
-
created_at: Joi.string().allow(""),
|
|
1666
|
-
modified_at: Joi.string().allow(""),
|
|
1667
|
-
__v: Joi.number(),
|
|
1668
|
-
_id: Joi.string().allow(""),
|
|
1669
|
-
name: Joi.string().allow(""),
|
|
1670
|
-
status: Joi.string().allow(""),
|
|
1671
|
-
activated_on: Joi.string().allow("").allow(null),
|
|
1672
|
-
cancelled_on: Joi.string().allow("").allow(null),
|
|
1673
|
-
metadata: Joi.any(),
|
|
1674
|
-
return_url: Joi.string().allow(""),
|
|
1675
|
-
is_test: Joi.boolean(),
|
|
1676
|
-
pricing_type: Joi.string().allow(""),
|
|
1677
|
-
subscriber_id: Joi.string().allow(""),
|
|
1678
|
-
entity_type: Joi.string().allow(""),
|
|
1679
|
-
entity_id: Joi.string().allow(""),
|
|
1680
|
-
meta: Joi.any(),
|
|
1681
|
-
price: BillingPlatformModel.EntityChargePrice(),
|
|
1682
|
-
});
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
/** @returns {CreateOneTimeChargeResponse} */
|
|
1686
|
-
static CreateOneTimeChargeResponse() {
|
|
1687
|
-
return Joi.object({
|
|
1688
|
-
charge: BillingPlatformModel.Charge(),
|
|
1689
|
-
confirm_url: Joi.string().allow(""),
|
|
1690
|
-
});
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
/** @returns {Charge} */
|
|
1694
|
-
static Charge() {
|
|
1695
|
-
return Joi.object({
|
|
1696
|
-
final_charge: BillingPlatformModel.OneTimeChargeEntity(),
|
|
1697
|
-
});
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
|
-
/** @returns {InvoiceDetailsStatusTrail} */
|
|
1701
|
-
static InvoiceDetailsStatusTrail() {
|
|
1702
|
-
return Joi.object({
|
|
1703
|
-
_id: Joi.string().allow(""),
|
|
1704
|
-
value: Joi.string().allow(""),
|
|
1705
|
-
timestamp: Joi.string().allow(""),
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
/** @returns {InvoiceItemsPlanRecurring} */
|
|
1710
|
-
static InvoiceItemsPlanRecurring() {
|
|
1711
|
-
return Joi.object({
|
|
1712
|
-
interval: Joi.string().allow(""),
|
|
1713
|
-
interval_count: Joi.number(),
|
|
1714
|
-
});
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
/** @returns {InvoiceItemsPlan} */
|
|
1718
|
-
static InvoiceItemsPlan() {
|
|
1719
|
-
return Joi.object({
|
|
1720
|
-
recurring: BillingPlatformModel.InvoiceItemsPlanRecurring(),
|
|
1721
|
-
is_trial_plan: Joi.boolean(),
|
|
1722
|
-
plan_group: Joi.string().allow(""),
|
|
1723
|
-
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
1724
|
-
currency: Joi.string().allow(""),
|
|
1725
|
-
is_active: Joi.boolean(),
|
|
1726
|
-
is_visible: Joi.boolean(),
|
|
1727
|
-
trial_period: Joi.number(),
|
|
1728
|
-
addons: Joi.array().items(Joi.string().allow("")),
|
|
1729
|
-
tags: Joi.array().items(Joi.string().allow("")),
|
|
1730
|
-
type: Joi.string().allow(""),
|
|
1731
|
-
country: Joi.string().allow(""),
|
|
1732
|
-
_id: Joi.string().allow(""),
|
|
1733
|
-
name: Joi.string().allow(""),
|
|
1734
|
-
description: Joi.string().allow(""),
|
|
1735
|
-
amount: Joi.number(),
|
|
1736
|
-
product_suite_id: Joi.string().allow(""),
|
|
1737
|
-
created_at: Joi.string().allow(""),
|
|
1738
|
-
modified_at: Joi.string().allow(""),
|
|
1739
|
-
});
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
/** @returns {InvoiceItemsPeriod} */
|
|
1743
|
-
static InvoiceItemsPeriod() {
|
|
1744
|
-
return Joi.object({
|
|
1745
|
-
start: Joi.string().allow(""),
|
|
1746
|
-
end: Joi.string().allow(""),
|
|
1747
|
-
});
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
/** @returns {InvoiceItems} */
|
|
1751
|
-
static InvoiceItems() {
|
|
1752
|
-
return Joi.object({
|
|
1753
|
-
_id: Joi.string().allow(""),
|
|
1754
|
-
currency: Joi.string().allow(""),
|
|
1755
|
-
plan: BillingPlatformModel.InvoiceItemsPlan(),
|
|
1756
|
-
name: Joi.string().allow(""),
|
|
1757
|
-
quantity: Joi.number(),
|
|
1758
|
-
description: Joi.string().allow(""),
|
|
1759
|
-
period: BillingPlatformModel.InvoiceItemsPeriod(),
|
|
1760
|
-
unit_amount: Joi.number(),
|
|
1761
|
-
amount: Joi.number(),
|
|
1762
|
-
type: Joi.string().allow(""),
|
|
1763
|
-
invoice_id: Joi.string().allow(""),
|
|
1764
|
-
created_at: Joi.string().allow(""),
|
|
1765
|
-
modified_at: Joi.string().allow(""),
|
|
1766
|
-
});
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
/** @returns {InvoicesDataClient} */
|
|
1770
|
-
static InvoicesDataClient() {
|
|
1771
|
-
return Joi.object({
|
|
1772
|
-
name: Joi.string().allow(""),
|
|
1773
|
-
email: Joi.string().allow(""),
|
|
1774
|
-
phone: Joi.string().allow(""),
|
|
1775
|
-
address_lines: Joi.array().items(Joi.string().allow("")),
|
|
1776
|
-
});
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
/** @returns {InvoicesDataPeriod} */
|
|
1780
|
-
static InvoicesDataPeriod() {
|
|
1781
|
-
return Joi.object({
|
|
1782
|
-
start: Joi.string().allow(""),
|
|
1783
|
-
end: Joi.string().allow(""),
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
/** @returns {InvoicesDataPaymentMethod} */
|
|
1788
|
-
static InvoicesDataPaymentMethod() {
|
|
1789
|
-
return Joi.object({
|
|
1790
|
-
pg_payment_method_id: Joi.string().allow(""),
|
|
1791
|
-
});
|
|
1792
|
-
}
|
|
1793
|
-
|
|
1794
|
-
/** @returns {InvoicesData} */
|
|
1795
|
-
static InvoicesData() {
|
|
1796
|
-
return Joi.object({
|
|
1797
|
-
_id: Joi.string().allow(""),
|
|
1798
|
-
documents: Joi.any(),
|
|
1799
|
-
payment: Joi.any(),
|
|
1800
|
-
old_settlement: Joi.number().allow(null),
|
|
1801
|
-
credit_balance: Joi.number().allow(null),
|
|
1802
|
-
discount: Joi.any(),
|
|
1803
|
-
taxation: Joi.any(),
|
|
1804
|
-
credit_note_amount: Joi.number(),
|
|
1805
|
-
client: BillingPlatformModel.InvoicesDataClient(),
|
|
1806
|
-
auto_advance: Joi.boolean(),
|
|
1807
|
-
currency: Joi.string().allow(""),
|
|
1808
|
-
paid: Joi.boolean(),
|
|
1809
|
-
attemp: Joi.number(),
|
|
1810
|
-
collection_method: Joi.string().allow(""),
|
|
1811
|
-
subscriber_id: Joi.string().allow(""),
|
|
1812
|
-
invoice_url: Joi.string().allow(""),
|
|
1813
|
-
number: Joi.string().allow(""),
|
|
1814
|
-
pg_data: Joi.any(),
|
|
1815
|
-
period: BillingPlatformModel.InvoicesDataPeriod(),
|
|
1816
|
-
receipt_number: Joi.string().allow(""),
|
|
1817
|
-
statement_descriptor: Joi.string().allow(""),
|
|
1818
|
-
current_status: Joi.string().allow(""),
|
|
1819
|
-
status_trail: Joi.array().items(
|
|
1820
|
-
BillingPlatformModel.InvoiceDetailsStatusTrail()
|
|
1821
|
-
),
|
|
1822
|
-
subtotal: Joi.number(),
|
|
1823
|
-
total: Joi.number(),
|
|
1824
|
-
subscription: Joi.string().allow(""),
|
|
1825
|
-
next_action_time: Joi.string().allow(""),
|
|
1826
|
-
created_at: Joi.string().allow(""),
|
|
1827
|
-
modified_at: Joi.string().allow(""),
|
|
1828
|
-
hash_identifier: Joi.string().allow(""),
|
|
1829
|
-
payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
|
|
1830
|
-
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
1831
|
-
invoice_type: Joi.string().allow(""),
|
|
1832
|
-
});
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
/** @returns {Invoices} */
|
|
1836
|
-
static Invoices() {
|
|
1837
|
-
return Joi.object({
|
|
1838
|
-
data: Joi.array().items(BillingPlatformModel.InvoicesData()),
|
|
1839
|
-
start: Joi.number(),
|
|
1840
|
-
end: Joi.number(),
|
|
1841
|
-
limit: Joi.number(),
|
|
1842
|
-
page: Joi.number(),
|
|
1843
|
-
total: Joi.number(),
|
|
1844
|
-
});
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
/** @returns {Phone} */
|
|
1848
|
-
static Phone() {
|
|
1849
|
-
return Joi.object({
|
|
1850
|
-
phone_number: Joi.string().allow(""),
|
|
1851
|
-
phone_country_code: Joi.string().allow(""),
|
|
1852
|
-
});
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1855
|
-
/** @returns {SubscriptionBillingAddress} */
|
|
1856
|
-
static SubscriptionBillingAddress() {
|
|
1857
|
-
return Joi.object({
|
|
1858
|
-
country: Joi.string().allow(""),
|
|
1859
|
-
country_code: Joi.string().allow(""),
|
|
1860
|
-
state: Joi.string().allow(""),
|
|
1861
|
-
city: Joi.string().allow(""),
|
|
1862
|
-
line1: Joi.string().allow(""),
|
|
1863
|
-
line2: Joi.string().allow(""),
|
|
1864
|
-
postal_code: Joi.string().allow(""),
|
|
1865
|
-
});
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
|
-
/** @returns {SubscriptionCustomer} */
|
|
1869
|
-
static SubscriptionCustomer() {
|
|
1870
|
-
return Joi.object({
|
|
1871
|
-
phone: BillingPlatformModel.Phone(),
|
|
1872
|
-
billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
|
|
1873
|
-
_id: Joi.string().allow(""),
|
|
1874
|
-
unique_id: Joi.string().allow(""),
|
|
1875
|
-
type: Joi.string().allow(""),
|
|
1876
|
-
name: Joi.string().allow(""),
|
|
1877
|
-
email: Joi.string().allow(""),
|
|
1878
|
-
created_at: Joi.string().allow(""),
|
|
1879
|
-
modified_at: Joi.string().allow(""),
|
|
1880
|
-
data: Joi.any(),
|
|
1881
|
-
documents: Joi.any(),
|
|
1882
|
-
consent: Joi.boolean(),
|
|
1883
|
-
comms: Joi.boolean(),
|
|
1884
|
-
credit_balance: Joi.number().allow(null),
|
|
1885
|
-
business_country_info: BillingPlatformModel.BusinessCountryInfo(),
|
|
1886
|
-
});
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
/** @returns {SubscriptionCustomerCreate} */
|
|
1890
|
-
static SubscriptionCustomerCreate() {
|
|
1891
|
-
return Joi.object({
|
|
1892
|
-
phone: BillingPlatformModel.Phone(),
|
|
1893
|
-
billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
|
|
1894
|
-
unique_id: Joi.string().allow(""),
|
|
1895
|
-
type: Joi.string().allow(""),
|
|
1896
|
-
name: Joi.string().allow(""),
|
|
1897
|
-
email: Joi.string().allow(""),
|
|
1898
|
-
});
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
/** @returns {SubscriptionCurrentPeriod} */
|
|
1902
|
-
static SubscriptionCurrentPeriod() {
|
|
1903
|
-
return Joi.object({
|
|
1904
|
-
start: Joi.string().allow(""),
|
|
1905
|
-
end: Joi.string().allow(""),
|
|
1906
|
-
});
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
/** @returns {SubscriptionPauseCollection} */
|
|
1910
|
-
static SubscriptionPauseCollection() {
|
|
1911
|
-
return Joi.object({
|
|
1912
|
-
behavior: Joi.string().allow(""),
|
|
1913
|
-
resume_at: Joi.string().allow(""),
|
|
1914
|
-
});
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
/** @returns {SubscriptionTrial} */
|
|
1918
|
-
static SubscriptionTrial() {
|
|
1919
|
-
return Joi.object({
|
|
1920
|
-
start: Joi.string().allow(""),
|
|
1921
|
-
end: Joi.string().allow(""),
|
|
1922
|
-
});
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
/** @returns {SubscriptionInvoiceSettings} */
|
|
1926
|
-
static SubscriptionInvoiceSettings() {
|
|
1927
|
-
return Joi.object({
|
|
1928
|
-
generation: Joi.boolean(),
|
|
1929
|
-
charging: Joi.boolean(),
|
|
1930
|
-
});
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
/** @returns {Subscription} */
|
|
1934
|
-
static Subscription() {
|
|
1935
|
-
return Joi.object({
|
|
1936
|
-
meta: Joi.any(),
|
|
1937
|
-
current_period: BillingPlatformModel.SubscriptionCurrentPeriod(),
|
|
1938
|
-
pause_collection: BillingPlatformModel.SubscriptionPauseCollection(),
|
|
1939
|
-
trial: BillingPlatformModel.SubscriptionTrial(),
|
|
1940
|
-
invoice_settings: BillingPlatformModel.SubscriptionInvoiceSettings(),
|
|
1941
|
-
is_active: Joi.boolean(),
|
|
1942
|
-
cancel_at_period_end: Joi.boolean(),
|
|
1943
|
-
_id: Joi.string().allow(""),
|
|
1944
|
-
subscriber_id: Joi.string().allow(""),
|
|
1945
|
-
plan_id: Joi.string().allow(""),
|
|
1946
|
-
product_suite_id: Joi.string().allow(""),
|
|
1947
|
-
is_eligible_for_plan_change: Joi.boolean(),
|
|
1948
|
-
plan_data: BillingPlatformModel.Plan(),
|
|
1949
|
-
current_status: Joi.string().allow(""),
|
|
1950
|
-
collection_method: Joi.string().allow(""),
|
|
1951
|
-
created_at: Joi.string().allow(""),
|
|
1952
|
-
modified_at: Joi.string().allow(""),
|
|
1953
|
-
latest_invoice: Joi.string().allow(""),
|
|
1954
|
-
channel_type: Joi.string().allow(""),
|
|
1955
|
-
freezed: Joi.boolean(),
|
|
1956
|
-
cancel_at: Joi.string().allow(""),
|
|
1957
|
-
canceled_at: Joi.string().allow(""),
|
|
1958
|
-
});
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
/** @returns {SubscriptionStatus} */
|
|
1962
|
-
static SubscriptionStatus() {
|
|
1963
|
-
return Joi.object({
|
|
1964
|
-
is_enabled: Joi.boolean(),
|
|
1965
|
-
subscription: BillingPlatformModel.Subscription(),
|
|
1966
|
-
latest_invoice: BillingPlatformModel.InvoicesData(),
|
|
1967
|
-
next_plan: BillingPlatformModel.Plan(),
|
|
1968
|
-
current_subscriptions: Joi.array().items(
|
|
1969
|
-
BillingPlatformModel.Subscription()
|
|
1970
|
-
),
|
|
1971
|
-
mandate_amount: Joi.number(),
|
|
1972
|
-
message: Joi.string().allow(""),
|
|
1973
|
-
});
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
/** @returns {SubscriptionLimitApplication} */
|
|
1977
|
-
static SubscriptionLimitApplication() {
|
|
1978
|
-
return Joi.object({
|
|
1979
|
-
enabled: Joi.boolean(),
|
|
1980
|
-
hard_limit: Joi.number(),
|
|
1981
|
-
soft_limit: Joi.number(),
|
|
1982
|
-
});
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
/** @returns {SubscriptionLimitMarketplace} */
|
|
1986
|
-
static SubscriptionLimitMarketplace() {
|
|
1987
|
-
return Joi.object({
|
|
1988
|
-
enabled: Joi.boolean(),
|
|
1989
|
-
});
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
/** @returns {SubscriptionLimitOtherPlatform} */
|
|
1993
|
-
static SubscriptionLimitOtherPlatform() {
|
|
1994
|
-
return Joi.object({
|
|
1995
|
-
enabled: Joi.boolean(),
|
|
1996
|
-
});
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
/** @returns {SubscriptionLimitTeam} */
|
|
2000
|
-
static SubscriptionLimitTeam() {
|
|
2001
|
-
return Joi.object({
|
|
2002
|
-
limit: Joi.number(),
|
|
2003
|
-
});
|
|
2004
|
-
}
|
|
2005
|
-
|
|
2006
|
-
/** @returns {SubscriptionLimitProducts} */
|
|
2007
|
-
static SubscriptionLimitProducts() {
|
|
2008
|
-
return Joi.object({
|
|
2009
|
-
bulk: Joi.boolean(),
|
|
2010
|
-
limit: Joi.number(),
|
|
2011
|
-
});
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
/** @returns {SubscriptionLimitExtensions} */
|
|
2015
|
-
static SubscriptionLimitExtensions() {
|
|
2016
|
-
return Joi.object({
|
|
2017
|
-
enabled: Joi.boolean(),
|
|
2018
|
-
limit: Joi.number(),
|
|
2019
|
-
});
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
/** @returns {SubscriptionLimitIntegrations} */
|
|
2023
|
-
static SubscriptionLimitIntegrations() {
|
|
2024
|
-
return Joi.object({
|
|
2025
|
-
enabled: Joi.boolean(),
|
|
2026
|
-
limit: Joi.number(),
|
|
2027
|
-
});
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
/** @returns {SubscriptionLimit} */
|
|
2031
|
-
static SubscriptionLimit() {
|
|
2032
|
-
return Joi.object({
|
|
2033
|
-
application: BillingPlatformModel.SubscriptionLimitApplication(),
|
|
2034
|
-
marketplace: BillingPlatformModel.SubscriptionLimitMarketplace(),
|
|
2035
|
-
other_platform: BillingPlatformModel.SubscriptionLimitOtherPlatform(),
|
|
2036
|
-
team: BillingPlatformModel.SubscriptionLimitTeam(),
|
|
2037
|
-
products: BillingPlatformModel.SubscriptionLimitProducts(),
|
|
2038
|
-
extensions: BillingPlatformModel.SubscriptionLimitExtensions(),
|
|
2039
|
-
integrations: BillingPlatformModel.SubscriptionLimitIntegrations(),
|
|
2040
|
-
is_trial_plan: Joi.boolean(),
|
|
2041
|
-
});
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2044
|
-
/** @returns {IntentReq} */
|
|
2045
|
-
static IntentReq() {
|
|
2046
|
-
return Joi.object({
|
|
2047
|
-
unique_external_id: Joi.string().allow(""),
|
|
2048
|
-
plan_id: Joi.string().allow(""),
|
|
2049
|
-
});
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
|
-
/** @returns {PutIntentReq} */
|
|
2053
|
-
static PutIntentReq() {
|
|
2054
|
-
return Joi.object({
|
|
2055
|
-
unique_external_id: Joi.string().allow(""),
|
|
2056
|
-
setup_intent_id: Joi.string().allow(""),
|
|
2057
|
-
payment_method_id: Joi.string().allow(""),
|
|
2058
|
-
set_default: Joi.boolean(),
|
|
2059
|
-
});
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
/** @returns {SubscriptionActivateReq} */
|
|
2063
|
-
static SubscriptionActivateReq() {
|
|
2064
|
-
return Joi.object({
|
|
2065
|
-
unique_id: Joi.string().allow(""),
|
|
2066
|
-
type: Joi.string().allow(""),
|
|
2067
|
-
product_suite: Joi.string().allow(""),
|
|
2068
|
-
plan_id: Joi.string().allow(""),
|
|
2069
|
-
payment_method: Joi.string().allow(""),
|
|
2070
|
-
subscription_id: Joi.string().allow(""),
|
|
2071
|
-
coupon: Joi.string().allow(""),
|
|
2072
|
-
meta: Joi.any(),
|
|
2073
|
-
});
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
/** @returns {SubscriptionActivateRes} */
|
|
2077
|
-
static SubscriptionActivateRes() {
|
|
2078
|
-
return Joi.object({
|
|
2079
|
-
success: Joi.boolean(),
|
|
2080
|
-
data: BillingPlatformModel.Subscription(),
|
|
2081
|
-
});
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2084
|
-
/** @returns {CancelSubscriptionReq} */
|
|
2085
|
-
static CancelSubscriptionReq() {
|
|
2086
|
-
return Joi.object({
|
|
2087
|
-
unique_id: Joi.string().allow(""),
|
|
2088
|
-
type: Joi.string().allow(""),
|
|
2089
|
-
product_suite: Joi.string().allow(""),
|
|
2090
|
-
subscription_id: Joi.string().allow(""),
|
|
2091
|
-
});
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
/** @returns {CancelSubscriptionRes} */
|
|
2095
|
-
static CancelSubscriptionRes() {
|
|
2096
|
-
return Joi.object({
|
|
2097
|
-
success: Joi.boolean(),
|
|
2098
|
-
data: BillingPlatformModel.Subscription(),
|
|
2099
|
-
});
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
|
-
/** @returns {PlanStatusUpdateReq} */
|
|
2103
|
-
static PlanStatusUpdateReq() {
|
|
2104
|
-
return Joi.object({
|
|
2105
|
-
plan_id: Joi.string().allow(""),
|
|
2106
|
-
reason: Joi.string().allow(""),
|
|
2107
|
-
seller_status: Joi.string().allow(""),
|
|
2108
|
-
});
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
/** @returns {SubscribePlan} */
|
|
2112
|
-
static SubscribePlan() {
|
|
2113
|
-
return Joi.object({
|
|
2114
|
-
entity_type: Joi.string().allow(""),
|
|
2115
|
-
collection_type: Joi.string().allow(""),
|
|
2116
|
-
plan_id: Joi.string().allow(""),
|
|
2117
|
-
callback_url: Joi.string().allow(""),
|
|
2118
|
-
meta: BillingPlatformModel.Meta(),
|
|
2119
|
-
});
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
/** @returns {Meta} */
|
|
2123
|
-
static Meta() {
|
|
2124
|
-
return Joi.object({
|
|
2125
|
-
subscribe: Joi.boolean(),
|
|
2126
|
-
is_custom_plan: Joi.boolean(),
|
|
2127
|
-
is_plan_upgrade: Joi.boolean(),
|
|
2128
|
-
});
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
/** @returns {SubscribePlanRes} */
|
|
2132
|
-
static SubscribePlanRes() {
|
|
2133
|
-
return Joi.object({
|
|
2134
|
-
redirect_url: Joi.string().allow(""),
|
|
2135
|
-
transaction_id: Joi.string().allow(""),
|
|
2136
|
-
current_status: Joi.string().allow(""),
|
|
2137
|
-
meta: BillingPlatformModel.Meta(),
|
|
2138
|
-
});
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
/** @returns {EntityDetail} */
|
|
2142
|
-
static EntityDetail() {
|
|
2143
|
-
return Joi.object({
|
|
2144
|
-
entity: Joi.string().allow(""),
|
|
2145
|
-
item: BillingPlatformModel.Subscription(),
|
|
2146
|
-
});
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
/** @returns {PaymentOptions} */
|
|
2150
|
-
static PaymentOptions() {
|
|
2151
|
-
return Joi.object({
|
|
2152
|
-
_id: Joi.string().allow(""),
|
|
2153
|
-
name: Joi.string().allow(""),
|
|
2154
|
-
description: Joi.string().allow(""),
|
|
2155
|
-
logo: Joi.string().allow(""),
|
|
2156
|
-
aggregator_id: Joi.string().allow(""),
|
|
2157
|
-
aggregator: Joi.string().allow(""),
|
|
2158
|
-
created_at: Joi.string().allow(""),
|
|
2159
|
-
modified_at: Joi.string().allow(""),
|
|
2160
|
-
__v: Joi.number(),
|
|
2161
|
-
});
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
/** @returns {VerifyPaymentReq} */
|
|
2165
|
-
static VerifyPaymentReq() {
|
|
2166
|
-
return Joi.object({
|
|
2167
|
-
razorpay_payment_id: Joi.string().allow(""),
|
|
2168
|
-
razorpay_order_id: Joi.string().allow(""),
|
|
2169
|
-
razorpay_signature: Joi.string().allow(""),
|
|
2170
|
-
status_code: Joi.number(),
|
|
2171
|
-
provider_type: Joi.string().allow(""),
|
|
2172
|
-
});
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
/** @returns {Documents} */
|
|
2176
|
-
static Documents() {
|
|
2177
|
-
return Joi.object({
|
|
2178
|
-
pan: Joi.string().allow(""),
|
|
2179
|
-
gst: Joi.string().allow(""),
|
|
2180
|
-
});
|
|
2181
|
-
}
|
|
2182
|
-
|
|
2183
|
-
/** @returns {BillingAddress} */
|
|
2184
|
-
static BillingAddress() {
|
|
2185
|
-
return Joi.object({
|
|
2186
|
-
country: Joi.string().allow(""),
|
|
2187
|
-
state: Joi.string().allow(""),
|
|
2188
|
-
city: Joi.string().allow(""),
|
|
2189
|
-
line1: Joi.string().allow(""),
|
|
2190
|
-
line2: Joi.string().allow(""),
|
|
2191
|
-
postal_code: Joi.string().allow(""),
|
|
2192
|
-
country_code: Joi.string().allow(""),
|
|
2193
|
-
});
|
|
2194
|
-
}
|
|
2195
|
-
|
|
2196
|
-
/** @returns {Currency} */
|
|
2197
|
-
static Currency() {
|
|
2198
|
-
return Joi.object({
|
|
2199
|
-
code: Joi.string().allow(""),
|
|
2200
|
-
symbol: Joi.string().allow(""),
|
|
2201
|
-
name: Joi.string().allow(""),
|
|
2202
|
-
});
|
|
2203
|
-
}
|
|
2204
|
-
|
|
2205
|
-
/** @returns {BusinessCountryInfo} */
|
|
2206
|
-
static BusinessCountryInfo() {
|
|
2207
|
-
return Joi.object({
|
|
2208
|
-
country: Joi.string().allow(""),
|
|
2209
|
-
country_code: Joi.string().allow(""),
|
|
2210
|
-
currency: BillingPlatformModel.Currency(),
|
|
2211
|
-
timezone: Joi.string().allow(""),
|
|
2212
|
-
});
|
|
2213
|
-
}
|
|
2214
|
-
|
|
2215
|
-
/** @returns {SubscriberData} */
|
|
2216
|
-
static SubscriberData() {
|
|
2217
|
-
return Joi.object({
|
|
2218
|
-
pg_user_exists: Joi.boolean(),
|
|
2219
|
-
id: Joi.string().allow(""),
|
|
2220
|
-
pg_customer_id: Joi.string().allow(""),
|
|
2221
|
-
default_payment_method: Joi.string().allow(""),
|
|
2222
|
-
});
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
/** @returns {Subscriber} */
|
|
2226
|
-
static Subscriber() {
|
|
2227
|
-
return Joi.object({
|
|
2228
|
-
documents: BillingPlatformModel.Documents(),
|
|
2229
|
-
phone: Joi.any(),
|
|
2230
|
-
billing_address: BillingPlatformModel.BillingAddress(),
|
|
2231
|
-
consent: Joi.boolean(),
|
|
2232
|
-
comms: Joi.boolean(),
|
|
2233
|
-
_id: Joi.string().allow(""),
|
|
2234
|
-
type: Joi.string().allow(""),
|
|
2235
|
-
unique_id: Joi.string().allow(""),
|
|
2236
|
-
name: Joi.string().allow(""),
|
|
2237
|
-
email: Joi.string().allow(""),
|
|
2238
|
-
business_country_info: BillingPlatformModel.BusinessCountryInfo(),
|
|
2239
|
-
created_at: Joi.string().allow(""),
|
|
2240
|
-
modified_at: Joi.string().allow(""),
|
|
2241
|
-
credit_balance: Joi.number().allow(null),
|
|
2242
|
-
data: BillingPlatformModel.SubscriberData(),
|
|
2243
|
-
});
|
|
2244
|
-
}
|
|
2245
|
-
|
|
2246
|
-
/** @returns {AuthorModifiedDetails} */
|
|
2247
|
-
static AuthorModifiedDetails() {
|
|
2248
|
-
return Joi.object({
|
|
2249
|
-
first_name: Joi.string().allow(""),
|
|
2250
|
-
last_name: Joi.string().allow(""),
|
|
2251
|
-
is_admin: Joi.boolean(),
|
|
2252
|
-
});
|
|
2253
|
-
}
|
|
2254
|
-
|
|
2255
|
-
/** @returns {Author} */
|
|
2256
|
-
static Author() {
|
|
2257
|
-
return Joi.object({
|
|
2258
|
-
modified_by_details: BillingPlatformModel.AuthorModifiedDetails(),
|
|
2259
|
-
created_by: Joi.string().allow(""),
|
|
2260
|
-
modified_by: Joi.string().allow(""),
|
|
2261
|
-
});
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
/** @returns {EndingBalance} */
|
|
2265
|
-
static EndingBalance() {
|
|
2266
|
-
return Joi.object({
|
|
2267
|
-
amount: Joi.number(),
|
|
2268
|
-
old_entry_ref: Joi.string().allow("").allow(null),
|
|
2269
|
-
});
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
/** @returns {PaymentData} */
|
|
2273
|
-
static PaymentData() {
|
|
432
|
+
/** @returns {CreateSubscriptionCharge} */
|
|
433
|
+
static CreateSubscriptionCharge() {
|
|
2274
434
|
return Joi.object({
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
435
|
+
name: Joi.string().allow("").required(),
|
|
436
|
+
trial_days: Joi.number(),
|
|
437
|
+
line_items: Joi.array()
|
|
438
|
+
.items(BillingPlatformModel.ChargeLineItem())
|
|
439
|
+
.required(),
|
|
440
|
+
is_test: Joi.boolean(),
|
|
441
|
+
return_url: Joi.string().allow("").required(),
|
|
2280
442
|
});
|
|
2281
443
|
}
|
|
2282
444
|
|
|
2283
|
-
/** @returns {
|
|
2284
|
-
static
|
|
445
|
+
/** @returns {EntityChargeDetails} */
|
|
446
|
+
static EntityChargeDetails() {
|
|
2285
447
|
return Joi.object({
|
|
2286
|
-
entity: Joi.any(),
|
|
2287
|
-
author: BillingPlatformModel.Author(),
|
|
2288
448
|
_id: Joi.string().allow(""),
|
|
2289
|
-
|
|
2290
|
-
currency: Joi.string().allow(""),
|
|
449
|
+
subscription_id: Joi.string().allow(""),
|
|
2291
450
|
subscriber_id: Joi.string().allow(""),
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
ending_balance: BillingPlatformModel.EndingBalance(),
|
|
2295
|
-
payment: BillingPlatformModel.PaymentData(),
|
|
2296
|
-
type: Joi.string().allow(""),
|
|
2297
|
-
created_at: Joi.string().allow(""),
|
|
2298
|
-
modified_at: Joi.string().allow(""),
|
|
2299
|
-
});
|
|
2300
|
-
}
|
|
2301
|
-
|
|
2302
|
-
/** @returns {VerifyPaymentData} */
|
|
2303
|
-
static VerifyPaymentData() {
|
|
2304
|
-
return Joi.object({
|
|
2305
|
-
success: Joi.boolean(),
|
|
2306
|
-
subscriber: BillingPlatformModel.Subscriber(),
|
|
2307
|
-
credit_transaction: BillingPlatformModel.CreditTransaction(),
|
|
2308
|
-
});
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
/** @returns {VerifyPaymentRes} */
|
|
2312
|
-
static VerifyPaymentRes() {
|
|
2313
|
-
return Joi.object({
|
|
2314
|
-
status: Joi.string().allow(""),
|
|
2315
|
-
data: BillingPlatformModel.VerifyPaymentData(),
|
|
2316
|
-
});
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
/** @returns {DefaultMerchants} */
|
|
2320
|
-
static DefaultMerchants() {
|
|
2321
|
-
return Joi.object({
|
|
2322
|
-
stripe: Joi.string().allow(""),
|
|
2323
|
-
});
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
|
-
/** @returns {GlobalSettingsPayment} */
|
|
2327
|
-
static GlobalSettingsPayment() {
|
|
2328
|
-
return Joi.object({
|
|
2329
|
-
default_merchants: BillingPlatformModel.DefaultMerchants(),
|
|
2330
|
-
});
|
|
2331
|
-
}
|
|
2332
|
-
|
|
2333
|
-
/** @returns {GlobalSettingsData} */
|
|
2334
|
-
static GlobalSettingsData() {
|
|
2335
|
-
return Joi.object({
|
|
2336
|
-
payment: BillingPlatformModel.GlobalSettingsPayment(),
|
|
2337
|
-
freeze_panel: Joi.boolean(),
|
|
2338
|
-
_id: Joi.string().allow(""),
|
|
2339
|
-
created_at: Joi.string().allow(""),
|
|
2340
|
-
modified_at: Joi.string().allow(""),
|
|
2341
|
-
}).allow(null);
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
/** @returns {GlobalSettings} */
|
|
2345
|
-
static GlobalSettings() {
|
|
2346
|
-
return Joi.object({
|
|
2347
|
-
status: Joi.string().allow(""),
|
|
2348
|
-
data: BillingPlatformModel.GlobalSettingsData(),
|
|
2349
|
-
});
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
/** @returns {MethodChecks} */
|
|
2353
|
-
static MethodChecks() {
|
|
2354
|
-
return Joi.object({
|
|
2355
|
-
address_line1_check: Joi.string().allow(""),
|
|
2356
|
-
address_postal_code_check: Joi.string().allow(""),
|
|
2357
|
-
cvc_check: Joi.string().allow(""),
|
|
2358
|
-
});
|
|
2359
|
-
}
|
|
2360
|
-
|
|
2361
|
-
/** @returns {MethodNetworks} */
|
|
2362
|
-
static MethodNetworks() {
|
|
2363
|
-
return Joi.object({
|
|
2364
|
-
available: Joi.array().items(Joi.string().allow("")),
|
|
2365
|
-
preferred: Joi.string().allow("").allow(null),
|
|
2366
|
-
});
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
/** @returns {MethodSecureUsage} */
|
|
2370
|
-
static MethodSecureUsage() {
|
|
2371
|
-
return Joi.object({
|
|
2372
|
-
supported: Joi.boolean(),
|
|
2373
|
-
});
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
/** @returns {MethodDetails} */
|
|
2377
|
-
static MethodDetails() {
|
|
2378
|
-
return Joi.object({
|
|
2379
|
-
id: Joi.string().allow(""),
|
|
2380
|
-
type: Joi.string().allow(""),
|
|
2381
|
-
mandate_available: Joi.boolean(),
|
|
2382
|
-
mandate_amount: Joi.number(),
|
|
2383
|
-
pg_payment_method_id: Joi.string().allow(""),
|
|
2384
|
-
is_default: Joi.boolean(),
|
|
2385
|
-
data: BillingPlatformModel.SubscriptionMethodData(),
|
|
2386
|
-
});
|
|
2387
|
-
}
|
|
2388
|
-
|
|
2389
|
-
/** @returns {SubscriptionMethodData} */
|
|
2390
|
-
static SubscriptionMethodData() {
|
|
2391
|
-
return Joi.object({
|
|
2392
|
-
brand: Joi.string().allow(""),
|
|
2393
|
-
checks: BillingPlatformModel.MethodChecks(),
|
|
2394
|
-
country: Joi.string().allow(""),
|
|
2395
|
-
exp_month: Joi.number(),
|
|
2396
|
-
exp_year: Joi.number(),
|
|
2397
|
-
fingerprint: Joi.string().allow(""),
|
|
2398
|
-
funding: Joi.string().allow(""),
|
|
2399
|
-
generated_from: Joi.string().allow("").allow(null),
|
|
2400
|
-
last4: Joi.string().allow(""),
|
|
2401
|
-
networks: BillingPlatformModel.MethodNetworks(),
|
|
2402
|
-
three_d_secure_usage: BillingPlatformModel.MethodSecureUsage(),
|
|
2403
|
-
wallet: Joi.string().allow("").allow(null),
|
|
451
|
+
entity_type: Joi.string().allow(""),
|
|
452
|
+
entity_id: Joi.string().allow(""),
|
|
2404
453
|
name: Joi.string().allow(""),
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
static SubscriptionMethods() {
|
|
2411
|
-
return Joi.object({
|
|
2412
|
-
success: Joi.boolean(),
|
|
2413
|
-
data: Joi.array().items(BillingPlatformModel.MethodDetails()),
|
|
2414
|
-
});
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
|
-
/** @returns {ConfigPublicKey} */
|
|
2418
|
-
static ConfigPublicKey() {
|
|
2419
|
-
return Joi.object({
|
|
2420
|
-
public_key: Joi.string().allow(""),
|
|
2421
|
-
});
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
/** @returns {ConfigRes} */
|
|
2425
|
-
static ConfigRes() {
|
|
2426
|
-
return Joi.object({
|
|
2427
|
-
success: Joi.boolean(),
|
|
2428
|
-
aggregator: Joi.string().allow(""),
|
|
2429
|
-
config: BillingPlatformModel.ConfigPublicKey(),
|
|
2430
|
-
});
|
|
2431
|
-
}
|
|
2432
|
-
|
|
2433
|
-
/** @returns {PlanChangeData} */
|
|
2434
|
-
static PlanChangeData() {
|
|
2435
|
-
return Joi.object({
|
|
2436
|
-
total: Joi.number(),
|
|
2437
|
-
credit_note_amount: Joi.number(),
|
|
2438
|
-
settlement: Joi.number(),
|
|
2439
|
-
taxable_amount: Joi.number(),
|
|
2440
|
-
gst_amount: Joi.number(),
|
|
2441
|
-
gross_total: Joi.number(),
|
|
2442
|
-
gst: Joi.number(),
|
|
2443
|
-
discount: Joi.number(),
|
|
2444
|
-
});
|
|
2445
|
-
}
|
|
2446
|
-
|
|
2447
|
-
/** @returns {PlanChangeDetails} */
|
|
2448
|
-
static PlanChangeDetails() {
|
|
2449
|
-
return Joi.object({
|
|
454
|
+
term: Joi.string().allow(""),
|
|
455
|
+
charge_type: Joi.string().allow(""),
|
|
456
|
+
pricing_type: Joi.string().allow(""),
|
|
457
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
458
|
+
recurring: BillingPlatformModel.ChargeRecurring(),
|
|
2450
459
|
status: Joi.string().allow(""),
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
460
|
+
capped_amount: Joi.number(),
|
|
461
|
+
activated_on: Joi.string().allow("").allow(null),
|
|
462
|
+
cancelled_on: Joi.string().allow("").allow(null),
|
|
463
|
+
billing_date: Joi.string().allow("").allow(null),
|
|
464
|
+
current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
465
|
+
modified_at: Joi.string().allow(""),
|
|
466
|
+
created_at: Joi.string().allow(""),
|
|
467
|
+
is_test: Joi.boolean(),
|
|
468
|
+
company_id: Joi.string().allow(""),
|
|
469
|
+
meta: Joi.object().pattern(/\S/, Joi.any()),
|
|
470
|
+
__v: Joi.number(),
|
|
2459
471
|
});
|
|
2460
472
|
}
|
|
2461
473
|
|
|
2462
|
-
/** @returns {
|
|
2463
|
-
static
|
|
474
|
+
/** @returns {EntitySubscription} */
|
|
475
|
+
static EntitySubscription() {
|
|
2464
476
|
return Joi.object({
|
|
2465
|
-
aggregator: Joi.any(),
|
|
2466
|
-
currency: Joi.string().allow(""),
|
|
2467
|
-
current_status: Joi.string().allow(""),
|
|
2468
477
|
_id: Joi.string().allow(""),
|
|
2469
|
-
|
|
2470
|
-
|
|
478
|
+
product_suit_id: Joi.string().allow(""),
|
|
479
|
+
entity_id: Joi.string().allow(""),
|
|
2471
480
|
entity_type: Joi.string().allow(""),
|
|
2472
|
-
collection_type: Joi.string().allow(""),
|
|
2473
|
-
meta: BillingPlatformModel.TransactionMeta(),
|
|
2474
|
-
created_at: Joi.string().allow(""),
|
|
2475
|
-
modified_at: Joi.string().allow(""),
|
|
2476
|
-
});
|
|
2477
|
-
}
|
|
2478
|
-
|
|
2479
|
-
/** @returns {PaymentItems} */
|
|
2480
|
-
static PaymentItems() {
|
|
2481
|
-
return Joi.object({
|
|
2482
481
|
name: Joi.string().allow(""),
|
|
2483
|
-
code: Joi.string().allow(""),
|
|
2484
|
-
aggregator: Joi.string().allow(""),
|
|
2485
|
-
});
|
|
2486
|
-
}
|
|
2487
|
-
|
|
2488
|
-
/** @returns {GetPaymentOptions} */
|
|
2489
|
-
static GetPaymentOptions() {
|
|
2490
|
-
return Joi.object({
|
|
2491
|
-
payment_options: Joi.array().items(BillingPlatformModel.PaymentItems()),
|
|
2492
|
-
});
|
|
2493
|
-
}
|
|
2494
|
-
|
|
2495
|
-
/** @returns {TopupReq} */
|
|
2496
|
-
static TopupReq() {
|
|
2497
|
-
return Joi.object({
|
|
2498
|
-
amount: Joi.number(),
|
|
2499
|
-
currency: Joi.string().allow(""),
|
|
2500
|
-
provider_type: Joi.string().allow(""),
|
|
2501
|
-
});
|
|
2502
|
-
}
|
|
2503
|
-
|
|
2504
|
-
/** @returns {SetupMandateReq} */
|
|
2505
|
-
static SetupMandateReq() {
|
|
2506
|
-
return Joi.object({
|
|
2507
|
-
intent_id: Joi.string().allow(""),
|
|
2508
|
-
payment_method_id: Joi.string().allow(""),
|
|
2509
|
-
});
|
|
2510
|
-
}
|
|
2511
|
-
|
|
2512
|
-
/** @returns {SetupPaymentReq} */
|
|
2513
|
-
static SetupPaymentReq() {
|
|
2514
|
-
return Joi.object({
|
|
2515
|
-
payment_method: Joi.string().allow(""),
|
|
2516
|
-
payment_id: Joi.string().allow(""),
|
|
2517
|
-
plan_id: Joi.string().allow(""),
|
|
2518
|
-
invoice_id: Joi.string().allow(""),
|
|
2519
|
-
});
|
|
2520
|
-
}
|
|
2521
|
-
|
|
2522
|
-
/** @returns {SubscriptionRenewReq} */
|
|
2523
|
-
static SubscriptionRenewReq() {
|
|
2524
|
-
return Joi.object({
|
|
2525
|
-
invoice_id: Joi.string().allow(""),
|
|
2526
|
-
entity_type: Joi.string().allow(""),
|
|
2527
|
-
collection_type: Joi.string().allow(""),
|
|
2528
|
-
callback_url: Joi.string().allow(""),
|
|
2529
|
-
meta: BillingPlatformModel.RenewMeta(),
|
|
2530
|
-
});
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
/** @returns {RenewMeta} */
|
|
2534
|
-
static RenewMeta() {
|
|
2535
|
-
return Joi.object({
|
|
2536
|
-
invoice_payment: Joi.boolean(),
|
|
2537
|
-
renew: Joi.boolean(),
|
|
2538
|
-
});
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
/** @returns {SubscriptionMethodsReq} */
|
|
2542
|
-
static SubscriptionMethodsReq() {
|
|
2543
|
-
return Joi.object({
|
|
2544
|
-
unique_external_id: Joi.string().allow(""),
|
|
2545
|
-
setup_intent_id: Joi.string().allow(""),
|
|
2546
|
-
pg_payment_method_id: Joi.string().allow(""),
|
|
2547
|
-
set_default: Joi.boolean(),
|
|
2548
|
-
});
|
|
2549
|
-
}
|
|
2550
|
-
|
|
2551
|
-
/** @returns {CreditTransactionResponse} */
|
|
2552
|
-
static CreditTransactionResponse() {
|
|
2553
|
-
return Joi.object({
|
|
2554
|
-
total: Joi.number(),
|
|
2555
|
-
limit: Joi.number(),
|
|
2556
|
-
page: Joi.number(),
|
|
2557
|
-
pages: Joi.number(),
|
|
2558
|
-
items: Joi.array().items(BillingPlatformModel.CreditTransaction()),
|
|
2559
|
-
});
|
|
2560
|
-
}
|
|
2561
|
-
|
|
2562
|
-
/** @returns {DowngradePlanReq} */
|
|
2563
|
-
static DowngradePlanReq() {
|
|
2564
|
-
return Joi.object({
|
|
2565
|
-
unique_id: Joi.string().allow(""),
|
|
2566
|
-
type: Joi.string().allow(""),
|
|
2567
|
-
product_suite: Joi.string().allow(""),
|
|
2568
|
-
plan_id: Joi.string().allow(""),
|
|
2569
|
-
reason: Joi.string().allow(""),
|
|
2570
|
-
platform: Joi.string().allow("").allow(null),
|
|
2571
|
-
});
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2574
|
-
/** @returns {Taxation} */
|
|
2575
|
-
static Taxation() {
|
|
2576
|
-
return Joi.object({
|
|
2577
|
-
gst: Joi.number(),
|
|
2578
|
-
});
|
|
2579
|
-
}
|
|
2580
|
-
|
|
2581
|
-
/** @returns {OneTimeFees} */
|
|
2582
|
-
static OneTimeFees() {
|
|
2583
|
-
return Joi.object({
|
|
2584
|
-
developement: Joi.number().allow(null),
|
|
2585
|
-
marketing: Joi.number().allow(null),
|
|
2586
|
-
});
|
|
2587
|
-
}
|
|
2588
|
-
|
|
2589
|
-
/** @returns {CreditLine} */
|
|
2590
|
-
static CreditLine() {
|
|
2591
|
-
return Joi.object({
|
|
2592
|
-
is_active: Joi.boolean(),
|
|
2593
|
-
});
|
|
2594
|
-
}
|
|
2595
|
-
|
|
2596
|
-
/** @returns {StatusMessage} */
|
|
2597
|
-
static StatusMessage() {
|
|
2598
|
-
return Joi.object({
|
|
2599
|
-
status: Joi.string().allow(""),
|
|
2600
|
-
message: Joi.string().allow(""),
|
|
2601
|
-
success: Joi.boolean(),
|
|
2602
|
-
code: Joi.string().allow(""),
|
|
2603
|
-
});
|
|
2604
|
-
}
|
|
2605
|
-
|
|
2606
|
-
/** @returns {PaymentCollectReq} */
|
|
2607
|
-
static PaymentCollectReq() {
|
|
2608
|
-
return Joi.object({
|
|
2609
|
-
transaction_id: Joi.string().allow(""),
|
|
2610
|
-
credit_balance: Joi.boolean().allow(null),
|
|
2611
|
-
payment_mode: Joi.string().allow(""),
|
|
2612
|
-
payment_method: Joi.string().allow(""),
|
|
2613
|
-
invoice_id: Joi.string().allow(""),
|
|
2614
|
-
});
|
|
2615
|
-
}
|
|
2616
|
-
|
|
2617
|
-
/** @returns {SubscriptionRenewResMeta} */
|
|
2618
|
-
static SubscriptionRenewResMeta() {
|
|
2619
|
-
return Joi.object({
|
|
2620
|
-
invoice_payment: Joi.boolean(),
|
|
2621
|
-
renew: Joi.boolean(),
|
|
2622
|
-
});
|
|
2623
|
-
}
|
|
2624
|
-
|
|
2625
|
-
/** @returns {SubscriptionRenewRes} */
|
|
2626
|
-
static SubscriptionRenewRes() {
|
|
2627
|
-
return Joi.object({
|
|
2628
|
-
redirect_url: Joi.string().allow(""),
|
|
2629
|
-
transaction_id: Joi.string().allow(""),
|
|
2630
|
-
current_status: Joi.string().allow(""),
|
|
2631
|
-
meta: BillingPlatformModel.SubscriptionRenewResMeta(),
|
|
2632
|
-
});
|
|
2633
|
-
}
|
|
2634
|
-
|
|
2635
|
-
/** @returns {SetupIntentRes} */
|
|
2636
|
-
static SetupIntentRes() {
|
|
2637
|
-
return Joi.object({
|
|
2638
|
-
success: Joi.boolean(),
|
|
2639
|
-
data: BillingPlatformModel.SetupIntentData(),
|
|
2640
|
-
});
|
|
2641
|
-
}
|
|
2642
|
-
|
|
2643
|
-
/** @returns {SetupIntentData} */
|
|
2644
|
-
static SetupIntentData() {
|
|
2645
|
-
return Joi.object({
|
|
2646
|
-
id: Joi.string().allow(""),
|
|
2647
|
-
client_secret: Joi.string().allow(""),
|
|
2648
|
-
customer: Joi.string().allow(""),
|
|
2649
|
-
status: Joi.string().allow(""),
|
|
2650
|
-
});
|
|
2651
|
-
}
|
|
2652
|
-
|
|
2653
|
-
/** @returns {SetupPayment} */
|
|
2654
|
-
static SetupPayment() {
|
|
2655
|
-
return Joi.object({
|
|
2656
|
-
id: Joi.string().allow(""),
|
|
2657
|
-
status: Joi.string().allow(""),
|
|
2658
|
-
customer: Joi.string().allow(""),
|
|
2659
|
-
client_secret: Joi.string().allow(""),
|
|
2660
|
-
payment_method: Joi.string().allow(""),
|
|
2661
|
-
mandate: Joi.string().allow(""),
|
|
2662
|
-
payment_method_options: BillingPlatformModel.PaymentMethodOptions(),
|
|
2663
|
-
});
|
|
2664
|
-
}
|
|
2665
|
-
|
|
2666
|
-
/** @returns {PaymentMethodOptions} */
|
|
2667
|
-
static PaymentMethodOptions() {
|
|
2668
|
-
return Joi.object({
|
|
2669
|
-
card: BillingPlatformModel.Card(),
|
|
2670
|
-
});
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
/** @returns {Card} */
|
|
2674
|
-
static Card() {
|
|
2675
|
-
return Joi.object({
|
|
2676
|
-
mandate_options: BillingPlatformModel.MandateOptions(),
|
|
2677
|
-
});
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
|
-
/** @returns {MandateOptions} */
|
|
2681
|
-
static MandateOptions() {
|
|
2682
|
-
return Joi.object({
|
|
2683
|
-
amount: Joi.number(),
|
|
2684
|
-
});
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
/** @returns {Message} */
|
|
2688
|
-
static Message() {
|
|
2689
|
-
return Joi.object({
|
|
2690
|
-
message: Joi.string().allow(""),
|
|
2691
|
-
});
|
|
2692
|
-
}
|
|
2693
|
-
|
|
2694
|
-
/** @returns {TopupRes} */
|
|
2695
|
-
static TopupRes() {
|
|
2696
|
-
return Joi.object({
|
|
2697
482
|
status: Joi.string().allow(""),
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
currency: Joi.string().allow(""),
|
|
2701
|
-
transaction_id: Joi.string().allow(""),
|
|
2702
|
-
});
|
|
2703
|
-
}
|
|
2704
|
-
|
|
2705
|
-
/** @returns {CancelTopupReq} */
|
|
2706
|
-
static CancelTopupReq() {
|
|
2707
|
-
return Joi.object({
|
|
2708
|
-
order_id: Joi.string().allow(""),
|
|
2709
|
-
});
|
|
2710
|
-
}
|
|
2711
|
-
|
|
2712
|
-
/** @returns {CancelTopupRes} */
|
|
2713
|
-
static CancelTopupRes() {
|
|
2714
|
-
return Joi.object({
|
|
2715
|
-
_id: Joi.string().allow(""),
|
|
2716
|
-
subscriber_id: Joi.string().allow(""),
|
|
2717
|
-
amount: Joi.number(),
|
|
2718
|
-
currency: Joi.string().allow(""),
|
|
2719
|
-
aggregator: Joi.string().allow(""),
|
|
2720
|
-
aggregator_order_id: Joi.string().allow(""),
|
|
483
|
+
trial_days: Joi.number(),
|
|
484
|
+
is_test: Joi.boolean(),
|
|
2721
485
|
created_at: Joi.string().allow(""),
|
|
2722
486
|
modified_at: Joi.string().allow(""),
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
487
|
+
subscriber_id: Joi.string().allow(""),
|
|
488
|
+
line_items: Joi.array().items(BillingPlatformModel.EntityChargeDetails()),
|
|
489
|
+
return_url: Joi.string().allow(""),
|
|
2726
490
|
});
|
|
2727
491
|
}
|
|
2728
492
|
|
|
2729
|
-
/** @returns {
|
|
2730
|
-
static
|
|
493
|
+
/** @returns {CreateSubscription} */
|
|
494
|
+
static CreateSubscription() {
|
|
2731
495
|
return Joi.object({
|
|
2732
|
-
|
|
496
|
+
subscription: BillingPlatformModel.EntitySubscription(),
|
|
497
|
+
confirm_url: Joi.string().allow(""),
|
|
2733
498
|
});
|
|
2734
499
|
}
|
|
2735
500
|
}
|