wallet 0.1.220005 → 1.1.3

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 (322) hide show
  1. package/.openapi-generator/FILES +309 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +401 -0
  5. package/api/advertisementCreditsApi.ts +589 -0
  6. package/api/analyticsApi.ts +5953 -0
  7. package/api/apis.ts +86 -0
  8. package/api/appleWalletSubscribersApi.ts +235 -0
  9. package/api/billingApi.ts +680 -0
  10. package/api/clubMembersPointsApi.ts +798 -0
  11. package/api/configurationApi.ts +225 -0
  12. package/api/countriesApi.ts +155 -0
  13. package/api/customerApi.ts +737 -0
  14. package/api/dashboardApi.ts +1553 -0
  15. package/api/dynamicVouchersApi.ts +603 -0
  16. package/api/employeeAccessApi.ts +165 -0
  17. package/api/employeesApi.ts +2933 -0
  18. package/api/industriesApi.ts +155 -0
  19. package/api/infoGenesisReportsApi.ts +2023 -0
  20. package/api/integratedTerminalsApi.ts +447 -0
  21. package/api/interactionsApi.ts +678 -0
  22. package/api/linkBookApi.ts +447 -0
  23. package/api/linkBookSectionApi.ts +447 -0
  24. package/api/loginAndLogoutApi.ts +296 -0
  25. package/api/membershipTiersApi.ts +729 -0
  26. package/api/merchantApi.ts +1534 -0
  27. package/api/merchantCreditsApi.ts +798 -0
  28. package/api/merchantURLsApi.ts +586 -0
  29. package/api/mobileTerminalApi.ts +323 -0
  30. package/api/newsApi.ts +447 -0
  31. package/api/paymentDesignsApi.ts +519 -0
  32. package/api/performancesApi.ts +447 -0
  33. package/api/promoCodesApi.ts +447 -0
  34. package/api/sMSApi.ts +1999 -0
  35. package/api/settingsApi.ts +220 -0
  36. package/api/staticVoucherCampaignGroupsApi.ts +165 -0
  37. package/api/staticVoucherCampaignsApi.ts +1484 -0
  38. package/api/staticVouchersApi.ts +535 -0
  39. package/api/systemApi.ts +604 -0
  40. package/api/transactionLedgerApi.ts +203 -0
  41. package/api/utilitiesApi.ts +157 -0
  42. package/api/webTerminalApi.ts +309 -0
  43. package/api.ts +3 -0
  44. package/examples/advertisementcredits.example.ts +51 -0
  45. package/examples/clubmembers.example.ts +51 -0
  46. package/examples/linkbook.example.ts +51 -0
  47. package/examples/membershiptiers.example.ts +50 -0
  48. package/examples/merchanturls.example.ts +48 -0
  49. package/examples/news.example.ts +52 -0
  50. package/examples/paymentdesigns.example.ts +57 -0
  51. package/git_push.sh +57 -0
  52. package/model/advertisementCredit.ts +103 -0
  53. package/model/advertisementCreditBroadcast.ts +154 -0
  54. package/model/advertisementCreditScan.ts +170 -0
  55. package/model/agreement.ts +133 -0
  56. package/model/alert.ts +79 -0
  57. package/model/announcement.ts +67 -0
  58. package/model/applicableTerminals.ts +30 -0
  59. package/model/applicableTerminalsAnyOf.ts +17 -0
  60. package/model/applicableTerminalsAnyOf1.ts +17 -0
  61. package/model/applicableTerminalsAnyOf2.ts +17 -0
  62. package/model/applicableTerminalsAnyOf3.ts +17 -0
  63. package/model/authError.ts +55 -0
  64. package/model/availablePhoneNumbersRequest.ts +43 -0
  65. package/model/clickFunnelAmount.ts +37 -0
  66. package/model/clickFunnelContact.ts +248 -0
  67. package/model/clickFunnelContactProfile.ts +235 -0
  68. package/model/clickFunnelEvent.ts +38 -0
  69. package/model/clickFunnelOriginalAmount.ts +37 -0
  70. package/model/clickFunnelProduct.ts +194 -0
  71. package/model/clickFunnelPurchase.ts +178 -0
  72. package/model/createStaticVoucherCampaign.ts +109 -0
  73. package/model/createStaticVoucherCampaignWithVoucher.ts +109 -0
  74. package/model/createStaticVoucherCampaignWithVoucherWithCSV.ts +109 -0
  75. package/model/dashboardWidget.ts +115 -0
  76. package/model/duplicateRowFound.ts +55 -0
  77. package/model/dynamicVoucher.ts +224 -0
  78. package/model/dynamicVoucherBroadcast.ts +154 -0
  79. package/model/employee.ts +109 -0
  80. package/model/employeeActivityLog.ts +67 -0
  81. package/model/employeeAlert.ts +79 -0
  82. package/model/exportDataFile.ts +85 -0
  83. package/model/falsumError.ts +41 -0
  84. package/model/falsumField.ts +55 -0
  85. package/model/feature.ts +79 -0
  86. package/model/forbiddenRequest.ts +55 -0
  87. package/model/foreignKeyDoesNotExist.ts +55 -0
  88. package/model/helpDeskRequest.ts +85 -0
  89. package/model/importedList.ts +73 -0
  90. package/model/importedListRecipient.ts +73 -0
  91. package/model/inlineObject.ts +31 -0
  92. package/model/inlineObject1.ts +31 -0
  93. package/model/inlineObject10.ts +37 -0
  94. package/model/inlineObject11.ts +37 -0
  95. package/model/inlineObject12.ts +37 -0
  96. package/model/inlineObject13.ts +37 -0
  97. package/model/inlineObject14.ts +37 -0
  98. package/model/inlineObject15.ts +67 -0
  99. package/model/inlineObject16.ts +61 -0
  100. package/model/inlineObject17.ts +55 -0
  101. package/model/inlineObject18.ts +61 -0
  102. package/model/inlineObject19.ts +55 -0
  103. package/model/inlineObject2.ts +31 -0
  104. package/model/inlineObject20.ts +61 -0
  105. package/model/inlineObject21.ts +73 -0
  106. package/model/inlineObject22.ts +31 -0
  107. package/model/inlineObject23.ts +31 -0
  108. package/model/inlineObject24.ts +43 -0
  109. package/model/inlineObject25.ts +55 -0
  110. package/model/inlineObject26.ts +31 -0
  111. package/model/inlineObject27.ts +31 -0
  112. package/model/inlineObject28.ts +43 -0
  113. package/model/inlineObject29.ts +49 -0
  114. package/model/inlineObject3.ts +31 -0
  115. package/model/inlineObject30.ts +43 -0
  116. package/model/inlineObject31.ts +31 -0
  117. package/model/inlineObject32.ts +31 -0
  118. package/model/inlineObject33.ts +31 -0
  119. package/model/inlineObject34.ts +43 -0
  120. package/model/inlineObject35.ts +43 -0
  121. package/model/inlineObject36.ts +43 -0
  122. package/model/inlineObject37.ts +43 -0
  123. package/model/inlineObject38.ts +43 -0
  124. package/model/inlineObject39.ts +43 -0
  125. package/model/inlineObject4.ts +37 -0
  126. package/model/inlineObject40.ts +43 -0
  127. package/model/inlineObject41.ts +43 -0
  128. package/model/inlineObject42.ts +43 -0
  129. package/model/inlineObject43.ts +43 -0
  130. package/model/inlineObject44.ts +43 -0
  131. package/model/inlineObject45.ts +43 -0
  132. package/model/inlineObject46.ts +43 -0
  133. package/model/inlineObject47.ts +43 -0
  134. package/model/inlineObject48.ts +43 -0
  135. package/model/inlineObject49.ts +43 -0
  136. package/model/inlineObject5.ts +31 -0
  137. package/model/inlineObject50.ts +43 -0
  138. package/model/inlineObject51.ts +97 -0
  139. package/model/inlineObject52.ts +31 -0
  140. package/model/inlineObject53.ts +97 -0
  141. package/model/inlineObject54.ts +97 -0
  142. package/model/inlineObject55.ts +91 -0
  143. package/model/inlineObject56.ts +37 -0
  144. package/model/inlineObject57.ts +37 -0
  145. package/model/inlineObject58.ts +37 -0
  146. package/model/inlineObject59.ts +43 -0
  147. package/model/inlineObject6.ts +31 -0
  148. package/model/inlineObject60.ts +43 -0
  149. package/model/inlineObject61.ts +43 -0
  150. package/model/inlineObject62.ts +37 -0
  151. package/model/inlineObject63.ts +37 -0
  152. package/model/inlineObject64.ts +37 -0
  153. package/model/inlineObject65.ts +205 -0
  154. package/model/inlineObject66.ts +49 -0
  155. package/model/inlineObject67.ts +49 -0
  156. package/model/inlineObject68.ts +37 -0
  157. package/model/inlineObject69.ts +121 -0
  158. package/model/inlineObject7.ts +31 -0
  159. package/model/inlineObject8.ts +43 -0
  160. package/model/inlineObject9.ts +37 -0
  161. package/model/inlineResponse200.ts +37 -0
  162. package/model/inlineResponse2001.ts +56 -0
  163. package/model/inlineResponse20010.ts +109 -0
  164. package/model/inlineResponse20011.ts +43 -0
  165. package/model/inlineResponse2002.ts +31 -0
  166. package/model/inlineResponse2003.ts +31 -0
  167. package/model/inlineResponse2004.ts +43 -0
  168. package/model/inlineResponse2005.ts +38 -0
  169. package/model/inlineResponse2006.ts +97 -0
  170. package/model/inlineResponse2007.ts +44 -0
  171. package/model/inlineResponse2008.ts +31 -0
  172. package/model/inlineResponse2009.ts +98 -0
  173. package/model/internalServerError.ts +55 -0
  174. package/model/ledgerEntry.ts +176 -0
  175. package/model/linkBook.ts +85 -0
  176. package/model/linkBookSection.ts +61 -0
  177. package/model/mSMemberHistory.ts +112 -0
  178. package/model/mSMemberHistoryPagination.ts +53 -0
  179. package/model/mSMemberRedemption.ts +109 -0
  180. package/model/mSMemberRedemptionPagination.ts +53 -0
  181. package/model/mSMembershipTierHistory.ts +106 -0
  182. package/model/mSMembershipTierHistoryPagination.ts +53 -0
  183. package/model/mSMembershipTierRedemption.ts +121 -0
  184. package/model/mSMembershipTierRedemptionPagination.ts +53 -0
  185. package/model/mSMerchantCreditHistory.ts +88 -0
  186. package/model/mSMerchantCreditHistoryPagination.ts +53 -0
  187. package/model/mSMerchantCreditRedemption.ts +109 -0
  188. package/model/mSMerchantCreditRedemptionPagination.ts +53 -0
  189. package/model/mediaFile.ts +85 -0
  190. package/model/member.ts +118 -0
  191. package/model/memberSearch.ts +61 -0
  192. package/model/merchant.ts +133 -0
  193. package/model/merchantCreditSearch.ts +61 -0
  194. package/model/merchantNotInitialized.ts +55 -0
  195. package/model/merchantURL.ts +67 -0
  196. package/model/message.ts +74 -0
  197. package/model/models.ts +1015 -0
  198. package/model/moduleError.ts +157 -0
  199. package/model/newsArticle.ts +85 -0
  200. package/model/optInList.ts +121 -0
  201. package/model/optInListSource.ts +73 -0
  202. package/model/optInListSubscriber.ts +104 -0
  203. package/model/outboundSMS.ts +157 -0
  204. package/model/paginatedWTMembers.ts +53 -0
  205. package/model/paginatedWTMerchantCredits.ts +53 -0
  206. package/model/paginationRequestWithSortOptions.ts +75 -0
  207. package/model/paymentDesign.ts +139 -0
  208. package/model/performance.ts +100 -0
  209. package/model/phoneNumber.ts +157 -0
  210. package/model/pickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.ts +106 -0
  211. package/model/pickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.ts +67 -0
  212. package/model/pickMSMemberExcludeKeyofMSMemberMemberIdentifier.ts +106 -0
  213. package/model/pickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.ts +43 -0
  214. package/model/pickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.ts +82 -0
  215. package/model/pickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.ts +46 -0
  216. package/model/pickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.ts +52 -0
  217. package/model/pickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.ts +100 -0
  218. package/model/pickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeID.ts +94 -0
  219. package/model/pickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.ts +100 -0
  220. package/model/pickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.ts +46 -0
  221. package/model/pickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.ts +154 -0
  222. package/model/pickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.ts +137 -0
  223. package/model/pickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.ts +58 -0
  224. package/model/pickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.ts +106 -0
  225. package/model/pickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.ts +142 -0
  226. package/model/pickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsBackgroundImageURLOrCompanyLogoURLOrEmployeeID.ts +94 -0
  227. package/model/pickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.ts +106 -0
  228. package/model/pickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.ts +167 -0
  229. package/model/pickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID.ts +58 -0
  230. package/model/pickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.ts +58 -0
  231. package/model/pickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.ts +76 -0
  232. package/model/pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.ts +52 -0
  233. package/model/pickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.ts +40 -0
  234. package/model/pickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.ts +58 -0
  235. package/model/pickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.ts +138 -0
  236. package/model/pickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.ts +112 -0
  237. package/model/pickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.ts +46 -0
  238. package/model/plan.ts +62 -0
  239. package/model/portalPage.ts +67 -0
  240. package/model/presignedPost.ts +41 -0
  241. package/model/presignedPostFields.ts +43 -0
  242. package/model/product.ts +74 -0
  243. package/model/promoCode.ts +97 -0
  244. package/model/reachPerformanceStats.ts +70 -0
  245. package/model/request.ts +349 -0
  246. package/model/response.ts +67 -0
  247. package/model/role.ts +117 -0
  248. package/model/roleAuditLog.ts +97 -0
  249. package/model/sSOptInSource.ts +73 -0
  250. package/model/simpleSMSBroadcast.ts +147 -0
  251. package/model/staticVoucher.ts +224 -0
  252. package/model/staticVoucherCampaign.ts +175 -0
  253. package/model/staticVoucherCampaignBroadcast.ts +142 -0
  254. package/model/staticVoucherCampaignGroup.ts +85 -0
  255. package/model/staticVoucherCampaignUpdate.ts +85 -0
  256. package/model/status.ts +30 -0
  257. package/model/statusAnyOf.ts +17 -0
  258. package/model/statusAnyOf1.ts +17 -0
  259. package/model/statusAnyOf2.ts +17 -0
  260. package/model/statusAnyOf3.ts +17 -0
  261. package/model/subscriptionFeature.ts +79 -0
  262. package/model/subscriptionPlan.ts +69 -0
  263. package/model/subscriptionProduct.ts +81 -0
  264. package/model/tcpa.ts +67 -0
  265. package/model/updateStaticVoucherCampaignWithVoucher.ts +109 -0
  266. package/model/vSCampaignGeneratedMessage.ts +43 -0
  267. package/model/vSCampaignGeneratedMessagePagination.ts +53 -0
  268. package/model/vSDynamicVoucherStatus.ts +28 -0
  269. package/model/wTAdvertisementCredit.ts +103 -0
  270. package/model/wTAdvertisementCreditScan.ts +170 -0
  271. package/model/wTAdvertisementCreditUpdateParams.ts +55 -0
  272. package/model/wTDynamicVoucher.ts +224 -0
  273. package/model/wTDynamicVoucherCreateParams.ts +103 -0
  274. package/model/wTDynamicVoucherRedemption.ts +164 -0
  275. package/model/wTDynamicVoucherSummary.ts +169 -0
  276. package/model/wTDynamicVoucherUpdateParams.ts +103 -0
  277. package/model/wTEmployee.ts +109 -0
  278. package/model/wTEmployeeCreate.ts +61 -0
  279. package/model/wTEmployeeUpdate.ts +55 -0
  280. package/model/wTImportedList.ts +73 -0
  281. package/model/wTLinkBookCreateParams.ts +55 -0
  282. package/model/wTLinkBookSectionCreateParams.ts +31 -0
  283. package/model/wTLinkBookSectionUpdateParams.ts +31 -0
  284. package/model/wTLinkBookUpdateParams.ts +55 -0
  285. package/model/wTMember.ts +118 -0
  286. package/model/wTMemberCreationParams.ts +73 -0
  287. package/model/wTMembershipTier.ts +106 -0
  288. package/model/wTMembershipTierCreationParams.ts +64 -0
  289. package/model/wTMembershipTierUpdateParams.ts +64 -0
  290. package/model/wTMembershipTierWithMemberCount.ts +115 -0
  291. package/model/wTMerchantCredit.ts +106 -0
  292. package/model/wTMerchantCreditCreationParams.ts +49 -0
  293. package/model/wTMerchantURLCreate.ts +37 -0
  294. package/model/wTMerchantURLUpdate.ts +37 -0
  295. package/model/wTNewsArticleCreateParams.ts +55 -0
  296. package/model/wTNewsArticleUpdateParams.ts +55 -0
  297. package/model/wTOptInList.ts +121 -0
  298. package/model/wTOptInListCreationParams.ts +91 -0
  299. package/model/wTPaymentDesign.ts +139 -0
  300. package/model/wTPaymentDesignCreateParams.ts +115 -0
  301. package/model/wTPaymentDesignUpdateParams.ts +115 -0
  302. package/model/wTPerformanceCreateParams.ts +70 -0
  303. package/model/wTPerformanceUpdateParams.ts +70 -0
  304. package/model/wTPosMachine.ts +88 -0
  305. package/model/wTPosMachineCreateParams.ts +58 -0
  306. package/model/wTPosMachineUpdateParams.ts +58 -0
  307. package/model/wTPromoCodeCreateParams.ts +67 -0
  308. package/model/wTPromoCodeUpdateParams.ts +67 -0
  309. package/model/wTRole.ts +116 -0
  310. package/model/wTStaticVoucher.ts +224 -0
  311. package/model/wTStaticVoucherCampaign.ts +175 -0
  312. package/model/wTStaticVoucherCreateParams.ts +49 -0
  313. package/model/wTStaticVoucherUpdateParams.ts +43 -0
  314. package/model/wTWalletPageView.ts +251 -0
  315. package/model/wTWalletPageViewGeoPoint.ts +37 -0
  316. package/model/walletPageView.ts +251 -0
  317. package/model/webpage.ts +85 -0
  318. package/package.json +24 -10
  319. package/readme-generator.py +43 -0
  320. package/tsconfig.json +25 -0
  321. package/index.js +0 -4
  322. package/readme.md +0 -21
