@gofynd/fdk-client-javascript 1.4.8-beta.3 → 1.4.9

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.
Files changed (189) hide show
  1. package/README.md +26 -1
  2. package/package.json +2 -2
  3. package/sdk/application/ApplicationClient.d.ts +8 -0
  4. package/sdk/application/ApplicationClient.js +14 -0
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +20 -20
  6. package/sdk/application/Cart/CartApplicationClient.js +20 -20
  7. package/sdk/application/Cart/CartApplicationModel.d.ts +2446 -664
  8. package/sdk/application/Cart/CartApplicationModel.js +783 -552
  9. package/sdk/application/Cart/CartApplicationValidator.d.ts +268 -194
  10. package/sdk/application/Cart/CartApplicationValidator.js +100 -114
  11. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +53 -53
  12. package/sdk/application/Catalog/CatalogApplicationClient.js +53 -53
  13. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2012 -503
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +603 -453
  15. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +64 -64
  16. package/sdk/application/Catalog/CatalogApplicationValidator.js +32 -32
  17. package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
  18. package/sdk/application/Common/CommonApplicationClient.js +2 -2
  19. package/sdk/application/Common/CommonApplicationModel.d.ts +170 -90
  20. package/sdk/application/Common/CommonApplicationModel.js +59 -58
  21. package/sdk/application/Common/CommonApplicationValidator.d.ts +8 -5
  22. package/sdk/application/Common/CommonApplicationValidator.js +3 -3
  23. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +2 -2
  24. package/sdk/application/Communication/CommunicationApplicationClient.js +2 -2
  25. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +170 -35
  26. package/sdk/application/Communication/CommunicationApplicationModel.js +54 -33
  27. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +15 -15
  28. package/sdk/application/Configuration/ConfigurationApplicationClient.js +15 -15
  29. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +624 -443
  30. package/sdk/application/Configuration/ConfigurationApplicationModel.js +259 -248
  31. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +32 -24
  32. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +14 -13
  33. package/sdk/application/Content/ContentApplicationClient.d.ts +16 -16
  34. package/sdk/application/Content/ContentApplicationClient.js +16 -16
  35. package/sdk/application/Content/ContentApplicationModel.d.ts +1205 -282
  36. package/sdk/application/Content/ContentApplicationModel.js +341 -277
  37. package/sdk/application/Content/ContentApplicationValidator.d.ts +28 -17
  38. package/sdk/application/Content/ContentApplicationValidator.js +11 -10
  39. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +3 -3
  40. package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
  41. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +146 -37
  42. package/sdk/application/FileStorage/FileStorageApplicationModel.js +38 -36
  43. package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
  44. package/sdk/application/Lead/LeadApplicationClient.js +3 -3
  45. package/sdk/application/Lead/LeadApplicationModel.d.ts +195 -134
  46. package/sdk/application/Lead/LeadApplicationModel.js +110 -67
  47. package/sdk/application/Lead/LeadApplicationValidator.d.ts +8 -8
  48. package/sdk/application/Lead/LeadApplicationValidator.js +4 -4
  49. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +10 -10
  50. package/sdk/application/Logistic/LogisticApplicationClient.js +10 -10
  51. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +1039 -221
  52. package/sdk/application/Logistic/LogisticApplicationModel.js +342 -199
  53. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +76 -82
  54. package/sdk/application/Logistic/LogisticApplicationValidator.js +38 -41
  55. package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
  56. package/sdk/application/Order/OrderApplicationClient.js +10 -10
  57. package/sdk/application/Order/OrderApplicationModel.d.ts +1400 -325
  58. package/sdk/application/Order/OrderApplicationModel.js +391 -317
  59. package/sdk/application/Order/OrderApplicationValidator.d.ts +32 -30
  60. package/sdk/application/Order/OrderApplicationValidator.js +15 -14
  61. package/sdk/application/Payment/PaymentApplicationClient.d.ts +43 -43
  62. package/sdk/application/Payment/PaymentApplicationClient.js +43 -43
  63. package/sdk/application/Payment/PaymentApplicationModel.d.ts +1111 -1022
  64. package/sdk/application/Payment/PaymentApplicationModel.js +537 -521
  65. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +82 -49
  66. package/sdk/application/Payment/PaymentApplicationValidator.js +30 -30
  67. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +28 -7
  68. package/sdk/application/Rewards/RewardsApplicationModel.js +7 -7
  69. package/sdk/application/Share/ShareApplicationModel.d.ts +178 -38
  70. package/sdk/application/Share/ShareApplicationModel.js +53 -37
  71. package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -2
  72. package/sdk/application/Share/ShareApplicationValidator.js +2 -1
  73. package/sdk/application/Theme/ThemeApplicationClient.d.ts +4 -4
  74. package/sdk/application/Theme/ThemeApplicationClient.js +14 -8
  75. package/sdk/application/Theme/ThemeApplicationModel.d.ts +528 -287
  76. package/sdk/application/Theme/ThemeApplicationModel.js +208 -172
  77. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +17 -12
  78. package/sdk/application/Theme/ThemeApplicationValidator.js +8 -6
  79. package/sdk/application/User/UserApplicationClient.d.ts +36 -36
  80. package/sdk/application/User/UserApplicationClient.js +36 -36
  81. package/sdk/application/User/UserApplicationModel.d.ts +1062 -255
  82. package/sdk/application/User/UserApplicationModel.js +298 -244
  83. package/sdk/application/User/UserApplicationValidator.d.ts +80 -80
  84. package/sdk/application/User/UserApplicationValidator.js +40 -40
  85. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +1 -1
  86. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -1
  87. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +20 -5
  88. package/sdk/application/Webhook/WebhookApplicationModel.js +5 -5
  89. package/sdk/common/Clickstream.js +95 -15
  90. package/sdk/common/Constant.d.ts +9 -0
  91. package/sdk/common/Constant.js +11 -0
  92. package/sdk/common/Utility.js +19 -0
  93. package/sdk/common/utils.js +8 -1
  94. package/sdk/partner/Lead/LeadPartnerModel.d.ts +28 -7
  95. package/sdk/partner/Lead/LeadPartnerModel.js +7 -7
  96. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +28 -7
  97. package/sdk/partner/Logistics/LogisticsPartnerModel.js +7 -7
  98. package/sdk/partner/PartnerClient.d.ts +8 -0
  99. package/sdk/partner/PartnerClient.js +14 -0
  100. package/sdk/partner/Theme/ThemePartnerClient.d.ts +20 -0
  101. package/sdk/partner/Theme/ThemePartnerClient.js +158 -0
  102. package/sdk/partner/Theme/ThemePartnerModel.d.ts +45 -6
  103. package/sdk/partner/Theme/ThemePartnerModel.js +33 -4
  104. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
  105. package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
  106. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +28 -7
  107. package/sdk/partner/Webhook/WebhookPartnerModel.js +7 -7
  108. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +28 -7
  109. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +7 -7
  110. package/sdk/platform/Billing/BillingPlatformClient.d.ts +6 -397
  111. package/sdk/platform/Billing/BillingPlatformClient.js +77 -3215
  112. package/sdk/platform/Billing/BillingPlatformModel.d.ts +621 -2021
  113. package/sdk/platform/Billing/BillingPlatformModel.js +353 -2405
  114. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +12 -451
  115. package/sdk/platform/Billing/BillingPlatformValidator.js +8 -483
  116. package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -7
  117. package/sdk/platform/Cart/CartPlatformModel.js +8 -8
  118. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +12 -2
  119. package/sdk/platform/Catalog/CatalogPlatformClient.js +41 -1
  120. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +46 -12
  121. package/sdk/platform/Catalog/CatalogPlatformModel.js +14 -11
  122. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -0
  123. package/sdk/platform/Catalog/CatalogPlatformValidator.js +17 -0
  124. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +28 -7
  125. package/sdk/platform/Communication/CommunicationPlatformModel.js +7 -7
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -7
  127. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +7 -7
  128. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -97
  129. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +77 -782
  130. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +24 -701
  131. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +7 -539
  132. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +1 -183
  133. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +0 -134
  134. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
  135. package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -79
  136. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -15
  137. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -13
  138. package/sdk/platform/Content/ContentPlatformModel.d.ts +58 -17
  139. package/sdk/platform/Content/ContentPlatformModel.js +28 -15
  140. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +28 -7
  141. package/sdk/platform/Discount/DiscountPlatformModel.js +7 -7
  142. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +127 -25
  143. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +37 -25
  144. package/sdk/platform/Finance/FinancePlatformClient.d.ts +28 -28
  145. package/sdk/platform/Finance/FinancePlatformClient.js +28 -28
  146. package/sdk/platform/Finance/FinancePlatformModel.d.ts +1583 -347
  147. package/sdk/platform/Finance/FinancePlatformModel.js +463 -351
  148. package/sdk/platform/Lead/LeadPlatformModel.d.ts +28 -7
  149. package/sdk/platform/Lead/LeadPlatformModel.js +7 -7
  150. package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -0
  151. package/sdk/platform/Order/OrderPlatformClient.js +165 -0
  152. package/sdk/platform/Order/OrderPlatformModel.d.ts +613 -39
  153. package/sdk/platform/Order/OrderPlatformModel.js +359 -41
  154. package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -1
  155. package/sdk/platform/Order/OrderPlatformValidator.js +28 -0
  156. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +30 -9
  157. package/sdk/platform/Payment/PaymentPlatformModel.js +9 -9
  158. package/sdk/platform/PlatformClient.d.ts +8 -0
  159. package/sdk/platform/PlatformClient.js +14 -0
  160. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +28 -7
  161. package/sdk/platform/Rewards/RewardsPlatformModel.js +7 -7
  162. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +12 -9
  163. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +12 -9
  164. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +120 -22
  165. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +76 -21
  166. package/sdk/platform/Share/SharePlatformModel.d.ts +28 -7
  167. package/sdk/platform/Share/SharePlatformModel.js +7 -7
  168. package/sdk/platform/Theme/ThemePlatformModel.d.ts +18 -5
  169. package/sdk/platform/Theme/ThemePlatformModel.js +7 -4
  170. package/sdk/platform/User/UserPlatformModel.d.ts +18 -18
  171. package/sdk/platform/User/UserPlatformModel.js +9 -9
  172. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +28 -7
  173. package/sdk/platform/Webhook/WebhookPlatformModel.js +7 -7
  174. package/sdk/public/PublicClient.d.ts +0 -4
  175. package/sdk/public/PublicClient.js +0 -8
  176. package/sdk/public/index.d.ts +0 -2
  177. package/sdk/public/index.js +0 -4
  178. package/sdk/public/Billing/BillingPublicClient.d.ts +0 -45
  179. package/sdk/public/Billing/BillingPublicClient.js +0 -269
  180. package/sdk/public/Billing/BillingPublicModel.d.ts +0 -434
  181. package/sdk/public/Billing/BillingPublicModel.js +0 -395
  182. package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -34
  183. package/sdk/public/Billing/BillingPublicValidator.js +0 -38
  184. package/sdk/public/Inventory/InventoryPublicClient.d.ts +0 -87
  185. package/sdk/public/Inventory/InventoryPublicClient.js +0 -529
  186. package/sdk/public/Inventory/InventoryPublicModel.d.ts +0 -393
  187. package/sdk/public/Inventory/InventoryPublicModel.js +0 -448
  188. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +0 -91
  189. package/sdk/public/Inventory/InventoryPublicValidator.js +0 -85
@@ -1,155 +1,52 @@
1
1
  const Joi = require("joi");
2
2
 
3
- /**
4
- * @typedef CompanyInfo
5
- * @property {string} [company_name]
6
- * @property {string} [gstin]
7
- * @property {string} [address]
8
- * @property {AddressDetails} [address_details]
9
- * @property {string} [pan]
10
- * @property {string} [phone]
11
- * @property {string} [email]
12
- * @property {string} [cin]
13
- */
14
-
15
- /**
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]
23
- */
24
-
25
- /**
26
- * @typedef InvoiceData
27
- * @property {InvoiceDetailsData} [invoice]
28
- * @property {InvoiceItems[]} [invoice_items]
29
- * @property {CompanyInfo} [shopsense_details]
30
- */
31
-
32
- /**
33
- * @typedef InvoiceDetailsData
34
- * @property {number} [attemp]
35
- * @property {Object} [documents]
36
- * @property {Object} [payment]
37
- * @property {Period} [period]
38
- * @property {Client} [client]
39
- * @property {Object} [discount]
40
- * @property {Object} [taxation]
41
- * @property {string} [_id]
42
- * @property {boolean} [auto_advance]
43
- * @property {string} [collection_method]
44
- * @property {string} [subscriber_id]
45
- * @property {string} [currency]
46
- * @property {string} [invoice_url]
47
- * @property {string} [number]
48
- * @property {boolean} [paid]
49
- * @property {Object} [pg_data]
50
- * @property {string} [receipt_number]
51
- * @property {string} [statement_descriptor]
52
- * @property {string} [current_status]
53
- * @property {StatusTrail[]} [status_trail]
54
- * @property {number} [subtotal]
55
- * @property {number} [total]
56
- * @property {number} [old_settlement]
57
- * @property {number} [credit_balance]
58
- * @property {string} [subscription]
59
- * @property {number} [attempt]
60
- * @property {string} [next_action_time]
61
- * @property {number} [credit_note_amount]
62
- * @property {string} [created_at]
63
- * @property {string} [modified_at]
64
- */
65
-
66
- /**
67
- * @typedef Client
68
- * @property {string} [name]
69
- * @property {string} [email]
70
- * @property {string} [phone]
71
- * @property {string[]} [address_lines]
72
- */
73
-
74
- /**
75
- * @typedef Period
76
- * @property {string} [start]
77
- * @property {string} [end]
78
- */
79
-
80
- /**
81
- * @typedef StatusTrail
82
- * @property {string} [value]
83
- * @property {string} [timestamp]
84
- * @property {string} [_id]
85
- */
86
-
87
- /**
88
- * @typedef PaymentCollectRes
89
- * @property {string} [transaction_id]
90
- * @property {string} [current_status]
91
- */
92
-
93
3
  /**
94
4
  * @typedef SubscriptionChargeRes
95
- * @property {string} [_id]
96
- * @property {string} [product_suit_id]
97
- * @property {string} [entity_id]
98
- * @property {string} [entity_type]
99
- * @property {string} [name]
100
- * @property {string} [status]
101
- * @property {number} [trial_days]
102
- * @property {string} [activated_on]
103
- * @property {string} [cancelled_on]
104
- * @property {boolean} [is_test]
105
- * @property {string} [created_at]
106
- * @property {string} [modified_at]
107
- * @property {string} [company_id]
108
- * @property {Object[]} [line_items]
109
- */
110
-
111
- /**
112
- * @typedef PostDowngradeRes
113
- * @property {boolean} [success]
114
- * @property {DowngradeRes} [data]
115
- */
116
-
117
- /**
118
- * @typedef DowngradeRes
119
- * @property {string} [_id]
120
- * @property {string} [status]
121
- * @property {string} [subscriber_id]
122
- * @property {boolean} [activated]
123
- * @property {string} [created_at]
124
- * @property {string} [modified_at]
125
- * @property {string} [plan_id]
126
- * @property {string} [reason]
127
- * @property {string} [request_user_id]
128
- * @property {string} [subscription_id]
5
+ * @property {string} [_id] - Unique identifier for the subscription charge
6
+ * @property {string} [product_suit_id] - ID of the product suit associated with
7
+ * the charge
8
+ * @property {string} [entity_id] - Unique identifier for the entity
9
+ * @property {string} [entity_type] - Type of entity (e.g., subscription, extension)
10
+ * @property {string} [name] - Name of the subscription charge
11
+ * @property {string} [status] - Current status of the subscription charge
12
+ * @property {number} [trial_days] - Number of trial days provided
13
+ * @property {string} [activated_on] - Date when the charge was activated
14
+ * @property {string} [cancelled_on] - Date when the charge was cancelled
15
+ * @property {boolean} [is_test] - Indicates if the charge is for testing purposes
16
+ * @property {string} [created_at] - Timestamp when the charge was created
17
+ * @property {string} [modified_at] - Timestamp when the charge was last modified
18
+ * @property {string} [company_id] - Company id
19
+ * @property {Object[]} [line_items] - List of line items associated with the charge
129
20
  */
