@gofynd/fdk-client-javascript 0.1.35

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 (277) hide show
  1. package/.github/workflows/on_create_release.yml +23 -0
  2. package/.github/workflows/on_merge_main.yml +38 -0
  3. package/.github/workflows/on_pull_request.yml +35 -0
  4. package/.prettierrc +5 -0
  5. package/LICENSE +21 -0
  6. package/README.md +118 -0
  7. package/application.d.ts +3 -0
  8. package/application.js +6 -0
  9. package/common.d.ts +4 -0
  10. package/common.js +9 -0
  11. package/documentation/application/CART.md +7290 -0
  12. package/documentation/application/CATALOG.md +9570 -0
  13. package/documentation/application/COMMON.md +448 -0
  14. package/documentation/application/COMMUNICATION.md +463 -0
  15. package/documentation/application/CONFIGURATION.md +2902 -0
  16. package/documentation/application/CONTENT.md +3350 -0
  17. package/documentation/application/FILESTORAGE.md +491 -0
  18. package/documentation/application/LEAD.md +1891 -0
  19. package/documentation/application/LOGISTIC.md +439 -0
  20. package/documentation/application/ORDER.md +3428 -0
  21. package/documentation/application/PAYMENT.md +5035 -0
  22. package/documentation/application/POSCART.md +7889 -0
  23. package/documentation/application/README.md +21 -0
  24. package/documentation/application/REWARDS.md +714 -0
  25. package/documentation/application/SHARE.md +729 -0
  26. package/documentation/application/THEME.md +5796 -0
  27. package/documentation/application/USER.md +4326 -0
  28. package/documentation/platform/ANALYTICS.md +1150 -0
  29. package/documentation/platform/AUDITTRAIL.md +572 -0
  30. package/documentation/platform/BILLING.md +2396 -0
  31. package/documentation/platform/CART.md +5539 -0
  32. package/documentation/platform/CATALOG.md +21624 -0
  33. package/documentation/platform/COMMON.md +448 -0
  34. package/documentation/platform/COMMUNICATION.md +5714 -0
  35. package/documentation/platform/COMPANYPROFILE.md +2141 -0
  36. package/documentation/platform/CONFIGURATION.md +7335 -0
  37. package/documentation/platform/CONTENT.md +8989 -0
  38. package/documentation/platform/DISCOUNT.md +773 -0
  39. package/documentation/platform/FILESTORAGE.md +994 -0
  40. package/documentation/platform/INVENTORY.md +1775 -0
  41. package/documentation/platform/LEAD.md +4736 -0
  42. package/documentation/platform/ORDER.md +3764 -0
  43. package/documentation/platform/PARTNER.md +216 -0
  44. package/documentation/platform/PAYMENT.md +3444 -0
  45. package/documentation/platform/README.md +27 -0
  46. package/documentation/platform/REWARDS.md +871 -0
  47. package/documentation/platform/SHARE.md +602 -0
  48. package/documentation/platform/THEME.md +35725 -0
  49. package/documentation/platform/USER.md +2305 -0
  50. package/documentation/platform/WEBHOOK.md +587 -0
  51. package/documentation/public/CONFIGURATION.md +448 -0
  52. package/documentation/public/INVENTORY.md +686 -0
  53. package/documentation/public/WEBHOOK.md +348 -0
  54. package/index.d.ts +10 -0
  55. package/index.js +18 -0
  56. package/jest.config.d.ts +4 -0
  57. package/jest.config.js +6 -0
  58. package/package.json +35 -0
  59. package/platform.d.ts +3 -0
  60. package/platform.js +6 -0
  61. package/public.d.ts +3 -0
  62. package/public.js +6 -0
  63. package/sdk/application/ApplicationAPIClient.d.ts +11 -0
  64. package/sdk/application/ApplicationAPIClient.js +44 -0
  65. package/sdk/application/ApplicationClient.d.ts +40 -0
  66. package/sdk/application/ApplicationClient.js +84 -0
  67. package/sdk/application/ApplicationConfig.d.ts +19 -0
  68. package/sdk/application/ApplicationConfig.js +55 -0
  69. package/sdk/application/ApplicationModels.d.ts +826 -0
  70. package/sdk/application/ApplicationModels.js +10474 -0
  71. package/sdk/application/client/CartApplicationClient.d.ts +432 -0
  72. package/sdk/application/client/CartApplicationClient.js +1066 -0
  73. package/sdk/application/client/CatalogApplicationClient.d.ts +694 -0
  74. package/sdk/application/client/CatalogApplicationClient.js +1629 -0
  75. package/sdk/application/client/CommonApplicationClient.d.ts +38 -0
  76. package/sdk/application/client/CommonApplicationClient.js +105 -0
  77. package/sdk/application/client/CommunicationApplicationClient.d.ts +39 -0
  78. package/sdk/application/client/CommunicationApplicationClient.js +131 -0
  79. package/sdk/application/client/ConfigurationApplicationClient.d.ts +210 -0
  80. package/sdk/application/client/ConfigurationApplicationClient.js +649 -0
  81. package/sdk/application/client/ContentApplicationClient.d.ts +256 -0
  82. package/sdk/application/client/ContentApplicationClient.js +785 -0
  83. package/sdk/application/client/FileStorageApplicationClient.d.ts +88 -0
  84. package/sdk/application/client/FileStorageApplicationClient.js +214 -0
  85. package/sdk/application/client/LeadApplicationClient.d.ts +90 -0
  86. package/sdk/application/client/LeadApplicationClient.js +264 -0
  87. package/sdk/application/client/LogisticApplicationClient.d.ts +42 -0
  88. package/sdk/application/client/LogisticApplicationClient.js +128 -0
  89. package/sdk/application/client/OrderApplicationClient.d.ts +190 -0
  90. package/sdk/application/client/OrderApplicationClient.js +479 -0
  91. package/sdk/application/client/PaymentApplicationClient.d.ts +454 -0
  92. package/sdk/application/client/PaymentApplicationClient.js +1378 -0
  93. package/sdk/application/client/PosCartApplicationClient.d.ts +449 -0
  94. package/sdk/application/client/PosCartApplicationClient.js +1123 -0
  95. package/sdk/application/client/RewardsApplicationClient.d.ts +93 -0
  96. package/sdk/application/client/RewardsApplicationClient.js +293 -0
  97. package/sdk/application/client/ShareApplicationClient.d.ts +87 -0
  98. package/sdk/application/client/ShareApplicationClient.js +268 -0
  99. package/sdk/application/client/ThemeApplicationClient.d.ts +52 -0
  100. package/sdk/application/client/ThemeApplicationClient.js +161 -0
  101. package/sdk/application/client/UserApplicationClient.d.ts +446 -0
  102. package/sdk/application/client/UserApplicationClient.js +1275 -0
  103. package/sdk/application/constructUrl.d.ts +5 -0
  104. package/sdk/application/constructUrl.js +13 -0
  105. package/sdk/application/index.d.ts +2 -0
  106. package/sdk/application/index.js +4 -0
  107. package/sdk/application/models/CartValidator.d.ts +29 -0
  108. package/sdk/application/models/CartValidator.js +223 -0
  109. package/sdk/application/models/CatalogValidator.d.ts +33 -0
  110. package/sdk/application/models/CatalogValidator.js +233 -0
  111. package/sdk/application/models/CommonValidator.d.ts +5 -0
  112. package/sdk/application/models/CommonValidator.js +18 -0
  113. package/sdk/application/models/CommunicationValidator.d.ts +6 -0
  114. package/sdk/application/models/CommunicationValidator.js +20 -0
  115. package/sdk/application/models/ConfigurationValidator.d.ts +19 -0
  116. package/sdk/application/models/ConfigurationValidator.js +88 -0
  117. package/sdk/application/models/ContentValidator.d.ts +22 -0
  118. package/sdk/application/models/ContentValidator.js +106 -0
  119. package/sdk/application/models/FileStorageValidator.d.ts +6 -0
  120. package/sdk/application/models/FileStorageValidator.js +24 -0
  121. package/sdk/application/models/LeadValidator.d.ts +10 -0
  122. package/sdk/application/models/LeadValidator.js +48 -0
  123. package/sdk/application/models/LogisticValidator.d.ts +6 -0
  124. package/sdk/application/models/LogisticValidator.js +22 -0
  125. package/sdk/application/models/OrderValidator.d.ts +15 -0
  126. package/sdk/application/models/OrderValidator.js +87 -0
  127. package/sdk/application/models/PaymentValidator.d.ts +40 -0
  128. package/sdk/application/models/PaymentValidator.js +235 -0
  129. package/sdk/application/models/PosCartValidator.d.ts +30 -0
  130. package/sdk/application/models/PosCartValidator.js +232 -0
  131. package/sdk/application/models/RewardsValidator.d.ts +10 -0
  132. package/sdk/application/models/RewardsValidator.js +43 -0
  133. package/sdk/application/models/ShareValidator.d.ts +10 -0
  134. package/sdk/application/models/ShareValidator.js +44 -0
  135. package/sdk/application/models/ThemeValidator.d.ts +7 -0
  136. package/sdk/application/models/ThemeValidator.js +27 -0
  137. package/sdk/application/models/UserValidator.d.ts +38 -0
  138. package/sdk/application/models/UserValidator.js +233 -0
  139. package/sdk/common/AxiosHelper.d.ts +1 -0
  140. package/sdk/common/AxiosHelper.js +141 -0
  141. package/sdk/common/Constant.d.ts +294 -0
  142. package/sdk/common/Constant.js +332 -0
  143. package/sdk/common/FDKError.d.ts +26 -0
  144. package/sdk/common/FDKError.js +51 -0
  145. package/sdk/common/Logger.d.ts +2 -0
  146. package/sdk/common/Logger.js +85 -0
  147. package/sdk/common/Paginator.d.ts +16 -0
  148. package/sdk/common/Paginator.js +26 -0
  149. package/sdk/common/RequestSigner.d.ts +1 -0
  150. package/sdk/common/RequestSigner.js +306 -0
  151. package/sdk/common/Utility.d.ts +9 -0
  152. package/sdk/common/Utility.js +86 -0
  153. package/sdk/common/utils.d.ts +14 -0
  154. package/sdk/common/utils.js +165 -0
  155. package/sdk/platform/OAuthClient.d.ts +26 -0
  156. package/sdk/platform/OAuthClient.js +221 -0
  157. package/sdk/platform/PlatformAPIClient.d.ts +12 -0
  158. package/sdk/platform/PlatformAPIClient.js +43 -0
  159. package/sdk/platform/PlatformApplicationClient.d.ts +24398 -0
  160. package/sdk/platform/PlatformApplicationClient.js +23185 -0
  161. package/sdk/platform/PlatformApplicationModels.d.ts +333 -0
  162. package/sdk/platform/PlatformApplicationModels.js +21262 -0
  163. package/sdk/platform/PlatformClient.d.ts +9535 -0
  164. package/sdk/platform/PlatformClient.js +12336 -0
  165. package/sdk/platform/PlatformConfig.d.ts +29 -0
  166. package/sdk/platform/PlatformConfig.js +36 -0
  167. package/sdk/platform/PlatformModels.d.ts +1396 -0
  168. package/sdk/platform/PlatformModels.js +19222 -0
  169. package/sdk/platform/client/AnalyticsPlatformClient.d.ts +84 -0
  170. package/sdk/platform/client/AnalyticsPlatformClient.js +215 -0
  171. package/sdk/platform/client/AuditTrailPlatformClient.d.ts +38 -0
  172. package/sdk/platform/client/AuditTrailPlatformClient.js +133 -0
  173. package/sdk/platform/client/BillingPlatformClient.d.ts +109 -0
  174. package/sdk/platform/client/BillingPlatformClient.js +381 -0
  175. package/sdk/platform/client/CatalogPlatformClient.d.ts +806 -0
  176. package/sdk/platform/client/CatalogPlatformClient.js +2462 -0
  177. package/sdk/platform/client/CommonPlatformClient.d.ts +30 -0
  178. package/sdk/platform/client/CommonPlatformClient.js +84 -0
  179. package/sdk/platform/client/CommunicationPlatformClient.d.ts +26 -0
  180. package/sdk/platform/client/CommunicationPlatformClient.js +72 -0
  181. package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +182 -0
  182. package/sdk/platform/client/CompanyProfilePlatformClient.js +540 -0
  183. package/sdk/platform/client/ConfigurationPlatformClient.d.ts +277 -0
  184. package/sdk/platform/client/ConfigurationPlatformClient.js +806 -0
  185. package/sdk/platform/client/DiscountPlatformClient.d.ts +118 -0
  186. package/sdk/platform/client/DiscountPlatformClient.js +364 -0
  187. package/sdk/platform/client/FileStoragePlatformClient.d.ts +111 -0
  188. package/sdk/platform/client/FileStoragePlatformClient.js +268 -0
  189. package/sdk/platform/client/InventoryPlatformClient.d.ts +125 -0
  190. package/sdk/platform/client/InventoryPlatformClient.js +409 -0
  191. package/sdk/platform/client/LeadPlatformClient.d.ts +150 -0
  192. package/sdk/platform/client/LeadPlatformClient.js +439 -0
  193. package/sdk/platform/client/OrderPlatformClient.d.ts +190 -0
  194. package/sdk/platform/client/OrderPlatformClient.js +521 -0
  195. package/sdk/platform/client/PaymentPlatformClient.d.ts +98 -0
  196. package/sdk/platform/client/PaymentPlatformClient.js +331 -0
  197. package/sdk/platform/client/WebhookPlatformClient.d.ts +64 -0
  198. package/sdk/platform/client/WebhookPlatformClient.js +207 -0
  199. package/sdk/platform/index.d.ts +2 -0
  200. package/sdk/platform/index.js +4 -0
  201. package/sdk/platform/models/AnalyticsValidator.d.ts +7 -0
  202. package/sdk/platform/models/AnalyticsValidator.js +36 -0
  203. package/sdk/platform/models/AuditTrailValidator.d.ts +7 -0
  204. package/sdk/platform/models/AuditTrailValidator.js +26 -0
  205. package/sdk/platform/models/BillingValidator.d.ts +15 -0
  206. package/sdk/platform/models/BillingValidator.js +72 -0
  207. package/sdk/platform/models/CartValidator.d.ts +0 -0
  208. package/sdk/platform/models/CartValidator.js +0 -0
  209. package/sdk/platform/models/CatalogValidator.d.ts +74 -0
  210. package/sdk/platform/models/CatalogValidator.js +484 -0
  211. package/sdk/platform/models/CommonValidator.d.ts +5 -0
  212. package/sdk/platform/models/CommonValidator.js +18 -0
  213. package/sdk/platform/models/CommunicationValidator.d.ts +4 -0
  214. package/sdk/platform/models/CommunicationValidator.js +11 -0
  215. package/sdk/platform/models/CompanyProfileValidator.d.ts +17 -0
  216. package/sdk/platform/models/CompanyProfileValidator.js +93 -0
  217. package/sdk/platform/models/ConfigurationValidator.d.ts +21 -0
  218. package/sdk/platform/models/ConfigurationValidator.js +134 -0
  219. package/sdk/platform/models/ContentValidator.d.ts +0 -0
  220. package/sdk/platform/models/ContentValidator.js +0 -0
  221. package/sdk/platform/models/DiscountValidator.d.ts +13 -0
  222. package/sdk/platform/models/DiscountValidator.js +75 -0
  223. package/sdk/platform/models/FileStorageValidator.d.ts +9 -0
  224. package/sdk/platform/models/FileStorageValidator.js +44 -0
  225. package/sdk/platform/models/InventoryValidator.d.ts +15 -0
  226. package/sdk/platform/models/InventoryValidator.js +81 -0
  227. package/sdk/platform/models/LeadValidator.d.ts +14 -0
  228. package/sdk/platform/models/LeadValidator.js +78 -0
  229. package/sdk/platform/models/OrderValidator.d.ts +14 -0
  230. package/sdk/platform/models/OrderValidator.js +110 -0
  231. package/sdk/platform/models/PartnerValidator.d.ts +0 -0
  232. package/sdk/platform/models/PartnerValidator.js +0 -0
  233. package/sdk/platform/models/PaymentValidator.d.ts +13 -0
  234. package/sdk/platform/models/PaymentValidator.js +65 -0
  235. package/sdk/platform/models/RewardsValidator.d.ts +0 -0
  236. package/sdk/platform/models/RewardsValidator.js +0 -0
  237. package/sdk/platform/models/ShareValidator.d.ts +0 -0
  238. package/sdk/platform/models/ShareValidator.js +0 -0
  239. package/sdk/platform/models/ThemeValidator.d.ts +0 -0
  240. package/sdk/platform/models/ThemeValidator.js +0 -0
  241. package/sdk/platform/models/UserValidator.d.ts +0 -0
  242. package/sdk/platform/models/UserValidator.js +0 -0
  243. package/sdk/platform/models/WebhookValidator.d.ts +9 -0
  244. package/sdk/platform/models/WebhookValidator.js +42 -0
  245. package/sdk/public/PublicAPIClient.d.ts +11 -0
  246. package/sdk/public/PublicAPIClient.js +38 -0
  247. package/sdk/public/PublicClient.d.ts +12 -0
  248. package/sdk/public/PublicClient.js +24 -0
  249. package/sdk/public/PublicConfig.d.ts +10 -0
  250. package/sdk/public/PublicConfig.js +12 -0
  251. package/sdk/public/PublicModels.d.ts +50 -0
  252. package/sdk/public/PublicModels.js +712 -0
  253. package/sdk/public/client/ConfigurationPublicClient.d.ts +38 -0
  254. package/sdk/public/client/ConfigurationPublicClient.js +102 -0
  255. package/sdk/public/client/InventoryPublicClient.d.ts +81 -0
  256. package/sdk/public/client/InventoryPublicClient.js +239 -0
  257. package/sdk/public/client/WebhookPublicClient.d.ts +28 -0
  258. package/sdk/public/client/WebhookPublicClient.js +92 -0
  259. package/sdk/public/constructUrl.d.ts +5 -0
  260. package/sdk/public/constructUrl.js +13 -0
  261. package/sdk/public/index.d.ts +2 -0
  262. package/sdk/public/index.js +4 -0
  263. package/sdk/public/models/ConfigurationValidator.d.ts +5 -0
  264. package/sdk/public/models/ConfigurationValidator.js +18 -0
  265. package/sdk/public/models/InventoryValidator.d.ts +9 -0
  266. package/sdk/public/models/InventoryValidator.js +43 -0
  267. package/sdk/public/models/WebhookValidator.d.ts +5 -0
  268. package/sdk/public/models/WebhookValidator.js +14 -0
  269. package/tests/application/catalog.spec.js +47 -0
  270. package/tests/common/action-url.spec.js +35 -0
  271. package/tests/common/schema/action-url.json +163 -0
  272. package/tests/common/schema/url-action.json +667 -0
  273. package/tests/common/url-action.spec.js +48 -0
  274. package/tests/helpers/cookie.helper.js +31 -0
  275. package/tests/helpers/oauth.helper.js +43 -0
  276. package/tests/platform/catalog.spec.js +49 -0
  277. package/tests/public/location.spec.js +39 -0