package/README.md ADDED
@@ -0,0 +1,401 @@
1
+
2
+ # TypeScript Client for accessing Wallet API
3
+
4
+ ## Usage
5
+
6
+
7
+ ### Create and manipulate Membership Tiers
8
+
9
+ ```nodejs
10
+ import * as api from "../api";
11
+
12
+ async function membershipTiers() {
13
+ let tiersClient = new api.MembershipTiersApi();
14
+
15
+ // Create new membership tier
16
+ let tier = await tiersClient.createMembershipTier({
17
+ tierNumber: "1",
18
+ tierName: "GOLD",
19
+ tierDiscount: 20,
20
+ tierDesignID: "JSUilOPE98",
21
+ pointsDesignID: "L918AJ7356"
22
+ }).catch(err => {
23
+ throw err;
24
+ }).then(resp => {
25
+ return resp.body
26
+ });
27
+
28
+ // The membership tier that has just been created
29
+ console.log(tier);
30
+
31
+ tier = await tiersClient.updateMembershipTier(tier.id, {
32
+ ...tier,
33
+ tierName: "SILVER"
34
+ }).catch(err => {
35
+ throw err;
36
+ }).then(resp => {
37
+ return resp.body
38
+ });
39
+
40
+ // Archive the membership tier
41
+ tier = await tiersClient.archiveMembershipTier(tier.id)
42
+ .catch(err => {
43
+ throw err;
44
+ }).then(resp => {
45
+ return resp.body
46
+ });
47
+
48
+ console.log(tier.isActive); // This will be false, since the tier has just been archived
49
+
50
+ // Restore the membership tier
51
+ tier = await tiersClient.restoreMembershipTier(tier.id)
52
+ .catch(err => {
53
+ throw err;
54
+ }).then(resp => {
55
+ return resp.body
56
+ });
57
+
58
+ console.log(tier.isActive); // This will be true, since the tier has just been restored
59
+ }
60
+ ```
61
+
62
+ ### Create and manipulate Payment Designs
63
+
64
+ ```nodejs
65
+ import * as api from "../api";
66
+
67
+ async function paymentDesigns() {
68
+ let designClient = new api.PaymentDesignsApi();
69
+
70
+ // Create a new payment design
71
+ let design = await designClient.createPaymentDesign({
72
+ borderColor: "#f0f0f0",
73
+ borderStyleType: "Dashed",
74
+ borderSize: "4px",
75
+ borderRadius: 2,
76
+ fontColor: "#777777",
77
+ fontType: "Arial",
78
+ abbreviation: "ABBR",
79
+ acronym: "AR",
80
+ icon: "fa-anchor",
81
+ designName: "Thanksgiving Design",
82
+ displayName: "Decorator",
83
+ }).catch(err => {
84
+ throw err;
85
+ }).then(resp => {
86
+ return resp.body
87
+ });
88
+
89
+ // The payment design that has just been created
90
+ console.log(design);
91
+
92
+ // Change the borderColor and borderSize of the payment design
93
+ design = await designClient.updatePaymentDesign(design.id, {
94
+ ...design,
95
+ borderColor: "#050505",
96
+ borderSize: "6px",
97
+ }).catch(err => {
98
+ throw err;
99
+ }).then(resp => {
100
+ return resp.body
101
+ });
102
+
103
+ // Archive the payment design
104
+ design = await designClient.archivePaymentDesign(design.id)
105
+ .catch(err => {
106
+ throw err;
107
+ }).then(resp => {
108
+ return resp.body
109
+ });
110
+
111
+ console.log(design.isActive); // This will be false, since the design has just been archived
112
+
113
+ // Restore the payment design
114
+ design = await designClient.restorePaymentDesign(design.id)
115
+ .catch(err => {
116
+ throw err;
117
+ }).then(resp => {
118
+ return resp.body
119
+ });
120
+ console.log(design.isActive); // This will be true, since the design has just been restored
121
+ }
122
+ ```
123
+
124
+ ### Create and manipulate Club Members
125
+
126
+ ```nodejs
127
+ import * as api from "../api";
128
+
129
+ async function clubMembers() {
130
+ let membersClient = new api.ClubMembersPointsApi();
131
+
132
+ // Create new club member
133
+ let member = await membersClient.createMember({
134
+ firstName: "John",
135
+ lastName: "Doe",
136
+ membershipTierID: "HDywI893LQ",
137
+ mobileNumber: "+1807654543",
138
+ pointsAccrued: 2000,
139
+ memberID: "MEM001"
140
+ }).catch(err => {
141
+ throw err;
142
+ }).then(resp => {
143
+ return resp.body
144
+ });
145
+
146
+ // The club member that has just been created
147
+ console.log(member);
148
+
149
+ member = await membersClient.updateMember(member.id, {
150
+ ...member,
151
+ mobileNumber: "+1809863542"
152
+ }).catch(err => {
153
+ throw err;
154
+ }).then(resp => {
155
+ return resp.body
156
+ });
157
+
158
+ // Archive the club member
159
+ member = await membersClient.archiveMember(member.id)
160
+ .catch(err => {
161
+ throw err;
162
+ }).then(resp => {
163
+ return resp.body
164
+ });
165
+
166
+ console.log(member.isActive); // This will be false, since the member has just been archived
167
+
168
+ // Restore the club member
169
+ member = await membersClient.restoreMember(member.id)
170
+ .catch(err => {
171
+ throw err;
172
+ }).then(resp => {
173
+ return resp.body
174
+ });
175
+
176
+ console.log(member.isActive); // This will be true, since the member has just been restored
177
+ }
178
+ ```
179
+
180
+ ### Create and manipulate Advertisement Credits
181
+
182
+ ```nodejs
183
+ import * as api from "../api";
184
+
185
+ async function advertisementCredits() {
186
+ let client = new api.AdvertisementCreditsApi();
187
+
188
+ // Create a new advertisement credit
189
+ let adCredit = await client.createAdvertisementCredit({
190
+ title: "Ad Credit",
191
+ valueType: "percent",
192
+ paymentDesignID: "HUdjo93KL",
193
+ maxUses: 5,
194
+ discountValue: 5,
195
+ }).catch(err => {
196
+ throw err;
197
+ }).then(resp => {
198
+ return resp.body
199
+ });
200
+
201
+ // The advertisement credit that has just been created
202
+ console.log(adCredit);
203
+
204
+ // Update the advertisement credit with a new maxUses count
205
+ adCredit = await client.updateAdvertisementCredit(adCredit.id, {
206
+ ...adCredit,
207
+ maxUses: 10,
208
+ }).catch(err => {
209
+ throw err;
210
+ }).then(resp => {
211
+ return resp.body
212
+ });
213
+
214
+ // Archive the advertisement credit
215
+ adCredit = await client.archiveAdvertisementCredit(adCredit.id)
216
+ .catch(err => {
217
+ throw err;
218
+ }).then(resp => {
219
+ return resp.body
220
+ });
221
+
222
+ console.log(adCredit.isActive); // This will be false, since the advertisement credit has just been archived
223
+
224
+ // Restore the advertisement credit
225
+ adCredit = await client.restoreAdvertisementCredit(adCredit.id)
226
+ .catch(err => {
227
+ throw err;
228
+ }).then(resp => {
229
+ return resp.body
230
+ });
231
+
232
+ console.log(adCredit.isActive); // This will be true, since the advertisement credit has just been restored
233
+ }
234
+ ```
235
+
236
+ ### Create and manipulate Link Book Links
237
+
238
+ ```nodejs
239
+ import * as api from "../api";
240
+
241
+ async function linkBook() {
242
+ let client = new api.LinkBookApi();
243
+
244
+ // Create a new link book link
245
+ let link = await client.createLinkBook({
246
+ title: "External Link",
247
+ url: "https://example.com",
248
+ icon: "fa-clock",
249
+ orderNumber: 1,
250
+ linkBookSectionID: "",
251
+ }).catch(err => {
252
+ throw err;
253
+ }).then(resp => {
254
+ return resp.body
255
+ });
256
+
257
+ // The link book link that has just been created
258
+ console.log(link);
259
+
260
+ // Update the link book link with a new url
261
+ link = await client.updateLinkBook(link.id, {
262
+ ...link,
263
+ url: "https://test.com"
264
+ }).catch(err => {
265
+ throw err;
266
+ }).then(resp => {
267
+ return resp.body
268
+ });
269
+
270
+ // Archive the link book link
271
+ link = await client.archiveLinkBook(link.id)
272
+ .catch(err => {
273
+ throw err;
274
+ }).then(resp => {
275
+ return resp.body
276
+ });
277
+
278
+ console.log(link.isActive); // This will be false, since the link book link has just been archived
279
+
280
+ // Restore the link book link
281
+ link = await client.restoreLinkBook(link.id)
282
+ .catch(err => {
283
+ throw err;
284
+ }).then(resp => {
285
+ return resp.body
286
+ });
287
+
288
+ console.log(link.isActive); // This will be true, since the link book link has just been restored
289
+ }
290
+ ```
291
+
292
+ ### Create and manipulate Merchant URLs
293
+
294
+ ```nodejs
295
+ import * as api from "../api";
296
+
297
+ async function merchantURLs() {
298
+ let client = new api.MerchantURLsApi();
299
+
300
+ // Create a new merchant URL
301
+ let url = await client.createMerchantURL({
302
+ nickname: "Instagram",
303
+ destinationURL: "https://instagram.com/merchant"
304
+ }).catch(err => {
305
+ throw err;
306
+ }).then(resp => {
307
+ return resp.body
308
+ });
309
+
310
+ // The merchant URL that has just been created
311
+ console.log(url);
312
+
313
+ // Update the merchant URL with a new destination URL
314
+ url = await client.updateMerchantURL(url.id, {
315
+ ...url,
316
+ destinationURL: "https://instagram.com/redirect/merchant"
317
+ }).catch(err => {
318
+ throw err;
319
+ }).then(resp => {
320
+ return resp.body
321
+ });
322
+
323
+ // Archive the merchant URL
324
+ url = await client.archiveMerchantURL(url.id)
325
+ .catch(err => {
326
+ throw err;
327
+ }).then(resp => {
328
+ return resp.body
329
+ });
330
+
331
+ console.log(url.isActive); // This will be false, since the merchant URL has just been archived
332
+
333
+ // Restore the merchant URL
334
+ url = await client.restoreMerchantURL(url.id)
335
+ .catch(err => {
336
+ throw err;
337
+ }).then(resp => {
338
+ return resp.body
339
+ });
340
+
341
+ console.log(url.isActive); // This will be true, since the merchant URL has just been restored
342
+ }
343
+ ```
344
+
345
+ ### Create and manipulate News Articles
346
+
347
+ ```nodejs
348
+ import * as api from "../api";
349
+
350
+ async function news() {
351
+ let client = new api.NewsApi();
352
+
353
+ // Create a new news article
354
+ let article = await client.createNewsArticle({
355
+ title: "News Article",
356
+ orderNumber: 1,
357
+ body: "This is a news article related to the merchant",
358
+ url: "https://blog.merchant.com",
359
+ mediaURL: "https://example.com/image"
360
+ }).catch(err => {
361
+ throw err;
362
+ }).then(resp => {
363
+ return resp.body
364
+ });
365
+
366
+
367
+ // The news article that has just been created
368
+ console.log(article);
369
+
370
+ // Update the news article with a new title
371
+ article = await client.updateNewsArticle(article.id, {
372
+ ...article,
373
+ title: "News Article Updated"
374
+ }).catch(err => {
375
+ throw err;
376
+ }).then(resp => {
377
+ return resp.body
378
+ });
379
+
380
+ // Archive the news article
381
+ article = await client.archiveNewsArticle(article.id)
382
+ .catch(err => {
383
+ throw err;
384
+ }).then(resp => {
385
+ return resp.body
386
+ });
387
+
388
+ console.log(article.isActive); // This will be false, since the news article has just been archived
389
+
390
+ // Restore the news article
391
+ article = await client.restoreNewsArticle(article.id)
392
+ .catch(err => {
393
+ throw err;
394
+ }).then(resp => {
395
+ return resp.body
396
+ });
397
+
398
+ console.log(article.isActive); // This will be true, since the news article has just been restored
399
+ }
400
+ ```
401
+