130
21
 
131
22
  /**
132
- * @typedef PaymentStatusData
133
- * @property {string} [_id]
134
- * @property {string} [journey]
135
- * @property {Object[]} [webhook_response]
136
- * @property {string} [aggregator_status]
137
- * @property {string} [current_status]
138
- * @property {string} [created_at]
139
- * @property {string} [modified_at]
140
- * @property {number} [__v]
141
- * @property {string} [aggregator_order_id]
142
- */
143
-
144
- /**
145
- * @typedef PaymentStatusResponse
146
- * @property {string} [status]
147
- * @property {PaymentStatusData} [data]
148
- */
149
-
150
- /**
151
- * @typedef BadRequest
152
- * @property {string} [message] - Failure message.
23
+ * @typedef ChargeDetails
24
+ * @property {string} [_id] - Unique identifier for the charge.
25
+ * @property {string} [entity_type] - The type of entity associated with the
26
+ * charge (e.g., 'extension', 'subscription').
27
+ * @property {string} [entity_id] - Unique identifier for the entity associated
28
+ * with the charge.
29
+ * @property {string} [name] - The name of the charge.
30
+ * @property {string} [term] - Description of the charge term.
31
+ * @property {string} [charge_type] - The type of charge (e.g., 'standalone',
32
+ * 'recurring').
33
+ * @property {string} [pricing_type] - The pricing model for the charge (e.g.,
34
+ * 'one_time', 'recurring').
35
+ * @property {EntityChargePrice} [price]
36
+ * @property {ChargeRecurring} [recurring]
37
+ * @property {string} [status] - Current status of the charge.
38
+ * @property {number} [capped_amount] - Maximum amount that can be charged, if applicable.
39
+ * @property {string} [activated_on] - Date and time when the charge was activated.
40
+ * @property {string} [cancelled_on] - Date and time when the charge was cancelled.
41
+ * @property {string} [billing_date] - Date and time when the charge was billed.
42
+ * @property {SubscriptionTrialPeriod} [current_period]
43
+ * @property {string} [modified_at] - Date and time when the charge details were
44
+ * last modified.
45
+ * @property {string} [created_at] - Date and time when the charge was created.
46
+ * @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
47
+ * @property {string} [company_id] - Company id.
48
+ * @property {Object} [meta] - Additional metadata associated with the charge.
49
+ * @property {number} [__v] - Internal version key for the charge record.
153
50
  */
154
51
 
155
52
  /**
@@ -159,2377 +56,428 @@ const Joi = require("joi");
159
56
  * @property {Object} [success]
160
57
  */
161
58
 
162
- /**
163
- * @typedef InternalServerError
164
- * @property {string} [message] - Internal server Server error
165
- * @property {string} [code] - Error code
166
- */
167
-
168
- /**
169
- * @typedef CheckValidityResponse
170
- * @property {boolean} [is_valid]
171
- * @property {number} [discount_amount]
172
- */
173
-
174
- /**
175
- * @typedef PlanRecurring
176
- * @property {string} [interval]
177
- * @property {number} [interval_count]
178
- */
179
-
180
- /**
181
- * @typedef PlanMeta
182
- * @property {string} [seller_status]
183
- * @property {string} [company]
184
- * @property {string} [plan_platform_display_name]
185
- */
186
-
187
- /**
188
- * @typedef Plan
189
- * @property {Object[]} [fee_components]
190
- * @property {PlanRecurring} [recurring]
191
- * @property {boolean} [is_trial_plan]
192
- * @property {string} [plan_group]
193
- * @property {string[]} [tag_lines]
194
- * @property {string} [currency]
195
- * @property {boolean} [is_active]
196
- * @property {boolean} [is_visible]
197
- * @property {number} [trial_period]
198
- * @property {string[]} [addons]
199
- * @property {string[]} [tags]
200
- * @property {string} [type]
201
- * @property {string} [country]
202
- * @property {string} [_id]
203
- * @property {string} [name]
204
- * @property {string} [description]
205
- * @property {number} [amount]
206
- * @property {string} [product_suite_id]
207
- * @property {string} [created_at]
208
- * @property {string} [modified_at]
209
- * @property {Taxation} [taxation]
210
- * @property {OneTimeFees} [one_time_fees]
211
- * @property {CreditLine} [credit_line]
212
- * @property {string} [current_status]
213
- * @property {string} [channel_type]
214
- * @property {Object[]} [company_ids]
215
- * @property {string} [platform]
216
- * @property {string} [activated_on]
217
- * @property {PlanMeta} [meta]
218
- * @property {string} [created_by]
219
- */
220
-
221
- /**
222
- * @typedef SubscriptionTrialPeriod
223
- * @property {string} [start_date]
224
- * @property {string} [end_date]
225
- */
226
-
227
- /**
228
- * @typedef EntityChargePrice
229
- * @property {number} [amount] - Amount for price. Minimum value 1
230
- * @property {string} [currency_code]
231
- */
232
-
233
- /**
234
- * @typedef OneTimeChargeItem
235
- * @property {string} [name]
236
- * @property {string} [term]
237
- * @property {string} [pricing_type]
238
- * @property {EntityChargePrice} [price]
239
- * @property {number} [capped_amount]
240
- * @property {boolean} [is_test]
241
- * @property {Object} [metadata]
242
- */
243
-
244
59
  /**
245
60
  * @typedef CreateOneTimeCharge
246
- * @property {string} [name]
61
+ * @property {string} [name] - The name of the one-time charge to be created.
247
62
  * @property {OneTimeChargeItem} [charge]
248
- * @property {boolean} [is_test]
249
- * @property {string} [return_url]
250
- */
251
-
252
- /**
253
- * @typedef ChargeRecurring
254
- * @property {string} [interval]
255
- * @property {number} [interval_time]
256
- */
257
-
258
- /**
259
- * @typedef ChargeDetails
260
- * @property {string} [_id]
261
- * @property {string} [entity_type]
262
- * @property {string} [entity_id]
263
- * @property {string} [name]
264
- * @property {string} [term]
265
- * @property {string} [charge_type]
266
- * @property {string} [pricing_type]
267
- * @property {EntityChargePrice} [price]
268
- * @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]
274
- * @property {SubscriptionTrialPeriod} [current_period]
275
- * @property {string} [modified_at]
276
- * @property {string} [created_at]
277
- * @property {boolean} [is_test]
278
- * @property {string} [company_id]
279
- * @property {Object} [meta]
280
- * @property {number} [__v]
281
- */
282
-
283
- /**
284
- * @typedef OneTimeChargeEntity
285
- * @property {string} [term]
286
- * @property {string} [charge_type]
287
- * @property {number} [capped_amount]
288
- * @property {string} [billing_date]
289
- * @property {string} [created_at]
290
- * @property {string} [modified_at]
291
- * @property {number} [__v]
292
- * @property {string} [_id]
293
- * @property {string} [name]
294
- * @property {string} [status]
295
- * @property {string} [activated_on]
296
- * @property {string} [cancelled_on]
297
- * @property {Object} [metadata]
298
- * @property {string} [return_url]
299
- * @property {boolean} [is_test]
300
- * @property {string} [pricing_type]
301
- * @property {string} [subscriber_id]
302
- * @property {string} [entity_type]
303
- * @property {string} [entity_id]
304
- * @property {Object} [meta]
305
- * @property {EntityChargePrice} [price]
63
+ * @property {boolean} [is_test] - Indicates whether the charge creation is for
64
+ * testing purposes.
65
+ * @property {string} [return_url] - URL to which the user will be redirected
66
+ * after creating the charge.
306
67
  */
307
68
 
