@gofynd/fdk-client-javascript 1.4.8-beta.2 → 1.4.8
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 +26 -1
- package/package.json +2 -2
- package/sdk/application/ApplicationClient.d.ts +8 -0
- package/sdk/application/ApplicationClient.js +14 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +20 -20
- package/sdk/application/Cart/CartApplicationClient.js +20 -20
- package/sdk/application/Cart/CartApplicationModel.d.ts +2446 -664
- package/sdk/application/Cart/CartApplicationModel.js +783 -552
- package/sdk/application/Cart/CartApplicationValidator.d.ts +268 -194
- package/sdk/application/Cart/CartApplicationValidator.js +100 -114
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +53 -53
- package/sdk/application/Catalog/CatalogApplicationClient.js +53 -53
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2012 -503
- package/sdk/application/Catalog/CatalogApplicationModel.js +603 -453
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +64 -64
- package/sdk/application/Catalog/CatalogApplicationValidator.js +32 -32
- package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
- package/sdk/application/Common/CommonApplicationClient.js +2 -2
- package/sdk/application/Common/CommonApplicationModel.d.ts +170 -90
- package/sdk/application/Common/CommonApplicationModel.js +59 -58
- package/sdk/application/Common/CommonApplicationValidator.d.ts +8 -5
- package/sdk/application/Common/CommonApplicationValidator.js +3 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +2 -2
- package/sdk/application/Communication/CommunicationApplicationClient.js +2 -2
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +170 -35
- package/sdk/application/Communication/CommunicationApplicationModel.js +54 -33
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +15 -15
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +15 -15
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +624 -443
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +259 -248
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +32 -24
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +14 -13
- package/sdk/application/Content/ContentApplicationClient.d.ts +16 -16
- package/sdk/application/Content/ContentApplicationClient.js +16 -16
- package/sdk/application/Content/ContentApplicationModel.d.ts +1206 -281
- package/sdk/application/Content/ContentApplicationModel.js +342 -276
- package/sdk/application/Content/ContentApplicationValidator.d.ts +28 -17
- package/sdk/application/Content/ContentApplicationValidator.js +11 -10
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +3 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +146 -37
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +38 -36
- package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
- package/sdk/application/Lead/LeadApplicationClient.js +3 -3
- package/sdk/application/Lead/LeadApplicationModel.d.ts +195 -134
- package/sdk/application/Lead/LeadApplicationModel.js +110 -67
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +8 -8
- package/sdk/application/Lead/LeadApplicationValidator.js +4 -4
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +10 -10
- package/sdk/application/Logistic/LogisticApplicationClient.js +10 -10
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +1039 -221
- package/sdk/application/Logistic/LogisticApplicationModel.js +342 -199
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +76 -82
- package/sdk/application/Logistic/LogisticApplicationValidator.js +38 -41
- package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
- package/sdk/application/Order/OrderApplicationClient.js +10 -10
- package/sdk/application/Order/OrderApplicationModel.d.ts +1401 -324
- package/sdk/application/Order/OrderApplicationModel.js +392 -316
- package/sdk/application/Order/OrderApplicationValidator.d.ts +32 -30
- package/sdk/application/Order/OrderApplicationValidator.js +15 -14
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +43 -43
- package/sdk/application/Payment/PaymentApplicationClient.js +43 -43
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +1111 -1022
- package/sdk/application/Payment/PaymentApplicationModel.js +537 -521
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +82 -49
- package/sdk/application/Payment/PaymentApplicationValidator.js +30 -30
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +28 -7
- package/sdk/application/Rewards/RewardsApplicationModel.js +7 -7
- package/sdk/application/Share/ShareApplicationModel.d.ts +178 -38
- package/sdk/application/Share/ShareApplicationModel.js +53 -37
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -2
- package/sdk/application/Share/ShareApplicationValidator.js +2 -1
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +4 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +14 -8
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +528 -287
- package/sdk/application/Theme/ThemeApplicationModel.js +208 -172
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +17 -12
- package/sdk/application/Theme/ThemeApplicationValidator.js +8 -6
- package/sdk/application/User/UserApplicationClient.d.ts +36 -36
- package/sdk/application/User/UserApplicationClient.js +36 -36
- package/sdk/application/User/UserApplicationModel.d.ts +1062 -255
- package/sdk/application/User/UserApplicationModel.js +298 -244
- package/sdk/application/User/UserApplicationValidator.d.ts +80 -80
- package/sdk/application/User/UserApplicationValidator.js +40 -40
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +1 -1
- package/sdk/application/Webhook/WebhookApplicationClient.js +1 -1
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +20 -5
- package/sdk/application/Webhook/WebhookApplicationModel.js +5 -5
- package/sdk/common/Clickstream.js +95 -15
- package/sdk/common/Constant.d.ts +9 -0
- package/sdk/common/Constant.js +11 -0
- package/sdk/common/Utility.js +19 -0
- package/sdk/common/utils.js +8 -1
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +28 -7
- package/sdk/partner/Lead/LeadPartnerModel.js +7 -7
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +75 -8
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +59 -7
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +2 -2
- package/sdk/partner/PartnerClient.d.ts +8 -0
- package/sdk/partner/PartnerClient.js +14 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +20 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +158 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +45 -6
- package/sdk/partner/Theme/ThemePartnerModel.js +33 -4
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +28 -7
- package/sdk/partner/Webhook/WebhookPartnerModel.js +7 -7
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +28 -7
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +7 -7
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +21 -10
- package/sdk/platform/Billing/BillingPlatformClient.js +167 -83
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +2849 -565
- package/sdk/platform/Billing/BillingPlatformModel.js +935 -556
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +30 -14
- package/sdk/platform/Billing/BillingPlatformValidator.js +31 -16
- package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -7
- package/sdk/platform/Cart/CartPlatformModel.js +8 -8
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +20 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +37 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +16 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +12 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +41 -1
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +46 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.js +14 -11
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +17 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +28 -7
- package/sdk/platform/Communication/CommunicationPlatformModel.js +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +7 -7
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -97
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +77 -782
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +24 -701
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +7 -539
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +1 -183
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +0 -134
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -79
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -15
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -13
- package/sdk/platform/Content/ContentPlatformModel.d.ts +60 -17
- package/sdk/platform/Content/ContentPlatformModel.js +30 -15
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +28 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +7 -7
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +127 -25
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +37 -25
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +30 -30
- package/sdk/platform/Finance/FinancePlatformClient.js +30 -30
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1601 -348
- package/sdk/platform/Finance/FinancePlatformModel.js +488 -352
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +28 -7
- package/sdk/platform/Lead/LeadPlatformModel.js +7 -7
- package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -0
- package/sdk/platform/Order/OrderPlatformClient.js +165 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +631 -39
- package/sdk/platform/Order/OrderPlatformModel.js +367 -41
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +28 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +30 -9
- package/sdk/platform/Payment/PaymentPlatformModel.js +9 -9
- package/sdk/platform/PlatformClient.d.ts +8 -0
- package/sdk/platform/PlatformClient.js +14 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +28 -7
- package/sdk/platform/Rewards/RewardsPlatformModel.js +7 -7
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +12 -9
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +12 -9
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +139 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +98 -21
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +4 -4
- package/sdk/platform/Share/SharePlatformModel.d.ts +28 -7
- package/sdk/platform/Share/SharePlatformModel.js +7 -7
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +18 -5
- package/sdk/platform/Theme/ThemePlatformModel.js +7 -4
- package/sdk/platform/User/UserPlatformModel.d.ts +18 -20
- package/sdk/platform/User/UserPlatformModel.js +9 -11
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +54 -33
- package/sdk/platform/Webhook/WebhookPlatformModel.js +33 -33
- package/sdk/public/Billing/BillingPublicClient.d.ts +11 -0
- package/sdk/public/Billing/BillingPublicClient.js +80 -0
- package/sdk/public/Billing/BillingPublicModel.d.ts +584 -99
- package/sdk/public/Billing/BillingPublicModel.js +252 -87
- package/sdk/public/Billing/BillingPublicValidator.d.ts +10 -1
- package/sdk/public/Billing/BillingPublicValidator.js +12 -0
- package/sdk/public/PublicClient.d.ts +0 -2
- package/sdk/public/PublicClient.js +0 -4
- package/sdk/public/index.d.ts +0 -1
- package/sdk/public/index.js +0 -2
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +0 -87
- package/sdk/public/Inventory/InventoryPublicClient.js +0 -529
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +0 -393
- package/sdk/public/Inventory/InventoryPublicModel.js +0 -448
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +0 -91
- package/sdk/public/Inventory/InventoryPublicValidator.js +0 -85
|
@@ -2,24 +2,24 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef CompanyInfo
|
|
5
|
-
* @property {string} [company_name]
|
|
6
|
-
* @property {string} [gstin]
|
|
7
|
-
* @property {string} [address]
|
|
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
8
|
* @property {AddressDetails} [address_details]
|
|
9
|
-
* @property {string} [pan]
|
|
10
|
-
* @property {string} [phone]
|
|
11
|
-
* @property {string} [email]
|
|
12
|
-
* @property {string} [cin]
|
|
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
13
|
*/
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @typedef AddressDetails
|
|
17
|
-
* @property {string} [address_line_1]
|
|
18
|
-
* @property {string} [address_line_2]
|
|
19
|
-
* @property {string} [city]
|
|
20
|
-
* @property {string} [pincode]
|
|
21
|
-
* @property {string} [state]
|
|
22
|
-
* @property {string} [country]
|
|
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
23
|
*/
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -31,81 +31,89 @@ const Joi = require("joi");
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* @typedef InvoiceDetailsData
|
|
34
|
-
* @property {number} [attemp]
|
|
35
|
-
* @property {Object} [documents]
|
|
36
|
-
* @property {Object} [payment]
|
|
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
37
|
* @property {Period} [period]
|
|
38
38
|
* @property {Client} [client]
|
|
39
|
-
* @property {Object} [discount]
|
|
40
|
-
* @property {Object} [taxation]
|
|
41
|
-
* @property {string} [_id]
|
|
42
|
-
* @property {boolean} [auto_advance]
|
|
43
|
-
*
|
|
44
|
-
* @property {string} [
|
|
45
|
-
*
|
|
46
|
-
* @property {string} [
|
|
47
|
-
*
|
|
48
|
-
* @property {
|
|
49
|
-
* @property {
|
|
50
|
-
* @property {string} [
|
|
51
|
-
* @property {
|
|
52
|
-
* @property {
|
|
53
|
-
* @property {
|
|
54
|
-
* @property {
|
|
55
|
-
* @property {
|
|
56
|
-
* @property {
|
|
57
|
-
* @property {number} [
|
|
58
|
-
* @property {
|
|
59
|
-
* @property {number} [
|
|
60
|
-
* @property {
|
|
61
|
-
* @property {
|
|
62
|
-
* @property {
|
|
63
|
-
* @property {string} [
|
|
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)
|
|
64
68
|
*/
|
|
65
69
|
|
|
66
70
|
/**
|
|
67
71
|
* @typedef Client
|
|
68
|
-
* @property {string} [name]
|
|
69
|
-
* @property {string} [email]
|
|
70
|
-
* @property {string} [phone]
|
|
71
|
-
* @property {string[]} [address_lines]
|
|
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
|
|
72
76
|
*/
|
|
73
77
|
|
|
74
78
|
/**
|
|
75
79
|
* @typedef Period
|
|
76
|
-
* @property {string} [start]
|
|
77
|
-
* @property {string} [end]
|
|
80
|
+
* @property {string} [start] - Start date of the period
|
|
81
|
+
* @property {string} [end] - End date of the period
|
|
78
82
|
*/
|
|
79
83
|
|
|
80
84
|
/**
|
|
81
85
|
* @typedef StatusTrail
|
|
82
|
-
* @property {string} [value]
|
|
83
|
-
*
|
|
84
|
-
* @property {string} [
|
|
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
|
|
85
91
|
*/
|
|
86
92
|
|
|
87
93
|
/**
|
|
88
94
|
* @typedef PaymentCollectRes
|
|
89
|
-
* @property {string} [transaction_id]
|
|
90
|
-
* @property {string} [current_status]
|
|
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)
|
|
91
98
|
*/
|
|
92
99
|
|
|
93
100
|
/**
|
|
94
101
|
* @typedef SubscriptionChargeRes
|
|
95
|
-
* @property {string} [_id]
|
|
96
|
-
* @property {string} [product_suit_id]
|
|
97
|
-
*
|
|
98
|
-
* @property {string} [
|
|
99
|
-
* @property {string} [
|
|
100
|
-
* @property {string} [
|
|
101
|
-
* @property {
|
|
102
|
-
* @property {
|
|
103
|
-
* @property {string} [
|
|
104
|
-
* @property {
|
|
105
|
-
* @property {
|
|
106
|
-
* @property {string} [
|
|
107
|
-
* @property {string} [
|
|
108
|
-
* @property {
|
|
102
|
+
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
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
|
|
110
|
+
* @property {string} [activated_on] - Date when the charge was activated
|
|
111
|
+
* @property {string} [cancelled_on] - Date when the charge was cancelled
|
|
112
|
+
* @property {boolean} [is_test] - Indicates if the charge is for testing purposes
|
|
113
|
+
* @property {string} [created_at] - Timestamp when the charge was created
|
|
114
|
+
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
115
|
+
* @property {string} [company_id] - Company id
|
|
116
|
+
* @property {Object[]} [line_items] - List of line items associated with the charge
|
|
109
117
|
*/
|
|
110
118
|
|
|
111
119
|
/**
|
|
@@ -116,34 +124,45 @@ const Joi = require("joi");
|
|
|
116
124
|
|
|
117
125
|
/**
|
|
118
126
|
* @typedef DowngradeRes
|
|
119
|
-
* @property {string} [_id]
|
|
120
|
-
* @property {string} [status]
|
|
121
|
-
*
|
|
122
|
-
* @property {
|
|
123
|
-
*
|
|
124
|
-
* @property {
|
|
125
|
-
* @property {string} [
|
|
126
|
-
* @property {string} [
|
|
127
|
-
*
|
|
128
|
-
* @property {string} [
|
|
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
|
|
129
142
|
*/
|
|
130
143
|
|
|
131
144
|
/**
|
|
132
145
|
* @typedef PaymentStatusData
|
|
133
|
-
* @property {string} [_id]
|
|
134
|
-
* @property {string} [journey]
|
|
135
|
-
* @property {Object[]} [webhook_response]
|
|
136
|
-
*
|
|
137
|
-
* @property {string} [
|
|
138
|
-
*
|
|
139
|
-
* @property {string} [
|
|
140
|
-
*
|
|
141
|
-
* @property {string} [
|
|
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
|
|
142
161
|
*/
|
|
143
162
|
|
|
144
163
|
/**
|
|
145
164
|
* @typedef PaymentStatusResponse
|
|
146
|
-
* @property {string} [status]
|
|
165
|
+
* @property {string} [status] - The status of the payment.
|
|
147
166
|
* @property {PaymentStatusData} [data]
|
|
148
167
|
*/
|
|
149
168
|
|
|
@@ -161,92 +180,113 @@ const Joi = require("joi");
|
|
|
161
180
|
|
|
162
181
|
/**
|
|
163
182
|
* @typedef InternalServerError
|
|
164
|
-
* @property {string} [message] - Internal server
|
|
183
|
+
* @property {string} [message] - Internal server error
|
|
165
184
|
* @property {string} [code] - Error code
|
|
166
185
|
*/
|
|
167
186
|
|
|
168
187
|
/**
|
|
169
188
|
* @typedef CheckValidityResponse
|
|
170
|
-
* @property {boolean} [is_valid]
|
|
171
|
-
* @property {number} [discount_amount]
|
|
189
|
+
* @property {boolean} [is_valid] - Indicates whether the request is valid.
|
|
190
|
+
* @property {number} [discount_amount] - The amount of discount applicable.
|
|
172
191
|
*/
|
|
173
192
|
|
|
174
193
|
/**
|
|
175
194
|
* @typedef PlanRecurring
|
|
176
|
-
* @property {string} [interval]
|
|
195
|
+
* @property {string} [interval] - The interval at which the plan recurs.
|
|
177
196
|
* @property {number} [interval_count]
|
|
178
197
|
*/
|
|
179
198
|
|
|
180
199
|
/**
|
|
181
200
|
* @typedef PlanMeta
|
|
182
|
-
* @property {string} [seller_status]
|
|
183
|
-
* @property {string} [company]
|
|
184
|
-
* @property {string} [plan_platform_display_name]
|
|
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.
|
|
185
212
|
*/
|
|
186
213
|
|
|
187
214
|
/**
|
|
188
215
|
* @typedef Plan
|
|
189
|
-
* @property {Object[]} [fee_components]
|
|
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.
|
|
190
218
|
* @property {PlanRecurring} [recurring]
|
|
191
|
-
* @property {boolean} [is_trial_plan]
|
|
192
|
-
* @property {string} [plan_group]
|
|
193
|
-
* @property {string[]} [tag_lines]
|
|
194
|
-
*
|
|
195
|
-
* @property {
|
|
196
|
-
* @property {
|
|
197
|
-
*
|
|
198
|
-
* @property {
|
|
199
|
-
* @property {
|
|
200
|
-
* @property {
|
|
201
|
-
* @property {string} [
|
|
202
|
-
* @property {string} [
|
|
203
|
-
* @property {string} [
|
|
204
|
-
* @property {
|
|
205
|
-
* @property {
|
|
206
|
-
* @property {string} [
|
|
207
|
-
* @property {string} [
|
|
208
|
-
* @property {
|
|
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.
|
|
209
241
|
* @property {Taxation} [taxation]
|
|
210
242
|
* @property {OneTimeFees} [one_time_fees]
|
|
211
243
|
* @property {CreditLine} [credit_line]
|
|
212
|
-
* @property {string} [current_status]
|
|
213
|
-
*
|
|
214
|
-
* @property {
|
|
215
|
-
*
|
|
216
|
-
* @property {string} [
|
|
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.
|
|
217
253
|
* @property {PlanMeta} [meta]
|
|
218
|
-
* @property {string} [created_by]
|
|
254
|
+
* @property {string} [created_by] - Identifier of the user who created the plan.
|
|
219
255
|
*/
|
|
220
256
|
|
|
221
257
|
/**
|
|
222
258
|
* @typedef SubscriptionTrialPeriod
|
|
223
|
-
* @property {string} [start_date]
|
|
224
|
-
* @property {string} [end_date]
|
|
259
|
+
* @property {string} [start_date] - The start date and time of the trial period.
|
|
260
|
+
* @property {string} [end_date] - The end date and time of the trial period.
|
|
225
261
|
*/
|
|
226
262
|
|
|
227
263
|
/**
|
|
228
264
|
* @typedef EntityChargePrice
|
|
229
|
-
* @property {number} [amount] -
|
|
230
|
-
* @property {string} [currency_code]
|
|
265
|
+
* @property {number} [amount] - The amount for the price. The minimum value is 1.
|
|
266
|
+
* @property {string} [currency_code] - The currency code for the price
|
|
231
267
|
*/
|
|
232
268
|
|
|
233
269
|
/**
|
|
234
270
|
* @typedef OneTimeChargeItem
|
|
235
|
-
* @property {string} [name]
|
|
236
|
-
* @property {string} [term]
|
|
237
|
-
* @property {string} [pricing_type]
|
|
271
|
+
* @property {string} [name] - The name of the one-time charge item.
|
|
272
|
+
* @property {string} [term] - The term or description of the charge.
|
|
273
|
+
* @property {string} [pricing_type] - The type of pricing for the charge item.
|
|
238
274
|
* @property {EntityChargePrice} [price]
|
|
239
|
-
* @property {number} [capped_amount]
|
|
240
|
-
*
|
|
241
|
-
* @property {
|
|
275
|
+
* @property {number} [capped_amount] - The maximum amount that can be charged
|
|
276
|
+
* for this item, if applicable.
|
|
277
|
+
* @property {boolean} [is_test] - Indicates whether the charge item is for
|
|
278
|
+
* testing purposes.
|
|
279
|
+
* @property {Object} [metadata] - Additional metadata associated with the charge item.
|
|
242
280
|
*/
|
|
243
281
|
|
|
244
282
|
/**
|
|
245
283
|
* @typedef CreateOneTimeCharge
|
|
246
|
-
* @property {string} [name]
|
|
284
|
+
* @property {string} [name] - The name of the one-time charge to be created.
|
|
247
285
|
* @property {OneTimeChargeItem} [charge]
|
|
248
|
-
* @property {boolean} [is_test]
|
|
249
|
-
*
|
|
286
|
+
* @property {boolean} [is_test] - Indicates whether the charge creation is for
|
|
287
|
+
* testing purposes.
|
|
288
|
+
* @property {string} [return_url] - URL to which the user will be redirected
|
|
289
|
+
* after creating the charge.
|
|
250
290
|
*/
|
|
251
291
|
|
|
252
292
|
/**
|
|
@@ -257,58 +297,74 @@ const Joi = require("joi");
|
|
|
257
297
|
|
|
258
298
|
/**
|
|
259
299
|
* @typedef ChargeDetails
|
|
260
|
-
* @property {string} [_id]
|
|
261
|
-
* @property {string} [entity_type]
|
|
262
|
-
*
|
|
263
|
-
* @property {string} [
|
|
264
|
-
*
|
|
265
|
-
* @property {string} [
|
|
266
|
-
* @property {string} [
|
|
300
|
+
* @property {string} [_id] - Unique identifier for the charge.
|
|
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.
|
|
306
|
+
* @property {string} [term] - Description of the charge term.
|
|
307
|
+
* @property {string} [charge_type] - The type of charge (e.g., 'standalone',
|
|
308
|
+
* 'recurring').
|
|
309
|
+
* @property {string} [pricing_type] - The pricing model for the charge (e.g.,
|
|
310
|
+
* 'one_time', 'recurring').
|
|
267
311
|
* @property {EntityChargePrice} [price]
|
|
268
312
|
* @property {ChargeRecurring} [recurring]
|
|
269
|
-
* @property {string} [status]
|
|
270
|
-
* @property {number} [capped_amount]
|
|
271
|
-
* @property {string} [activated_on]
|
|
272
|
-
* @property {string} [cancelled_on]
|
|
273
|
-
* @property {string} [billing_date]
|
|
313
|
+
* @property {string} [status] - Current status of the charge.
|
|
314
|
+
* @property {number} [capped_amount] - Maximum amount that can be charged, if applicable.
|
|
315
|
+
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
316
|
+
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
317
|
+
* @property {string} [billing_date] - Date and time when the charge was billed.
|
|
274
318
|
* @property {SubscriptionTrialPeriod} [current_period]
|
|
275
|
-
* @property {string} [modified_at]
|
|
276
|
-
*
|
|
277
|
-
* @property {
|
|
278
|
-
* @property {
|
|
279
|
-
* @property {
|
|
280
|
-
* @property {
|
|
319
|
+
* @property {string} [modified_at] - Date and time when the charge details were
|
|
320
|
+
* last modified.
|
|
321
|
+
* @property {string} [created_at] - Date and time when the charge was created.
|
|
322
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
323
|
+
* @property {string} [company_id] - Company id.
|
|
324
|
+
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
325
|
+
* @property {number} [__v] - Internal version key for the charge record.
|
|
281
326
|
*/
|
|
282
327
|
|
|
283
328
|
/**
|
|
284
329
|
* @typedef OneTimeChargeEntity
|
|
285
|
-
* @property {string} [term]
|
|
286
|
-
* @property {string} [charge_type]
|
|
287
|
-
*
|
|
288
|
-
* @property {
|
|
289
|
-
*
|
|
290
|
-
* @property {string} [
|
|
291
|
-
*
|
|
292
|
-
* @property {string} [
|
|
293
|
-
* @property {string} [
|
|
294
|
-
*
|
|
295
|
-
* @property {
|
|
296
|
-
* @property {string} [
|
|
297
|
-
* @property {
|
|
298
|
-
* @property {string} [
|
|
299
|
-
*
|
|
300
|
-
* @property {string} [
|
|
301
|
-
*
|
|
302
|
-
* @property {string} [
|
|
303
|
-
*
|
|
304
|
-
* @property {Object} [
|
|
330
|
+
* @property {string} [term] - Description of the charge term or usage.
|
|
331
|
+
* @property {string} [charge_type] - Type of the charge (e.g., 'subscription',
|
|
332
|
+
* 'extension').
|
|
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.
|
|
337
|
+
* @property {string} [created_at] - Date and time when the charge entity was created.
|
|
338
|
+
* @property {string} [modified_at] - Date and time when the charge entity was
|
|
339
|
+
* last modified.
|
|
340
|
+
* @property {number} [__v] - Internal version key for the charge record.
|
|
341
|
+
* @property {string} [_id] - Unique identifier for the charge entity.
|
|
342
|
+
* @property {string} [name] - The name of the one-time charge.
|
|
343
|
+
* @property {string} [status] - Current status of the charge (e.g., 'pending',
|
|
344
|
+
* 'completed').
|
|
345
|
+
* @property {string} [activated_on] - Date and time when the charge was
|
|
346
|
+
* activated. Null if not yet activated.
|
|
347
|
+
* @property {string} [cancelled_on] - Date and time when the charge was
|
|
348
|
+
* cancelled. Null if not cancelled.
|
|
349
|
+
* @property {Object} [metadata] - Additional metadata associated with the charge.
|
|
350
|
+
* @property {string} [return_url] - URL to redirect to after processing the charge.
|
|
351
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
352
|
+
* @property {string} [pricing_type] - Pricing model for the charge (e.g., 'one_time').
|
|
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.
|
|
359
|
+
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
305
360
|
* @property {EntityChargePrice} [price]
|
|
306
361
|
*/
|
|
307
362
|
|
|
308
363
|
/**
|
|
309
364
|
* @typedef CreateOneTimeChargeResponse
|
|
310
365
|
* @property {Charge} [charge]
|
|
311
|
-
* @property {string} [confirm_url]
|
|
366
|
+
* @property {string} [confirm_url] - URL to which users are redirected to
|
|
367
|
+
* confirm or complete the payment or subscription process.
|
|
312
368
|
*/
|
|
313
369
|
|
|
314
370
|
/**
|
|
@@ -318,160 +374,179 @@ const Joi = require("joi");
|
|
|
318
374
|
|
|
319
375
|
/**
|
|
320
376
|
* @typedef InvoiceDetailsStatusTrail
|
|
321
|
-
* @property {string} [_id]
|
|
322
|
-
* @property {string} [value]
|
|
323
|
-
*
|
|
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.
|
|
324
381
|
*/
|
|
325
382
|
|
|
326
383
|
/**
|
|
327
384
|
* @typedef InvoiceItemsPlanRecurring
|
|
328
|
-
* @property {string} [interval]
|
|
329
|
-
*
|
|
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.
|
|
330
388
|
*/
|
|
331
389
|
|
|
332
390
|
/**
|
|
333
391
|
* @typedef InvoiceItemsPlan
|
|
334
392
|
* @property {InvoiceItemsPlanRecurring} [recurring]
|
|
335
|
-
* @property {boolean} [is_trial_plan]
|
|
336
|
-
* @property {string} [plan_group]
|
|
337
|
-
* @property {string[]} [tag_lines]
|
|
338
|
-
*
|
|
339
|
-
* @property {
|
|
340
|
-
* @property {boolean} [
|
|
341
|
-
* @property {
|
|
342
|
-
* @property {
|
|
343
|
-
* @property {string[]} [
|
|
344
|
-
* @property {string} [
|
|
345
|
-
* @property {string} [
|
|
346
|
-
* @property {string} [
|
|
347
|
-
* @property {string} [
|
|
348
|
-
* @property {string} [
|
|
349
|
-
* @property {
|
|
350
|
-
* @property {
|
|
351
|
-
* @property {string} [
|
|
352
|
-
*
|
|
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.
|
|
353
413
|
*/
|
|
354
414
|
|
|
355
415
|
/**
|
|
356
416
|
* @typedef InvoiceItemsPeriod
|
|
357
|
-
* @property {string} [start]
|
|
358
|
-
* @property {string} [end]
|
|
417
|
+
* @property {string} [start] - Start date of the invoice period.
|
|
418
|
+
* @property {string} [end] - End date of the invoice period.
|
|
359
419
|
*/
|
|
360
420
|
|
|
361
421
|
/**
|
|
362
422
|
* @typedef InvoiceItems
|
|
363
|
-
* @property {string} [_id]
|
|
364
|
-
* @property {string} [currency]
|
|
423
|
+
* @property {string} [_id] - Unique identifier for the invoice item.
|
|
424
|
+
* @property {string} [currency] - Currency for the amount.
|
|
365
425
|
* @property {InvoiceItemsPlan} [plan]
|
|
366
|
-
* @property {string} [name]
|
|
367
|
-
* @property {number} [quantity]
|
|
368
|
-
* @property {string} [description]
|
|
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.
|
|
369
429
|
* @property {InvoiceItemsPeriod} [period]
|
|
370
|
-
* @property {number} [unit_amount]
|
|
371
|
-
* @property {number} [amount]
|
|
372
|
-
* @property {string} [type]
|
|
373
|
-
* @property {string} [invoice_id]
|
|
374
|
-
* @property {string} [created_at]
|
|
375
|
-
* @property {string} [modified_at]
|
|
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.
|
|
376
436
|
*/
|
|
377
437
|
|
|
378
438
|
/**
|
|
379
439
|
* @typedef InvoicesDataClient
|
|
380
|
-
* @property {string} [name]
|
|
381
|
-
* @property {string} [email]
|
|
382
|
-
* @property {string} [phone]
|
|
383
|
-
* @property {string[]} [address_lines]
|
|
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.
|
|
384
444
|
*/
|
|
385
445
|
|
|
386
446
|
/**
|
|
387
447
|
* @typedef InvoicesDataPeriod
|
|
388
|
-
* @property {string} [start]
|
|
389
|
-
* @property {string} [end]
|
|
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.
|
|
390
450
|
*/
|
|
391
451
|
|
|
392
452
|
/**
|
|
393
453
|
* @typedef InvoicesDataPaymentMethod
|
|
394
|
-
* @property {string} [pg_payment_method_id]
|
|
454
|
+
* @property {string} [pg_payment_method_id] - Payment gateway-specific payment
|
|
455
|
+
* method identifier. Nullable if not applicable.
|
|
395
456
|
*/
|
|
396
457
|
|
|
397
458
|
/**
|
|
398
459
|
* @typedef InvoicesData
|
|
399
|
-
* @property {string} [_id]
|
|
400
|
-
* @property {Object} [documents]
|
|
401
|
-
* @property {Object} [payment]
|
|
402
|
-
* @property {number} [old_settlement]
|
|
403
|
-
* @property {number} [credit_balance]
|
|
404
|
-
*
|
|
405
|
-
* @property {Object} [
|
|
406
|
-
* @property {
|
|
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.
|
|
407
469
|
* @property {InvoicesDataClient} [client]
|
|
408
|
-
* @property {boolean} [auto_advance]
|
|
409
|
-
*
|
|
410
|
-
* @property {
|
|
411
|
-
* @property {
|
|
412
|
-
* @property {
|
|
413
|
-
* @property {string} [
|
|
414
|
-
*
|
|
415
|
-
* @property {string} [
|
|
416
|
-
*
|
|
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.
|
|
417
483
|
* @property {InvoicesDataPeriod} [period]
|
|
418
|
-
* @property {string} [receipt_number]
|
|
419
|
-
* @property {string} [statement_descriptor]
|
|
420
|
-
*
|
|
421
|
-
* @property {
|
|
422
|
-
*
|
|
423
|
-
* @property {
|
|
424
|
-
*
|
|
425
|
-
* @property {
|
|
426
|
-
* @property {
|
|
427
|
-
* @property {string} [
|
|
428
|
-
*
|
|
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.
|
|
429
500
|
* @property {InvoicesDataPaymentMethod} [payment_method]
|
|
430
|
-
* @property {InvoiceItems[]} [invoice_items]
|
|
501
|
+
* @property {InvoiceItems[]} [invoice_items] - List of items included in the invoice.
|
|
502
|
+
* @property {string} [invoice_type] - Type of invoice (e.g., extension, subscription).
|
|
431
503
|
*/
|
|
432
504
|
|
|
433
505
|
/**
|
|
434
506
|
* @typedef Invoices
|
|
435
507
|
* @property {InvoicesData[]} [data]
|
|
436
|
-
* @property {number} [start]
|
|
437
|
-
* @property {number} [end]
|
|
438
|
-
* @property {number} [limit]
|
|
439
|
-
* @property {number} [page]
|
|
440
|
-
* @property {number} [total]
|
|
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.
|
|
441
513
|
*/
|
|
442
514
|
|
|
443
515
|
/**
|
|
444
516
|
* @typedef Phone
|
|
445
|
-
* @property {string} [phone_number]
|
|
446
|
-
* @property {string} [phone_country_code]
|
|
517
|
+
* @property {string} [phone_number] - The phone number of the contact.
|
|
518
|
+
* @property {string} [phone_country_code] - The country code of the phone number.
|
|
447
519
|
*/
|
|
448
520
|
|
|
449
521
|
/**
|
|
450
522
|
* @typedef SubscriptionBillingAddress
|
|
451
|
-
* @property {string} [country]
|
|
452
|
-
* @property {string} [
|
|
453
|
-
* @property {string} [
|
|
454
|
-
* @property {string} [
|
|
455
|
-
* @property {string} [
|
|
456
|
-
* @property {string} [
|
|
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.
|
|
457
530
|
*/
|
|
458
531
|
|
|
459
532
|
/**
|
|
460
533
|
* @typedef SubscriptionCustomer
|
|
461
534
|
* @property {Phone} [phone]
|
|
462
535
|
* @property {SubscriptionBillingAddress} [billing_address]
|
|
463
|
-
* @property {string} [_id]
|
|
464
|
-
* @property {string} [unique_id]
|
|
465
|
-
* @property {string} [type]
|
|
466
|
-
* @property {string} [name]
|
|
467
|
-
* @property {string} [email]
|
|
468
|
-
* @property {string} [created_at]
|
|
469
|
-
* @property {string} [modified_at]
|
|
470
|
-
*
|
|
471
|
-
* @property {Object} [
|
|
472
|
-
* @property {
|
|
473
|
-
* @property {boolean} [
|
|
474
|
-
* @property {
|
|
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.
|
|
475
550
|
* @property {BusinessCountryInfo} [business_country_info]
|
|
476
551
|
*/
|
|
477
552
|
|
|
@@ -479,110 +554,137 @@ const Joi = require("joi");
|
|
|
479
554
|
* @typedef SubscriptionCustomerCreate
|
|
480
555
|
* @property {Phone} [phone]
|
|
481
556
|
* @property {SubscriptionBillingAddress} [billing_address]
|
|
482
|
-
* @property {string} [unique_id]
|
|
483
|
-
* @property {string} [type]
|
|
484
|
-
* @property {string} [name]
|
|
485
|
-
* @property {string} [email]
|
|
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
|
|
486
561
|
*/
|
|
487
562
|
|
|
488
563
|
/**
|
|
489
564
|
* @typedef SubscriptionCurrentPeriod
|
|
490
|
-
* @property {string} [start]
|
|
491
|
-
*
|
|
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.
|
|
492
568
|
*/
|
|
493
569
|
|
|
494
570
|
/**
|
|
495
571
|
* @typedef SubscriptionPauseCollection
|
|
496
|
-
* @property {string} [behavior]
|
|
497
|
-
*
|
|
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.
|
|
498
576
|
*/
|
|
499
577
|
|
|
500
578
|
/**
|
|
501
579
|
* @typedef SubscriptionTrial
|
|
502
|
-
* @property {string} [start]
|
|
503
|
-
* @property {string} [end]
|
|
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.
|
|
504
582
|
*/
|
|
505
583
|
|
|
506
584
|
/**
|
|
507
585
|
* @typedef SubscriptionInvoiceSettings
|
|
508
|
-
* @property {boolean} [generation]
|
|
509
|
-
*
|
|
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.
|
|
510
591
|
*/
|
|
511
592
|
|
|
512
593
|
/**
|
|
513
594
|
* @typedef Subscription
|
|
514
|
-
* @property {Object} [meta]
|
|
595
|
+
* @property {Object} [meta] - Additional metadata related to the subscription.
|
|
515
596
|
* @property {SubscriptionCurrentPeriod} [current_period]
|
|
516
597
|
* @property {SubscriptionPauseCollection} [pause_collection]
|
|
517
598
|
* @property {SubscriptionTrial} [trial]
|
|
518
599
|
* @property {SubscriptionInvoiceSettings} [invoice_settings]
|
|
519
|
-
* @property {boolean} [is_active]
|
|
520
|
-
*
|
|
521
|
-
* @property {
|
|
522
|
-
*
|
|
523
|
-
* @property {string} [
|
|
524
|
-
* @property {string} [
|
|
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.
|
|
525
613
|
* @property {Plan} [plan_data]
|
|
526
|
-
* @property {string} [current_status]
|
|
527
|
-
*
|
|
528
|
-
* @property {string} [
|
|
529
|
-
*
|
|
530
|
-
* @property {string} [
|
|
531
|
-
* @property {string} [
|
|
532
|
-
*
|
|
533
|
-
* @property {string} [
|
|
534
|
-
*
|
|
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.
|
|
535
631
|
*/
|
|
536
632
|
|
|
537
633
|
/**
|
|
538
634
|
* @typedef SubscriptionStatus
|
|
539
|
-
* @property {boolean} [is_enabled]
|
|
635
|
+
* @property {boolean} [is_enabled] - Indicates whether the subscription status
|
|
636
|
+
* is enabled.
|
|
540
637
|
* @property {Subscription} [subscription]
|
|
541
638
|
* @property {InvoicesData} [latest_invoice]
|
|
542
639
|
* @property {Plan} [next_plan]
|
|
543
|
-
* @property {Subscription[]} [current_subscriptions]
|
|
544
|
-
*
|
|
545
|
-
* @property {
|
|
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.
|
|
546
646
|
*/
|
|
547
647
|
|
|
548
648
|
/**
|
|
549
649
|
* @typedef SubscriptionLimitApplication
|
|
550
|
-
* @property {boolean} [enabled]
|
|
551
|
-
* @property {number} [hard_limit]
|
|
552
|
-
* @property {number} [soft_limit]
|
|
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.
|
|
553
654
|
*/
|
|
554
655
|
|
|
555
656
|
/**
|
|
556
657
|
* @typedef SubscriptionLimitMarketplace
|
|
557
|
-
* @property {boolean} [enabled]
|
|
658
|
+
* @property {boolean} [enabled] - Indicates whether the marketplace limit is enabled.
|
|
558
659
|
*/
|
|
559
660
|
|
|
560
661
|
/**
|
|
561
662
|
* @typedef SubscriptionLimitOtherPlatform
|
|
562
|
-
* @property {boolean} [enabled]
|
|
663
|
+
* @property {boolean} [enabled] - Indicates whether the other platform limit is enabled.
|
|
563
664
|
*/
|
|
564
665
|
|
|
565
666
|
/**
|
|
566
667
|
* @typedef SubscriptionLimitTeam
|
|
567
|
-
* @property {number} [limit]
|
|
668
|
+
* @property {number} [limit] - The limit for team-related features.
|
|
568
669
|
*/
|
|
569
670
|
|
|
570
671
|
/**
|
|
571
672
|
* @typedef SubscriptionLimitProducts
|
|
572
|
-
* @property {boolean} [bulk]
|
|
573
|
-
* @property {number} [limit]
|
|
673
|
+
* @property {boolean} [bulk] - Indicates whether bulk product limits are enabled.
|
|
674
|
+
* @property {number} [limit] - The limit for products.
|
|
574
675
|
*/
|
|
575
676
|
|
|
576
677
|
/**
|
|
577
678
|
* @typedef SubscriptionLimitExtensions
|
|
578
|
-
* @property {boolean} [enabled]
|
|
579
|
-
* @property {number} [limit]
|
|
679
|
+
* @property {boolean} [enabled] - Indicates whether the extensions limit is enabled.
|
|
680
|
+
* @property {number} [limit] - The limit for extensions.
|
|
580
681
|
*/
|
|
581
682
|
|
|
582
683
|
/**
|
|
583
684
|
* @typedef SubscriptionLimitIntegrations
|
|
584
|
-
* @property {boolean} [enabled]
|
|
585
|
-
* @property {number} [limit]
|
|
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.
|
|
586
688
|
*/
|
|
587
689
|
|
|
588
690
|
/**
|
|
@@ -594,47 +696,62 @@ const Joi = require("joi");
|
|
|
594
696
|
* @property {SubscriptionLimitProducts} [products]
|
|
595
697
|
* @property {SubscriptionLimitExtensions} [extensions]
|
|
596
698
|
* @property {SubscriptionLimitIntegrations} [integrations]
|
|
597
|
-
* @property {boolean} [is_trial_plan]
|
|
699
|
+
* @property {boolean} [is_trial_plan] - Indicates whether the subscription is
|
|
700
|
+
* for a trial plan.
|
|
598
701
|
*/
|
|
599
702
|
|
|
600
703
|
/**
|
|
601
704
|
* @typedef IntentReq
|
|
602
|
-
* @property {string} [unique_external_id]
|
|
603
|
-
*
|
|
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.
|
|
604
708
|
*/
|
|
605
709
|
|
|
606
710
|
/**
|
|
607
711
|
* @typedef PutIntentReq
|
|
608
|
-
* @property {string} [unique_external_id]
|
|
609
|
-
*
|
|
610
|
-
* @property {string} [
|
|
611
|
-
*
|
|
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.
|
|
612
720
|
*/
|
|
613
721
|
|
|
614
722
|
/**
|
|
615
723
|
* @typedef SubscriptionActivateReq
|
|
616
|
-
* @property {string} [unique_id]
|
|
617
|
-
*
|
|
618
|
-
* @property {string} [
|
|
619
|
-
* @property {string} [
|
|
620
|
-
*
|
|
621
|
-
* @property {string} [
|
|
622
|
-
* @property {string} [
|
|
623
|
-
*
|
|
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.
|
|
624
737
|
*/
|
|
625
738
|
|
|
626
739
|
/**
|
|
627
740
|
* @typedef SubscriptionActivateRes
|
|
628
|
-
* @property {boolean} [success]
|
|
741
|
+
* @property {boolean} [success] - Indicates whether the subscription activation
|
|
742
|
+
* was successful.
|
|
629
743
|
* @property {Subscription} [data]
|
|
630
744
|
*/
|
|
631
745
|
|
|
632
746
|
/**
|
|
633
747
|
* @typedef CancelSubscriptionReq
|
|
634
|
-
* @property {string} [unique_id]
|
|
635
|
-
*
|
|
636
|
-
* @property {string} [
|
|
637
|
-
*
|
|
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.
|
|
638
755
|
*/
|
|
639
756
|
|
|
640
757
|
/**
|
|
@@ -645,173 +762,213 @@ const Joi = require("joi");
|
|
|
645
762
|
|
|
646
763
|
/**
|
|
647
764
|
* @typedef PlanStatusUpdateReq
|
|
648
|
-
* @property {string} [plan_id]
|
|
649
|
-
*
|
|
650
|
-
* @property {string} [
|
|
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).
|
|
651
770
|
*/
|
|
652
771
|
|
|
653
772
|
/**
|
|
654
|
-
* @typedef
|
|
655
|
-
* @property {string} [entity_type]
|
|
656
|
-
*
|
|
657
|
-
* @property {string} [
|
|
658
|
-
*
|
|
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
|
|
659
780
|
* @property {Meta} [meta]
|
|
660
781
|
*/
|
|
661
782
|
|
|
662
783
|
/**
|
|
663
784
|
* @typedef Meta
|
|
664
|
-
* @property {boolean} [subscribe]
|
|
665
|
-
*
|
|
666
|
-
* @property {boolean} [
|
|
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.
|
|
667
791
|
*/
|
|
668
792
|
|
|
669
793
|
/**
|
|
670
794
|
* @typedef SubscribePlanRes
|
|
671
|
-
* @property {string} [redirect_url]
|
|
672
|
-
*
|
|
673
|
-
* @property {string} [
|
|
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).
|
|
674
801
|
* @property {Meta} [meta]
|
|
675
802
|
*/
|
|
676
803
|
|
|
677
804
|
/**
|
|
678
805
|
* @typedef EntityDetail
|
|
679
|
-
* @property {string} [entity]
|
|
806
|
+
* @property {string} [entity] - Specifies the type of entity (e.g., subscription, user).
|
|
680
807
|
* @property {Subscription} [item]
|
|
681
808
|
*/
|
|
682
809
|
|
|
683
810
|
/**
|
|
684
811
|
* @typedef PaymentOptions
|
|
685
|
-
* @property {string} [_id]
|
|
686
|
-
* @property {string} [name]
|
|
687
|
-
* @property {string} [description]
|
|
688
|
-
*
|
|
689
|
-
* @property {string} [
|
|
690
|
-
* @property {string} [aggregator
|
|
691
|
-
* @property {string} [
|
|
692
|
-
* @property {string} [
|
|
693
|
-
* @property {
|
|
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.
|
|
694
823
|
*/
|
|
695
824
|
|
|
696
825
|
/**
|
|
697
826
|
* @typedef VerifyPaymentReq
|
|
698
|
-
* @property {string} [razorpay_payment_id]
|
|
699
|
-
* @property {string} [razorpay_order_id]
|
|
700
|
-
* @property {string} [razorpay_signature]
|
|
701
|
-
*
|
|
702
|
-
* @property {
|
|
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.
|
|
703
834
|
*/
|
|
704
835
|
|
|
705
836
|
/**
|
|
706
837
|
* @typedef Documents
|
|
707
|
-
* @property {string} [pan]
|
|
708
|
-
* @property {string} [gst]
|
|
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.
|
|
709
840
|
*/
|
|
710
841
|
|
|
711
842
|
/**
|
|
712
843
|
* @typedef BillingAddress
|
|
713
|
-
* @property {string} [country]
|
|
714
|
-
* @property {string} [state]
|
|
715
|
-
* @property {string} [city]
|
|
716
|
-
* @property {string} [line1]
|
|
717
|
-
* @property {string} [line2]
|
|
718
|
-
* @property {string} [postal_code]
|
|
719
|
-
* @property {string} [country_code]
|
|
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.
|
|
720
852
|
*/
|
|
721
853
|
|
|
722
854
|
/**
|
|
723
855
|
* @typedef Currency
|
|
724
|
-
* @property {string} [code]
|
|
725
|
-
* @property {string} [symbol]
|
|
726
|
-
* @property {string} [name]
|
|
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.
|
|
727
859
|
*/
|
|
728
860
|
|
|
729
861
|
/**
|
|
730
862
|
* @typedef BusinessCountryInfo
|
|
731
|
-
* @property {string} [country]
|
|
732
|
-
* @property {string} [country_code]
|
|
863
|
+
* @property {string} [country] - The country where the business is registered.
|
|
864
|
+
* @property {string} [country_code] - ISO country code for the business's country.
|
|
733
865
|
* @property {Currency} [currency]
|
|
734
|
-
* @property {string} [timezone]
|
|
866
|
+
* @property {string} [timezone] - Timezone in which the business operates.
|
|
735
867
|
*/
|
|
736
868
|
|
|
737
869
|
/**
|
|
738
870
|
* @typedef SubscriberData
|
|
739
|
-
* @property {boolean} [pg_user_exists]
|
|
740
|
-
*
|
|
741
|
-
* @property {string} [
|
|
742
|
-
* @property {string} [
|
|
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.
|
|
743
878
|
*/
|
|
744
879
|
|
|
745
880
|
/**
|
|
746
881
|
* @typedef Subscriber
|
|
747
882
|
* @property {Documents} [documents]
|
|
748
|
-
* @property {Object} [phone]
|
|
883
|
+
* @property {Object} [phone] - Contact information for the subscriber, such as
|
|
884
|
+
* phone number.
|
|
749
885
|
* @property {BillingAddress} [billing_address]
|
|
750
|
-
* @property {boolean} [consent]
|
|
751
|
-
*
|
|
752
|
-
* @property {
|
|
753
|
-
*
|
|
754
|
-
* @property {string} [
|
|
755
|
-
* @property {string} [
|
|
756
|
-
*
|
|
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.
|
|
757
896
|
* @property {BusinessCountryInfo} [business_country_info]
|
|
758
|
-
* @property {string} [created_at]
|
|
759
|
-
* @property {string} [modified_at]
|
|
760
|
-
*
|
|
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.
|
|
761
902
|
* @property {SubscriberData} [data]
|
|
762
903
|
*/
|
|
763
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
|
+
|
|
764
913
|
/**
|
|
765
914
|
* @typedef Author
|
|
766
|
-
* @property {
|
|
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.
|
|
767
918
|
*/
|
|
768
919
|
|
|
769
920
|
/**
|
|
770
921
|
* @typedef EndingBalance
|
|
771
|
-
* @property {number} [amount]
|
|
772
|
-
* @property {string} [old_entry_ref]
|
|
922
|
+
* @property {number} [amount] - The ending balance amount.
|
|
923
|
+
* @property {string} [old_entry_ref] - Reference to the previous entry if applicable.
|
|
773
924
|
*/
|
|
774
925
|
|
|
775
926
|
/**
|
|
776
927
|
* @typedef PaymentData
|
|
777
|
-
* @property {string} [transaction_id]
|
|
778
|
-
* @property {string} [aggregator]
|
|
779
|
-
* @property {string} [aggregator_order_id]
|
|
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.
|
|
780
935
|
*/
|
|
781
936
|
|
|
782
937
|
/**
|
|
783
938
|
* @typedef CreditTransaction
|
|
784
|
-
* @property {Object} [entity]
|
|
939
|
+
* @property {Object} [entity] - The entity associated with the transaction.
|
|
785
940
|
* @property {Author} [author]
|
|
786
|
-
* @property {string} [_id]
|
|
787
|
-
* @property {number} [amount]
|
|
788
|
-
* @property {string} [currency]
|
|
789
|
-
* @property {string} [subscriber_id]
|
|
790
|
-
*
|
|
791
|
-
* @property {
|
|
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.
|
|
792
948
|
* @property {EndingBalance} [ending_balance]
|
|
793
949
|
* @property {PaymentData} [payment]
|
|
794
|
-
* @property {string} [type]
|
|
795
|
-
* @property {string} [created_at]
|
|
796
|
-
* @property {string} [modified_at]
|
|
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.
|
|
797
954
|
*/
|
|
798
955
|
|
|
799
956
|
/**
|
|
800
957
|
* @typedef VerifyPaymentData
|
|
801
|
-
* @property {boolean} [success]
|
|
958
|
+
* @property {boolean} [success] - Indicates if the payment verification was successful.
|
|
802
959
|
* @property {Subscriber} [subscriber]
|
|
803
960
|
* @property {CreditTransaction} [credit_transaction]
|
|
804
961
|
*/
|
|
805
962
|
|
|
806
963
|
/**
|
|
807
964
|
* @typedef VerifyPaymentRes
|
|
808
|
-
* @property {string} [status]
|
|
965
|
+
* @property {string} [status] - The status of the payment verification.
|
|
809
966
|
* @property {VerifyPaymentData} [data]
|
|
810
967
|
*/
|
|
811
968
|
|
|
812
969
|
/**
|
|
813
970
|
* @typedef DefaultMerchants
|
|
814
|
-
* @property {string} [stripe]
|
|
971
|
+
* @property {string} [stripe] - The default Stripe merchant identifier.
|
|
815
972
|
*/
|
|
816
973
|
|
|
817
974
|
/**
|
|
@@ -822,265 +979,280 @@ const Joi = require("joi");
|
|
|
822
979
|
/**
|
|
823
980
|
* @typedef GlobalSettingsData
|
|
824
981
|
* @property {GlobalSettingsPayment} [payment]
|
|
825
|
-
* @property {boolean} [freeze_panel]
|
|
826
|
-
* @property {string} [_id]
|
|
827
|
-
* @property {string} [created_at]
|
|
828
|
-
*
|
|
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.
|
|
829
988
|
*/
|
|
830
989
|
|
|
831
990
|
/**
|
|
832
991
|
* @typedef GlobalSettings
|
|
833
|
-
* @property {string} [status]
|
|
992
|
+
* @property {string} [status] - The status of the global settings retrieval.
|
|
834
993
|
* @property {GlobalSettingsData} [data]
|
|
835
994
|
*/
|
|
836
995
|
|
|
837
996
|
/**
|
|
838
997
|
* @typedef MethodChecks
|
|
839
|
-
* @property {string} [address_line1_check]
|
|
840
|
-
* @property {string} [address_postal_code_check]
|
|
841
|
-
*
|
|
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.
|
|
842
1002
|
*/
|
|
843
1003
|
|
|
844
1004
|
/**
|
|
845
1005
|
* @typedef MethodNetworks
|
|
846
|
-
* @property {string[]} [available]
|
|
847
|
-
* @property {string} [preferred]
|
|
1006
|
+
* @property {string[]} [available] - List of available networks for the payment method.
|
|
1007
|
+
* @property {string} [preferred] - Preferred network for the payment method.
|
|
848
1008
|
*/
|
|
849
1009
|
|
|
850
1010
|
/**
|
|
851
1011
|
* @typedef MethodSecureUsage
|
|
852
|
-
* @property {boolean} [supported]
|
|
1012
|
+
* @property {boolean} [supported] - Indicates if 3D Secure is supported for the
|
|
1013
|
+
* payment method.
|
|
853
1014
|
*/
|
|
854
1015
|
|
|
855
1016
|
/**
|
|
856
1017
|
* @typedef MethodDetails
|
|
857
|
-
* @property {string} [id]
|
|
858
|
-
* @property {string} [type]
|
|
859
|
-
* @property {boolean} [mandate_available]
|
|
860
|
-
*
|
|
861
|
-
* @property {
|
|
862
|
-
* @property {
|
|
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.
|
|
863
1026
|
* @property {SubscriptionMethodData} [data]
|
|
864
1027
|
*/
|
|
865
1028
|
|
|
866
1029
|
/**
|
|
867
1030
|
* @typedef SubscriptionMethodData
|
|
868
|
-
* @property {string} [brand]
|
|
1031
|
+
* @property {string} [brand] - Brand of the payment method.
|
|
869
1032
|
* @property {MethodChecks} [checks]
|
|
870
|
-
* @property {string} [country]
|
|
871
|
-
* @property {number} [exp_month]
|
|
872
|
-
* @property {number} [exp_year]
|
|
873
|
-
* @property {string} [fingerprint]
|
|
874
|
-
* @property {string} [funding]
|
|
875
|
-
* @property {string} [generated_from]
|
|
876
|
-
*
|
|
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.
|
|
877
1041
|
* @property {MethodNetworks} [networks]
|
|
878
1042
|
* @property {MethodSecureUsage} [three_d_secure_usage]
|
|
879
|
-
* @property {string} [wallet]
|
|
880
|
-
* @property {string} [name]
|
|
881
|
-
* @property {boolean} [is_default]
|
|
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.
|
|
882
1046
|
*/
|
|
883
1047
|
|
|
884
1048
|
/**
|
|
885
1049
|
* @typedef SubscriptionMethods
|
|
886
|
-
* @property {boolean} [success]
|
|
887
|
-
*
|
|
1050
|
+
* @property {boolean} [success] - Indicates if the retrieval of subscription
|
|
1051
|
+
* methods was successful.
|
|
1052
|
+
* @property {MethodDetails[]} [data] - List of subscription methods.
|
|
888
1053
|
*/
|
|
889
1054
|
|
|
890
1055
|
/**
|
|
891
1056
|
* @typedef ConfigPublicKey
|
|
892
|
-
* @property {string} [public_key]
|
|
1057
|
+
* @property {string} [public_key] - Public key for the payment aggregator.
|
|
893
1058
|
*/
|
|
894
1059
|
|
|
895
1060
|
/**
|
|
896
1061
|
* @typedef ConfigRes
|
|
897
|
-
* @property {boolean} [success]
|
|
898
|
-
*
|
|
1062
|
+
* @property {boolean} [success] - Indicates if the retrieval of configuration
|
|
1063
|
+
* was successful.
|
|
1064
|
+
* @property {string} [aggregator] - The payment aggregator.
|
|
899
1065
|
* @property {ConfigPublicKey} [config]
|
|
900
1066
|
*/
|
|
901
1067
|
|
|
902
1068
|
/**
|
|
903
1069
|
* @typedef PlanChangeData
|
|
904
|
-
* @property {number} [total]
|
|
905
|
-
* @property {number} [credit_note_amount]
|
|
906
|
-
* @property {number} [settlement]
|
|
907
|
-
* @property {number} [taxable_amount]
|
|
908
|
-
* @property {number} [gst_amount]
|
|
909
|
-
* @property {number} [gross_total]
|
|
910
|
-
* @property {number} [gst]
|
|
911
|
-
* @property {number} [discount]
|
|
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.
|
|
912
1078
|
*/
|
|
913
1079
|
|
|
914
1080
|
/**
|
|
915
1081
|
* @typedef PlanChangeDetails
|
|
916
|
-
* @property {string} [status]
|
|
1082
|
+
* @property {string} [status] - Status of the plan change.
|
|
917
1083
|
* @property {PlanChangeData} [data]
|
|
918
1084
|
*/
|
|
919
1085
|
|
|
920
1086
|
/**
|
|
921
1087
|
* @typedef TransactionMeta
|
|
922
|
-
* @property {string} [invoice_id]
|
|
1088
|
+
* @property {string} [invoice_id] - Invoice ID associated with the transaction.
|
|
923
1089
|
*/
|
|
924
1090
|
|
|
925
1091
|
/**
|
|
926
1092
|
* @typedef PaymentTransactionDetails
|
|
927
|
-
* @property {Object} [aggregator]
|
|
928
|
-
* @property {string} [currency]
|
|
929
|
-
* @property {string} [current_status]
|
|
930
|
-
* @property {string} [_id]
|
|
931
|
-
* @property {string} [subscriber_id]
|
|
932
|
-
* @property {number} [amount]
|
|
933
|
-
* @property {string} [entity_type]
|
|
934
|
-
* @property {string} [collection_type]
|
|
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.
|
|
935
1101
|
* @property {TransactionMeta} [meta]
|
|
936
|
-
* @property {string} [created_at]
|
|
937
|
-
* @property {string} [modified_at]
|
|
1102
|
+
* @property {string} [created_at] - Timestamp when the transaction was created.
|
|
1103
|
+
* @property {string} [modified_at] - Timestamp when the transaction was last modified.
|
|
938
1104
|
*/
|
|
939
1105
|
|
|
940
1106
|
/**
|
|
941
1107
|
* @typedef PaymentItems
|
|
942
|
-
* @property {string} [name]
|
|
943
|
-
* @property {string} [code]
|
|
944
|
-
* @property {string} [aggregator]
|
|
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.
|
|
945
1111
|
*/
|
|
946
1112
|
|
|
947
1113
|
/**
|
|
948
1114
|
* @typedef GetPaymentOptions
|
|
949
|
-
* @property {PaymentItems[]} [payment_options]
|
|
1115
|
+
* @property {PaymentItems[]} [payment_options] - List of available payment options.
|
|
950
1116
|
*/
|
|
951
1117
|
|
|
952
1118
|
/**
|
|
953
1119
|
* @typedef TopupReq
|
|
954
|
-
* @property {number} [amount]
|
|
955
|
-
* @property {string} [currency]
|
|
956
|
-
* @property {string} [provider_type]
|
|
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.
|
|
957
1123
|
*/
|
|
958
1124
|
|
|
959
1125
|
/**
|
|
960
1126
|
* @typedef SetupMandateReq
|
|
961
|
-
* @property {string} [intent_id]
|
|
962
|
-
* @property {string} [payment_method_id]
|
|
1127
|
+
* @property {string} [intent_id] - ID of the setup intent.
|
|
1128
|
+
* @property {string} [payment_method_id] - ID of the payment method.
|
|
963
1129
|
*/
|
|
964
1130
|
|
|
965
1131
|
/**
|
|
966
1132
|
* @typedef SetupPaymentReq
|
|
967
|
-
* @property {string} [payment_method]
|
|
968
|
-
* @property {string} [payment_id]
|
|
969
|
-
* @property {string} [plan_id]
|
|
970
|
-
* @property {string} [invoice_id]
|
|
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.
|
|
971
1137
|
*/
|
|
972
1138
|
|
|
973
1139
|
/**
|
|
974
1140
|
* @typedef SubscriptionRenewReq
|
|
975
|
-
* @property {string} [invoice_id]
|
|
976
|
-
* @property {string} [entity_type]
|
|
977
|
-
* @property {string} [collection_type]
|
|
978
|
-
* @property {string} [callback_url]
|
|
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
|
|
979
1145
|
* @property {RenewMeta} [meta]
|
|
980
1146
|
*/
|
|
981
1147
|
|
|
982
1148
|
/**
|
|
983
1149
|
* @typedef RenewMeta
|
|
984
|
-
* @property {boolean} [invoice_payment]
|
|
985
|
-
*
|
|
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.
|
|
986
1153
|
*/
|
|
987
1154
|
|
|
988
1155
|
/**
|
|
989
1156
|
* @typedef SubscriptionMethodsReq
|
|
990
|
-
* @property {string} [unique_external_id]
|
|
991
|
-
*
|
|
992
|
-
* @property {string} [
|
|
993
|
-
* @property {
|
|
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.
|
|
994
1163
|
*/
|
|
995
1164
|
|
|
996
1165
|
/**
|
|
997
1166
|
* @typedef CreditTransactionResponse
|
|
998
|
-
* @property {number} [total] - Total number of transactions
|
|
999
|
-
* @property {number} [limit] - Maximum number of transactions per page
|
|
1000
|
-
* @property {number} [page] - Current page number
|
|
1001
|
-
* @property {number} [pages] - Total number of pages
|
|
1002
|
-
* @property {CreditTransaction[]} [items]
|
|
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.
|
|
1003
1172
|
*/
|
|
1004
1173
|
|
|
1005
1174
|
/**
|
|
1006
1175
|
* @typedef DowngradePlanReq
|
|
1007
|
-
* @property {string} [unique_id]
|
|
1008
|
-
* @property {string} [type]
|
|
1009
|
-
* @property {string} [product_suite]
|
|
1010
|
-
* @property {string} [plan_id]
|
|
1011
|
-
* @property {string} [reason]
|
|
1012
|
-
* @property {string} [platform]
|
|
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.
|
|
1013
1182
|
*/
|
|
1014
1183
|
|
|
1015
1184
|
/**
|
|
1016
1185
|
* @typedef Taxation
|
|
1017
|
-
* @property {number} [gst] - GST percentage
|
|
1186
|
+
* @property {number} [gst] - GST percentage.
|
|
1018
1187
|
*/
|
|
1019
1188
|
|
|
1020
1189
|
/**
|
|
1021
1190
|
* @typedef OneTimeFees
|
|
1022
|
-
* @property {number} [developement]
|
|
1023
|
-
* @property {number} [marketing]
|
|
1191
|
+
* @property {number} [developement] - One-time development fee.
|
|
1192
|
+
* @property {number} [marketing] - One-time marketing fee.
|
|
1024
1193
|
*/
|
|
1025
1194
|
|
|
1026
1195
|
/**
|
|
1027
1196
|
* @typedef CreditLine
|
|
1028
|
-
* @property {boolean} [is_active]
|
|
1197
|
+
* @property {boolean} [is_active] - Indicates whether the credit line is active.
|
|
1029
1198
|
*/
|
|
1030
1199
|
|
|
1031
1200
|
/**
|
|
1032
1201
|
* @typedef StatusMessage
|
|
1033
|
-
* @property {string} [status]
|
|
1034
|
-
* @property {string} [message]
|
|
1035
|
-
* @property {boolean} [success]
|
|
1036
|
-
* @property {string} [code]
|
|
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.
|
|
1037
1206
|
*/
|
|
1038
1207
|
|
|
1039
1208
|
/**
|
|
1040
1209
|
* @typedef PaymentCollectReq
|
|
1041
|
-
* @property {string} [transaction_id]
|
|
1042
|
-
* @property {boolean} [credit_balance]
|
|
1043
|
-
*
|
|
1044
|
-
* @property {string} [
|
|
1045
|
-
* @property {string} [
|
|
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.
|
|
1046
1216
|
*/
|
|
1047
1217
|
|
|
1048
1218
|
/**
|
|
1049
1219
|
* @typedef SubscriptionRenewResMeta
|
|
1050
|
-
* @property {boolean} [invoice_payment]
|
|
1051
|
-
*
|
|
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.
|
|
1052
1223
|
*/
|
|
1053
1224
|
|
|
1054
1225
|
/**
|
|
1055
1226
|
* @typedef SubscriptionRenewRes
|
|
1056
|
-
* @property {string} [redirect_url]
|
|
1057
|
-
*
|
|
1058
|
-
* @property {string} [
|
|
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.
|
|
1059
1231
|
* @property {SubscriptionRenewResMeta} [meta]
|
|
1060
1232
|
*/
|
|
1061
1233
|
|
|
1062
1234
|
/**
|
|
1063
1235
|
* @typedef SetupIntentRes
|
|
1064
|
-
* @property {boolean} [success]
|
|
1236
|
+
* @property {boolean} [success] - Indicates if the setup intent was successful.
|
|
1065
1237
|
* @property {SetupIntentData} [data]
|
|
1066
1238
|
*/
|
|
1067
1239
|
|
|
1068
1240
|
/**
|
|
1069
1241
|
* @typedef SetupIntentData
|
|
1070
|
-
* @property {string} [id]
|
|
1071
|
-
* @property {string} [client_secret]
|
|
1072
|
-
* @property {
|
|
1073
|
-
* @property {string} [status]
|
|
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.
|
|
1074
1246
|
*/
|
|
1075
1247
|
|
|
1076
1248
|
/**
|
|
1077
1249
|
* @typedef SetupPayment
|
|
1078
|
-
* @property {string} [id]
|
|
1079
|
-
* @property {string} [status]
|
|
1080
|
-
* @property {
|
|
1081
|
-
* @property {string} [client_secret]
|
|
1082
|
-
* @property {string} [payment_method]
|
|
1083
|
-
* @property {string} [mandate]
|
|
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.
|
|
1084
1256
|
* @property {PaymentMethodOptions} [payment_method_options]
|
|
1085
1257
|
*/
|
|
1086
1258
|
|
|
@@ -1096,46 +1268,135 @@ const Joi = require("joi");
|
|
|
1096
1268
|
|
|
1097
1269
|
/**
|
|
1098
1270
|
* @typedef MandateOptions
|
|
1099
|
-
* @property {number} [amount]
|
|
1271
|
+
* @property {number} [amount] - The mandate amount.
|
|
1100
1272
|
*/
|
|
1101
1273
|
|
|
1102
1274
|
/**
|
|
1103
1275
|
* @typedef Message
|
|
1104
|
-
* @property {string} [message]
|
|
1276
|
+
* @property {string} [message] - A message providing details about the operation status.
|
|
1105
1277
|
*/
|
|
1106
1278
|
|
|
1107
1279
|
/**
|
|
1108
1280
|
* @typedef TopupRes
|
|
1109
|
-
* @property {string} [status]
|
|
1110
|
-
* @property {string} [aggregator_order_id]
|
|
1111
|
-
* @property {number} [amount]
|
|
1112
|
-
* @property {string} [currency]
|
|
1113
|
-
* @property {string} [transaction_id]
|
|
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.
|
|
1114
1286
|
*/
|
|
1115
1287
|
|
|
1116
1288
|
/**
|
|
1117
1289
|
* @typedef CancelTopupReq
|
|
1118
|
-
* @property {string} [order_id]
|
|
1290
|
+
* @property {string} [order_id] - The order ID of the top-up to cancel.
|
|
1119
1291
|
*/
|
|
1120
1292
|
|
|
1121
1293
|
/**
|
|
1122
1294
|
* @typedef CancelTopupRes
|
|
1123
|
-
* @property {string} [_id]
|
|
1124
|
-
* @property {string} [subscriber_id]
|
|
1125
|
-
* @property {number} [amount]
|
|
1126
|
-
* @property {string} [currency]
|
|
1127
|
-
* @property {string} [aggregator]
|
|
1128
|
-
* @property {string} [aggregator_order_id]
|
|
1129
|
-
* @property {string} [created_at]
|
|
1130
|
-
* @property {string} [modified_at]
|
|
1131
|
-
* @property {number} [__v]
|
|
1132
|
-
* @property {string} [aggregator_status]
|
|
1133
|
-
* @property {string} [current_status]
|
|
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.
|
|
1134
1306
|
*/
|
|
1135
1307
|
|
|
1136
1308
|
/**
|
|
1137
1309
|
* @typedef DefaultReq
|
|
1138
|
-
* @property {string} [payment_method_id]
|
|
1310
|
+
* @property {string} [payment_method_id] - The ID of the payment method to set
|
|
1311
|
+
* as default.
|
|
1312
|
+
*/
|
|
1313
|
+
|
|
1314
|
+
/**
|
|
1315
|
+
* @typedef EntityChargeRecurring
|
|
1316
|
+
* @property {string} interval - The interval of the subscription.
|
|
1317
|
+
*/
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* @typedef ChargeLineItem
|
|
1321
|
+
* @property {string} name - Its name of the extension plan.
|
|
1322
|
+
* @property {string} term - It indicates how it will be charged.
|
|
1323
|
+
* @property {string} pricing_type - It indicates the extension subscription
|
|
1324
|
+
* will be auto renewed timely.
|
|
1325
|
+
* @property {EntityChargePrice} price
|
|
1326
|
+
* @property {EntityChargeRecurring} [recurring]
|
|
1327
|
+
* @property {number} [capped_amount]
|
|
1328
|
+
* @property {number} [trial_days]
|
|
1329
|
+
* @property {boolean} [is_test]
|
|
1330
|
+
* @property {Object} [metadata]
|
|
1331
|
+
*/
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* @typedef CreateSubscriptionCharge
|
|
1335
|
+
* @property {string} name - The name of the charge.
|
|
1336
|
+
* @property {number} [trial_days]
|
|
1337
|
+
* @property {ChargeLineItem[]} line_items
|
|
1338
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
1339
|
+
* @property {string} return_url - The URL passed in request which extension
|
|
1340
|
+
* expects in return.
|
|
1341
|
+
*/
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* @typedef EntityChargeDetails
|
|
1345
|
+
* @property {string} [_id] - Unique identifier for the charge.
|
|
1346
|
+
* @property {string} [subscription_id] - Unique identifier of the extension subscription.
|
|
1347
|
+
* @property {string} [subscriber_id] - Unique identifier of the
|
|
1348
|
+
* subscriber/company who installed extension subscription.
|
|
1349
|
+
* @property {string} [entity_type] - The type of entity associated with the
|
|
1350
|
+
* charge (e.g., 'extension', 'subscription').
|
|
1351
|
+
* @property {string} [entity_id] - Unique identifier for the entity associated
|
|
1352
|
+
* with the charge.
|
|
1353
|
+
* @property {string} [name] - The name of the charge.
|
|
1354
|
+
* @property {string} [term] - Description of the charge term.
|
|
1355
|
+
* @property {string} [charge_type] - The type of charge (e.g., 'standalone',
|
|
1356
|
+
* 'recurring').
|
|
1357
|
+
* @property {string} [pricing_type] - The pricing model for the charge (e.g.,
|
|
1358
|
+
* 'one_time', 'recurring').
|
|
1359
|
+
* @property {EntityChargePrice} [price]
|
|
1360
|
+
* @property {ChargeRecurring} [recurring]
|
|
1361
|
+
* @property {string} [status] - Current status of the charge.
|
|
1362
|
+
* @property {number} [capped_amount] - Maximum amount that can be charged, if applicable.
|
|
1363
|
+
* @property {string} [activated_on] - Date and time when the charge was activated.
|
|
1364
|
+
* @property {string} [cancelled_on] - Date and time when the charge was cancelled.
|
|
1365
|
+
* @property {string} [billing_date] - Date and time when the charge was billed.
|
|
1366
|
+
* @property {SubscriptionTrialPeriod} [current_period]
|
|
1367
|
+
* @property {string} [modified_at] - Date and time when the charge details were
|
|
1368
|
+
* last modified.
|
|
1369
|
+
* @property {string} [created_at] - Date and time when the charge was created.
|
|
1370
|
+
* @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
|
|
1371
|
+
* @property {string} [company_id] - Company id.
|
|
1372
|
+
* @property {Object} [meta] - Additional metadata associated with the charge.
|
|
1373
|
+
* @property {number} [__v] - Internal version key for the charge record.
|
|
1374
|
+
*/
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* @typedef EntitySubscription
|
|
1378
|
+
* @property {string} [_id] - Unique identifier for the subscription charge
|
|
1379
|
+
* @property {string} [product_suit_id] - ID of the product suit associated with
|
|
1380
|
+
* the charge
|
|
1381
|
+
* @property {string} [entity_id] - Unique identifier for the entity
|
|
1382
|
+
* @property {string} [entity_type] - Type of entity (e.g., subscription, extension)
|
|
1383
|
+
* @property {string} [name] - Name of the subscription charge
|
|
1384
|
+
* @property {string} [status] - Current status of the subscription charge
|
|
1385
|
+
* @property {number} [trial_days] - Number of trial days provided
|
|
1386
|
+
* @property {boolean} [is_test] - Indicates if the charge is for testing purposes
|
|
1387
|
+
* @property {string} [created_at] - Timestamp when the charge was created
|
|
1388
|
+
* @property {string} [modified_at] - Timestamp when the charge was last modified
|
|
1389
|
+
* @property {string} [subscriber_id] - Unique Identifier of the company
|
|
1390
|
+
* @property {EntityChargeDetails[]} [line_items]
|
|
1391
|
+
* @property {string} [return_url] - The URL passed in request which extension
|
|
1392
|
+
* expects in return.
|
|
1393
|
+
*/
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* @typedef CreateSubscriptionResponse
|
|
1397
|
+
* @property {EntitySubscription} [subscription]
|
|
1398
|
+
* @property {string} [confirm_url] - URL to which users are redirected to
|
|
1399
|
+
* confirm or complete the payment or subscription process.
|
|
1139
1400
|
*/
|
|
1140
1401
|
|
|
1141
1402
|
class BillingPlatformModel {
|
|
@@ -1207,6 +1468,7 @@ class BillingPlatformModel {
|
|
|
1207
1468
|
credit_note_amount: Joi.number(),
|
|
1208
1469
|
created_at: Joi.string().allow(""),
|
|
1209
1470
|
modified_at: Joi.string().allow(""),
|
|
1471
|
+
invoice_type: Joi.string().allow(""),
|
|
1210
1472
|
});
|
|
1211
1473
|
}
|
|
1212
1474
|
|
|
@@ -1358,25 +1620,35 @@ class BillingPlatformModel {
|
|
|
1358
1620
|
seller_status: Joi.string().allow(""),
|
|
1359
1621
|
company: Joi.string().allow(""),
|
|
1360
1622
|
plan_platform_display_name: Joi.string().allow("").allow(null),
|
|
1623
|
+
tags: Joi.array().items(Joi.string().allow("")),
|
|
1624
|
+
});
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/** @returns {CountryRes} */
|
|
1628
|
+
static CountryRes() {
|
|
1629
|
+
return Joi.object({
|
|
1630
|
+
name: Joi.string().allow(""),
|
|
1631
|
+
code: Joi.string().allow(""),
|
|
1361
1632
|
});
|
|
1362
1633
|
}
|
|
1363
1634
|
|
|
1364
1635
|
/** @returns {Plan} */
|
|
1365
1636
|
static Plan() {
|
|
1366
1637
|
return Joi.object({
|
|
1367
|
-
fee_components: Joi.array().items(Joi.any()),
|
|
1638
|
+
fee_components: Joi.array().items(Joi.any()).allow(null, ""),
|
|
1368
1639
|
recurring: BillingPlatformModel.PlanRecurring(),
|
|
1369
1640
|
is_trial_plan: Joi.boolean(),
|
|
1370
1641
|
plan_group: Joi.string().allow(""),
|
|
1371
1642
|
tag_lines: Joi.array().items(Joi.string().allow("")),
|
|
1372
1643
|
currency: Joi.string().allow(""),
|
|
1644
|
+
approved_by: Joi.string().allow(""),
|
|
1373
1645
|
is_active: Joi.boolean(),
|
|
1374
1646
|
is_visible: Joi.boolean(),
|
|
1375
1647
|
trial_period: Joi.number(),
|
|
1376
1648
|
addons: Joi.array().items(Joi.string().allow("")),
|
|
1377
1649
|
tags: Joi.array().items(Joi.string().allow("")),
|
|
1378
1650
|
type: Joi.string().allow(""),
|
|
1379
|
-
country:
|
|
1651
|
+
country: BillingPlatformModel.CountryRes(),
|
|
1380
1652
|
_id: Joi.string().allow(""),
|
|
1381
1653
|
name: Joi.string().allow(""),
|
|
1382
1654
|
description: Joi.string().allow(""),
|
|
@@ -1389,7 +1661,7 @@ class BillingPlatformModel {
|
|
|
1389
1661
|
credit_line: BillingPlatformModel.CreditLine(),
|
|
1390
1662
|
current_status: Joi.string().allow(""),
|
|
1391
1663
|
channel_type: Joi.string().allow(""),
|
|
1392
|
-
company_ids: Joi.array().items(Joi.
|
|
1664
|
+
company_ids: Joi.array().items(Joi.string().allow("").allow(null)),
|
|
1393
1665
|
platform: Joi.string().allow("").allow(null),
|
|
1394
1666
|
activated_on: Joi.string().allow(""),
|
|
1395
1667
|
meta: BillingPlatformModel.PlanMeta(),
|
|
@@ -1644,6 +1916,7 @@ class BillingPlatformModel {
|
|
|
1644
1916
|
hash_identifier: Joi.string().allow(""),
|
|
1645
1917
|
payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
|
|
1646
1918
|
invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
|
|
1919
|
+
invoice_type: Joi.string().allow(""),
|
|
1647
1920
|
});
|
|
1648
1921
|
}
|
|
1649
1922
|
|
|
@@ -1671,6 +1944,7 @@ class BillingPlatformModel {
|
|
|
1671
1944
|
static SubscriptionBillingAddress() {
|
|
1672
1945
|
return Joi.object({
|
|
1673
1946
|
country: Joi.string().allow(""),
|
|
1947
|
+
country_code: Joi.string().allow(""),
|
|
1674
1948
|
state: Joi.string().allow(""),
|
|
1675
1949
|
city: Joi.string().allow(""),
|
|
1676
1950
|
line1: Joi.string().allow(""),
|
|
@@ -1758,6 +2032,7 @@ class BillingPlatformModel {
|
|
|
1758
2032
|
subscriber_id: Joi.string().allow(""),
|
|
1759
2033
|
plan_id: Joi.string().allow(""),
|
|
1760
2034
|
product_suite_id: Joi.string().allow(""),
|
|
2035
|
+
is_eligible_for_plan_change: Joi.boolean(),
|
|
1761
2036
|
plan_data: BillingPlatformModel.Plan(),
|
|
1762
2037
|
current_status: Joi.string().allow(""),
|
|
1763
2038
|
collection_method: Joi.string().allow(""),
|
|
@@ -1921,8 +2196,8 @@ class BillingPlatformModel {
|
|
|
1921
2196
|
});
|
|
1922
2197
|
}
|
|
1923
2198
|
|
|
1924
|
-
/** @returns {
|
|
1925
|
-
static
|
|
2199
|
+
/** @returns {SubscribePlan} */
|
|
2200
|
+
static SubscribePlan() {
|
|
1926
2201
|
return Joi.object({
|
|
1927
2202
|
entity_type: Joi.string().allow(""),
|
|
1928
2203
|
collection_type: Joi.string().allow(""),
|
|
@@ -2029,7 +2304,7 @@ class BillingPlatformModel {
|
|
|
2029
2304
|
static SubscriberData() {
|
|
2030
2305
|
return Joi.object({
|
|
2031
2306
|
pg_user_exists: Joi.boolean(),
|
|
2032
|
-
id: Joi.
|
|
2307
|
+
id: Joi.string().allow(""),
|
|
2033
2308
|
pg_customer_id: Joi.string().allow(""),
|
|
2034
2309
|
default_payment_method: Joi.string().allow(""),
|
|
2035
2310
|
});
|
|
@@ -2056,10 +2331,21 @@ class BillingPlatformModel {
|
|
|
2056
2331
|
});
|
|
2057
2332
|
}
|
|
2058
2333
|
|
|
2334
|
+
/** @returns {AuthorModifiedDetails} */
|
|
2335
|
+
static AuthorModifiedDetails() {
|
|
2336
|
+
return Joi.object({
|
|
2337
|
+
first_name: Joi.string().allow(""),
|
|
2338
|
+
last_name: Joi.string().allow(""),
|
|
2339
|
+
is_admin: Joi.boolean(),
|
|
2340
|
+
});
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2059
2343
|
/** @returns {Author} */
|
|
2060
2344
|
static Author() {
|
|
2061
2345
|
return Joi.object({
|
|
2062
|
-
modified_by_details:
|
|
2346
|
+
modified_by_details: BillingPlatformModel.AuthorModifiedDetails(),
|
|
2347
|
+
created_by: Joi.string().allow(""),
|
|
2348
|
+
modified_by: Joi.string().allow(""),
|
|
2063
2349
|
});
|
|
2064
2350
|
}
|
|
2065
2351
|
|
|
@@ -2067,7 +2353,7 @@ class BillingPlatformModel {
|
|
|
2067
2353
|
static EndingBalance() {
|
|
2068
2354
|
return Joi.object({
|
|
2069
2355
|
amount: Joi.number(),
|
|
2070
|
-
old_entry_ref: Joi.string().allow(""),
|
|
2356
|
+
old_entry_ref: Joi.string().allow("").allow(null),
|
|
2071
2357
|
});
|
|
2072
2358
|
}
|
|
2073
2359
|
|
|
@@ -2077,6 +2363,8 @@ class BillingPlatformModel {
|
|
|
2077
2363
|
transaction_id: Joi.string().allow(""),
|
|
2078
2364
|
aggregator: Joi.string().allow(""),
|
|
2079
2365
|
aggregator_order_id: Joi.string().allow(""),
|
|
2366
|
+
receipt_date: Joi.string().allow(""),
|
|
2367
|
+
unique_transaction_reference: Joi.string().allow(""),
|
|
2080
2368
|
});
|
|
2081
2369
|
}
|
|
2082
2370
|
|
|
@@ -2090,7 +2378,7 @@ class BillingPlatformModel {
|
|
|
2090
2378
|
currency: Joi.string().allow(""),
|
|
2091
2379
|
subscriber_id: Joi.string().allow(""),
|
|
2092
2380
|
description: Joi.string().allow(""),
|
|
2093
|
-
is_test: Joi.
|
|
2381
|
+
is_test: Joi.string().allow(""),
|
|
2094
2382
|
ending_balance: BillingPlatformModel.EndingBalance(),
|
|
2095
2383
|
payment: BillingPlatformModel.PaymentData(),
|
|
2096
2384
|
type: Joi.string().allow(""),
|
|
@@ -2445,7 +2733,7 @@ class BillingPlatformModel {
|
|
|
2445
2733
|
return Joi.object({
|
|
2446
2734
|
id: Joi.string().allow(""),
|
|
2447
2735
|
client_secret: Joi.string().allow(""),
|
|
2448
|
-
customer: Joi.
|
|
2736
|
+
customer: Joi.string().allow(""),
|
|
2449
2737
|
status: Joi.string().allow(""),
|
|
2450
2738
|
});
|
|
2451
2739
|
}
|
|
@@ -2455,7 +2743,7 @@ class BillingPlatformModel {
|
|
|
2455
2743
|
return Joi.object({
|
|
2456
2744
|
id: Joi.string().allow(""),
|
|
2457
2745
|
status: Joi.string().allow(""),
|
|
2458
|
-
customer: Joi.
|
|
2746
|
+
customer: Joi.string().allow(""),
|
|
2459
2747
|
client_secret: Joi.string().allow(""),
|
|
2460
2748
|
payment_method: Joi.string().allow(""),
|
|
2461
2749
|
mandate: Joi.string().allow(""),
|
|
@@ -2532,5 +2820,96 @@ class BillingPlatformModel {
|
|
|
2532
2820
|
payment_method_id: Joi.string().allow(""),
|
|
2533
2821
|
});
|
|
2534
2822
|
}
|
|
2823
|
+
|
|
2824
|
+
/** @returns {EntityChargeRecurring} */
|
|
2825
|
+
static EntityChargeRecurring() {
|
|
2826
|
+
return Joi.object({
|
|
2827
|
+
interval: Joi.string().allow("").required(),
|
|
2828
|
+
});
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2831
|
+
/** @returns {ChargeLineItem} */
|
|
2832
|
+
static ChargeLineItem() {
|
|
2833
|
+
return Joi.object({
|
|
2834
|
+
name: Joi.string().allow("").required(),
|
|
2835
|
+
term: Joi.string().allow("").required(),
|
|
2836
|
+
pricing_type: Joi.string().allow("").required(),
|
|
2837
|
+
price: BillingPlatformModel.EntityChargePrice().required(),
|
|
2838
|
+
recurring: BillingPlatformModel.EntityChargeRecurring(),
|
|
2839
|
+
capped_amount: Joi.number(),
|
|
2840
|
+
trial_days: Joi.number(),
|
|
2841
|
+
is_test: Joi.boolean(),
|
|
2842
|
+
metadata: Joi.any(),
|
|
2843
|
+
});
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
/** @returns {CreateSubscriptionCharge} */
|
|
2847
|
+
static CreateSubscriptionCharge() {
|
|
2848
|
+
return Joi.object({
|
|
2849
|
+
name: Joi.string().allow("").required(),
|
|
2850
|
+
trial_days: Joi.number(),
|
|
2851
|
+
line_items: Joi.array()
|
|
2852
|
+
.items(BillingPlatformModel.ChargeLineItem())
|
|
2853
|
+
.required(),
|
|
2854
|
+
is_test: Joi.boolean(),
|
|
2855
|
+
return_url: Joi.string().allow("").required(),
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
/** @returns {EntityChargeDetails} */
|
|
2860
|
+
static EntityChargeDetails() {
|
|
2861
|
+
return Joi.object({
|
|
2862
|
+
_id: Joi.string().allow(""),
|
|
2863
|
+
subscription_id: Joi.string().allow(""),
|
|
2864
|
+
subscriber_id: Joi.string().allow(""),
|
|
2865
|
+
entity_type: Joi.string().allow(""),
|
|
2866
|
+
entity_id: Joi.string().allow(""),
|
|
2867
|
+
name: Joi.string().allow(""),
|
|
2868
|
+
term: Joi.string().allow(""),
|
|
2869
|
+
charge_type: Joi.string().allow(""),
|
|
2870
|
+
pricing_type: Joi.string().allow(""),
|
|
2871
|
+
price: BillingPlatformModel.EntityChargePrice(),
|
|
2872
|
+
recurring: BillingPlatformModel.ChargeRecurring(),
|
|
2873
|
+
status: Joi.string().allow(""),
|
|
2874
|
+
capped_amount: Joi.number(),
|
|
2875
|
+
activated_on: Joi.string().allow("").allow(null),
|
|
2876
|
+
cancelled_on: Joi.string().allow("").allow(null),
|
|
2877
|
+
billing_date: Joi.string().allow("").allow(null),
|
|
2878
|
+
current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
|
|
2879
|
+
modified_at: Joi.string().allow(""),
|
|
2880
|
+
created_at: Joi.string().allow(""),
|
|
2881
|
+
is_test: Joi.boolean(),
|
|
2882
|
+
company_id: Joi.string().allow(""),
|
|
2883
|
+
meta: Joi.any(),
|
|
2884
|
+
__v: Joi.number(),
|
|
2885
|
+
});
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
/** @returns {EntitySubscription} */
|
|
2889
|
+
static EntitySubscription() {
|
|
2890
|
+
return Joi.object({
|
|
2891
|
+
_id: Joi.string().allow(""),
|
|
2892
|
+
product_suit_id: Joi.string().allow(""),
|
|
2893
|
+
entity_id: Joi.string().allow(""),
|
|
2894
|
+
entity_type: Joi.string().allow(""),
|
|
2895
|
+
name: Joi.string().allow(""),
|
|
2896
|
+
status: Joi.string().allow(""),
|
|
2897
|
+
trial_days: Joi.number(),
|
|
2898
|
+
is_test: Joi.boolean(),
|
|
2899
|
+
created_at: Joi.string().allow(""),
|
|
2900
|
+
modified_at: Joi.string().allow(""),
|
|
2901
|
+
subscriber_id: Joi.string().allow(""),
|
|
2902
|
+
line_items: Joi.array().items(BillingPlatformModel.EntityChargeDetails()),
|
|
2903
|
+
return_url: Joi.string().allow(""),
|
|
2904
|
+
});
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
/** @returns {CreateSubscriptionResponse} */
|
|
2908
|
+
static CreateSubscriptionResponse() {
|
|
2909
|
+
return Joi.object({
|
|
2910
|
+
subscription: BillingPlatformModel.EntitySubscription(),
|
|
2911
|
+
confirm_url: Joi.string().allow(""),
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2535
2914
|
}
|
|
2536
2915
|
module.exports = BillingPlatformModel;
|