@gofynd/fdk-client-javascript 1.4.2-beta.1 → 1.4.2-beta.10

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