308
69
  /**
309
70
  * @typedef CreateOneTimeChargeResponse
310
71
  * @property {Charge} [charge]
311
- * @property {string} [confirm_url]
312
- */
313
-
314
- /**
315
- * @typedef Charge
316
- * @property {OneTimeChargeEntity} [final_charge]
317
- */
318
-
319
- /**
320
- * @typedef InvoiceDetailsStatusTrail
321
- * @property {string} [_id]
322
- * @property {string} [value]
323
- * @property {string} [timestamp]
324
- */
325
-
326
- /**
327
- * @typedef InvoiceItemsPlanRecurring
328
- * @property {string} [interval]
329
- * @property {number} [interval_count]
330
- */
331
-
332
- /**
333
- * @typedef InvoiceItemsPlan
334
- * @property {InvoiceItemsPlanRecurring} [recurring]
335
- * @property {boolean} [is_trial_plan]
336
- * @property {string} [plan_group]
337
- * @property {string[]} [tag_lines]
338
- * @property {string} [currency]
339
- * @property {boolean} [is_active]
340
- * @property {boolean} [is_visible]
341
- * @property {number} [trial_period]
342
- * @property {string[]} [addons]
343
- * @property {string[]} [tags]
344
- * @property {string} [type]
345
- * @property {string} [country]
346
- * @property {string} [_id]
347
- * @property {string} [name]
348
- * @property {string} [description]
349
- * @property {number} [amount]
350
- * @property {string} [product_suite_id]
351
- * @property {string} [created_at]
352
- * @property {string} [modified_at]
353
- */
354
-
355
- /**
356
- * @typedef InvoiceItemsPeriod
357
- * @property {string} [start]
358
- * @property {string} [end]
359
- */
360
-
361
- /**
362
- * @typedef InvoiceItems
363
- * @property {string} [_id]
364
- * @property {string} [currency]
365
- * @property {InvoiceItemsPlan} [plan]
366
- * @property {string} [name]
367
- * @property {number} [quantity]
368
- * @property {string} [description]
369
- * @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]
376
- */
377
-
378
- /**
379
- * @typedef InvoicesDataClient
380
- * @property {string} [name]
381
- * @property {string} [email]
382
- * @property {string} [phone]
383
- * @property {string[]} [address_lines]
384
- */
385
-
386
- /**
387
- * @typedef InvoicesDataPeriod
388
- * @property {string} [start]
389
- * @property {string} [end]
390
- */
391
-
392
- /**
393
- * @typedef InvoicesDataPaymentMethod
394
- * @property {string} [pg_payment_method_id]
395
- */
396
-
397
- /**
398
- * @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
- * @property {Object} [discount]
405
- * @property {Object} [taxation]
406
- * @property {number} [credit_note_amount]
407
- * @property {InvoicesDataClient} [client]
408
- * @property {boolean} [auto_advance]
409
- * @property {string} [currency]
410
- * @property {boolean} [paid]
411
- * @property {number} [attemp]
412
- * @property {string} [collection_method]
413
- * @property {string} [subscriber_id]
414
- * @property {string} [invoice_url]
415
- * @property {string} [number]
416
- * @property {Object} [pg_data]
417
- * @property {InvoicesDataPeriod} [period]
418
- * @property {string} [receipt_number]
419
- * @property {string} [statement_descriptor]
420
- * @property {string} [current_status]
421
- * @property {InvoiceDetailsStatusTrail[]} [status_trail]
422
- * @property {number} [subtotal]
423
- * @property {number} [total]
424
- * @property {string} [subscription]
425
- * @property {string} [next_action_time]
426
- * @property {string} [created_at]
427
- * @property {string} [modified_at]
428
- * @property {string} [hash_identifier]
429
- * @property {InvoicesDataPaymentMethod} [payment_method]
430
- * @property {InvoiceItems[]} [invoice_items]
431
- */
432
-
433
- /**
434
- * @typedef Invoices
435
- * @property {InvoicesData[]} [data]
436
- * @property {number} [start]
437
- * @property {number} [end]
438
- * @property {number} [limit]
439
- * @property {number} [page]
440
- * @property {number} [total]
441
- */
442
-
443
- /**
444
- * @typedef Phone
445
- * @property {string} [phone_number]
446
- * @property {string} [phone_country_code]
447
- */
448
-
449
- /**
450
- * @typedef SubscriptionBillingAddress
451
- * @property {string} [country]
452
- * @property {string} [state]
453
- * @property {string} [city]
454
- * @property {string} [line1]
455
- * @property {string} [line2]
456
- * @property {string} [postal_code]
457
- */
458
-
459
- /**
460
- * @typedef SubscriptionCustomer
461
- * @property {Phone} [phone]
462
- * @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
- * @property {Object} [data]
471
- * @property {Object} [documents]
472
- * @property {boolean} [consent]
473
- * @property {boolean} [comms]
474
- * @property {number} [credit_balance]
475
- * @property {BusinessCountryInfo} [business_country_info]
476
- */
477
-
478
- /**
479
- * @typedef SubscriptionCustomerCreate
480
- * @property {Phone} [phone]
481
- * @property {SubscriptionBillingAddress} [billing_address]
482
- * @property {string} [unique_id]
483
- * @property {string} [type]
484
- * @property {string} [name]
485
- * @property {string} [email]
486
- */
487
-
488
- /**
489
- * @typedef SubscriptionCurrentPeriod
490
- * @property {string} [start]
491
- * @property {string} [end]
492
- */
493
-
494
- /**
495
- * @typedef SubscriptionPauseCollection
496
- * @property {string} [behavior]
497
- * @property {string} [resume_at]
498
- */
499
-
500
- /**
501
- * @typedef SubscriptionTrial
502
- * @property {string} [start]
503
- * @property {string} [end]
504
- */
505
-
506
- /**
507
- * @typedef SubscriptionInvoiceSettings
508
- * @property {boolean} [generation]
509
- * @property {boolean} [charging]
510
- */
511
-
512
- /**
513
- * @typedef Subscription
514
- * @property {Object} [meta]
515
- * @property {SubscriptionCurrentPeriod} [current_period]
516
- * @property {SubscriptionPauseCollection} [pause_collection]
517
- * @property {SubscriptionTrial} [trial]
518
- * @property {SubscriptionInvoiceSettings} [invoice_settings]
519
- * @property {boolean} [is_active]
520
- * @property {boolean} [cancel_at_period_end]
521
- * @property {string} [_id]
522
- * @property {string} [subscriber_id]
523
- * @property {string} [plan_id]
524
- * @property {string} [product_suite_id]
525
- * @property {Plan} [plan_data]
526
- * @property {string} [current_status]
527
- * @property {string} [collection_method]
528
- * @property {string} [created_at]
529
- * @property {string} [modified_at]
530
- * @property {string} [latest_invoice]
531
- * @property {string} [channel_type]
532
- * @property {boolean} [freezed]
533
- * @property {string} [cancel_at]
534
- * @property {string} [canceled_at]
535
- */
536
-
537
- /**
538
- * @typedef SubscriptionStatus
539
- * @property {boolean} [is_enabled]
540
- * @property {Subscription} [subscription]
541
- * @property {InvoicesData} [latest_invoice]
542
- * @property {Plan} [next_plan]
543
- * @property {Subscription[]} [current_subscriptions]
544
- * @property {number} [mandate_amount]
545
- * @property {string} [message]
546
- */
547
-
548
- /**
549
- * @typedef SubscriptionLimitApplication
550
- * @property {boolean} [enabled]
551
- * @property {number} [hard_limit]
552
- * @property {number} [soft_limit]
553
- */
554
-
555
- /**
556
- * @typedef SubscriptionLimitMarketplace
557
- * @property {boolean} [enabled]
558
- */
559
-
560
- /**
561
- * @typedef SubscriptionLimitOtherPlatform
562
- * @property {boolean} [enabled]
563
- */
564
-
565
- /**
566
- * @typedef SubscriptionLimitTeam
567
- * @property {number} [limit]
568
- */
569
-
570
- /**
571
- * @typedef SubscriptionLimitProducts
572
- * @property {boolean} [bulk]
573
- * @property {number} [limit]
574
- */
575
-
576
- /**
577
- * @typedef SubscriptionLimitExtensions
578
- * @property {boolean} [enabled]
579
- * @property {number} [limit]
580
- */
581
-
582
- /**
583
- * @typedef SubscriptionLimitIntegrations
584
- * @property {boolean} [enabled]
585
- * @property {number} [limit]
586
- */
587
-
588
- /**
589
- * @typedef SubscriptionLimit
590
- * @property {SubscriptionLimitApplication} [application]
591
- * @property {SubscriptionLimitMarketplace} [marketplace]
592
- * @property {SubscriptionLimitOtherPlatform} [other_platform]
593
- * @property {SubscriptionLimitTeam} [team]
594
- * @property {SubscriptionLimitProducts} [products]
595
- * @property {SubscriptionLimitExtensions} [extensions]
596
- * @property {SubscriptionLimitIntegrations} [integrations]
597
- * @property {boolean} [is_trial_plan]
598
- */
599
-
600
- /**
601
- * @typedef IntentReq
602
- * @property {string} [unique_external_id]
603
- * @property {string} [plan_id]
604
- */
605
-
606
- /**
607
- * @typedef PutIntentReq
608
- * @property {string} [unique_external_id]
609
- * @property {string} [setup_intent_id]
610
- * @property {string} [payment_method_id]
611
- * @property {boolean} [set_default]
612
- */
613
-
614
- /**
615
- * @typedef SubscriptionActivateReq
616
- * @property {string} [unique_id]
617
- * @property {string} [type]
618
- * @property {string} [product_suite]
619
- * @property {string} [plan_id]
620
- * @property {string} [payment_method]
621
- * @property {string} [subscription_id]
622
- * @property {string} [coupon]
623
- * @property {Object} [meta]
624
- */
625
-
626
- /**
627
- * @typedef SubscriptionActivateRes
628
- * @property {boolean} [success]
629
- * @property {Subscription} [data]
630
- */
631
-
632
- /**
633
- * @typedef CancelSubscriptionReq
634
- * @property {string} [unique_id]
635
- * @property {string} [type]
636
- * @property {string} [product_suite]
637
- * @property {string} [subscription_id]
638
- */
639
-
640
- /**
641
- * @typedef CancelSubscriptionRes
642
- * @property {boolean} [success]
643
- * @property {Subscription} [data]
644
- */
645
-
646
- /**
647
- * @typedef PlanStatusUpdateReq
648
- * @property {string} [plan_id]
649
- * @property {string} [reason]
650
- * @property {string} [seller_status]
651
- */
652
-
653
- /**
654
- * @typedef SunscribePlan
655
- * @property {string} [entity_type]
656
- * @property {string} [collection_type]
657
- * @property {string} [plan_id]
658
- * @property {string} [callback_url]
659
- * @property {Meta} [meta]
660
- */
661
-
662
- /**
663
- * @typedef Meta
664
- * @property {boolean} [subscribe]
665
- * @property {boolean} [is_custom_plan]
666
- * @property {boolean} [is_plan_upgrade]
667
- */
668
-
669
- /**
670
- * @typedef SubscribePlanRes
671
- * @property {string} [redirect_url]
672
- * @property {string} [transaction_id]
673
- * @property {string} [current_status]
674
- * @property {Meta} [meta]
675
- */
676
-
677
- /**
678
- * @typedef EntityDetail
679
- * @property {string} [entity]
680
- * @property {Subscription} [item]
681
- */
682
-
683
- /**
684
- * @typedef PaymentOptions
685
- * @property {string} [_id]
686
- * @property {string} [name]
687
- * @property {string} [description]
688
- * @property {string} [logo]
689
- * @property {string} [aggregator_id]
690
- * @property {string} [aggregator]
691
- * @property {string} [created_at]
692
- * @property {string} [modified_at]
693
- * @property {number} [__v]
694
- */
695
-
696
- /**
697
- * @typedef VerifyPaymentReq
698
- * @property {string} [razorpay_payment_id]
699
- * @property {string} [razorpay_order_id]
700
- * @property {string} [razorpay_signature]
701
- * @property {number} [status_code]
702
- * @property {string} [provider_type]
703
- */
704
-
705
- /**
706
- * @typedef Documents
707
- * @property {string} [pan]
708
- * @property {string} [gst]
709
- */
710
-
711
- /**
712
- * @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]
720
- */
721
-
722
- /**
723
- * @typedef Currency
724
- * @property {string} [code]
725
- * @property {string} [symbol]
726
- * @property {string} [name]
727
- */
728
-
729
- /**
730
- * @typedef BusinessCountryInfo
731
- * @property {string} [country]
732
- * @property {string} [country_code]
733
- * @property {Currency} [currency]
734
- * @property {string} [timezone]
735
- */
736
-
737
- /**
738
- * @typedef SubscriberData
739
- * @property {boolean} [pg_user_exists]
740
- * @property {Object} [id]
741
- * @property {string} [pg_customer_id]
742
- * @property {string} [default_payment_method]
743
- */
744
-
745
- /**
746
- * @typedef Subscriber
747
- * @property {Documents} [documents]
748
- * @property {Object} [phone]
749
- * @property {BillingAddress} [billing_address]
750
- * @property {boolean} [consent]
751
- * @property {boolean} [comms]
752
- * @property {string} [_id]
753
- * @property {string} [type]
754
- * @property {string} [unique_id]
755
- * @property {string} [name]
756
- * @property {string} [email]
757
- * @property {BusinessCountryInfo} [business_country_info]
758
- * @property {string} [created_at]
759
- * @property {string} [modified_at]
760
- * @property {number} [credit_balance]
761
- * @property {SubscriberData} [data]
762
- */
763
-
764
- /**
765
- * @typedef Author
766
- * @property {Object} [modified_by_details]
72
+ * @property {string} [confirm_url] - URL to which users are redirected to
73
+ * confirm or complete the payment or subscription process.
767
74
  */
768
75
 
769
76
  /**
770
- * @typedef EndingBalance
771
- * @property {number} [amount]
772
- * @property {string} [old_entry_ref]
77
+ * @typedef BadRequest
78
+ * @property {string} [message] - Failure message.
773
79
  */
774
80
 
775
81
  /**
776
- * @typedef PaymentData
777
- * @property {string} [transaction_id]
778
- * @property {string} [aggregator]
779
- * @property {string} [aggregator_order_id]
82
+ * @typedef CreateSubscriptionCharge
83
+ * @property {string} name - The name of the charge.
84
+ * @property {number} [trial_days]
85
+ * @property {ChargeLineItem[]} line_items
86
+ * @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
87
+ * @property {string} return_url - The URL passed in request which extension
88
+ * expects in return.
780
89
  */
781
90
 
782
91
  /**
783
- * @typedef CreditTransaction
784
- * @property {Object} [entity]
785
- * @property {Author} [author]
786
- * @property {string} [_id]
787
- * @property {number} [amount]
788
- * @property {string} [currency]
789
- * @property {string} [subscriber_id]
790
- * @property {string} [description]
791
- * @property {Object} [is_test]
792
- * @property {EndingBalance} [ending_balance]
793
- * @property {PaymentData} [payment]
794
- * @property {string} [type]
795
- * @property {string} [created_at]
796
- * @property {string} [modified_at]
92
+ * @typedef CreateSubscriptionResponse
93
+ * @property {EntitySubscription} [subscription]
94
+ * @property {string} [confirm_url] - URL to which users are redirected to
95
+ * confirm or complete the payment or subscription process.
797
96
  */
798
97
 
799
98
  /**
800
- * @typedef VerifyPaymentData
801
- * @property {boolean} [success]
802
- * @property {Subscriber} [subscriber]
803
- * @property {CreditTransaction} [credit_transaction]
99
+ * @typedef EntityChargePrice
100
+ * @property {number} [amount] - The amount for the price. The minimum value is 1.
101
+ * @property {string} [currency_code] - The currency code for the price
804
102
  */
805
103
 
