@gofynd/fdk-client-javascript 1.6.3 → 3.0.0-beta.1
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 +0 -2
- package/sdk/application/ApplicationClient.js +0 -2
- package/sdk/application/Cart/CartApplicationClient.d.ts +113 -93
- package/sdk/application/Cart/CartApplicationClient.js +270 -139
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +110 -110
- package/sdk/application/Catalog/CatalogApplicationClient.js +122 -138
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
- package/sdk/application/Common/CommonApplicationClient.js +3 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +43 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +190 -3
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +71 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +103 -29
- package/sdk/application/Content/ContentApplicationClient.d.ts +51 -21
- package/sdk/application/Content/ContentApplicationClient.js +197 -36
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -6
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
- package/sdk/application/Lead/LeadApplicationClient.js +3 -3
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +79 -64
- package/sdk/application/Logistic/LogisticApplicationClient.js +246 -264
- package/sdk/application/Order/OrderApplicationClient.d.ts +44 -24
- package/sdk/application/Order/OrderApplicationClient.js +140 -21
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +211 -111
- package/sdk/application/Payment/PaymentApplicationClient.js +610 -109
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +13 -13
- package/sdk/application/Rewards/RewardsApplicationClient.js +7 -7
- package/sdk/application/Share/ShareApplicationClient.d.ts +7 -7
- package/sdk/application/Share/ShareApplicationClient.js +14 -14
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +23 -3
- package/sdk/application/Theme/ThemeApplicationClient.js +103 -5
- package/sdk/application/User/UserApplicationClient.d.ts +13 -23
- package/sdk/application/User/UserApplicationClient.js +9 -57
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +4 -4
- package/sdk/application/Webhook/WebhookApplicationClient.js +3 -3
- package/sdk/partner/Authorization/AuthorizationPartnerClient.d.ts +66 -0
- package/sdk/partner/Authorization/AuthorizationPartnerClient.js +431 -0
- package/sdk/partner/Authorization/AuthorizationPartnerModel.d.ts +231 -0
- package/sdk/partner/Authorization/AuthorizationPartnerModel.js +152 -0
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.d.ts +8 -0
- package/sdk/partner/Authorization/AuthorizationPartnerValidator.js +39 -0
- package/sdk/partner/Catalog/CatalogPartnerClient.d.ts +26 -0
- package/sdk/partner/Catalog/CatalogPartnerClient.js +173 -0
- package/sdk/partner/Catalog/CatalogPartnerModel.d.ts +238 -0
- package/sdk/partner/Catalog/CatalogPartnerModel.js +248 -0
- package/sdk/partner/Catalog/CatalogPartnerValidator.d.ts +5 -0
- package/sdk/partner/Catalog/CatalogPartnerValidator.js +19 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +12 -22
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +12 -87
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +33 -99
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +25 -84
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -1
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +4 -10
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +5 -5
- package/sdk/partner/Lead/LeadPartnerClient.js +4 -4
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +100 -49
- package/sdk/partner/Lead/LeadPartnerModel.js +100 -74
- package/sdk/partner/Lead/LeadPartnerValidator.js +1 -1
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +33 -160
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +66 -1180
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +288 -1685
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +226 -824
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +1 -13
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +14 -141
- package/sdk/partner/PartnerClient.d.ts +6 -0
- package/sdk/partner/PartnerClient.js +9 -0
- package/sdk/partner/Payment/PaymentPartnerClient.d.ts +116 -0
- package/sdk/partner/Payment/PaymentPartnerClient.js +857 -0
- package/sdk/partner/Payment/PaymentPartnerModel.d.ts +388 -0
- package/sdk/partner/Payment/PaymentPartnerModel.js +442 -0
- package/sdk/partner/Payment/PaymentPartnerValidator.d.ts +14 -0
- package/sdk/partner/Payment/PaymentPartnerValidator.js +74 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +63 -21
- package/sdk/partner/Theme/ThemePartnerClient.js +396 -71
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +104 -72
- package/sdk/partner/Theme/ThemePartnerModel.js +101 -75
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +5 -1
- package/sdk/partner/Theme/ThemePartnerValidator.js +42 -12
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +18 -18
- package/sdk/partner/Webhook/WebhookPartnerClient.js +18 -18
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +191 -612
- package/sdk/partner/Webhook/WebhookPartnerModel.js +159 -234
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +3 -3
- package/sdk/partner/index.d.ts +3 -0
- package/sdk/partner/index.js +6 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +1 -4
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +32 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +243 -3
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +145 -49
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +171 -20
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +39 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +35 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +406 -15
- package/sdk/platform/Billing/BillingPlatformClient.js +3214 -76
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +3798 -459
- package/sdk/platform/Billing/BillingPlatformModel.js +2577 -342
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +465 -24
- package/sdk/platform/Billing/BillingPlatformValidator.js +490 -14
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +284 -205
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +671 -553
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +165 -165
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +108 -132
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3136 -4788
- package/sdk/platform/Cart/CartPlatformModel.js +2850 -2031
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1015 -419
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +6450 -2010
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1121 -230
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +919 -127
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +372 -574
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1238 -1317
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +8351 -9825
- package/sdk/platform/Catalog/CatalogPlatformModel.js +9662 -6881
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +288 -235
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +241 -183
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -6
- package/sdk/platform/Common/CommonPlatformClient.js +5 -6
- package/sdk/platform/Common/CommonPlatformModel.d.ts +9 -9
- package/sdk/platform/Common/CommonPlatformModel.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +374 -234
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +875 -583
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +170 -139
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +145 -126
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +56 -3
- package/sdk/platform/Communication/CommunicationPlatformClient.js +307 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +424 -252
- package/sdk/platform/Communication/CommunicationPlatformModel.js +540 -320
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +62 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +48 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +68 -99
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +84 -140
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +238 -256
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +222 -244
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +20 -20
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +20 -20
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +333 -118
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1470 -409
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +158 -55
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +163 -41
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +151 -61
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +595 -101
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +1199 -462
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +1008 -321
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +80 -34
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +79 -24
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +253 -140
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1087 -458
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +221 -178
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +220 -157
- package/sdk/platform/Content/ContentPlatformClient.d.ts +124 -123
- package/sdk/platform/Content/ContentPlatformClient.js +459 -379
- package/sdk/platform/Content/ContentPlatformModel.d.ts +833 -1307
- package/sdk/platform/Content/ContentPlatformModel.js +893 -582
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +140 -150
- package/sdk/platform/Content/ContentPlatformValidator.js +131 -135
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +60 -36
- package/sdk/platform/Discount/DiscountPlatformClient.js +85 -36
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +46 -47
- package/sdk/platform/Discount/DiscountPlatformModel.js +42 -46
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformValidator.js +2 -2
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +18 -15
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +24 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +75 -86
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +60 -74
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +320 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +2333 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +2895 -0
- package/sdk/platform/Finance/FinancePlatformModel.js +2150 -0
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +284 -0
- package/sdk/platform/Finance/FinancePlatformValidator.js +354 -0
- 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 +4 -24
- package/sdk/platform/Lead/LeadPlatformClient.js +4 -160
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +142 -57
- package/sdk/platform/Lead/LeadPlatformModel.js +162 -79
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +3 -29
- package/sdk/platform/Lead/LeadPlatformValidator.js +2 -28
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +94 -25
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +600 -57
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +115 -115
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +120 -43
- package/sdk/platform/Order/OrderPlatformClient.d.ts +502 -293
- package/sdk/platform/Order/OrderPlatformClient.js +1466 -913
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4111 -9093
- package/sdk/platform/Order/OrderPlatformModel.js +3202 -4230
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +445 -612
- package/sdk/platform/Order/OrderPlatformValidator.js +316 -326
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +7 -9
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +9 -9
- package/sdk/platform/Partner/PartnerPlatformModel.js +7 -7
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +382 -135
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +2453 -935
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +306 -93
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +305 -70
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +66 -56
- package/sdk/platform/Payment/PaymentPlatformClient.js +269 -124
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3525 -1313
- package/sdk/platform/Payment/PaymentPlatformModel.js +3813 -1511
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +64 -35
- package/sdk/platform/Payment/PaymentPlatformValidator.js +60 -34
- package/sdk/platform/PlatformClient.d.ts +2 -0
- package/sdk/platform/PlatformClient.js +4 -0
- 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 +14 -9
- package/sdk/platform/Rewards/RewardsPlatformModel.js +10 -8
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +344 -56
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +2180 -302
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +380 -54
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +336 -37
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +127 -213
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +538 -1306
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +3429 -2979
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3642 -1785
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +218 -392
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +151 -290
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +4 -16
- package/sdk/platform/Share/SharePlatformApplicationClient.js +8 -86
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +6 -23
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +3 -16
- package/sdk/platform/Share/SharePlatformModel.d.ts +6 -50
- package/sdk/platform/Share/SharePlatformModel.js +3 -43
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +26 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +157 -10
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +21 -10
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +23 -6
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +18 -8
- package/sdk/platform/Theme/ThemePlatformClient.js +85 -8
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +425 -17
- package/sdk/platform/Theme/ThemePlatformModel.js +329 -23
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +7 -3
- package/sdk/platform/Theme/ThemePlatformValidator.js +9 -2
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +22 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +91 -12
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +15 -3
- package/sdk/platform/User/UserPlatformApplicationValidator.js +14 -2
- package/sdk/platform/User/UserPlatformModel.d.ts +223 -59
- package/sdk/platform/User/UserPlatformModel.js +204 -65
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +78 -25
- package/sdk/platform/Webhook/WebhookPlatformClient.js +470 -75
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +434 -758
- package/sdk/platform/Webhook/WebhookPlatformModel.js +395 -410
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +55 -10
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +72 -12
- package/sdk/platform/index.d.ts +1 -0
- package/sdk/platform/index.js +2 -0
- package/sdk/public/Billing/BillingPublicClient.d.ts +56 -0
- package/sdk/public/Billing/BillingPublicClient.js +397 -0
- package/sdk/public/Billing/BillingPublicModel.d.ts +919 -0
- package/sdk/public/Billing/BillingPublicModel.js +560 -0
- package/sdk/public/Billing/BillingPublicValidator.d.ts +43 -0
- package/sdk/public/Billing/BillingPublicValidator.js +50 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -4
- package/sdk/public/Configuration/ConfigurationPublicClient.js +97 -9
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +102 -40
- package/sdk/public/Configuration/ConfigurationPublicModel.js +111 -29
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +11 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +12 -0
- package/sdk/public/Content/ContentPublicClient.d.ts +22 -0
- package/sdk/public/Content/ContentPublicClient.js +183 -0
- package/sdk/public/Content/ContentPublicModel.d.ts +38 -1
- package/sdk/public/Content/ContentPublicModel.js +47 -1
- package/sdk/public/Content/ContentPublicValidator.d.ts +17 -1
- package/sdk/public/Content/ContentPublicValidator.js +19 -0
- 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 +8 -8
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +67 -215
- package/sdk/public/Webhook/WebhookPublicModel.js +61 -66
- 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/application/Finance/FinanceApplicationClient.d.ts +0 -29
- package/sdk/application/Finance/FinanceApplicationClient.js +0 -126
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +0 -22
- package/sdk/public/Catalog/CatalogPublicClient.js +0 -138
- package/sdk/public/Catalog/CatalogPublicModel.d.ts +0 -155
- package/sdk/public/Catalog/CatalogPublicModel.js +0 -116
- package/sdk/public/Catalog/CatalogPublicValidator.d.ts +0 -55
- package/sdk/public/Catalog/CatalogPublicValidator.js +0 -35
|
@@ -1,37 +1,257 @@
|
|
|
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
|
+
|
|
3
100
|
/**
|
|
4
101
|
* @typedef SubscriptionChargeRes
|
|
5
102
|
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
6
|
-
* @property {string} [product_suit_id] -
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @property {string} [
|
|
10
|
-
* @property {string} [
|
|
11
|
-
*
|
|
12
|
-
* @property {
|
|
13
|
-
* @property {string} [status] - Current status of the extension subscription
|
|
14
|
-
* @property {number} [trial_days] - The number of days allocated for the trial period
|
|
103
|
+
* @property {string} [product_suit_id] - ID of the product suit associated with
|
|
104
|
+
* the charge
|
|
105
|
+
* @property {string} [entity_id] - Unique identifier for the entity
|
|
106
|
+
* @property {string} [entity_type] - Type of entity (e.g., subscription, extension)
|
|
107
|
+
* @property {string} [name] - Name of the subscription charge
|
|
108
|
+
* @property {string} [status] - Current status of the subscription charge
|
|
109
|
+
* @property {number} [trial_days] - Number of trial days provided
|
|
15
110
|
* @property {string} [activated_on] - Date when the charge was activated
|
|
16
111
|
* @property {string} [cancelled_on] - Date when the charge was cancelled
|
|
17
|
-
* @property {boolean} [is_test] - Indicates
|
|
18
|
-
* a test mode.
|
|
112
|
+
* @property {boolean} [is_test] - Indicates if the charge is for testing purposes
|
|
19
113
|
* @property {string} [created_at] - Timestamp when the charge was created
|
|
20
114
|
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
21
|
-
* @property {string} [company_id] -
|
|
115
|
+
* @property {string} [company_id] - Company id
|
|
22
116
|
* @property {Object[]} [line_items] - List of line items associated with the charge
|
|
23
117
|
*/
|
|
24
118
|
|
|
25
119
|
/**
|
|
26
|
-
* @typedef
|
|
120
|
+
* @typedef PostDowngradeRes
|
|
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
|
|
27
171
|
* @property {string} [message] - Failure message.
|
|
28
172
|
*/
|
|
29
173
|
|
|
30
174
|
/**
|
|
31
175
|
* @typedef ResourceNotFound
|
|
32
176
|
* @property {string} [message] - Resource not found with {id}
|
|
33
|
-
* @property {
|
|
34
|
-
* @property {
|
|
177
|
+
* @property {Object} [code]
|
|
178
|
+
* @property {Object} [success]
|
|
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.
|
|
35
255
|
*/
|
|
36
256
|
|
|
37
257
|
/**
|
|
@@ -53,9 +273,9 @@ const Joi = require("joi");
|
|
|
53
273
|
* @property {string} [pricing_type] - The type of pricing for the charge item.
|
|
54
274
|
* @property {EntityChargePrice} [price]
|
|
55
275
|
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
56
|
-
* for
|
|
57
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
58
|
-
*
|
|
276
|
+
* for this item, if applicable.
|
|
277
|
+
* @property {boolean} [is_test] - Indicates whether the charge item is for
|
|
278
|
+
* testing purposes.
|
|
59
279
|
* @property {Object} [metadata] - Additional metadata associated with the charge item.
|
|
60
280
|
*/
|
|
61
281
|
|
|
@@ -63,26 +283,26 @@ const Joi = require("joi");
|
|
|
63
283
|
* @typedef CreateOneTimeCharge
|
|
64
284
|
* @property {string} [name] - The name of the one-time charge to be created.
|
|
65
285
|
* @property {OneTimeChargeItem} [charge]
|
|
66
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
67
|
-
*
|
|
286
|
+
* @property {boolean} [is_test] - Indicates whether the charge creation is for
|
|
287
|
+
* testing purposes.
|
|
68
288
|
* @property {string} [return_url] - URL to which the user will be redirected
|
|
69
289
|
* after creating the charge.
|
|
70
290
|
*/
|
|
71
291
|
|
|
72
292
|
/**
|
|
73
293
|
* @typedef ChargeRecurring
|
|
74
|
-
* @property {string} [interval]
|
|
75
|
-
* applied. Examples include "month", "year", etc.
|
|
294
|
+
* @property {string} [interval]
|
|
76
295
|
* @property {number} [interval_time]
|
|
77
296
|
*/
|
|
78
297
|
|
|
79
298
|
/**
|
|
80
299
|
* @typedef ChargeDetails
|
|
81
300
|
* @property {string} [_id] - Unique identifier for the charge.
|
|
82
|
-
* @property {string} [entity_type] -
|
|
83
|
-
*
|
|
84
|
-
* @property {string} [entity_id] - Unique identifier for the entity
|
|
85
|
-
*
|
|
301
|
+
* @property {string} [entity_type] - The type of entity associated with the
|
|
302
|
+
* charge (e.g., 'extension', 'subscription').
|
|
303
|
+
* @property {string} [entity_id] - Unique identifier for the entity associated
|
|
304
|
+
* with the charge.
|
|
305
|
+
* @property {string} [name] - The name of the charge.
|
|
86
306
|
* @property {string} [term] - Description of the charge term.
|
|
87
307
|
* @property {string} [charge_type] - The type of charge (e.g., 'standalone',
|
|
88
308
|
* 'recurring').
|
|
@@ -91,19 +311,16 @@ const Joi = require("joi");
|
|
|
91
311
|
* @property {EntityChargePrice} [price]
|
|
92
312
|
* @property {ChargeRecurring} [recurring]
|
|
93
313
|
* @property {string} [status] - Current status of the charge.
|
|
94
|
-
* @property {number} [capped_amount] -
|
|
95
|
-
* for a particular service or item
|
|
314
|
+
* @property {number} [capped_amount] - Maximum amount that can be charged, if applicable.
|
|
96
315
|
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
97
316
|
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
98
|
-
* @property {string} [billing_date] -
|
|
99
|
-
* field is optional and may be null if the billing date is not specified.
|
|
317
|
+
* @property {string} [billing_date] - Date and time when the charge was billed.
|
|
100
318
|
* @property {SubscriptionTrialPeriod} [current_period]
|
|
101
319
|
* @property {string} [modified_at] - Date and time when the charge details were
|
|
102
320
|
* last modified.
|
|
103
321
|
* @property {string} [created_at] - Date and time when the charge was created.
|
|
104
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
105
|
-
*
|
|
106
|
-
* @property {string} [company_id] - The unique identifier of the company.
|
|
322
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
323
|
+
* @property {string} [company_id] - Company id.
|
|
107
324
|
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
108
325
|
* @property {number} [__v] - Internal version key for the charge record.
|
|
109
326
|
*/
|
|
@@ -113,37 +330,38 @@ const Joi = require("joi");
|
|
|
113
330
|
* @property {string} [term] - Description of the charge term or usage.
|
|
114
331
|
* @property {string} [charge_type] - Type of the charge (e.g., 'subscription',
|
|
115
332
|
* 'extension').
|
|
116
|
-
* @property {number} [capped_amount] -
|
|
117
|
-
*
|
|
118
|
-
* @property {string} [billing_date] -
|
|
119
|
-
*
|
|
333
|
+
* @property {number} [capped_amount] - Maximum amount that can be charged. If
|
|
334
|
+
* no cap, the value should be 0.
|
|
335
|
+
* @property {string} [billing_date] - Date when the charge was billed. Null if
|
|
336
|
+
* not yet billed.
|
|
120
337
|
* @property {string} [created_at] - Date and time when the charge entity was created.
|
|
121
338
|
* @property {string} [modified_at] - Date and time when the charge entity was
|
|
122
339
|
* last modified.
|
|
123
340
|
* @property {number} [__v] - Internal version key for the charge record.
|
|
124
341
|
* @property {string} [_id] - Unique identifier for the charge entity.
|
|
125
342
|
* @property {string} [name] - The name of the one-time charge.
|
|
126
|
-
* @property {string} [status] - Current status of the charge (e.g., 'pending'
|
|
343
|
+
* @property {string} [status] - Current status of the charge (e.g., 'pending',
|
|
344
|
+
* 'completed').
|
|
127
345
|
* @property {string} [activated_on] - Date and time when the charge was
|
|
128
346
|
* activated. Null if not yet activated.
|
|
129
347
|
* @property {string} [cancelled_on] - Date and time when the charge was
|
|
130
348
|
* cancelled. Null if not cancelled.
|
|
131
349
|
* @property {Object} [metadata] - Additional metadata associated with the charge.
|
|
132
350
|
* @property {string} [return_url] - URL to redirect to after processing the charge.
|
|
133
|
-
* @property {boolean} [is_test] - Indicates whether the
|
|
134
|
-
* a test mode.
|
|
351
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
135
352
|
* @property {string} [pricing_type] - Pricing model for the charge (e.g., 'one_time').
|
|
136
|
-
* @property {string} [subscriber_id] -
|
|
137
|
-
* the
|
|
138
|
-
* @property {string} [entity_type] -
|
|
139
|
-
*
|
|
140
|
-
* @property {string} [entity_id] - Unique identifier for the entity
|
|
353
|
+
* @property {string} [subscriber_id] - Unique identifier for the subscriber
|
|
354
|
+
* associated with the charge.
|
|
355
|
+
* @property {string} [entity_type] - Type of the entity related to the charge
|
|
356
|
+
* (e.g., 'subscription', 'user').
|
|
357
|
+
* @property {string} [entity_id] - Unique identifier for the entity associated
|
|
358
|
+
* with the charge.
|
|
141
359
|
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
142
360
|
* @property {EntityChargePrice} [price]
|
|
143
361
|
*/
|
|
144
362
|
|
|
145
363
|
/**
|
|
146
|
-
* @typedef
|
|
364
|
+
* @typedef CreateOneTimeChargeResponse
|
|
147
365
|
* @property {Charge} [charge]
|
|
148
366
|
* @property {string} [confirm_url] - URL to which users are redirected to
|
|
149
367
|
* confirm or complete the payment or subscription process.
|
|
@@ -155,346 +373,2363 @@ const Joi = require("joi");
|
|
|
155
373
|
*/
|
|
156
374
|
|
|
157
375
|
/**
|
|
158
|
-
* @typedef
|
|
159
|
-
* @property {string}
|
|
160
|
-
*
|
|
376
|
+
* @typedef InvoiceDetailsStatusTrail
|
|
377
|
+
* @property {string} [_id] - Unique identifier for the status trail entry.
|
|
378
|
+
* @property {string} [value] - The status value of the invoice at a particular
|
|
379
|
+
* point in time.
|
|
380
|
+
* @property {string} [timestamp] - The date and time when this status was recorded.
|
|
161
381
|
*/
|
|
162
382
|
|
|
163
383
|
/**
|
|
164
|
-
* @typedef
|
|
165
|
-
* @property {string}
|
|
166
|
-
*
|
|
167
|
-
* @property {
|
|
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.
|
|
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.
|
|
225
388
|
*/
|
|
226
389
|
|
|
227
390
|
/**
|
|
228
|
-
* @typedef
|
|
229
|
-
* @property {
|
|
230
|
-
* @property {
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* @property {string} [
|
|
235
|
-
*
|
|
236
|
-
* @property {
|
|
237
|
-
* @property {
|
|
238
|
-
* @property {
|
|
239
|
-
* @property {
|
|
240
|
-
*
|
|
241
|
-
* @property {string} [
|
|
242
|
-
* @property {string} [
|
|
243
|
-
* @property {string} [
|
|
244
|
-
*
|
|
245
|
-
* @property {
|
|
246
|
-
* @property {string} [
|
|
247
|
-
*
|
|
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.
|
|
248
413
|
*/
|
|
249
414
|
|
|
250
415
|
/**
|
|
251
|
-
* @typedef
|
|
252
|
-
* @property {
|
|
253
|
-
* @property {string} [
|
|
254
|
-
* initiation of extension installation.
|
|
416
|
+
* @typedef InvoiceItemsPeriod
|
|
417
|
+
* @property {string} [start] - Start date of the invoice period.
|
|
418
|
+
* @property {string} [end] - End date of the invoice period.
|
|
255
419
|
*/
|
|
256
420
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
company_id: Joi.string().allow(""),
|
|
274
|
-
line_items: Joi.array().items(Joi.any()),
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/** @returns {BadRequestSchema} */
|
|
279
|
-
static BadRequestSchema() {
|
|
280
|
-
return Joi.object({
|
|
281
|
-
message: Joi.string().allow(""),
|
|
282
|
-
});
|
|
283
|
-
}
|
|
421
|
+
/**
|
|
422
|
+
* @typedef InvoiceItems
|
|
423
|
+
* @property {string} [_id] - Unique identifier for the invoice item.
|
|
424
|
+
* @property {string} [currency] - Currency for the amount.
|
|
425
|
+
* @property {InvoiceItemsPlan} [plan]
|
|
426
|
+
* @property {string} [name] - Name of the invoice item.
|
|
427
|
+
* @property {number} [quantity] - Number of units of the invoice item.
|
|
428
|
+
* @property {string} [description] - Description of the invoice item.
|
|
429
|
+
* @property {InvoiceItemsPeriod} [period]
|
|
430
|
+
* @property {number} [unit_amount] - Amount per unit of the invoice item.
|
|
431
|
+
* @property {number} [amount] - Total amount for the invoice item.
|
|
432
|
+
* @property {string} [type] - Type of the invoice item (e.g., subscription, extension).
|
|
433
|
+
* @property {string} [invoice_id] - Identifier for the invoice to which the item belongs.
|
|
434
|
+
* @property {string} [created_at] - Timestamp when the invoice item was created.
|
|
435
|
+
* @property {string} [modified_at] - Timestamp when the invoice item was last modified.
|
|
436
|
+
*/
|
|
284
437
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
438
|
+
/**
|
|
439
|
+
* @typedef InvoicesDataClient
|
|
440
|
+
* @property {string} [name] - Name of the client.
|
|
441
|
+
* @property {string} [email] - Email address of the client.
|
|
442
|
+
* @property {string} [phone] - Phone number of the client.
|
|
443
|
+
* @property {string[]} [address_lines] - Array of address lines for the client’s address.
|
|
444
|
+
*/
|
|
293
445
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
});
|
|
300
|
-
}
|
|
446
|
+
/**
|
|
447
|
+
* @typedef InvoicesDataPeriod
|
|
448
|
+
* @property {string} [start] - The start date and time of the invoice period.
|
|
449
|
+
* @property {string} [end] - The end date and time of the invoice period.
|
|
450
|
+
*/
|
|
301
451
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
});
|
|
308
|
-
}
|
|
452
|
+
/**
|
|
453
|
+
* @typedef InvoicesDataPaymentMethod
|
|
454
|
+
* @property {string} [pg_payment_method_id] - Payment gateway-specific payment
|
|
455
|
+
* method identifier. Nullable if not applicable.
|
|
456
|
+
*/
|
|
309
457
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
458
|
+
/**
|
|
459
|
+
* @typedef InvoicesData
|
|
460
|
+
* @property {string} [_id] - Unique identifier for the invoice.
|
|
461
|
+
* @property {Object} [documents] - Associated documents related to the invoice.
|
|
462
|
+
* @property {Object} [payment] - Payment details for the invoice.
|
|
463
|
+
* @property {number} [old_settlement] - Previous settlement amount, if applicable.
|
|
464
|
+
* @property {number} [credit_balance] - Remaining credit balance applied to the
|
|
465
|
+
* invoice, if any.
|
|
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
|
+
*/
|
|
322
504
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
505
|
+
/**
|
|
506
|
+
* @typedef Invoices
|
|
507
|
+
* @property {InvoicesData[]} [data]
|
|
508
|
+
* @property {number} [start] - Index of the first item in the results.
|
|
509
|
+
* @property {number} [end] - Index of the last item in the results.
|
|
510
|
+
* @property {number} [limit] - Number of items per page.
|
|
511
|
+
* @property {number} [page] - Page number of the results.
|
|
512
|
+
* @property {number} [total] - Total number of items available.
|
|
513
|
+
*/
|
|
332
514
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
});
|
|
339
|
-
}
|
|
515
|
+
/**
|
|
516
|
+
* @typedef Phone
|
|
517
|
+
* @property {string} [phone_number] - The phone number of the contact.
|
|
518
|
+
* @property {string} [phone_country_code] - The country code of the phone number.
|
|
519
|
+
*/
|
|
340
520
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
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
|
-
}
|
|
521
|
+
/**
|
|
522
|
+
* @typedef SubscriptionBillingAddress
|
|
523
|
+
* @property {string} [country] - Name of the country for the billing address.
|
|
524
|
+
* @property {string} [country_code] - ISO country code for the billing address.
|
|
525
|
+
* @property {string} [state] - State or province for the billing address.
|
|
526
|
+
* @property {string} [city] - City for the billing address.
|
|
527
|
+
* @property {string} [line1] - First line of the street address.
|
|
528
|
+
* @property {string} [line2] - Second line of the street address (optional).
|
|
529
|
+
* @property {string} [postal_code] - Postal or ZIP code for the billing address.
|
|
530
|
+
*/
|
|
367
531
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
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
|
-
}
|
|
532
|
+
/**
|
|
533
|
+
* @typedef SubscriptionCustomer
|
|
534
|
+
* @property {Phone} [phone]
|
|
535
|
+
* @property {SubscriptionBillingAddress} [billing_address]
|
|
536
|
+
* @property {string} [_id] - Unique identifier for the subscriber.
|
|
537
|
+
* @property {string} [unique_id] - Identifier specific to the company.
|
|
538
|
+
* @property {string} [type] - Type of the customer (e.g., developer, company).
|
|
539
|
+
* @property {string} [name] - Name of the customer.
|
|
540
|
+
* @property {string} [email] - Email address of the customer.
|
|
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
|
+
*/
|
|
394
552
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
553
|
+
/**
|
|
554
|
+
* @typedef SubscriptionCustomerCreate
|
|
555
|
+
* @property {Phone} [phone]
|
|
556
|
+
* @property {SubscriptionBillingAddress} [billing_address]
|
|
557
|
+
* @property {string} [unique_id] - Company id for the customer, generated by the client.
|
|
558
|
+
* @property {string} [type] - Type of company
|
|
559
|
+
* @property {string} [name] - Name of the company
|
|
560
|
+
* @property {string} [email] - Email address of the company
|
|
561
|
+
*/
|
|
402
562
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
563
|
+
/**
|
|
564
|
+
* @typedef SubscriptionCurrentPeriod
|
|
565
|
+
* @property {string} [start] - The start date and time of the current
|
|
566
|
+
* subscription period.
|
|
567
|
+
* @property {string} [end] - The end date and time of the current subscription period.
|
|
568
|
+
*/
|
|
409
569
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
570
|
+
/**
|
|
571
|
+
* @typedef SubscriptionPauseCollection
|
|
572
|
+
* @property {string} [behavior] - Defines the behavior of the subscription when
|
|
573
|
+
* it is paused. Possible values could include `keep_as_draft` or `cancel`.
|
|
574
|
+
* @property {string} [resume_at] - The date and time when the paused
|
|
575
|
+
* subscription is scheduled to resume.
|
|
576
|
+
*/
|
|
416
577
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
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
|
-
}
|
|
578
|
+
/**
|
|
579
|
+
* @typedef SubscriptionTrial
|
|
580
|
+
* @property {string} [start] - The start date and time of the subscription trial period.
|
|
581
|
+
* @property {string} [end] - The end date and time of the subscription trial period.
|
|
582
|
+
*/
|
|
431
583
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
is_test: Joi.boolean(),
|
|
441
|
-
return_url: Joi.string().allow("").required(),
|
|
442
|
-
});
|
|
443
|
-
}
|
|
584
|
+
/**
|
|
585
|
+
* @typedef SubscriptionInvoiceSettings
|
|
586
|
+
* @property {boolean} [generation] - Indicates whether invoices are
|
|
587
|
+
* automatically generated for the subscription.
|
|
588
|
+
* @property {boolean} [charging] - Indicates whether charging is enabled for
|
|
589
|
+
* the subscription. This setting determines if charges are applied based on
|
|
590
|
+
* the invoice settings.
|
|
591
|
+
*/
|
|
444
592
|
|
|
445
|
-
|
|
446
|
-
|
|
593
|
+
/**
|
|
594
|
+
* @typedef Subscription
|
|
595
|
+
* @property {Object} [meta] - Additional metadata related to the subscription.
|
|
596
|
+
* @property {SubscriptionCurrentPeriod} [current_period]
|
|
597
|
+
* @property {SubscriptionPauseCollection} [pause_collection]
|
|
598
|
+
* @property {SubscriptionTrial} [trial]
|
|
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
|
+
*/
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* @typedef SubscriptionStatus
|
|
635
|
+
* @property {boolean} [is_enabled] - Indicates whether the subscription status
|
|
636
|
+
* is enabled.
|
|
637
|
+
* @property {Subscription} [subscription]
|
|
638
|
+
* @property {InvoicesData} [latest_invoice]
|
|
639
|
+
* @property {Plan} [next_plan]
|
|
640
|
+
* @property {Subscription[]} [current_subscriptions] - List of current
|
|
641
|
+
* subscriptions associated with the user.
|
|
642
|
+
* @property {number} [mandate_amount] - The amount mandated for the
|
|
643
|
+
* subscription or service.
|
|
644
|
+
* @property {string} [message] - A message providing additional context or
|
|
645
|
+
* information about the subscription status.
|
|
646
|
+
*/
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* @typedef SubscriptionLimitApplication
|
|
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() {
|
|
447
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(),
|
|
448
2233
|
_id: Joi.string().allow(""),
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
entity_type: Joi.string().allow(""),
|
|
452
|
-
entity_id: Joi.string().allow(""),
|
|
2234
|
+
type: Joi.string().allow(""),
|
|
2235
|
+
unique_id: Joi.string().allow(""),
|
|
453
2236
|
name: Joi.string().allow(""),
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
price: BillingPlatformModel.EntityChargePrice(),
|
|
458
|
-
recurring: BillingPlatformModel.ChargeRecurring(),
|
|
459
|
-
status: Joi.string().allow(""),
|
|
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(),
|
|
2237
|
+
email: Joi.string().allow(""),
|
|
2238
|
+
business_country_info: BillingPlatformModel.BusinessCountryInfo(),
|
|
2239
|
+
created_at: Joi.string().allow(""),
|
|
465
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() {
|
|
2274
|
+
return Joi.object({
|
|
2275
|
+
transaction_id: Joi.string().allow(""),
|
|
2276
|
+
aggregator: Joi.string().allow(""),
|
|
2277
|
+
aggregator_order_id: Joi.string().allow(""),
|
|
2278
|
+
receipt_date: Joi.string().allow(""),
|
|
2279
|
+
unique_transaction_reference: Joi.string().allow(""),
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
/** @returns {CreditTransaction} */
|
|
2284
|
+
static CreditTransaction() {
|
|
2285
|
+
return Joi.object({
|
|
2286
|
+
entity: Joi.any(),
|
|
2287
|
+
author: BillingPlatformModel.Author(),
|
|
2288
|
+
_id: Joi.string().allow(""),
|
|
2289
|
+
amount: Joi.number(),
|
|
2290
|
+
currency: Joi.string().allow(""),
|
|
2291
|
+
subscriber_id: Joi.string().allow(""),
|
|
2292
|
+
description: Joi.string().allow(""),
|
|
2293
|
+
is_test: Joi.string().allow(""),
|
|
2294
|
+
ending_balance: BillingPlatformModel.EndingBalance(),
|
|
2295
|
+
payment: BillingPlatformModel.PaymentData(),
|
|
2296
|
+
type: Joi.string().allow(""),
|
|
466
2297
|
created_at: Joi.string().allow(""),
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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(),
|
|
471
2330
|
});
|
|
472
2331
|
}
|
|
473
2332
|
|
|
474
|
-
/** @returns {
|
|
475
|
-
static
|
|
2333
|
+
/** @returns {GlobalSettingsData} */
|
|
2334
|
+
static GlobalSettingsData() {
|
|
476
2335
|
return Joi.object({
|
|
2336
|
+
payment: BillingPlatformModel.GlobalSettingsPayment(),
|
|
2337
|
+
freeze_panel: Joi.boolean(),
|
|
477
2338
|
_id: Joi.string().allow(""),
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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),
|
|
481
2404
|
name: Joi.string().allow(""),
|
|
2405
|
+
is_default: Joi.boolean(),
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
/** @returns {SubscriptionMethods} */
|
|
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({
|
|
482
2450
|
status: Joi.string().allow(""),
|
|
483
|
-
|
|
484
|
-
|
|
2451
|
+
data: BillingPlatformModel.PlanChangeData(),
|
|
2452
|
+
});
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2455
|
+
/** @returns {TransactionMeta} */
|
|
2456
|
+
static TransactionMeta() {
|
|
2457
|
+
return Joi.object({
|
|
2458
|
+
invoice_id: Joi.string().allow(""),
|
|
2459
|
+
});
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
/** @returns {PaymentTransactionDetails} */
|
|
2463
|
+
static PaymentTransactionDetails() {
|
|
2464
|
+
return Joi.object({
|
|
2465
|
+
aggregator: Joi.any(),
|
|
2466
|
+
currency: Joi.string().allow(""),
|
|
2467
|
+
current_status: Joi.string().allow(""),
|
|
2468
|
+
_id: Joi.string().allow(""),
|
|
2469
|
+
subscriber_id: Joi.string().allow(""),
|
|
2470
|
+
amount: Joi.number(),
|
|
2471
|
+
entity_type: Joi.string().allow(""),
|
|
2472
|
+
collection_type: Joi.string().allow(""),
|
|
2473
|
+
meta: BillingPlatformModel.TransactionMeta(),
|
|
485
2474
|
created_at: Joi.string().allow(""),
|
|
486
2475
|
modified_at: Joi.string().allow(""),
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
/** @returns {PaymentItems} */
|
|
2480
|
+
static PaymentItems() {
|
|
2481
|
+
return Joi.object({
|
|
2482
|
+
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
|
+
status: Joi.string().allow(""),
|
|
2698
|
+
aggregator_order_id: Joi.string().allow(""),
|
|
2699
|
+
amount: Joi.number(),
|
|
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(""),
|
|
487
2716
|
subscriber_id: Joi.string().allow(""),
|
|
488
|
-
|
|
489
|
-
|
|
2717
|
+
amount: Joi.number(),
|
|
2718
|
+
currency: Joi.string().allow(""),
|
|
2719
|
+
aggregator: Joi.string().allow(""),
|
|
2720
|
+
aggregator_order_id: Joi.string().allow(""),
|
|
2721
|
+
created_at: Joi.string().allow(""),
|
|
2722
|
+
modified_at: Joi.string().allow(""),
|
|
2723
|
+
__v: Joi.number(),
|
|
2724
|
+
aggregator_status: Joi.string().allow(""),
|
|
2725
|
+
current_status: Joi.string().allow(""),
|
|
490
2726
|
});
|
|
491
2727
|
}
|
|
492
2728
|
|
|
493
|
-
/** @returns {
|
|
494
|
-
static
|
|
2729
|
+
/** @returns {DefaultReq} */
|
|
2730
|
+
static DefaultReq() {
|
|
495
2731
|
return Joi.object({
|
|
496
|
-
|
|
497
|
-
confirm_url: Joi.string().allow(""),
|
|
2732
|
+
payment_method_id: Joi.string().allow(""),
|
|
498
2733
|
});
|
|
499
2734
|
}
|
|
500
2735
|
}
|