@@ -0,0 +1,21 @@
1
+ ##### [Back to home](../../README.md)
2
+
3
+ # FDK Application Front API Documentaion
4
+
5
+
6
+ * [Catalog](CATALOG.md) - Catalog API's allows you to access list of products, prices, seller details, similar features, variants and many more useful features.
7
+ * [Cart](CART.md) - Cart APIs
8
+ * [Common](COMMON.md) - Application configuration apis
9
+ * [Lead](LEAD.md) - Handles communication between Staff and Users
10
+ * [Theme](THEME.md) - Responsible for themes
11
+ * [User](USER.md) - Authentication Service
12
+ * [Content](CONTENT.md) - Content System
13
+ * [Communication](COMMUNICATION.md) - Manages email, sms, push notifications sent to users
14
+ * [Share](SHARE.md) - Short link and QR Code
15
+ * [FileStorage](FILESTORAGE.md) - File Storage
16
+ * [Configuration](CONFIGURATION.md) - Application configuration apis
17
+ * [Payment](PAYMENT.md) - Collect payment through many payment gateway i.e Stripe, Razorpay, Juspay etc.into Fynd or Self account
18
+ * [Order](ORDER.md) - Handles all Application order and shipment api(s)
19
+ * [Rewards](REWARDS.md) - Earn and redeem reward points
20
+ * [PosCart](POSCART.md) - Cart APIs
21
+ * [Logistic](LOGISTIC.md) - Handles Platform websites OMS
@@ -0,0 +1,714 @@
1
+
2
+
3
+
4
+
5
+ ##### [Back to Application docs](./README.md)
6
+
7
+ ## Rewards Methods
8
+ Earn and redeem reward points
9
+ * [getPointsOnProduct](#getpointsonproduct)
10
+ * [getOfferByName](#getofferbyname)
11
+ * [getOrderDiscount](#getorderdiscount)
12
+ * [getUserPoints](#getuserpoints)
13
+ * [getUserPointsHistory](#getuserpointshistory)
14
+ * [getUserReferralDetails](#getuserreferraldetails)
15
+ * [redeemReferralCode](#redeemreferralcode)
16
+
17
+
18
+
19
+ ## Methods with example and description
20
+
21
+
22
+ ### getPointsOnProduct
23
+ Get the eligibility of reward points on a product
24
+
25
+
26
+
27
+ ```javascript
28
+ // Promise
29
+ const promise = rewards.getPointsOnProduct({ body : value });
30
+
31
+ // Async/Await
32
+ const data = await rewards.getPointsOnProduct({ body : value });
33
+ ```
34
+
35
+
36
+
37
+
38
+
39
+ | Argument | Type | Required | Description |
40
+ | --------- | ----- | -------- | ----------- |
41
+ | body | [CatalogueOrderRequest](#CatalogueOrderRequest) | yes | Request body |
42
+
43
+
44
+ Use this API to evaluate the amount of reward points that could be earned on any catalogue product.
45
+
46
+ *Returned Response:*
47
+
48
+
49
+
50
+
51
+ [CatalogueOrderResponse](#CatalogueOrderResponse)
52
+
53
+ Success. Check example below or refer `CatalogueOrderRequest` for more details.
54
+
55
+
56
+
57
+
58
+ <details>
59
+ <summary><i>&nbsp; Example:</i></summary>
60
+
61
+ ```json
62
+
63
+ ```
64
+ </details>
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ ---
75
+
76
+
77
+ ### getOfferByName
78
+ Get offer by name
79
+
80
+
81
+
82
+ ```javascript
83
+ // Promise
84
+ const promise = rewards.getOfferByName({ name : value });
85
+
86
+ // Async/Await
87
+ const data = await rewards.getOfferByName({ name : value });
88
+ ```
89
+
90
+
91
+
92
+
93
+
94
+ | Argument | Type | Required | Description |
95
+ | --------- | ----- | -------- | ----------- |
96
+ | name | string | yes | The name given to the offer. |
97
+
98
+
99
+
100
+ Use this API to get the offer details and configuration by entering the name of the offer.
101
+
102
+ *Returned Response:*
103
+
104
+
105
+
106
+
107
+ [Offer](#Offer)
108
+
109
+ Success. Check example below or refer `Offer` for more details.
110
+
111
+
112
+
113
+
114
+ <details>
115
+ <summary><i>&nbsp; Example:</i></summary>
116
+
117
+ ```json
118
+
119
+ ```
120
+ </details>
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ ---
131
+
132
+
133
+ ### getOrderDiscount
134
+ Calculates the discount on order-amount
135
+
136
+
137
+
138
+ ```javascript
139
+ // Promise
140
+ const promise = rewards.getOrderDiscount({ body : value });
141
+
142
+ // Async/Await
143
+ const data = await rewards.getOrderDiscount({ body : value });
144
+ ```
145
+
146
+
147
+
148
+
149
+
150
+ | Argument | Type | Required | Description |
151
+ | --------- | ----- | -------- | ----------- |
152
+ | body | [OrderDiscountRequest](#OrderDiscountRequest) | yes | Request body |
153
+
154
+
155
+ Use this API to calculate the discount on order-amount based on all the amount range configured in order_discount.
156
+
157
+ *Returned Response:*
158
+
159
+
160
+
161
+
162
+ [OrderDiscountResponse](#OrderDiscountResponse)
163
+
164
+ Success. Check example below or refer `OrderDiscountResponse` for more details.
165
+
166
+
167
+
168
+
169
+ <details>
170
+ <summary><i>&nbsp; Example:</i></summary>
171
+
172
+ ```json
173
+
174
+ ```
175
+ </details>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+ ---
186
+
187
+
188
+ ### getUserPoints
189
+ Get reward points available with a user
190
+
191
+
192
+
193
+ ```javascript
194
+ // Promise
195
+ const promise = rewards.getUserPoints();
196
+
197
+ // Async/Await
198
+ const data = await rewards.getUserPoints();
199
+ ```
200
+
201
+
202
+
203
+
204
+
205
+
206
+ Use this API to retrieve total available points of a user for current application
207
+
208
+ *Returned Response:*
209
+
210
+
211
+
212
+
213
+ [PointsResponse](#PointsResponse)
214
+
215
+ Success. Check example below or refer `PointsResponse` for more details.
216
+
217
+
218
+
219
+
220
+ <details>
221
+ <summary><i>&nbsp; Example:</i></summary>
222
+
223
+ ```json
224
+
225
+ ```
226
+ </details>
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+ ---
237
+
238
+
239
+ ### getUserPointsHistory
240
+ Get all transactions of reward points
241
+
242
+
243
+
244
+ ```javascript
245
+ // Promise
246
+ const promise = rewards.getUserPointsHistory({ pageId : value,
247
+ pageSize : value });
248
+
249
+ // Async/Await
250
+ const data = await rewards.getUserPointsHistory({ pageId : value,
251
+ pageSize : value });
252
+ ```
253
+
254
+
255
+
256
+
257
+
258
+ | Argument | Type | Required | Description |
259
+ | --------- | ----- | -------- | ----------- |
260
+ | pageId | string | no | PageID is the ID of the requested page. For first request it should be kept empty. |
261
+ | pageSize | number | no | The number of items to retrieve in each page. |
262
+
263
+
264
+
265
+ Use this API to get a list of points transactions. The list of points history is paginated.
266
+
267
+ *Returned Response:*
268
+
269
+
270
+
271
+
272
+ [PointsHistoryResponse](#PointsHistoryResponse)
273
+
274
+ Success. Check example below or refer `PointsHistoryResponse` for more details.
275
+
276
+
277
+
278
+
279
+ <details>
280
+ <summary><i>&nbsp; Example:</i></summary>
281
+
282
+ ```json
283
+
284
+ ```
285
+ </details>
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+ ---
296
+
297
+
298
+ ### getUserReferralDetails
299
+ Get referral details of a user
300
+
301
+
302
+
303
+ ```javascript
304
+ // Promise
305
+ const promise = rewards.getUserReferralDetails();
306
+
307
+ // Async/Await
308
+ const data = await rewards.getUserReferralDetails();
309
+ ```
310
+
311
+
312
+
313
+
314
+
315
+
316
+ Use this API to retrieve the referral details a user has configured in the application.
317
+
318
+ *Returned Response:*
319
+
320
+
321
+
322
+
323
+ [ReferralDetailsResponse](#ReferralDetailsResponse)
324
+
325
+ Success. Check example below or refer `ReferralDetailsResponse` for more details.
326
+
327
+
328
+
329
+
330
+ <details>
331
+ <summary><i>&nbsp; Example:</i></summary>
332
+
333
+ ```json
334
+
335
+ ```
336
+ </details>
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+ ---
347
+
348
+
349
+ ### redeemReferralCode
350
+ Redeems a referral code and credits reward points to users
351
+
352
+
353
+
354
+ ```javascript
355
+ // Promise
356
+ const promise = rewards.redeemReferralCode({ body : value });
357
+
358
+ // Async/Await
359
+ const data = await rewards.redeemReferralCode({ body : value });
360
+ ```
361
+
362
+
363
+
364
+
365
+
366
+ | Argument | Type | Required | Description |
367
+ | --------- | ----- | -------- | ----------- |
368
+ | body | [RedeemReferralCodeRequest](#RedeemReferralCodeRequest) | yes | Request body |
369
+
370
+
371
+ Use this API to enter a referral code following which, the configured points would be credited to a user's reward points account.
372
+
373
+ *Returned Response:*
374
+
375
+
376
+
377
+
378
+ [RedeemReferralCodeResponse](#RedeemReferralCodeResponse)
379
+
380
+ Success. Check example below or refer `RedeemReferralCodeResponse` for more details.
381
+
382
+
383
+
384
+
385
+ <details>
386
+ <summary><i>&nbsp; Example:</i></summary>
387
+
388
+ ```json
389
+
390
+ ```
391
+ </details>
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+ ---
402
+
403
+
404
+
405
+ ### Schemas
406
+
407
+
408
+
409
+ #### [ActionPageParams](#ActionPageParams)
410
+
411
+ | Properties | Type | Nullable | Description |
412
+ | ---------- | ---- | -------- | ----------- |
413
+ | slug | [string] | no | |
414
+
415
+ ---
416
+
417
+
418
+
419
+
420
+ #### [Asset](#Asset)
421
+
422
+ | Properties | Type | Nullable | Description |
423
+ | ---------- | ---- | -------- | ----------- |
424
+ | aspect_ratio | string | no | |
425
+ | id | string | no | |
426
+ | secure_url | string | no | |
427
+
428
+ ---
429
+
430
+
431
+
432
+
433
+ #### [CatalogueOrderRequest](#CatalogueOrderRequest)
434
+
435
+ | Properties | Type | Nullable | Description |
436
+ | ---------- | ---- | -------- | ----------- |
437
+ | articles | [[RewardsArticle](#RewardsArticle)] | no | |
438
+
439
+ ---
440
+
441
+
442
+
443
+
444
+ #### [CatalogueOrderResponse](#CatalogueOrderResponse)
445
+
446
+ | Properties | Type | Nullable | Description |
447
+ | ---------- | ---- | -------- | ----------- |
448
+ | articles | [[RewardsArticle](#RewardsArticle)] | no | |
449
+
450
+ ---
451
+
452
+
453
+
454
+
455
+ #### [DiscountProperties](#DiscountProperties)
456
+
457
+ | Properties | Type | Nullable | Description |
458
+ | ---------- | ---- | -------- | ----------- |
459
+ | absolute | number | no | |
460
+ | currency | string | no | |
461
+ | display_absolute | string | no | |
462
+ | display_percent | string | no | |
463
+ | percent | number | no | |
464
+
465
+ ---
466
+
467
+
468
+
469
+
470
+ #### [Error](#Error)
471
+
472
+ | Properties | Type | Nullable | Description |
473
+ | ---------- | ---- | -------- | ----------- |
474
+ | code | number | no | |
475
+ | exception | string | no | |
476
+ | info | string | no | |
477
+ | message | string | no | |
478
+
479
+ ---
480
+
481
+
482
+
483
+
484
+ #### [Offer](#Offer)
485
+
486
+ | Properties | Type | Nullable | Description |
487
+ | ---------- | ---- | -------- | ----------- |
488
+ | _schedule | [Schedule](#Schedule) | no | |
489
+ | active | boolean | no | |
490
+ | application_id | string | no | |
491
+ | banner_image | [Asset](#Asset) | no | |
492
+ | created_at | string | no | |
493
+ | name | string | no | |
494
+ | rule | string | no | |
495
+ | share | [ShareMessages](#ShareMessages) | no | |
496
+ | sub_text | string | no | |
497
+ | text | string | no | |
498
+ | type | string | no | |
499
+ | updated_at | string | no | |
500
+ | updated_by | string | no | |
501
+ | url | string | no | |
502
+
503
+ ---
504
+
505
+
506
+
507
+
508
+ #### [OrderDiscountRequest](#OrderDiscountRequest)
509
+
510
+ | Properties | Type | Nullable | Description |
511
+ | ---------- | ---- | -------- | ----------- |
512
+ | currency | string | no | |
513
+ | order_amount | number | yes | |
514
+
515
+ ---
516
+
517
+
518
+
519
+
520
+ #### [OrderDiscountResponse](#OrderDiscountResponse)
521
+
522
+ | Properties | Type | Nullable | Description |
523
+ | ---------- | ---- | -------- | ----------- |
524
+ | applied_rule_bucket | [OrderDiscountRuleBucket](#OrderDiscountRuleBucket) | no | |
525
+ | base_discount | [DiscountProperties](#DiscountProperties) | no | |
526
+ | discount | [DiscountProperties](#DiscountProperties) | no | |
527
+ | order_amount | number | no | |
528
+ | points | number | no | |
529
+
530
+ ---
531
+
532
+
533
+
534
+
535
+ #### [OrderDiscountRuleBucket](#OrderDiscountRuleBucket)
536
+
537
+ | Properties | Type | Nullable | Description |
538
+ | ---------- | ---- | -------- | ----------- |
539
+ | high | number | no | |
540
+ | low | number | no | |
541
+ | max | number | no | |
542
+ | value | number | no | |
543
+ | value_type | string | no | |
544
+
545
+ ---
546
+
547
+
548
+
549
+
550
+ #### [Page](#Page)
551
+
552
+ | Properties | Type | Nullable | Description |
553
+ | ---------- | ---- | -------- | ----------- |
554
+ | current | number | no | |
555
+ | has_next | boolean | no | |
556
+ | has_previous | boolean | no | |
557
+ | item_total | number | no | |
558
+ | next_id | string | no | |
559
+ | size | number | no | |
560
+ | type | string | yes | |
561
+
562
+ ---
563
+
564
+
565
+
566
+
567
+ #### [PointsHistory](#PointsHistory)
568
+
569
+ | Properties | Type | Nullable | Description |
570
+ | ---------- | ---- | -------- | ----------- |
571
+ | _id | string | no | |
572
+ | application_id | string | no | |
573
+ | claimed | boolean | no | |
574
+ | created_at | string | no | |
575
+ | expires_on | string | no | |
576
+ | meta | string | no | |
577
+ | points | number | no | |
578
+ | remaining_points | number | no | |
579
+ | text_1 | string | no | |
580
+ | text_2 | string | no | |
581
+ | text_3 | string | no | |
582
+ | txn_name | string | no | |
583
+ | updated_at | string | no | |
584
+ | user_id | string | no | |
585
+
586
+ ---
587
+
588
+
589
+
590
+
591
+ #### [PointsHistoryResponse](#PointsHistoryResponse)
592
+
593
+ | Properties | Type | Nullable | Description |
594
+ | ---------- | ---- | -------- | ----------- |
595
+ | items | [[PointsHistory](#PointsHistory)] | no | History is the list of points transaction. |
596
+ | page | [Page](#Page) | no | |
597
+
598
+ ---
599
+
600
+
601
+
602
+
603
+ #### [PointsResponse](#PointsResponse)
604
+
605
+ | Properties | Type | Nullable | Description |
606
+ | ---------- | ---- | -------- | ----------- |
607
+ | points | number | no | Points is the total available |
608
+
609
+ ---
610
+
611
+
612
+
613
+
614
+ #### [RedeemReferralCodeRequest](#RedeemReferralCodeRequest)
615
+
616
+ | Properties | Type | Nullable | Description |
617
+ | ---------- | ---- | -------- | ----------- |
618
+ | device_id | string | yes | |
619
+ | referral_code | string | yes | |
620
+
621
+ ---
622
+
623
+
624
+
625
+
626
+ #### [RedeemReferralCodeResponse](#RedeemReferralCodeResponse)
627
+
628
+ | Properties | Type | Nullable | Description |
629
+ | ---------- | ---- | -------- | ----------- |
630
+ | message | string | no | |
631
+ | points | number | no | |
632
+ | redeemed | boolean | no | |
633
+ | referrer_id | string | no | |
634
+ | referrer_info | string | no | |
635
+
636
+ ---
637
+
638
+
639
+
640
+
641
+ #### [ReferralDetailsResponse](#ReferralDetailsResponse)
642
+
643
+ | Properties | Type | Nullable | Description |
644
+ | ---------- | ---- | -------- | ----------- |
645
+ | referral | [Offer](#Offer) | no | |
646
+ | referrer_info | string | no | |
647
+ | share | [ShareMessages](#ShareMessages) | no | |
648
+ | user | [ReferralDetailsUser](#ReferralDetailsUser) | no | |
649
+
650
+ ---
651
+
652
+
653
+
654
+
655
+ #### [ReferralDetailsUser](#ReferralDetailsUser)
656
+
657
+ | Properties | Type | Nullable | Description |
658
+ | ---------- | ---- | -------- | ----------- |
659
+ | blocked | boolean | no | |
660
+ | points | number | no | |
661
+ | redeemed | boolean | no | |
662
+ | referral_code | string | no | |
663
+
664
+ ---
665
+
666
+
667
+
668
+
669
+ #### [RewardsArticle](#RewardsArticle)
670
+
671
+ | Properties | Type | Nullable | Description |
672
+ | ---------- | ---- | -------- | ----------- |
673
+ | id | string | no | |
674
+ | points | number | no | |
675
+ | price | number | no | |
676
+
677
+ ---
678
+
679
+
680
+
681
+
682
+ #### [Schedule](#Schedule)
683
+
684
+ | Properties | Type | Nullable | Description |
685
+ | ---------- | ---- | -------- | ----------- |
686
+ | cron | string | no | |
687
+ | duration | number | no | |
688
+ | end | string | no | |
689
+ | start | string | no | |
690
+
691
+ ---
692
+
693
+
694
+
695
+
696
+ #### [ShareMessages](#ShareMessages)
697
+
698
+ | Properties | Type | Nullable | Description |
699
+ | ---------- | ---- | -------- | ----------- |
700
+ | email | string | no | |
701
+ | facebook | string | no | |
702
+ | fallback | string | no | |
703
+ | message | string | no | |
704
+ | messenger | string | no | |
705
+ | sms | string | no | |
706
+ | text | string | no | |
707
+ | twitter | string | no | |
708
+ | whatsapp | string | no | |
709
+
710
+ ---
711
+
712
+
713
+
714
+