806
- /**
807
- * @typedef VerifyPaymentRes
808
- * @property {string} [status]
809
- * @property {VerifyPaymentData} [data]
810
- */
811
-
812
- /**
813
- * @typedef DefaultMerchants
814
- * @property {string} [stripe]
815
- */
816
-
817
- /**
818
- * @typedef GlobalSettingsPayment
819
- * @property {DefaultMerchants} [default_merchants]
820
- */
821
-
822
- /**
823
- * @typedef GlobalSettingsData
824
- * @property {GlobalSettingsPayment} [payment]
825
- * @property {boolean} [freeze_panel]
826
- * @property {string} [_id]
827
- * @property {string} [created_at]
828
- * @property {string} [modified_at]
829
- */
830
-
831
- /**
832
- * @typedef GlobalSettings
833
- * @property {string} [status]
834
- * @property {GlobalSettingsData} [data]
835
- */
836
-
837
- /**
838
- * @typedef MethodChecks
839
- * @property {string} [address_line1_check]
840
- * @property {string} [address_postal_code_check]
841
- * @property {string} [cvc_check]
842
- */
843
-
844
- /**
845
- * @typedef MethodNetworks
846
- * @property {string[]} [available]
847
- * @property {string} [preferred]
848
- */
849
-
850
- /**
851
- * @typedef MethodSecureUsage
852
- * @property {boolean} [supported]
853
- */
854
-
855
- /**
856
- * @typedef MethodDetails
857
- * @property {string} [id]
858
- * @property {string} [type]
859
- * @property {boolean} [mandate_available]
860
- * @property {number} [mandate_amount]
861
- * @property {string} [pg_payment_method_id]
862
- * @property {boolean} [is_default]
863
- * @property {SubscriptionMethodData} [data]
864
- */
865
-
866
- /**
867
- * @typedef SubscriptionMethodData
868
- * @property {string} [brand]
869
- * @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
- * @property {string} [last4]
877
- * @property {MethodNetworks} [networks]
878
- * @property {MethodSecureUsage} [three_d_secure_usage]
879
- * @property {string} [wallet]
880
- * @property {string} [name]
881
- * @property {boolean} [is_default]
882
- */
883
-
884
- /**
885
- * @typedef SubscriptionMethods
886
- * @property {boolean} [success]
887
- * @property {MethodDetails[]} [data]
888
- */
889
-
890
- /**
891
- * @typedef ConfigPublicKey
892
- * @property {string} [public_key]
893
- */
894
-
895
- /**
896
- * @typedef ConfigRes
897
- * @property {boolean} [success]
898
- * @property {string} [aggregator]
899
- * @property {ConfigPublicKey} [config]
900
- */
901
-
902
- /**
903
- * @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]
912
- */
913
-
914
- /**
915
- * @typedef PlanChangeDetails
916
- * @property {string} [status]
917
- * @property {PlanChangeData} [data]
918
- */
919
-
920
- /**
921
- * @typedef TransactionMeta
922
- * @property {string} [invoice_id]
923
- */
924
-
925
- /**
926
- * @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]
935
- * @property {TransactionMeta} [meta]
936
- * @property {string} [created_at]
937
- * @property {string} [modified_at]
938
- */
939
-
940
- /**
941
- * @typedef PaymentItems
942
- * @property {string} [name]
943
- * @property {string} [code]
944
- * @property {string} [aggregator]
945
- */
946
-
947
- /**
948
- * @typedef GetPaymentOptions
949
- * @property {PaymentItems[]} [payment_options]
950
- */
951
-
952
- /**
953
- * @typedef TopupReq
954
- * @property {number} [amount]
955
- * @property {string} [currency]
956
- * @property {string} [provider_type]
957
- */
958
-
959
- /**
960
- * @typedef SetupMandateReq
961
- * @property {string} [intent_id]
962
- * @property {string} [payment_method_id]
963
- */
964
-
965
- /**
966
- * @typedef SetupPaymentReq
967
- * @property {string} [payment_method]
968
- * @property {string} [payment_id]
969
- * @property {string} [plan_id]
970
- * @property {string} [invoice_id]
971
- */
972
-
973
- /**
974
- * @typedef SubscriptionRenewReq
975
- * @property {string} [invoice_id]
976
- * @property {string} [entity_type]
977
- * @property {string} [collection_type]
978
- * @property {string} [callback_url]
979
- * @property {RenewMeta} [meta]
980
- */
981
-
982
- /**
983
- * @typedef RenewMeta
984
- * @property {boolean} [invoice_payment]
985
- * @property {boolean} [renew]
986
- */
987
-
988
- /**
989
- * @typedef SubscriptionMethodsReq
990
- * @property {string} [unique_external_id]
991
- * @property {string} [setup_intent_id]
992
- * @property {string} [pg_payment_method_id]
993
- * @property {boolean} [set_default]
994
- */
995
-
996
- /**
997
- * @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]
1003
- */
1004
-
1005
- /**
1006
- * @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]
1013
- */
1014
-
1015
- /**
1016
- * @typedef Taxation
1017
- * @property {number} [gst] - GST percentage
1018
- */
1019
-
1020
- /**
1021
- * @typedef OneTimeFees
1022
- * @property {number} [developement]
1023
- * @property {number} [marketing]
1024
- */
1025
-
1026
- /**
1027
- * @typedef CreditLine
1028
- * @property {boolean} [is_active]
1029
- */
1030
-
1031
- /**
1032
- * @typedef StatusMessage
1033
- * @property {string} [status]
1034
- * @property {string} [message]
1035
- * @property {boolean} [success]
1036
- * @property {string} [code]
1037
- */
1038
-
1039
- /**
1040
- * @typedef PaymentCollectReq
1041
- * @property {string} [transaction_id]
1042
- * @property {boolean} [credit_balance]
1043
- * @property {string} [payment_mode]
1044
- * @property {string} [payment_method]
1045
- * @property {string} [invoice_id]
1046
- */
1047
-
1048
- /**
1049
- * @typedef SubscriptionRenewResMeta
1050
- * @property {boolean} [invoice_payment]
1051
- * @property {boolean} [renew]
1052
- */
1053
-
1054
- /**
1055
- * @typedef SubscriptionRenewRes
1056
- * @property {string} [redirect_url]
1057
- * @property {string} [transaction_id]
1058
- * @property {string} [current_status]
1059
- * @property {SubscriptionRenewResMeta} [meta]
1060
- */
1061
-
1062
- /**
1063
- * @typedef SetupIntentRes
1064
- * @property {boolean} [success]
1065
- * @property {SetupIntentData} [data]
1066
- */
1067
-
1068
- /**
1069
- * @typedef SetupIntentData
1070
- * @property {string} [id]
1071
- * @property {string} [client_secret]
1072
- * @property {Object} [customer]
1073
- * @property {string} [status]
1074
- */
1075
-
1076
- /**
1077
- * @typedef SetupPayment
1078
- * @property {string} [id]
1079
- * @property {string} [status]
1080
- * @property {Object} [customer]
1081
- * @property {string} [client_secret]
1082
- * @property {string} [payment_method]
1083
- * @property {string} [mandate]
1084
- * @property {PaymentMethodOptions} [payment_method_options]
1085
- */
1086
-
1087
- /**
1088
- * @typedef PaymentMethodOptions
1089
- * @property {Card} [card]
1090
- */
1091
-
1092
- /**
1093
- * @typedef Card
1094
- * @property {MandateOptions} [mandate_options]
1095
- */
1096
-
1097
- /**
1098
- * @typedef MandateOptions
1099
- * @property {number} [amount]
1100
- */
1101
-
1102
- /**
1103
- * @typedef Message
1104
- * @property {string} [message]
1105
- */
1106
-
1107
- /**
1108
- * @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]
1114
- */
1115
-
1116
- /**
1117
- * @typedef CancelTopupReq
1118
- * @property {string} [order_id]
1119
- */
1120
-
1121
- /**
1122
- * @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]
1134
- */
1135
-
1136
- /**
1137
- * @typedef DefaultReq
1138
- * @property {string} [payment_method_id]
1139
- */
1140
-
1141
- class BillingPlatformModel {
1142
- /** @returns {CompanyInfo} */
1143
- static CompanyInfo() {
1144
- return Joi.object({
1145
- company_name: Joi.string().allow(""),
1146
- gstin: Joi.string().allow(""),
1147
- address: Joi.string().allow(""),
1148
- address_details: BillingPlatformModel.AddressDetails(),
1149
- pan: Joi.string().allow(""),
1150
- phone: Joi.string().allow(""),
1151
- email: Joi.string().allow(""),
1152
- cin: Joi.string().allow(""),
1153
- });
1154
- }
1155
-
1156
- /** @returns {AddressDetails} */
1157
- static AddressDetails() {
1158
- return Joi.object({
1159
- address_line_1: Joi.string().allow(""),
1160
- address_line_2: Joi.string().allow(""),
1161
- city: Joi.string().allow(""),
1162
- pincode: Joi.string().allow(""),
1163
- state: Joi.string().allow(""),
1164
- country: Joi.string().allow(""),
1165
- });
1166
- }
1167
-
1168
- /** @returns {InvoiceData} */
1169
- static InvoiceData() {
1170
- return Joi.object({
1171
- invoice: BillingPlatformModel.InvoiceDetailsData(),
1172
- invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
1173
- shopsense_details: BillingPlatformModel.CompanyInfo(),
1174
- });
1175
- }
1176
-
1177
- /** @returns {InvoiceDetailsData} */
1178
- static InvoiceDetailsData() {
1179
- return Joi.object({
1180
- attemp: Joi.number().allow(null),
1181
- documents: Joi.any(),
1182
- payment: Joi.any(),
1183
- period: BillingPlatformModel.Period(),
1184
- client: BillingPlatformModel.Client(),
1185
- discount: Joi.any(),
1186
- taxation: Joi.any(),
1187
- _id: Joi.string().allow(""),
1188
- auto_advance: Joi.boolean(),
1189
- collection_method: Joi.string().allow(""),
1190
- subscriber_id: Joi.string().allow(""),
1191
- currency: Joi.string().allow(""),
1192
- invoice_url: Joi.string().allow(""),
1193
- number: Joi.string().allow(""),
1194
- paid: Joi.boolean(),
1195
- pg_data: Joi.any(),
1196
- receipt_number: Joi.string().allow(""),
1197
- statement_descriptor: Joi.string().allow(""),
1198
- current_status: Joi.string().allow(""),
1199
- status_trail: Joi.array().items(BillingPlatformModel.StatusTrail()),
1200
- subtotal: Joi.number(),
1201
- total: Joi.number(),
1202
- old_settlement: Joi.number().allow(null),
1203
- credit_balance: Joi.number().allow(null),
1204
- subscription: Joi.string().allow(""),
1205
- attempt: Joi.number(),
1206
- next_action_time: Joi.string().allow(""),
1207
- credit_note_amount: Joi.number(),
1208
- created_at: Joi.string().allow(""),
1209
- modified_at: Joi.string().allow(""),
1210
- });
1211
- }
1212
-
1213
- /** @returns {Client} */
1214
- static Client() {
1215
- return Joi.object({
1216
- name: Joi.string().allow(""),
1217
- email: Joi.string().allow(""),
1218
- phone: Joi.string().allow(""),
1219
- address_lines: Joi.array().items(Joi.string().allow("")),
1220
- });
1221
- }
1222
-
1223
- /** @returns {Period} */
1224
- static Period() {
1225
- return Joi.object({
1226
- start: Joi.string().allow(""),
1227
- end: Joi.string().allow(""),
1228
- });
1229
- }
1230
-
1231
- /** @returns {StatusTrail} */
1232
- static StatusTrail() {
1233
- return Joi.object({
1234
- value: Joi.string().allow(""),
1235
- timestamp: Joi.string().allow(""),
1236
- _id: Joi.string().allow(""),
1237
- });
1238
- }
1239
-
1240
- /** @returns {PaymentCollectRes} */
1241
- static PaymentCollectRes() {
1242
- return Joi.object({
1243
- transaction_id: Joi.string().allow(""),
1244
- current_status: Joi.string().allow(""),
1245
- });
1246
- }
1247
-
1248
- /** @returns {SubscriptionChargeRes} */
1249
- static SubscriptionChargeRes() {
1250
- return Joi.object({
1251
- _id: Joi.string().allow(""),
1252
- product_suit_id: Joi.string().allow(""),
1253
- entity_id: Joi.string().allow(""),
1254
- entity_type: Joi.string().allow(""),
1255
- name: Joi.string().allow(""),
1256
- status: Joi.string().allow(""),
1257
- trial_days: Joi.number(),
1258
- activated_on: Joi.string().allow(""),
1259
- cancelled_on: Joi.string().allow(""),
1260
- is_test: Joi.boolean(),
1261
- created_at: Joi.string().allow(""),
1262
- modified_at: Joi.string().allow(""),
1263
- company_id: Joi.string().allow(""),
1264
- line_items: Joi.array().items(Joi.any()),
1265
- });
1266
- }
1267
-
1268
- /** @returns {PostDowngradeRes} */
1269
- static PostDowngradeRes() {
1270
- return Joi.object({
1271
- success: Joi.boolean(),
1272
- data: BillingPlatformModel.DowngradeRes(),
1273
- });
1274
- }
1275
-
1276
- /** @returns {DowngradeRes} */
1277
- static DowngradeRes() {
1278
- return Joi.object({
1279
- _id: Joi.string().allow(""),
1280
- status: Joi.string().allow(""),
1281
- subscriber_id: Joi.string().allow(""),
1282
- activated: Joi.boolean(),
1283
- created_at: Joi.string().allow(""),
1284
- modified_at: Joi.string().allow(""),
1285
- plan_id: Joi.string().allow(""),
1286
- reason: Joi.string().allow(""),
1287
- request_user_id: Joi.string().allow(""),
1288
- subscription_id: Joi.string().allow(""),
1289
- });
1290
- }
1291
-
1292
- /** @returns {PaymentStatusData} */
1293
- static PaymentStatusData() {
1294
- return Joi.object({
1295
- _id: Joi.string().allow(""),
1296
- journey: Joi.string().allow(""),
1297
- webhook_response: Joi.array().items(Joi.any()),
1298
- aggregator_status: Joi.string().allow(""),
1299
- current_status: Joi.string().allow(""),
1300
- created_at: Joi.string().allow(""),
1301
- modified_at: Joi.string().allow(""),
1302
- __v: Joi.number(),
1303
- aggregator_order_id: Joi.string().allow(""),
1304
- });
1305
- }
1306
-
1307
- /** @returns {PaymentStatusResponse} */
1308
- static PaymentStatusResponse() {
1309
- return Joi.object({
1310
- status: Joi.string().allow(""),
1311
- data: BillingPlatformModel.PaymentStatusData(),
1312
- });
1313
- }
1314
-
1315
- /** @returns {BadRequest} */
1316
- static BadRequest() {
1317
- return Joi.object({
1318
- message: Joi.string().allow(""),
1319
- });
1320
- }
1321
-
1322
- /** @returns {ResourceNotFound} */
1323
- static ResourceNotFound() {
1324
- return Joi.object({
1325
- message: Joi.string().allow(""),
1326
- code: Joi.any(),
1327
- success: Joi.any(),
1328
- });
1329
- }
1330
-
1331
- /** @returns {InternalServerError} */
1332
- static InternalServerError() {
1333
- return Joi.object({
1334
- message: Joi.string().allow(""),
1335
- code: Joi.string().allow(""),
1336
- });
1337
- }
1338
-
1339
- /** @returns {CheckValidityResponse} */
1340
- static CheckValidityResponse() {
1341
- return Joi.object({
1342
- is_valid: Joi.boolean(),
1343
- discount_amount: Joi.number(),
1344
- });
1345
- }
1346
-
1347
- /** @returns {PlanRecurring} */
1348
- static PlanRecurring() {
1349
- return Joi.object({
1350
- interval: Joi.string().allow(""),
1351
- interval_count: Joi.number(),
1352
- });
1353
- }
1354
-
1355
- /** @returns {PlanMeta} */
1356
- static PlanMeta() {
1357
- return Joi.object({
1358
- seller_status: Joi.string().allow(""),
1359
- company: Joi.string().allow(""),
1360
- plan_platform_display_name: Joi.string().allow("").allow(null),
1361
- });
1362
- }
1363
-
1364
- /** @returns {Plan} */
1365
- static Plan() {
1366
- return Joi.object({
1367
- fee_components: Joi.array().items(Joi.any()),
1368
- recurring: BillingPlatformModel.PlanRecurring(),
1369
- is_trial_plan: Joi.boolean(),
1370
- plan_group: Joi.string().allow(""),
1371
- tag_lines: Joi.array().items(Joi.string().allow("")),
1372
- currency: Joi.string().allow(""),
1373
- is_active: Joi.boolean(),
1374
- is_visible: Joi.boolean(),
1375
- trial_period: Joi.number(),
1376
- addons: Joi.array().items(Joi.string().allow("")),
1377
- tags: Joi.array().items(Joi.string().allow("")),
1378
- type: Joi.string().allow(""),
1379
- country: Joi.string().allow(""),
1380
- _id: Joi.string().allow(""),
1381
- name: Joi.string().allow(""),
1382
- description: Joi.string().allow(""),
1383
- amount: Joi.number(),
1384
- product_suite_id: Joi.string().allow(""),
1385
- created_at: Joi.string().allow(""),
1386
- modified_at: Joi.string().allow(""),
1387
- taxation: BillingPlatformModel.Taxation(),
1388
- one_time_fees: BillingPlatformModel.OneTimeFees(),
1389
- credit_line: BillingPlatformModel.CreditLine(),
1390
- current_status: Joi.string().allow(""),
1391
- channel_type: Joi.string().allow(""),
1392
- company_ids: Joi.array().items(Joi.any()),
1393
- platform: Joi.string().allow("").allow(null),
1394
- activated_on: Joi.string().allow(""),
1395
- meta: BillingPlatformModel.PlanMeta(),
1396
- created_by: Joi.string().allow(""),
1397
- });
1398
- }
1399
-
1400
- /** @returns {SubscriptionTrialPeriod} */
1401
- static SubscriptionTrialPeriod() {
1402
- return Joi.object({
1403
- start_date: Joi.string().allow(""),
1404
- end_date: Joi.string().allow(""),
1405
- });
1406
- }
1407
-
1408
- /** @returns {EntityChargePrice} */
1409
- static EntityChargePrice() {
1410
- return Joi.object({
1411
- amount: Joi.number(),
1412
- currency_code: Joi.string().allow(""),
1413
- });
1414
- }
1415
-
1416
- /** @returns {OneTimeChargeItem} */
1417
- static OneTimeChargeItem() {
1418
- return Joi.object({
1419
- name: Joi.string().allow(""),
1420
- term: Joi.string().allow(""),
1421
- pricing_type: Joi.string().allow(""),
1422
- price: BillingPlatformModel.EntityChargePrice(),
1423
- capped_amount: Joi.number(),
1424
- is_test: Joi.boolean(),
1425
- metadata: Joi.any(),
1426
- });
1427
- }
1428
-
1429
- /** @returns {CreateOneTimeCharge} */
1430
- static CreateOneTimeCharge() {
1431
- return Joi.object({
1432
- name: Joi.string().allow(""),
1433
- charge: BillingPlatformModel.OneTimeChargeItem(),
1434
- is_test: Joi.boolean(),
1435
- return_url: Joi.string().allow(""),
1436
- });
1437
- }
1438
-
1439
- /** @returns {ChargeRecurring} */
1440
- static ChargeRecurring() {
1441
- return Joi.object({
1442
- interval: Joi.string().allow(""),
1443
- interval_time: Joi.number(),
1444
- });
1445
- }
1446
-
1447
- /** @returns {ChargeDetails} */
1448
- static ChargeDetails() {
1449
- return Joi.object({
1450
- _id: Joi.string().allow(""),
1451
- entity_type: Joi.string().allow(""),
1452
- entity_id: Joi.string().allow(""),
1453
- name: Joi.string().allow(""),
1454
- term: Joi.string().allow(""),
1455
- charge_type: Joi.string().allow(""),
1456
- pricing_type: Joi.string().allow(""),
1457
- price: BillingPlatformModel.EntityChargePrice(),
1458
- recurring: BillingPlatformModel.ChargeRecurring(),
1459
- status: Joi.string().allow(""),
1460
- capped_amount: Joi.number(),
1461
- activated_on: Joi.string().allow(""),
1462
- cancelled_on: Joi.string().allow(""),
1463
- billing_date: Joi.string().allow(""),
1464
- current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
1465
- modified_at: Joi.string().allow(""),
1466
- created_at: Joi.string().allow(""),
1467
- is_test: Joi.boolean(),
1468
- company_id: Joi.string().allow(""),
1469
- meta: Joi.any(),
1470
- __v: Joi.number(),
1471
- });
1472
- }
1473
-
1474
- /** @returns {OneTimeChargeEntity} */
1475
- static OneTimeChargeEntity() {
1476
- return Joi.object({
1477
- term: Joi.string().allow(""),
1478
- charge_type: Joi.string().allow(""),
1479
- capped_amount: Joi.number(),
1480
- billing_date: Joi.string().allow("").allow(null),
1481
- created_at: Joi.string().allow(""),
1482
- modified_at: Joi.string().allow(""),
1483
- __v: Joi.number(),
1484
- _id: Joi.string().allow(""),
1485
- name: Joi.string().allow(""),
1486
- status: Joi.string().allow(""),
1487
- activated_on: Joi.string().allow("").allow(null),
1488
- cancelled_on: Joi.string().allow("").allow(null),
1489
- metadata: Joi.any(),
1490
- return_url: Joi.string().allow(""),
1491
- is_test: Joi.boolean(),
1492
- pricing_type: Joi.string().allow(""),
1493
- subscriber_id: Joi.string().allow(""),
1494
- entity_type: Joi.string().allow(""),
1495
- entity_id: Joi.string().allow(""),
1496
- meta: Joi.any(),
1497
- price: BillingPlatformModel.EntityChargePrice(),
1498
- });
1499
- }
1500
-
1501
- /** @returns {CreateOneTimeChargeResponse} */
1502
- static CreateOneTimeChargeResponse() {
1503
- return Joi.object({
1504
- charge: BillingPlatformModel.Charge(),
1505
- confirm_url: Joi.string().allow(""),
1506
- });
1507
- }
1508
-
1509
- /** @returns {Charge} */
1510
- static Charge() {
1511
- return Joi.object({
1512
- final_charge: BillingPlatformModel.OneTimeChargeEntity(),
1513
- });
1514
- }
1515
-
1516
- /** @returns {InvoiceDetailsStatusTrail} */
1517
- static InvoiceDetailsStatusTrail() {
1518
- return Joi.object({
1519
- _id: Joi.string().allow(""),
1520
- value: Joi.string().allow(""),
1521
- timestamp: Joi.string().allow(""),
1522
- });
1523
- }
1524
-
1525
- /** @returns {InvoiceItemsPlanRecurring} */
1526
- static InvoiceItemsPlanRecurring() {
1527
- return Joi.object({
1528
- interval: Joi.string().allow(""),
1529
- interval_count: Joi.number(),
1530
- });
1531
- }
1532
-
1533
- /** @returns {InvoiceItemsPlan} */
1534
- static InvoiceItemsPlan() {
1535
- return Joi.object({
1536
- recurring: BillingPlatformModel.InvoiceItemsPlanRecurring(),
1537
- is_trial_plan: Joi.boolean(),
1538
- plan_group: Joi.string().allow(""),
1539
- tag_lines: Joi.array().items(Joi.string().allow("")),
1540
- currency: Joi.string().allow(""),
1541
- is_active: Joi.boolean(),
1542
- is_visible: Joi.boolean(),
1543
- trial_period: Joi.number(),
1544
- addons: Joi.array().items(Joi.string().allow("")),
1545
- tags: Joi.array().items(Joi.string().allow("")),
1546
- type: Joi.string().allow(""),
1547
- country: Joi.string().allow(""),
1548
- _id: Joi.string().allow(""),
1549
- name: Joi.string().allow(""),
1550
- description: Joi.string().allow(""),
1551
- amount: Joi.number(),
1552
- product_suite_id: Joi.string().allow(""),
1553
- created_at: Joi.string().allow(""),
1554
- modified_at: Joi.string().allow(""),
1555
- });
1556
- }
1557
-
1558
- /** @returns {InvoiceItemsPeriod} */
1559
- static InvoiceItemsPeriod() {
1560
- return Joi.object({
1561
- start: Joi.string().allow(""),
1562
- end: Joi.string().allow(""),
1563
- });
1564
- }
1565
-
1566
- /** @returns {InvoiceItems} */
1567
- static InvoiceItems() {
1568
- return Joi.object({
1569
- _id: Joi.string().allow(""),
1570
- currency: Joi.string().allow(""),
1571
- plan: BillingPlatformModel.InvoiceItemsPlan(),
1572
- name: Joi.string().allow(""),
1573
- quantity: Joi.number(),
1574
- description: Joi.string().allow(""),
1575
- period: BillingPlatformModel.InvoiceItemsPeriod(),
1576
- unit_amount: Joi.number(),
1577
- amount: Joi.number(),
1578
- type: Joi.string().allow(""),
1579
- invoice_id: Joi.string().allow(""),
1580
- created_at: Joi.string().allow(""),
1581
- modified_at: Joi.string().allow(""),
1582
- });
1583
- }
1584
-
1585
- /** @returns {InvoicesDataClient} */
1586
- static InvoicesDataClient() {
1587
- return Joi.object({
1588
- name: Joi.string().allow(""),
1589
- email: Joi.string().allow(""),
1590
- phone: Joi.string().allow(""),
1591
- address_lines: Joi.array().items(Joi.string().allow("")),
1592
- });
1593
- }
1594
-
1595
- /** @returns {InvoicesDataPeriod} */
1596
- static InvoicesDataPeriod() {
1597
- return Joi.object({
1598
- start: Joi.string().allow(""),
1599
- end: Joi.string().allow(""),
1600
- });
1601
- }
1602
-
1603
- /** @returns {InvoicesDataPaymentMethod} */
1604
- static InvoicesDataPaymentMethod() {
1605
- return Joi.object({
1606
- pg_payment_method_id: Joi.string().allow(""),
1607
- });
1608
- }
1609
-
1610
- /** @returns {InvoicesData} */
1611
- static InvoicesData() {
1612
- return Joi.object({
1613
- _id: Joi.string().allow(""),
1614
- documents: Joi.any(),
1615
- payment: Joi.any(),
1616
- old_settlement: Joi.number().allow(null),
1617
- credit_balance: Joi.number().allow(null),
1618
- discount: Joi.any(),
1619
- taxation: Joi.any(),
1620
- credit_note_amount: Joi.number(),
1621
- client: BillingPlatformModel.InvoicesDataClient(),
1622
- auto_advance: Joi.boolean(),
1623
- currency: Joi.string().allow(""),
1624
- paid: Joi.boolean(),
1625
- attemp: Joi.number(),
1626
- collection_method: Joi.string().allow(""),
1627
- subscriber_id: Joi.string().allow(""),
1628
- invoice_url: Joi.string().allow(""),
1629
- number: Joi.string().allow(""),
1630
- pg_data: Joi.any(),
1631
- period: BillingPlatformModel.InvoicesDataPeriod(),
1632
- receipt_number: Joi.string().allow(""),
1633
- statement_descriptor: Joi.string().allow(""),
1634
- current_status: Joi.string().allow(""),
1635
- status_trail: Joi.array().items(
1636
- BillingPlatformModel.InvoiceDetailsStatusTrail()
1637
- ),
1638
- subtotal: Joi.number(),
1639
- total: Joi.number(),
1640
- subscription: Joi.string().allow(""),
1641
- next_action_time: Joi.string().allow(""),
1642
- created_at: Joi.string().allow(""),
1643
- modified_at: Joi.string().allow(""),
1644
- hash_identifier: Joi.string().allow(""),
1645
- payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
1646
- invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
1647
- });
1648
- }
1649
-
1650
- /** @returns {Invoices} */
1651
- static Invoices() {
1652
- return Joi.object({
1653
- data: Joi.array().items(BillingPlatformModel.InvoicesData()),
1654
- start: Joi.number(),
1655
- end: Joi.number(),
1656
- limit: Joi.number(),
1657
- page: Joi.number(),
1658
- total: Joi.number(),
1659
- });
1660
- }
1661
-
1662
- /** @returns {Phone} */
1663
- static Phone() {
1664
- return Joi.object({
1665
- phone_number: Joi.string().allow(""),
1666
- phone_country_code: Joi.string().allow(""),
1667
- });
1668
- }
1669
-
1670
- /** @returns {SubscriptionBillingAddress} */
1671
- static SubscriptionBillingAddress() {
1672
- return Joi.object({
1673
- country: Joi.string().allow(""),
1674
- state: Joi.string().allow(""),
1675
- city: Joi.string().allow(""),
1676
- line1: Joi.string().allow(""),
1677
- line2: Joi.string().allow(""),
1678
- postal_code: Joi.string().allow(""),
1679
- });
1680
- }
1681
-
1682
- /** @returns {SubscriptionCustomer} */
1683
- static SubscriptionCustomer() {
1684
- return Joi.object({
1685
- phone: BillingPlatformModel.Phone(),
1686
- billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
1687
- _id: Joi.string().allow(""),
1688
- unique_id: Joi.string().allow(""),
1689
- type: Joi.string().allow(""),
1690
- name: Joi.string().allow(""),
1691
- email: Joi.string().allow(""),
1692
- created_at: Joi.string().allow(""),
1693
- modified_at: Joi.string().allow(""),
1694
- data: Joi.any(),
1695
- documents: Joi.any(),
1696
- consent: Joi.boolean(),
1697
- comms: Joi.boolean(),
1698
- credit_balance: Joi.number().allow(null),
1699
- business_country_info: BillingPlatformModel.BusinessCountryInfo(),
1700
- });
1701
- }
1702
-
1703
- /** @returns {SubscriptionCustomerCreate} */
1704
- static SubscriptionCustomerCreate() {
1705
- return Joi.object({
1706
- phone: BillingPlatformModel.Phone(),
1707
- billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
1708
- unique_id: Joi.string().allow(""),
1709
- type: Joi.string().allow(""),
1710
- name: Joi.string().allow(""),
1711
- email: Joi.string().allow(""),
1712
- });
1713
- }
1714
-
1715
- /** @returns {SubscriptionCurrentPeriod} */
1716
- static SubscriptionCurrentPeriod() {
1717
- return Joi.object({
1718
- start: Joi.string().allow(""),
1719
- end: Joi.string().allow(""),
1720
- });
1721
- }
1722
-
1723
- /** @returns {SubscriptionPauseCollection} */
1724
- static SubscriptionPauseCollection() {
1725
- return Joi.object({
1726
- behavior: Joi.string().allow(""),
1727
- resume_at: Joi.string().allow(""),
1728
- });
1729
- }
1730
-
1731
- /** @returns {SubscriptionTrial} */
1732
- static SubscriptionTrial() {
1733
- return Joi.object({
1734
- start: Joi.string().allow(""),
1735
- end: Joi.string().allow(""),
1736
- });
1737
- }
1738
-
1739
- /** @returns {SubscriptionInvoiceSettings} */
1740
- static SubscriptionInvoiceSettings() {
1741
- return Joi.object({
1742
- generation: Joi.boolean(),
1743
- charging: Joi.boolean(),
1744
- });
1745
- }
1746
-
1747
- /** @returns {Subscription} */
1748
- static Subscription() {
1749
- return Joi.object({
1750
- meta: Joi.any(),
1751
- current_period: BillingPlatformModel.SubscriptionCurrentPeriod(),
1752
- pause_collection: BillingPlatformModel.SubscriptionPauseCollection(),
1753
- trial: BillingPlatformModel.SubscriptionTrial(),
1754
- invoice_settings: BillingPlatformModel.SubscriptionInvoiceSettings(),
1755
- is_active: Joi.boolean(),
1756
- cancel_at_period_end: Joi.boolean(),
1757
- _id: Joi.string().allow(""),
1758
- subscriber_id: Joi.string().allow(""),
1759
- plan_id: Joi.string().allow(""),
1760
- product_suite_id: Joi.string().allow(""),
1761
- plan_data: BillingPlatformModel.Plan(),
1762
- current_status: Joi.string().allow(""),
1763
- collection_method: Joi.string().allow(""),
1764
- created_at: Joi.string().allow(""),
1765
- modified_at: Joi.string().allow(""),
1766
- latest_invoice: Joi.string().allow(""),
1767
- channel_type: Joi.string().allow(""),
1768
- freezed: Joi.boolean(),
1769
- cancel_at: Joi.string().allow(""),
1770
- canceled_at: Joi.string().allow(""),
1771
- });
1772
- }
1773
-
1774
- /** @returns {SubscriptionStatus} */
1775
- static SubscriptionStatus() {
1776
- return Joi.object({
1777
- is_enabled: Joi.boolean(),
1778
- subscription: BillingPlatformModel.Subscription(),
1779
- latest_invoice: BillingPlatformModel.InvoicesData(),
1780
- next_plan: BillingPlatformModel.Plan(),
1781
- current_subscriptions: Joi.array().items(
1782
- BillingPlatformModel.Subscription()
1783
- ),
1784
- mandate_amount: Joi.number(),
1785
- message: Joi.string().allow(""),
1786
- });
1787
- }
1788
-
1789
- /** @returns {SubscriptionLimitApplication} */
1790
- static SubscriptionLimitApplication() {
1791
- return Joi.object({
1792
- enabled: Joi.boolean(),
1793
- hard_limit: Joi.number(),
1794
- soft_limit: Joi.number(),
1795
- });
1796
- }
1797
-
1798
- /** @returns {SubscriptionLimitMarketplace} */
1799
- static SubscriptionLimitMarketplace() {
1800
- return Joi.object({
1801
- enabled: Joi.boolean(),
1802
- });
1803
- }
1804
-
1805
- /** @returns {SubscriptionLimitOtherPlatform} */
1806
- static SubscriptionLimitOtherPlatform() {
1807
- return Joi.object({
1808
- enabled: Joi.boolean(),
1809
- });
1810
- }
1811
-
1812
- /** @returns {SubscriptionLimitTeam} */
1813
- static SubscriptionLimitTeam() {
1814
- return Joi.object({
1815
- limit: Joi.number(),
1816
- });
1817
- }
1818
-
1819
- /** @returns {SubscriptionLimitProducts} */
1820
- static SubscriptionLimitProducts() {
1821
- return Joi.object({
1822
- bulk: Joi.boolean(),
1823
- limit: Joi.number(),
1824
- });
1825
- }
1826
-
1827
- /** @returns {SubscriptionLimitExtensions} */
1828
- static SubscriptionLimitExtensions() {
1829
- return Joi.object({
1830
- enabled: Joi.boolean(),
1831
- limit: Joi.number(),
1832
- });
1833
- }
1834
-
1835
- /** @returns {SubscriptionLimitIntegrations} */
1836
- static SubscriptionLimitIntegrations() {
1837
- return Joi.object({
1838
- enabled: Joi.boolean(),
1839
- limit: Joi.number(),
1840
- });
1841
- }
1842
-
1843
- /** @returns {SubscriptionLimit} */
1844
- static SubscriptionLimit() {
1845
- return Joi.object({
1846
- application: BillingPlatformModel.SubscriptionLimitApplication(),
1847
- marketplace: BillingPlatformModel.SubscriptionLimitMarketplace(),
1848
- other_platform: BillingPlatformModel.SubscriptionLimitOtherPlatform(),
1849
- team: BillingPlatformModel.SubscriptionLimitTeam(),
1850
- products: BillingPlatformModel.SubscriptionLimitProducts(),
1851
- extensions: BillingPlatformModel.SubscriptionLimitExtensions(),
1852
- integrations: BillingPlatformModel.SubscriptionLimitIntegrations(),
1853
- is_trial_plan: Joi.boolean(),
1854
- });
1855
- }
1856
-
1857
- /** @returns {IntentReq} */
1858
- static IntentReq() {
1859
- return Joi.object({
1860
- unique_external_id: Joi.string().allow(""),
1861
- plan_id: Joi.string().allow(""),
1862
- });
1863
- }
1864
-
1865
- /** @returns {PutIntentReq} */
1866
- static PutIntentReq() {
1867
- return Joi.object({
1868
- unique_external_id: Joi.string().allow(""),
1869
- setup_intent_id: Joi.string().allow(""),
1870
- payment_method_id: Joi.string().allow(""),
1871
- set_default: Joi.boolean(),
1872
- });
1873
- }
1874
-
1875
- /** @returns {SubscriptionActivateReq} */
1876
- static SubscriptionActivateReq() {
1877
- return Joi.object({
1878
- unique_id: Joi.string().allow(""),
1879
- type: Joi.string().allow(""),
1880
- product_suite: Joi.string().allow(""),
1881
- plan_id: Joi.string().allow(""),
1882
- payment_method: Joi.string().allow(""),
1883
- subscription_id: Joi.string().allow(""),
1884
- coupon: Joi.string().allow(""),
1885
- meta: Joi.any(),
1886
- });
1887
- }
1888
-
1889
- /** @returns {SubscriptionActivateRes} */
1890
- static SubscriptionActivateRes() {
1891
- return Joi.object({
1892
- success: Joi.boolean(),
1893
- data: BillingPlatformModel.Subscription(),
1894
- });
1895
- }
1896
-
1897
- /** @returns {CancelSubscriptionReq} */
1898
- static CancelSubscriptionReq() {
1899
- return Joi.object({
1900
- unique_id: Joi.string().allow(""),
1901
- type: Joi.string().allow(""),
1902
- product_suite: Joi.string().allow(""),
1903
- subscription_id: Joi.string().allow(""),
1904
- });
1905
- }
1906
-
1907
- /** @returns {CancelSubscriptionRes} */
1908
- static CancelSubscriptionRes() {
1909
- return Joi.object({
1910
- success: Joi.boolean(),
1911
- data: BillingPlatformModel.Subscription(),
1912
- });
1913
- }
1914
-
1915
- /** @returns {PlanStatusUpdateReq} */
1916
- static PlanStatusUpdateReq() {
1917
- return Joi.object({
1918
- plan_id: Joi.string().allow(""),
1919
- reason: Joi.string().allow(""),
1920
- seller_status: Joi.string().allow(""),
1921
- });
1922
- }
1923
-
1924
- /** @returns {SunscribePlan} */
1925
- static SunscribePlan() {
1926
- return Joi.object({
1927
- entity_type: Joi.string().allow(""),
1928
- collection_type: Joi.string().allow(""),
1929
- plan_id: Joi.string().allow(""),
1930
- callback_url: Joi.string().allow(""),
1931
- meta: BillingPlatformModel.Meta(),
1932
- });
1933
- }
1934
-
1935
- /** @returns {Meta} */
1936
- static Meta() {
1937
- return Joi.object({
1938
- subscribe: Joi.boolean(),
1939
- is_custom_plan: Joi.boolean(),
1940
- is_plan_upgrade: Joi.boolean(),
1941
- });
1942
- }
1943
-
1944
- /** @returns {SubscribePlanRes} */
1945
- static SubscribePlanRes() {
1946
- return Joi.object({
1947
- redirect_url: Joi.string().allow(""),
1948
- transaction_id: Joi.string().allow(""),
1949
- current_status: Joi.string().allow(""),
1950
- meta: BillingPlatformModel.Meta(),
1951
- });
1952
- }
1953
-
1954
- /** @returns {EntityDetail} */
1955
- static EntityDetail() {
1956
- return Joi.object({
1957
- entity: Joi.string().allow(""),
1958
- item: BillingPlatformModel.Subscription(),
1959
- });
1960
- }
1961
-
1962
- /** @returns {PaymentOptions} */
1963
- static PaymentOptions() {
1964
- return Joi.object({
1965
- _id: Joi.string().allow(""),
1966
- name: Joi.string().allow(""),
1967
- description: Joi.string().allow(""),
1968
- logo: Joi.string().allow(""),
1969
- aggregator_id: Joi.string().allow(""),
1970
- aggregator: Joi.string().allow(""),
1971
- created_at: Joi.string().allow(""),
1972
- modified_at: Joi.string().allow(""),
1973
- __v: Joi.number(),
1974
- });
1975
- }
1976
-
1977
- /** @returns {VerifyPaymentReq} */
1978
- static VerifyPaymentReq() {
1979
- return Joi.object({
1980
- razorpay_payment_id: Joi.string().allow(""),
1981
- razorpay_order_id: Joi.string().allow(""),
1982
- razorpay_signature: Joi.string().allow(""),
1983
- status_code: Joi.number(),
1984
- provider_type: Joi.string().allow(""),
1985
- });
1986
- }
1987
-
1988
- /** @returns {Documents} */
1989
- static Documents() {
1990
- return Joi.object({
1991
- pan: Joi.string().allow(""),
1992
- gst: Joi.string().allow(""),
1993
- });
1994
- }
1995
-
1996
- /** @returns {BillingAddress} */
1997
- static BillingAddress() {
1998
- return Joi.object({
1999
- country: Joi.string().allow(""),
2000
- state: Joi.string().allow(""),
2001
- city: Joi.string().allow(""),
2002
- line1: Joi.string().allow(""),
2003
- line2: Joi.string().allow(""),
2004
- postal_code: Joi.string().allow(""),
2005
- country_code: Joi.string().allow(""),
2006
- });
2007
- }
2008
-
2009
- /** @returns {Currency} */
2010
- static Currency() {
2011
- return Joi.object({
2012
- code: Joi.string().allow(""),
2013
- symbol: Joi.string().allow(""),
2014
- name: Joi.string().allow(""),
2015
- });
2016
- }
2017
-
2018
- /** @returns {BusinessCountryInfo} */
2019
- static BusinessCountryInfo() {
2020
- return Joi.object({
2021
- country: Joi.string().allow(""),
2022
- country_code: Joi.string().allow(""),
2023
- currency: BillingPlatformModel.Currency(),
2024
- timezone: Joi.string().allow(""),
2025
- });
2026
- }
2027
-
2028
- /** @returns {SubscriberData} */
2029
- static SubscriberData() {
2030
- return Joi.object({
2031
- pg_user_exists: Joi.boolean(),
2032
- id: Joi.any(),
2033
- pg_customer_id: Joi.string().allow(""),
2034
- default_payment_method: Joi.string().allow(""),
2035
- });
2036
- }
2037
-
2038
- /** @returns {Subscriber} */
2039
- static Subscriber() {
2040
- return Joi.object({
2041
- documents: BillingPlatformModel.Documents(),
2042
- phone: Joi.any(),
2043
- billing_address: BillingPlatformModel.BillingAddress(),
2044
- consent: Joi.boolean(),
2045
- comms: Joi.boolean(),
2046
- _id: Joi.string().allow(""),
2047
- type: Joi.string().allow(""),
2048
- unique_id: Joi.string().allow(""),
2049
- name: Joi.string().allow(""),
2050
- email: Joi.string().allow(""),
2051
- business_country_info: BillingPlatformModel.BusinessCountryInfo(),
2052
- created_at: Joi.string().allow(""),
2053
- modified_at: Joi.string().allow(""),
2054
- credit_balance: Joi.number().allow(null),
2055
- data: BillingPlatformModel.SubscriberData(),
2056
- });
2057
- }
2058
-
2059
- /** @returns {Author} */
2060
- static Author() {
2061
- return Joi.object({
2062
- modified_by_details: Joi.any(),
2063
- });
2064
- }
2065
-
2066
- /** @returns {EndingBalance} */
2067
- static EndingBalance() {
2068
- return Joi.object({
2069
- amount: Joi.number(),
2070
- old_entry_ref: Joi.string().allow(""),
2071
- });
2072
- }
2073
-
2074
- /** @returns {PaymentData} */
2075
- static PaymentData() {
2076
- return Joi.object({
2077
- transaction_id: Joi.string().allow(""),
2078
- aggregator: Joi.string().allow(""),
2079
- aggregator_order_id: Joi.string().allow(""),
2080
- });
2081
- }
2082
-
2083
- /** @returns {CreditTransaction} */
2084
- static CreditTransaction() {
2085
- return Joi.object({
2086
- entity: Joi.any(),
2087
- author: BillingPlatformModel.Author(),
2088
- _id: Joi.string().allow(""),
2089
- amount: Joi.number(),
2090
- currency: Joi.string().allow(""),
2091
- subscriber_id: Joi.string().allow(""),
2092
- description: Joi.string().allow(""),
2093
- is_test: Joi.any(),
2094
- ending_balance: BillingPlatformModel.EndingBalance(),
2095
- payment: BillingPlatformModel.PaymentData(),
2096
- type: Joi.string().allow(""),
2097
- created_at: Joi.string().allow(""),
2098
- modified_at: Joi.string().allow(""),
2099
- });
2100
- }
2101
-
2102
- /** @returns {VerifyPaymentData} */
2103
- static VerifyPaymentData() {
2104
- return Joi.object({
2105
- success: Joi.boolean(),
2106
- subscriber: BillingPlatformModel.Subscriber(),
2107
- credit_transaction: BillingPlatformModel.CreditTransaction(),
2108
- });
2109
- }
2110
-
2111
- /** @returns {VerifyPaymentRes} */
2112
- static VerifyPaymentRes() {
2113
- return Joi.object({
2114
- status: Joi.string().allow(""),
2115
- data: BillingPlatformModel.VerifyPaymentData(),
2116
- });
2117
- }
2118
-
2119
- /** @returns {DefaultMerchants} */
2120
- static DefaultMerchants() {
2121
- return Joi.object({
2122
- stripe: Joi.string().allow(""),
2123
- });
2124
- }
2125
-
2126
- /** @returns {GlobalSettingsPayment} */
2127
- static GlobalSettingsPayment() {
2128
- return Joi.object({
2129
- default_merchants: BillingPlatformModel.DefaultMerchants(),
2130
- });
2131
- }
2132
-
2133
- /** @returns {GlobalSettingsData} */
2134
- static GlobalSettingsData() {
2135
- return Joi.object({
2136
- payment: BillingPlatformModel.GlobalSettingsPayment(),
2137
- freeze_panel: Joi.boolean(),
2138
- _id: Joi.string().allow(""),
2139
- created_at: Joi.string().allow(""),
2140
- modified_at: Joi.string().allow(""),
2141
- });
2142
- }
2143
-
2144
- /** @returns {GlobalSettings} */
2145
- static GlobalSettings() {
2146
- return Joi.object({
2147
- status: Joi.string().allow(""),
2148
- data: BillingPlatformModel.GlobalSettingsData(),
2149
- });
2150
- }
2151
-
2152
- /** @returns {MethodChecks} */
2153
- static MethodChecks() {
2154
- return Joi.object({
2155
- address_line1_check: Joi.string().allow(""),
2156
- address_postal_code_check: Joi.string().allow(""),
2157
- cvc_check: Joi.string().allow(""),
2158
- });
2159
- }
2160
-
2161
- /** @returns {MethodNetworks} */
2162
- static MethodNetworks() {
2163
- return Joi.object({
2164
- available: Joi.array().items(Joi.string().allow("")),
2165
- preferred: Joi.string().allow("").allow(null),
2166
- });
2167
- }
2168
-
2169
- /** @returns {MethodSecureUsage} */
2170
- static MethodSecureUsage() {
2171
- return Joi.object({
2172
- supported: Joi.boolean(),
2173
- });
2174
- }
104
+ /**
105
+ * @typedef ChargeRecurring
106
+ * @property {string} [interval]
107
+ * @property {number} [interval_time]
108
+ */
2175
109
 
2176
- /** @returns {MethodDetails} */
2177
- static MethodDetails() {
2178
- return Joi.object({
2179
- id: Joi.string().allow(""),
2180
- type: Joi.string().allow(""),
2181
- mandate_available: Joi.boolean(),
2182
- mandate_amount: Joi.number(),
2183
- pg_payment_method_id: Joi.string().allow(""),
2184
- is_default: Joi.boolean(),
2185
- data: BillingPlatformModel.SubscriptionMethodData(),
2186
- });
2187
- }
110
+ /**
111
+ * @typedef SubscriptionTrialPeriod
112
+ * @property {string} [start_date] - The start date and time of the trial period.
113
+ * @property {string} [end_date] - The end date and time of the trial period.
114
+ */
2188
115
 
2189
- /** @returns {SubscriptionMethodData} */
2190
- static SubscriptionMethodData() {
2191
- return Joi.object({
2192
- brand: Joi.string().allow(""),
2193
- checks: BillingPlatformModel.MethodChecks(),
2194
- country: Joi.string().allow(""),
2195
- exp_month: Joi.number(),
2196
- exp_year: Joi.number(),
2197
- fingerprint: Joi.string().allow(""),
2198
- funding: Joi.string().allow(""),
2199
- generated_from: Joi.string().allow("").allow(null),
2200
- last4: Joi.string().allow(""),
2201
- networks: BillingPlatformModel.MethodNetworks(),
2202
- three_d_secure_usage: BillingPlatformModel.MethodSecureUsage(),
2203
- wallet: Joi.string().allow("").allow(null),
2204
- name: Joi.string().allow(""),
2205
- is_default: Joi.boolean(),
2206
- });
2207
- }
116
+ /**
117
+ * @typedef Charge
118
+ * @property {OneTimeChargeEntity} [final_charge]
119
+ */
2208
120
 
2209
- /** @returns {SubscriptionMethods} */
2210
- static SubscriptionMethods() {
2211
- return Joi.object({
2212
- success: Joi.boolean(),
2213
- data: Joi.array().items(BillingPlatformModel.MethodDetails()),
2214
- });
2215
- }
121
+ /**
122
+ * @typedef OneTimeChargeItem
123
+ * @property {string} [name] - The name of the one-time charge item.
124
+ * @property {string} [term] - The term or description of the charge.
125
+ * @property {string} [pricing_type] - The type of pricing for the charge item.
126
+ * @property {EntityChargePrice} [price]
127
+ * @property {number} [capped_amount] - The maximum amount that can be charged
128
+ * for this item, if applicable.
129
+ * @property {boolean} [is_test] - Indicates whether the charge item is for
130
+ * testing purposes.
131
+ * @property {Object} [metadata] - Additional metadata associated with the charge item.
132
+ */
2216
133
 
2217
- /** @returns {ConfigPublicKey} */
2218
- static ConfigPublicKey() {
2219
- return Joi.object({
2220
- public_key: Joi.string().allow(""),
2221
- });
2222
- }
134
+ /**
135
+ * @typedef ChargeLineItem
136
+ * @property {string} name - Its name of the extension plan.
137
+ * @property {string} term - It indicates how it will be charged.
138
+ * @property {string} pricing_type - It indicates the extension subscription
139
+ * will be auto renewed timely.
140
+ * @property {EntityChargePrice} price
141
+ * @property {EntityChargeRecurring} [recurring]
142
+ * @property {number} [capped_amount]
143
+ * @property {number} [trial_days]
144
+ * @property {boolean} [is_test]
145
+ * @property {Object} [metadata]
146
+ */
2223
147
 
2224
- /** @returns {ConfigRes} */
2225
- static ConfigRes() {
2226
- return Joi.object({
2227
- success: Joi.boolean(),
2228
- aggregator: Joi.string().allow(""),
2229
- config: BillingPlatformModel.ConfigPublicKey(),
2230
- });
2231
- }
148
+ /**
149
+ * @typedef EntitySubscription
150
+ * @property {string} [_id] - Unique identifier for the subscription charge
151
+ * @property {string} [product_suit_id] - ID of the product suit associated with
152
+ * the charge
153
+ * @property {string} [entity_id] - Unique identifier for the entity
154
+ * @property {string} [entity_type] - Type of entity (e.g., subscription, extension)
155
+ * @property {string} [name] - Name of the subscription charge
156
+ * @property {string} [status] - Current status of the subscription charge
157
+ * @property {number} [trial_days] - Number of trial days provided
158
+ * @property {boolean} [is_test] - Indicates if the charge is for testing purposes
159
+ * @property {string} [created_at] - Timestamp when the charge was created
160
+ * @property {string} [modified_at] - Timestamp when the charge was last modified
161
+ * @property {string} [subscriber_id] - Unique Identifier of the company
162
+ * @property {EntityChargeDetails[]} [line_items]
163
+ * @property {string} [return_url] - The URL passed in request which extension
164
+ * expects in return.
165
+ */
2232
166
 
2233
- /** @returns {PlanChangeData} */
2234
- static PlanChangeData() {
2235
- return Joi.object({
2236
- total: Joi.number(),
2237
- credit_note_amount: Joi.number(),
2238
- settlement: Joi.number(),
2239
- taxable_amount: Joi.number(),
2240
- gst_amount: Joi.number(),
2241
- gross_total: Joi.number(),
2242
- gst: Joi.number(),
2243
- discount: Joi.number(),
2244
- });
2245
- }
167
+ /**
168
+ * @typedef OneTimeChargeEntity
169
+ * @property {string} [term] - Description of the charge term or usage.
170
+ * @property {string} [charge_type] - Type of the charge (e.g., 'subscription',
171
+ * 'extension').
172
+ * @property {number} [capped_amount] - Maximum amount that can be charged. If
173
+ * no cap, the value should be 0.
174
+ * @property {string} [billing_date] - Date when the charge was billed. Null if
175
+ * not yet billed.
176
+ * @property {string} [created_at] - Date and time when the charge entity was created.
177
+ * @property {string} [modified_at] - Date and time when the charge entity was
178
+ * last modified.
179
+ * @property {number} [__v] - Internal version key for the charge record.
180
+ * @property {string} [_id] - Unique identifier for the charge entity.
181
+ * @property {string} [name] - The name of the one-time charge.
182
+ * @property {string} [status] - Current status of the charge (e.g., 'pending',
183
+ * 'completed').
184
+ * @property {string} [activated_on] - Date and time when the charge was
185
+ * activated. Null if not yet activated.
186
+ * @property {string} [cancelled_on] - Date and time when the charge was
187
+ * cancelled. Null if not cancelled.
188
+ * @property {Object} [metadata] - Additional metadata associated with the charge.
189
+ * @property {string} [return_url] - URL to redirect to after processing the charge.
190
+ * @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
191
+ * @property {string} [pricing_type] - Pricing model for the charge (e.g., 'one_time').
192
+ * @property {string} [subscriber_id] - Unique identifier for the subscriber
193
+ * associated with the charge.
194
+ * @property {string} [entity_type] - Type of the entity related to the charge
195
+ * (e.g., 'subscription', 'user').
196
+ * @property {string} [entity_id] - Unique identifier for the entity associated
197
+ * with the charge.
198
+ * @property {Object} [meta] - Additional metadata associated with the charge.
199
+ * @property {EntityChargePrice} [price]
200
+ */
2246
201
 
2247
- /** @returns {PlanChangeDetails} */
2248
- static PlanChangeDetails() {
2249
- return Joi.object({
2250
- status: Joi.string().allow(""),
2251
- data: BillingPlatformModel.PlanChangeData(),
2252
- });
2253
- }
202
+ /**
203
+ * @typedef EntityChargeRecurring
204
+ * @property {string} interval - The interval of the subscription.
205
+ */
2254
206
 
2255
- /** @returns {TransactionMeta} */
2256
- static TransactionMeta() {
2257
- return Joi.object({
2258
- invoice_id: Joi.string().allow(""),
2259
- });
2260
- }
207
+ /**
208
+ * @typedef EntityChargeDetails
209
+ * @property {string} [_id] - Unique identifier for the charge.
210
+ * @property {string} [subscription_id] - Unique identifier of the extension subscription.
211
+ * @property {string} [subscriber_id] - Unique identifier of the
212
+ * subscriber/company who installed extension subscription.
213
+ * @property {string} [entity_type] - The type of entity associated with the
214
+ * charge (e.g., 'extension', 'subscription').
215
+ * @property {string} [entity_id] - Unique identifier for the entity associated
216
+ * with the charge.
217
+ * @property {string} [name] - The name of the charge.
218
+ * @property {string} [term] - Description of the charge term.
219
+ * @property {string} [charge_type] - The type of charge (e.g., 'standalone',
220
+ * 'recurring').
221
+ * @property {string} [pricing_type] - The pricing model for the charge (e.g.,
222
+ * 'one_time', 'recurring').
223
+ * @property {EntityChargePrice} [price]
224
+ * @property {ChargeRecurring} [recurring]
225
+ * @property {string} [status] - Current status of the charge.
226
+ * @property {number} [capped_amount] - Maximum amount that can be charged, if applicable.
227
+ * @property {string} [activated_on] - Date and time when the charge was activated.
228
+ * @property {string} [cancelled_on] - Date and time when the charge was cancelled.
229
+ * @property {string} [billing_date] - Date and time when the charge was billed.
230
+ * @property {SubscriptionTrialPeriod} [current_period]
231
+ * @property {string} [modified_at] - Date and time when the charge details were
232
+ * last modified.
233
+ * @property {string} [created_at] - Date and time when the charge was created.
234
+ * @property {boolean} [is_test] - Indicates whether the charge is for testing purposes.
235
+ * @property {string} [company_id] - Company id.
236
+ * @property {Object} [meta] - Additional metadata associated with the charge.
237
+ * @property {number} [__v] - Internal version key for the charge record.
238
+ */
2261
239
 
2262
- /** @returns {PaymentTransactionDetails} */
2263
- static PaymentTransactionDetails() {
240
+ class BillingPlatformModel {
241
+ /** @returns {SubscriptionChargeRes} */
242
+ static SubscriptionChargeRes() {
2264
243
  return Joi.object({
2265
- aggregator: Joi.any(),
2266
- currency: Joi.string().allow(""),
2267
- current_status: Joi.string().allow(""),
2268
244
  _id: Joi.string().allow(""),
2269
- subscriber_id: Joi.string().allow(""),
2270
- amount: Joi.number(),
245
+ product_suit_id: Joi.string().allow(""),
246
+ entity_id: Joi.string().allow(""),
2271
247
  entity_type: Joi.string().allow(""),
2272
- collection_type: Joi.string().allow(""),
2273
- meta: BillingPlatformModel.TransactionMeta(),
248
+ name: Joi.string().allow(""),
249
+ status: Joi.string().allow(""),
250
+ trial_days: Joi.number(),
251
+ activated_on: Joi.string().allow(""),
252
+ cancelled_on: Joi.string().allow(""),
253
+ is_test: Joi.boolean(),
2274
254
  created_at: Joi.string().allow(""),
2275
255
  modified_at: Joi.string().allow(""),
256
+ company_id: Joi.string().allow(""),
257
+ line_items: Joi.array().items(Joi.any()),
2276
258
  });
2277
259
  }
2278
260
 
2279
- /** @returns {PaymentItems} */
2280
- static PaymentItems() {
2281
- return Joi.object({
2282
- name: Joi.string().allow(""),
2283
- code: Joi.string().allow(""),
2284
- aggregator: Joi.string().allow(""),
2285
- });
2286
- }
2287
-
2288
- /** @returns {GetPaymentOptions} */
2289
- static GetPaymentOptions() {
2290
- return Joi.object({
2291
- payment_options: Joi.array().items(BillingPlatformModel.PaymentItems()),
2292
- });
2293
- }
2294
-
2295
- /** @returns {TopupReq} */
2296
- static TopupReq() {
2297
- return Joi.object({
2298
- amount: Joi.number(),
2299
- currency: Joi.string().allow(""),
2300
- provider_type: Joi.string().allow(""),
2301
- });
2302
- }
2303
-
2304
- /** @returns {SetupMandateReq} */
2305
- static SetupMandateReq() {
2306
- return Joi.object({
2307
- intent_id: Joi.string().allow(""),
2308
- payment_method_id: Joi.string().allow(""),
2309
- });
2310
- }
2311
-
2312
- /** @returns {SetupPaymentReq} */
2313
- static SetupPaymentReq() {
2314
- return Joi.object({
2315
- payment_method: Joi.string().allow(""),
2316
- payment_id: Joi.string().allow(""),
2317
- plan_id: Joi.string().allow(""),
2318
- invoice_id: Joi.string().allow(""),
2319
- });
2320
- }
2321
-
2322
- /** @returns {SubscriptionRenewReq} */
2323
- static SubscriptionRenewReq() {
261
+ /** @returns {ChargeDetails} */
262
+ static ChargeDetails() {
2324
263
  return Joi.object({
2325
- invoice_id: Joi.string().allow(""),
264
+ _id: Joi.string().allow(""),
2326
265
  entity_type: Joi.string().allow(""),
2327
- collection_type: Joi.string().allow(""),
2328
- callback_url: Joi.string().allow(""),
2329
- meta: BillingPlatformModel.RenewMeta(),
2330
- });
2331
- }
2332
-
2333
- /** @returns {RenewMeta} */
2334
- static RenewMeta() {
2335
- return Joi.object({
2336
- invoice_payment: Joi.boolean(),
2337
- renew: Joi.boolean(),
2338
- });
2339
- }
2340
-
2341
- /** @returns {SubscriptionMethodsReq} */
2342
- static SubscriptionMethodsReq() {
2343
- return Joi.object({
2344
- unique_external_id: Joi.string().allow(""),
2345
- setup_intent_id: Joi.string().allow(""),
2346
- pg_payment_method_id: Joi.string().allow(""),
2347
- set_default: Joi.boolean(),
2348
- });
2349
- }
2350
-
2351
- /** @returns {CreditTransactionResponse} */
2352
- static CreditTransactionResponse() {
2353
- return Joi.object({
2354
- total: Joi.number(),
2355
- limit: Joi.number(),
2356
- page: Joi.number(),
2357
- pages: Joi.number(),
2358
- items: Joi.array().items(BillingPlatformModel.CreditTransaction()),
2359
- });
2360
- }
2361
-
2362
- /** @returns {DowngradePlanReq} */
2363
- static DowngradePlanReq() {
2364
- return Joi.object({
2365
- unique_id: Joi.string().allow(""),
2366
- type: Joi.string().allow(""),
2367
- product_suite: Joi.string().allow(""),
2368
- plan_id: Joi.string().allow(""),
2369
- reason: Joi.string().allow(""),
2370
- platform: Joi.string().allow("").allow(null),
266
+ entity_id: Joi.string().allow(""),
267
+ name: Joi.string().allow(""),
268
+ term: Joi.string().allow(""),
269
+ charge_type: Joi.string().allow(""),
270
+ pricing_type: Joi.string().allow(""),
271
+ price: BillingPlatformModel.EntityChargePrice(),
272
+ recurring: BillingPlatformModel.ChargeRecurring(),
273
+ status: Joi.string().allow(""),
274
+ capped_amount: Joi.number(),
275
+ activated_on: Joi.string().allow(""),
276
+ cancelled_on: Joi.string().allow(""),
277
+ billing_date: Joi.string().allow(""),
278
+ current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
279
+ modified_at: Joi.string().allow(""),
280
+ created_at: Joi.string().allow(""),
281
+ is_test: Joi.boolean(),
282
+ company_id: Joi.string().allow(""),
283
+ meta: Joi.any(),
284
+ __v: Joi.number(),
2371
285
  });
2372
286
  }
2373
287
 
2374
- /** @returns {Taxation} */
2375
- static Taxation() {
288
+ /** @returns {ResourceNotFound} */
289
+ static ResourceNotFound() {
2376
290
  return Joi.object({
2377
- gst: Joi.number(),
291
+ message: Joi.string().allow(""),
292
+ code: Joi.any(),
293
+ success: Joi.any(),
2378
294
  });
2379
295
  }
2380
296
 
2381
- /** @returns {OneTimeFees} */
2382
- static OneTimeFees() {
297
+ /** @returns {CreateOneTimeCharge} */
298
+ static CreateOneTimeCharge() {
2383
299
  return Joi.object({
2384
- developement: Joi.number().allow(null),
2385
- marketing: Joi.number().allow(null),
300
+ name: Joi.string().allow(""),
301
+ charge: BillingPlatformModel.OneTimeChargeItem(),
302
+ is_test: Joi.boolean(),
303
+ return_url: Joi.string().allow(""),
2386
304
  });
2387
305
  }
2388
306
 
2389
- /** @returns {CreditLine} */
2390
- static CreditLine() {
307
+ /** @returns {CreateOneTimeChargeResponse} */
308
+ static CreateOneTimeChargeResponse() {
2391
309
  return Joi.object({
2392
- is_active: Joi.boolean(),
310
+ charge: BillingPlatformModel.Charge(),
311
+ confirm_url: Joi.string().allow(""),
2393
312
  });
2394
313
  }
2395
314
 
2396
- /** @returns {StatusMessage} */
2397
- static StatusMessage() {
315
+ /** @returns {BadRequest} */
316
+ static BadRequest() {
2398
317
  return Joi.object({
2399
- status: Joi.string().allow(""),
2400
318
  message: Joi.string().allow(""),
2401
- success: Joi.boolean(),
2402
- code: Joi.string().allow(""),
2403
- });
2404
- }
2405
-
2406
- /** @returns {PaymentCollectReq} */
2407
- static PaymentCollectReq() {
2408
- return Joi.object({
2409
- transaction_id: Joi.string().allow(""),
2410
- credit_balance: Joi.boolean().allow(null),
2411
- payment_mode: Joi.string().allow(""),
2412
- payment_method: Joi.string().allow(""),
2413
- invoice_id: Joi.string().allow(""),
2414
319
  });
2415
320
  }
2416
321
 
2417
- /** @returns {SubscriptionRenewResMeta} */
2418
- static SubscriptionRenewResMeta() {
322
+ /** @returns {CreateSubscriptionCharge} */
323
+ static CreateSubscriptionCharge() {
2419
324
  return Joi.object({
2420
- invoice_payment: Joi.boolean(),
2421
- renew: Joi.boolean(),
325
+ name: Joi.string().allow("").required(),
326
+ trial_days: Joi.number(),
327
+ line_items: Joi.array()
328
+ .items(BillingPlatformModel.ChargeLineItem())
329
+ .required(),
330
+ is_test: Joi.boolean(),
331
+ return_url: Joi.string().allow("").required(),
2422
332
  });
2423
333
  }
2424
334
 
2425
- /** @returns {SubscriptionRenewRes} */
2426
- static SubscriptionRenewRes() {
335
+ /** @returns {CreateSubscriptionResponse} */
336
+ static CreateSubscriptionResponse() {
2427
337
  return Joi.object({
2428
- redirect_url: Joi.string().allow(""),
2429
- transaction_id: Joi.string().allow(""),
2430
- current_status: Joi.string().allow(""),
2431
- meta: BillingPlatformModel.SubscriptionRenewResMeta(),
338
+ subscription: BillingPlatformModel.EntitySubscription(),
339
+ confirm_url: Joi.string().allow(""),
2432
340
  });
2433
341
  }
2434
342
 
2435
- /** @returns {SetupIntentRes} */
2436
- static SetupIntentRes() {
343
+ /** @returns {EntityChargePrice} */
344
+ static EntityChargePrice() {
2437
345
  return Joi.object({
2438
- success: Joi.boolean(),
2439
- data: BillingPlatformModel.SetupIntentData(),
346
+ amount: Joi.number(),
347
+ currency_code: Joi.string().allow(""),
2440
348
  });
2441
349
  }
2442
350
 
2443
- /** @returns {SetupIntentData} */
2444
- static SetupIntentData() {
351
+ /** @returns {ChargeRecurring} */
352
+ static ChargeRecurring() {
2445
353
  return Joi.object({
2446
- id: Joi.string().allow(""),
2447
- client_secret: Joi.string().allow(""),
2448
- customer: Joi.any(),
2449
- status: Joi.string().allow(""),
354
+ interval: Joi.string().allow(""),
355
+ interval_time: Joi.number(),
2450
356
  });
2451
357
  }
2452
358
 
2453
- /** @returns {SetupPayment} */
2454
- static SetupPayment() {
359
+ /** @returns {SubscriptionTrialPeriod} */
360
+ static SubscriptionTrialPeriod() {
2455
361
  return Joi.object({
2456
- id: Joi.string().allow(""),
2457
- status: Joi.string().allow(""),
2458
- customer: Joi.any(),
2459
- client_secret: Joi.string().allow(""),
2460
- payment_method: Joi.string().allow(""),
2461
- mandate: Joi.string().allow(""),
2462
- payment_method_options: BillingPlatformModel.PaymentMethodOptions(),
362
+ start_date: Joi.string().allow(""),
363
+ end_date: Joi.string().allow(""),
2463
364
  });
2464
365
  }
2465
366
 
2466
- /** @returns {PaymentMethodOptions} */
2467
- static PaymentMethodOptions() {
367
+ /** @returns {Charge} */
368
+ static Charge() {
2468
369
  return Joi.object({
2469
- card: BillingPlatformModel.Card(),
370
+ final_charge: BillingPlatformModel.OneTimeChargeEntity(),
2470
371
  });
2471
372
  }
2472
373
 
2473
- /** @returns {Card} */
2474
- static Card() {
374
+ /** @returns {OneTimeChargeItem} */
375
+ static OneTimeChargeItem() {
2475
376
  return Joi.object({
2476
- mandate_options: BillingPlatformModel.MandateOptions(),
377
+ name: Joi.string().allow(""),
378
+ term: Joi.string().allow(""),
379
+ pricing_type: Joi.string().allow(""),
380
+ price: BillingPlatformModel.EntityChargePrice(),
381
+ capped_amount: Joi.number(),
382
+ is_test: Joi.boolean(),
383
+ metadata: Joi.any(),
2477
384
  });
2478
385
  }
2479
386
 
2480
- /** @returns {MandateOptions} */
2481
- static MandateOptions() {
387
+ /** @returns {ChargeLineItem} */
388
+ static ChargeLineItem() {
2482
389
  return Joi.object({
2483
- amount: Joi.number(),
390
+ name: Joi.string().allow("").required(),
391
+ term: Joi.string().allow("").required(),
392
+ pricing_type: Joi.string().allow("").required(),
393
+ price: BillingPlatformModel.EntityChargePrice().required(),
394
+ recurring: BillingPlatformModel.EntityChargeRecurring(),
395
+ capped_amount: Joi.number(),
396
+ trial_days: Joi.number(),
397
+ is_test: Joi.boolean(),
398
+ metadata: Joi.any(),
2484
399
  });
2485
400
  }
2486
401
 
2487
- /** @returns {Message} */
2488
- static Message() {
402
+ /** @returns {EntitySubscription} */
403
+ static EntitySubscription() {
2489
404
  return Joi.object({
2490
- message: Joi.string().allow(""),
405
+ _id: Joi.string().allow(""),
406
+ product_suit_id: Joi.string().allow(""),
407
+ entity_id: Joi.string().allow(""),
408
+ entity_type: Joi.string().allow(""),
409
+ name: Joi.string().allow(""),
410
+ status: Joi.string().allow(""),
411
+ trial_days: Joi.number(),
412
+ is_test: Joi.boolean(),
413
+ created_at: Joi.string().allow(""),
414
+ modified_at: Joi.string().allow(""),
415
+ subscriber_id: Joi.string().allow(""),
416
+ line_items: Joi.array().items(BillingPlatformModel.EntityChargeDetails()),
417
+ return_url: Joi.string().allow(""),
2491
418
  });
2492
419
  }
2493
420
 
2494
- /** @returns {TopupRes} */
2495
- static TopupRes() {
421
+ /** @returns {OneTimeChargeEntity} */
422
+ static OneTimeChargeEntity() {
2496
423
  return Joi.object({
424
+ term: Joi.string().allow(""),
425
+ charge_type: Joi.string().allow(""),
426
+ capped_amount: Joi.number(),
427
+ billing_date: Joi.string().allow("").allow(null),
428
+ created_at: Joi.string().allow(""),
429
+ modified_at: Joi.string().allow(""),
430
+ __v: Joi.number(),
431
+ _id: Joi.string().allow(""),
432
+ name: Joi.string().allow(""),
2497
433
  status: Joi.string().allow(""),
2498
- aggregator_order_id: Joi.string().allow(""),
2499
- amount: Joi.number(),
2500
- currency: Joi.string().allow(""),
2501
- transaction_id: Joi.string().allow(""),
434
+ activated_on: Joi.string().allow("").allow(null),
435
+ cancelled_on: Joi.string().allow("").allow(null),
436
+ metadata: Joi.any(),
437
+ return_url: Joi.string().allow(""),
438
+ is_test: Joi.boolean(),
439
+ pricing_type: Joi.string().allow(""),
440
+ subscriber_id: Joi.string().allow(""),
441
+ entity_type: Joi.string().allow(""),
442
+ entity_id: Joi.string().allow(""),
443
+ meta: Joi.any(),
444
+ price: BillingPlatformModel.EntityChargePrice(),
2502
445
  });
2503
446
  }
2504
447
 
2505
- /** @returns {CancelTopupReq} */
2506
- static CancelTopupReq() {
448
+ /** @returns {EntityChargeRecurring} */
449
+ static EntityChargeRecurring() {
2507
450
  return Joi.object({
2508
- order_id: Joi.string().allow(""),
451
+ interval: Joi.string().allow("").required(),
2509
452
  });
2510
453
  }
2511
454
 
2512
- /** @returns {CancelTopupRes} */
2513
- static CancelTopupRes() {
455
+ /** @returns {EntityChargeDetails} */
456
+ static EntityChargeDetails() {
2514
457
  return Joi.object({
2515
458
  _id: Joi.string().allow(""),
459
+ subscription_id: Joi.string().allow(""),
2516
460
  subscriber_id: Joi.string().allow(""),
2517
- amount: Joi.number(),
2518
- currency: Joi.string().allow(""),
2519
- aggregator: Joi.string().allow(""),
2520
- aggregator_order_id: Joi.string().allow(""),
2521
- created_at: Joi.string().allow(""),
461
+ entity_type: Joi.string().allow(""),
462
+ entity_id: Joi.string().allow(""),
463
+ name: Joi.string().allow(""),
464
+ term: Joi.string().allow(""),
465
+ charge_type: Joi.string().allow(""),
466
+ pricing_type: Joi.string().allow(""),
467
+ price: BillingPlatformModel.EntityChargePrice(),
468
+ recurring: BillingPlatformModel.ChargeRecurring(),
469
+ status: Joi.string().allow(""),
470
+ capped_amount: Joi.number(),
471
+ activated_on: Joi.string().allow("").allow(null),
472
+ cancelled_on: Joi.string().allow("").allow(null),
473
+ billing_date: Joi.string().allow("").allow(null),
474
+ current_period: BillingPlatformModel.SubscriptionTrialPeriod(),
2522
475
  modified_at: Joi.string().allow(""),
476
+ created_at: Joi.string().allow(""),
477
+ is_test: Joi.boolean(),
478
+ company_id: Joi.string().allow(""),
479
+ meta: Joi.any(),
2523
480
  __v: Joi.number(),
2524
- aggregator_status: Joi.string().allow(""),
2525
- current_status: Joi.string().allow(""),
2526
- });
2527
- }
2528
-
2529
- /** @returns {DefaultReq} */
2530
- static DefaultReq() {
2531
- return Joi.object({
2532
- payment_method_id: Joi.string().allow(""),
2533
481
  });
2534
482
  }
2535
483
  }