@payabli/sdk-node 0.0.134 → 0.0.136

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 (181) hide show
  1. package/README.md +13 -13
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +6 -0
  4. package/dist/cjs/Client.js +52 -42
  5. package/dist/cjs/api/resources/ghostCard/client/Client.d.ts +67 -0
  6. package/dist/cjs/api/resources/ghostCard/client/Client.js +201 -0
  7. package/dist/cjs/api/resources/ghostCard/client/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/ghostCard/client/index.js +17 -0
  9. package/dist/cjs/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.d.ts +53 -0
  10. package/dist/cjs/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.js +3 -0
  11. package/dist/cjs/api/resources/ghostCard/client/requests/UpdateCardRequestBody.d.ts +14 -0
  12. package/dist/cjs/api/resources/ghostCard/client/requests/UpdateCardRequestBody.js +3 -0
  13. package/dist/cjs/api/resources/ghostCard/client/requests/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/ghostCard/client/requests/index.js +2 -0
  15. package/dist/cjs/api/resources/ghostCard/exports.d.ts +2 -0
  16. package/dist/cjs/api/resources/ghostCard/exports.js +21 -0
  17. package/dist/cjs/api/resources/ghostCard/index.d.ts +2 -0
  18. package/dist/cjs/api/resources/ghostCard/index.js +18 -0
  19. package/dist/cjs/api/resources/ghostCard/types/CardStatus.d.ts +8 -0
  20. package/dist/cjs/api/resources/ghostCard/types/CardStatus.js +11 -0
  21. package/dist/cjs/api/resources/ghostCard/types/CreateGhostCardResponse.d.ts +17 -0
  22. package/dist/cjs/api/resources/ghostCard/types/CreateGhostCardResponse.js +3 -0
  23. package/dist/cjs/api/resources/ghostCard/types/index.d.ts +2 -0
  24. package/dist/cjs/api/resources/ghostCard/types/index.js +18 -0
  25. package/dist/cjs/api/resources/index.d.ts +6 -0
  26. package/dist/cjs/api/resources/index.js +7 -1
  27. package/dist/cjs/api/resources/payoutSubscription/client/Client.d.ts +156 -0
  28. package/dist/cjs/api/resources/payoutSubscription/client/Client.js +385 -0
  29. package/dist/cjs/api/resources/payoutSubscription/client/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/payoutSubscription/client/index.js +17 -0
  31. package/dist/cjs/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.d.ts +67 -0
  32. package/dist/cjs/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.js +3 -0
  33. package/dist/cjs/api/resources/payoutSubscription/client/requests/index.d.ts +1 -0
  34. package/dist/cjs/api/resources/payoutSubscription/client/requests/index.js +2 -0
  35. package/dist/cjs/api/resources/payoutSubscription/exports.d.ts +2 -0
  36. package/dist/cjs/api/resources/payoutSubscription/exports.js +21 -0
  37. package/dist/cjs/api/resources/payoutSubscription/index.d.ts +2 -0
  38. package/dist/cjs/api/resources/payoutSubscription/index.js +18 -0
  39. package/dist/cjs/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.d.ts +20 -0
  40. package/dist/cjs/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.js +3 -0
  41. package/dist/cjs/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.d.ts +14 -0
  42. package/dist/cjs/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.js +3 -0
  43. package/dist/cjs/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.ts +151 -0
  44. package/dist/cjs/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.js +3 -0
  45. package/dist/cjs/api/resources/payoutSubscription/types/PayoutPaymentDetail.d.ts +31 -0
  46. package/dist/cjs/api/resources/payoutSubscription/types/PayoutPaymentDetail.js +3 -0
  47. package/dist/cjs/api/resources/payoutSubscription/types/PayoutScheduleDetail.d.ts +9 -0
  48. package/dist/cjs/api/resources/payoutSubscription/types/PayoutScheduleDetail.js +3 -0
  49. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSetPause.d.ts +4 -0
  50. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSetPause.js +3 -0
  51. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.ts +195 -0
  52. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.js +3 -0
  53. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.ts +195 -0
  54. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.js +3 -0
  55. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.d.ts +69 -0
  56. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.js +3 -0
  57. package/dist/cjs/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.ts +155 -0
  58. package/dist/cjs/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.js +3 -0
  59. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.d.ts +9 -0
  60. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.js +3 -0
  61. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.d.ts +15 -0
  62. package/dist/cjs/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.js +3 -0
  63. package/dist/cjs/api/resources/payoutSubscription/types/index.d.ts +12 -0
  64. package/dist/cjs/api/resources/payoutSubscription/types/index.js +28 -0
  65. package/dist/cjs/api/resources/query/client/Client.d.ts +46 -6
  66. package/dist/cjs/api/resources/query/client/Client.js +150 -6
  67. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.d.ts +84 -0
  68. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.js +3 -0
  69. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.d.ts +84 -0
  70. package/dist/cjs/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.js +3 -0
  71. package/dist/cjs/api/resources/query/client/requests/index.d.ts +2 -0
  72. package/dist/cjs/api/types/NotificationStandardRequest.d.ts +0 -31
  73. package/dist/cjs/api/types/NotificationStandardRequest.js +0 -31
  74. package/dist/cjs/api/types/Remitaddress1.d.ts +1 -1
  75. package/dist/cjs/api/types/Remitaddress2.d.ts +1 -1
  76. package/dist/cjs/api/types/Remitcity.d.ts +1 -1
  77. package/dist/cjs/api/types/Remitcountry.d.ts +1 -1
  78. package/dist/cjs/api/types/Remitstate.d.ts +1 -1
  79. package/dist/cjs/api/types/Remitzip.d.ts +1 -1
  80. package/dist/cjs/api/types/VendorData.d.ts +6 -6
  81. package/dist/cjs/api/types/VendorEin.d.ts +1 -1
  82. package/dist/cjs/api/types/VendorName1.d.ts +1 -1
  83. package/dist/cjs/api/types/VendorName2.d.ts +1 -1
  84. package/dist/cjs/api/types/VendorNumber.d.ts +1 -1
  85. package/dist/cjs/api/types/VendorOutData.d.ts +9 -9
  86. package/dist/cjs/api/types/VendorQueryRecord.d.ts +1 -1
  87. package/dist/cjs/api/types/Vendorstatus.d.ts +5 -3
  88. package/dist/cjs/core/file/file.js +3 -2
  89. package/dist/cjs/version.d.ts +1 -1
  90. package/dist/cjs/version.js +1 -1
  91. package/dist/esm/BaseClient.mjs +2 -2
  92. package/dist/esm/Client.d.mts +6 -0
  93. package/dist/esm/Client.mjs +10 -0
  94. package/dist/esm/api/resources/ghostCard/client/Client.d.mts +67 -0
  95. package/dist/esm/api/resources/ghostCard/client/Client.mjs +164 -0
  96. package/dist/esm/api/resources/ghostCard/client/index.d.mts +1 -0
  97. package/dist/esm/api/resources/ghostCard/client/index.mjs +1 -0
  98. package/dist/esm/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.d.mts +53 -0
  99. package/dist/esm/api/resources/ghostCard/client/requests/CreateGhostCardRequestBody.mjs +2 -0
  100. package/dist/esm/api/resources/ghostCard/client/requests/UpdateCardRequestBody.d.mts +14 -0
  101. package/dist/esm/api/resources/ghostCard/client/requests/UpdateCardRequestBody.mjs +2 -0
  102. package/dist/esm/api/resources/ghostCard/client/requests/index.d.mts +2 -0
  103. package/dist/esm/api/resources/ghostCard/client/requests/index.mjs +1 -0
  104. package/dist/esm/api/resources/ghostCard/exports.d.mts +2 -0
  105. package/dist/esm/api/resources/ghostCard/exports.mjs +3 -0
  106. package/dist/esm/api/resources/ghostCard/index.d.mts +2 -0
  107. package/dist/esm/api/resources/ghostCard/index.mjs +2 -0
  108. package/dist/esm/api/resources/ghostCard/types/CardStatus.d.mts +8 -0
  109. package/dist/esm/api/resources/ghostCard/types/CardStatus.mjs +8 -0
  110. package/dist/esm/api/resources/ghostCard/types/CreateGhostCardResponse.d.mts +17 -0
  111. package/dist/esm/api/resources/ghostCard/types/CreateGhostCardResponse.mjs +2 -0
  112. package/dist/esm/api/resources/ghostCard/types/index.d.mts +2 -0
  113. package/dist/esm/api/resources/ghostCard/types/index.mjs +2 -0
  114. package/dist/esm/api/resources/index.d.mts +6 -0
  115. package/dist/esm/api/resources/index.mjs +6 -0
  116. package/dist/esm/api/resources/payoutSubscription/client/Client.d.mts +156 -0
  117. package/dist/esm/api/resources/payoutSubscription/client/Client.mjs +348 -0
  118. package/dist/esm/api/resources/payoutSubscription/client/index.d.mts +1 -0
  119. package/dist/esm/api/resources/payoutSubscription/client/index.mjs +1 -0
  120. package/dist/esm/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.d.mts +67 -0
  121. package/dist/esm/api/resources/payoutSubscription/client/requests/RequestPayoutSchedule.mjs +2 -0
  122. package/dist/esm/api/resources/payoutSubscription/client/requests/index.d.mts +1 -0
  123. package/dist/esm/api/resources/payoutSubscription/client/requests/index.mjs +1 -0
  124. package/dist/esm/api/resources/payoutSubscription/exports.d.mts +2 -0
  125. package/dist/esm/api/resources/payoutSubscription/exports.mjs +3 -0
  126. package/dist/esm/api/resources/payoutSubscription/index.d.mts +2 -0
  127. package/dist/esm/api/resources/payoutSubscription/index.mjs +2 -0
  128. package/dist/esm/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.d.mts +20 -0
  129. package/dist/esm/api/resources/payoutSubscription/types/AddPayoutSubscriptionResponse.mjs +2 -0
  130. package/dist/esm/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.d.mts +14 -0
  131. package/dist/esm/api/resources/payoutSubscription/types/DeletePayoutSubscriptionResponse.mjs +2 -0
  132. package/dist/esm/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.mts +151 -0
  133. package/dist/esm/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.mjs +2 -0
  134. package/dist/esm/api/resources/payoutSubscription/types/PayoutPaymentDetail.d.mts +31 -0
  135. package/dist/esm/api/resources/payoutSubscription/types/PayoutPaymentDetail.mjs +2 -0
  136. package/dist/esm/api/resources/payoutSubscription/types/PayoutScheduleDetail.d.mts +9 -0
  137. package/dist/esm/api/resources/payoutSubscription/types/PayoutScheduleDetail.mjs +2 -0
  138. package/dist/esm/api/resources/payoutSubscription/types/PayoutSetPause.d.mts +4 -0
  139. package/dist/esm/api/resources/payoutSubscription/types/PayoutSetPause.mjs +2 -0
  140. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.mts +195 -0
  141. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.mjs +2 -0
  142. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.mts +195 -0
  143. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.mjs +2 -0
  144. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.d.mts +69 -0
  145. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionRequestBody.mjs +2 -0
  146. package/dist/esm/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.mts +155 -0
  147. package/dist/esm/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.mjs +2 -0
  148. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.d.mts +9 -0
  149. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionBody.mjs +2 -0
  150. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.d.mts +15 -0
  151. package/dist/esm/api/resources/payoutSubscription/types/UpdatePayoutSubscriptionResponse.mjs +2 -0
  152. package/dist/esm/api/resources/payoutSubscription/types/index.d.mts +12 -0
  153. package/dist/esm/api/resources/payoutSubscription/types/index.mjs +12 -0
  154. package/dist/esm/api/resources/query/client/Client.d.mts +46 -6
  155. package/dist/esm/api/resources/query/client/Client.mjs +150 -6
  156. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.d.mts +84 -0
  157. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsOrgRequest.mjs +2 -0
  158. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.d.mts +84 -0
  159. package/dist/esm/api/resources/query/client/requests/ListPayoutSubscriptionsRequest.mjs +2 -0
  160. package/dist/esm/api/resources/query/client/requests/index.d.mts +2 -0
  161. package/dist/esm/api/types/NotificationStandardRequest.d.mts +0 -31
  162. package/dist/esm/api/types/NotificationStandardRequest.mjs +0 -31
  163. package/dist/esm/api/types/Remitaddress1.d.mts +1 -1
  164. package/dist/esm/api/types/Remitaddress2.d.mts +1 -1
  165. package/dist/esm/api/types/Remitcity.d.mts +1 -1
  166. package/dist/esm/api/types/Remitcountry.d.mts +1 -1
  167. package/dist/esm/api/types/Remitstate.d.mts +1 -1
  168. package/dist/esm/api/types/Remitzip.d.mts +1 -1
  169. package/dist/esm/api/types/VendorData.d.mts +6 -6
  170. package/dist/esm/api/types/VendorEin.d.mts +1 -1
  171. package/dist/esm/api/types/VendorName1.d.mts +1 -1
  172. package/dist/esm/api/types/VendorName2.d.mts +1 -1
  173. package/dist/esm/api/types/VendorNumber.d.mts +1 -1
  174. package/dist/esm/api/types/VendorOutData.d.mts +9 -9
  175. package/dist/esm/api/types/VendorQueryRecord.d.mts +1 -1
  176. package/dist/esm/api/types/Vendorstatus.d.mts +5 -3
  177. package/dist/esm/core/file/file.mjs +3 -2
  178. package/dist/esm/version.d.mts +1 -1
  179. package/dist/esm/version.mjs +1 -1
  180. package/package.json +29 -7
  181. package/reference.md +682 -78
@@ -0,0 +1,164 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as Payabli from "../../../index.mjs";
18
+ export class GhostCardClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Creates a ghost card, a multi-use virtual debit card issued to a vendor for recurring or discretionary spend.
24
+ *
25
+ * Unlike single-use virtual cards issued as part of a payout transaction, ghost cards aren't tied to a specific payout. They're issued directly to a vendor and can be reused up to a configurable number of times within the card's spending limits.
26
+ *
27
+ * @param {Payabli.Entry} entry
28
+ * @param {Payabli.CreateGhostCardRequestBody} request
29
+ * @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link Payabli.BadRequestError}
32
+ * @throws {@link Payabli.UnauthorizedError}
33
+ * @throws {@link Payabli.InternalServerError}
34
+ * @throws {@link Payabli.ServiceUnavailableError}
35
+ *
36
+ * @example
37
+ * await client.ghostCard.createGhostCard("8cfec2e0fa", {
38
+ * vendorId: 42,
39
+ * expenseLimit: 500,
40
+ * maxNumberOfUses: 3,
41
+ * exactAmount: false,
42
+ * expenseLimitPeriod: "monthly",
43
+ * billingCycle: "monthly",
44
+ * billingCycleDay: "1",
45
+ * dailyTransactionCount: 5,
46
+ * dailyAmountLimit: 200,
47
+ * transactionAmountLimit: 100,
48
+ * mcc: "5411",
49
+ * tcc: "R",
50
+ * misc1: "PO-98765",
51
+ * misc2: "Dept-Finance"
52
+ * })
53
+ */
54
+ createGhostCard(entry, request, requestOptions) {
55
+ return core.HttpResponsePromise.fromPromise(this.__createGhostCard(entry, request, requestOptions));
56
+ }
57
+ __createGhostCard(entry, request, requestOptions) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
60
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
61
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
62
+ const _response = yield core.fetcher({
63
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOutCard/GhostCard/${core.url.encodePathParam(entry)}`),
64
+ method: "POST",
65
+ headers: _headers,
66
+ contentType: "application/json",
67
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
68
+ requestType: "json",
69
+ body: request,
70
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
71
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
72
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
73
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
74
+ logging: this._options.logging,
75
+ });
76
+ if (_response.ok) {
77
+ return { data: _response.body, rawResponse: _response.rawResponse };
78
+ }
79
+ if (_response.error.reason === "status-code") {
80
+ switch (_response.error.statusCode) {
81
+ case 400:
82
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
83
+ case 401:
84
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
85
+ case 500:
86
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
87
+ case 503:
88
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
89
+ default:
90
+ throw new errors.PayabliError({
91
+ statusCode: _response.error.statusCode,
92
+ body: _response.error.body,
93
+ rawResponse: _response.rawResponse,
94
+ });
95
+ }
96
+ }
97
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/MoneyOutCard/GhostCard/{entry}");
98
+ });
99
+ }
100
+ /**
101
+ * Updates the status of a virtual card (including ghost cards) under a paypoint.
102
+ *
103
+ * @param {Payabli.Entry} entry
104
+ * @param {Payabli.UpdateCardRequestBody} request
105
+ * @param {GhostCardClient.RequestOptions} requestOptions - Request-specific configuration.
106
+ *
107
+ * @throws {@link Payabli.BadRequestError}
108
+ * @throws {@link Payabli.UnauthorizedError}
109
+ * @throws {@link Payabli.InternalServerError}
110
+ * @throws {@link Payabli.ServiceUnavailableError}
111
+ *
112
+ * @example
113
+ * await client.ghostCard.updateCard("8cfec2e0fa", {
114
+ * cardToken: "gc_abc123def456",
115
+ * status: "Cancelled"
116
+ * })
117
+ */
118
+ updateCard(entry, request, requestOptions) {
119
+ return core.HttpResponsePromise.fromPromise(this.__updateCard(entry, request, requestOptions));
120
+ }
121
+ __updateCard(entry, request, requestOptions) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
124
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
125
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
126
+ const _response = yield core.fetcher({
127
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOutCard/card/${core.url.encodePathParam(entry)}`),
128
+ method: "PATCH",
129
+ headers: _headers,
130
+ contentType: "application/json",
131
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
132
+ requestType: "json",
133
+ body: request,
134
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
135
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
136
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
137
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
138
+ logging: this._options.logging,
139
+ });
140
+ if (_response.ok) {
141
+ return { data: _response.body, rawResponse: _response.rawResponse };
142
+ }
143
+ if (_response.error.reason === "status-code") {
144
+ switch (_response.error.statusCode) {
145
+ case 400:
146
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
147
+ case 401:
148
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
149
+ case 500:
150
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
151
+ case 503:
152
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
153
+ default:
154
+ throw new errors.PayabliError({
155
+ statusCode: _response.error.statusCode,
156
+ body: _response.error.body,
157
+ rawResponse: _response.rawResponse,
158
+ });
159
+ }
160
+ }
161
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/MoneyOutCard/card/{entry}");
162
+ });
163
+ }
164
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * vendorId: 42,
5
+ * expenseLimit: 500,
6
+ * maxNumberOfUses: 3,
7
+ * exactAmount: false,
8
+ * expenseLimitPeriod: "monthly",
9
+ * billingCycle: "monthly",
10
+ * billingCycleDay: "1",
11
+ * dailyTransactionCount: 5,
12
+ * dailyAmountLimit: 200,
13
+ * transactionAmountLimit: 100,
14
+ * mcc: "5411",
15
+ * tcc: "R",
16
+ * misc1: "PO-98765",
17
+ * misc2: "Dept-Finance"
18
+ * }
19
+ */
20
+ export interface CreateGhostCardRequestBody {
21
+ /** ID of the vendor who receives the card. The vendor must belong to the paypoint and have an active status. */
22
+ vendorId: number;
23
+ /** Spending limit for the card. Must be greater than `0` and can't exceed the paypoint's configured payout credit limit. */
24
+ expenseLimit: number;
25
+ /** Requested expiration date for the card. If not provided, defaults to 30 days from creation. */
26
+ expirationDate?: string;
27
+ /** Initial load amount for the card. Defaults to `0`. */
28
+ amount?: number;
29
+ /** Maximum number of times the card can be used. If `0` or negative, defaults to `9999`. Ignored and set to `1` when `exactAmount` is `true`. */
30
+ maxNumberOfUses?: number;
31
+ /** When `true`, restricts the card to a single use. `maxNumberOfUses` is automatically set to `1` regardless of any other value provided. */
32
+ exactAmount?: boolean;
33
+ /** Time period over which `expenseLimit` applies (for example, `monthly` or `weekly`). No server-side enforcement. */
34
+ expenseLimitPeriod?: string;
35
+ /** Billing cycle identifier. */
36
+ billingCycle?: string;
37
+ /** Day within the billing cycle. */
38
+ billingCycleDay?: string;
39
+ /** Maximum number of transactions allowed per day. Defaults to `0` (unlimited). */
40
+ dailyTransactionCount?: number;
41
+ /** Maximum total spend allowed per day. Defaults to `0` (unlimited). */
42
+ dailyAmountLimit?: number;
43
+ /** Maximum spend allowed per single transaction. Defaults to `0` (unlimited). */
44
+ transactionAmountLimit?: number;
45
+ /** Merchant Category Code to restrict where the card can be used. Must be a valid MCC if provided. */
46
+ mcc?: string;
47
+ /** Transaction Category Code to restrict where the card can be used. Must be a valid TCC if provided. */
48
+ tcc?: string;
49
+ /** Custom metadata field. Stored on the card record. */
50
+ misc1?: string;
51
+ /** Custom metadata field. Stored on the card record. */
52
+ misc2?: string;
53
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,14 @@
1
+ import type * as Payabli from "../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * cardToken: "gc_abc123def456",
6
+ * status: "Cancelled"
7
+ * }
8
+ */
9
+ export interface UpdateCardRequestBody {
10
+ /** Token that uniquely identifies the card. This is the `ReferenceId` returned when the card was created. */
11
+ cardToken: string;
12
+ /** The new status to set on the card. */
13
+ status?: Payabli.CardStatus;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { CreateGhostCardRequestBody } from "./CreateGhostCardRequestBody.mjs";
2
+ export type { UpdateCardRequestBody } from "./UpdateCardRequestBody.mjs";
@@ -0,0 +1,2 @@
1
+ export { GhostCardClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { GhostCardClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,8 @@
1
+ /** The status to set on the card. Not all transitions are valid: `Active` can change to `Inactive`, `Cancelled`, or `Expired`. `Inactive` can change to `Active`. `Expired` can change to `Active` (renews the card). `Cancelled` is terminal and can't be changed. */
2
+ export declare const CardStatus: {
3
+ readonly Active: "Active";
4
+ readonly Inactive: "Inactive";
5
+ readonly Cancelled: "Cancelled";
6
+ readonly Expired: "Expired";
7
+ };
8
+ export type CardStatus = (typeof CardStatus)[keyof typeof CardStatus];
@@ -0,0 +1,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** The status to set on the card. Not all transitions are valid: `Active` can change to `Inactive`, `Cancelled`, or `Expired`. `Inactive` can change to `Active`. `Expired` can change to `Active` (renews the card). `Cancelled` is terminal and can't be changed. */
3
+ export const CardStatus = {
4
+ Active: "Active",
5
+ Inactive: "Inactive",
6
+ Cancelled: "Cancelled",
7
+ Expired: "Expired",
8
+ };
@@ -0,0 +1,17 @@
1
+ import type * as Payabli from "../../../index.mjs";
2
+ /**
3
+ * Response for creating a ghost card.
4
+ */
5
+ export interface CreateGhostCardResponse {
6
+ isSuccess?: Payabli.IsSuccess | undefined;
7
+ responseText: Payabli.ResponseText;
8
+ responseData?: CreateGhostCardResponse.ResponseData | undefined;
9
+ }
10
+ export declare namespace CreateGhostCardResponse {
11
+ interface ResponseData {
12
+ /** Card token for the ghost card. Use this value to reference the card in subsequent operations (update, cancel, etc.). */
13
+ ReferenceId?: string | undefined;
14
+ ResultCode?: Payabli.ResultCode | undefined;
15
+ ResultText?: Payabli.Resulttext | undefined;
16
+ }
17
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./CardStatus.mjs";
2
+ export * from "./CreateGhostCardResponse.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./CardStatus.mjs";
2
+ export * from "./CreateGhostCardResponse.mjs";
@@ -18,6 +18,9 @@ export * as customer from "./customer/index.mjs";
18
18
  export * from "./export/client/requests/index.mjs";
19
19
  export * as export_ from "./export/index.mjs";
20
20
  export * from "./export/types/index.mjs";
21
+ export * from "./ghostCard/client/requests/index.mjs";
22
+ export * as ghostCard from "./ghostCard/index.mjs";
23
+ export * from "./ghostCard/types/index.mjs";
21
24
  export * from "./hostedPaymentPages/client/requests/index.mjs";
22
25
  export * as hostedPaymentPages from "./hostedPaymentPages/index.mjs";
23
26
  export * from "./import/client/requests/index.mjs";
@@ -52,6 +55,9 @@ export * from "./paymentLink/types/index.mjs";
52
55
  export * from "./paymentMethodDomain/client/requests/index.mjs";
53
56
  export * as paymentMethodDomain from "./paymentMethodDomain/index.mjs";
54
57
  export * from "./paymentMethodDomain/types/index.mjs";
58
+ export * from "./payoutSubscription/client/requests/index.mjs";
59
+ export * as payoutSubscription from "./payoutSubscription/index.mjs";
60
+ export * from "./payoutSubscription/types/index.mjs";
55
61
  export * from "./paypoint/client/requests/index.mjs";
56
62
  export * as paypoint from "./paypoint/index.mjs";
57
63
  export * from "./paypoint/types/index.mjs";
@@ -18,6 +18,9 @@ export * as customer from "./customer/index.mjs";
18
18
  export * from "./export/client/requests/index.mjs";
19
19
  export * as export_ from "./export/index.mjs";
20
20
  export * from "./export/types/index.mjs";
21
+ export * from "./ghostCard/client/requests/index.mjs";
22
+ export * as ghostCard from "./ghostCard/index.mjs";
23
+ export * from "./ghostCard/types/index.mjs";
21
24
  export * from "./hostedPaymentPages/client/requests/index.mjs";
22
25
  export * as hostedPaymentPages from "./hostedPaymentPages/index.mjs";
23
26
  export * from "./import/client/requests/index.mjs";
@@ -52,6 +55,9 @@ export * from "./paymentLink/types/index.mjs";
52
55
  export * from "./paymentMethodDomain/client/requests/index.mjs";
53
56
  export * as paymentMethodDomain from "./paymentMethodDomain/index.mjs";
54
57
  export * from "./paymentMethodDomain/types/index.mjs";
58
+ export * from "./payoutSubscription/client/requests/index.mjs";
59
+ export * as payoutSubscription from "./payoutSubscription/index.mjs";
60
+ export * from "./payoutSubscription/types/index.mjs";
55
61
  export * from "./paypoint/client/requests/index.mjs";
56
62
  export * as paypoint from "./paypoint/index.mjs";
57
63
  export * from "./paypoint/types/index.mjs";
@@ -0,0 +1,156 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as Payabli from "../../../index.mjs";
5
+ export declare namespace PayoutSubscriptionClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class PayoutSubscriptionClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<PayoutSubscriptionClient.Options>;
12
+ constructor(options?: PayoutSubscriptionClient.Options);
13
+ /**
14
+ * Creates a payout subscription to automatically send payouts to a vendor on a recurring schedule. See [Manage payout subscriptions](/guides/pay-out-developer-payout-subscriptions-manage) for a step-by-step guide.
15
+ *
16
+ * @param {Payabli.RequestPayoutSchedule} request
17
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Payabli.BadRequestError}
20
+ * @throws {@link Payabli.UnauthorizedError}
21
+ * @throws {@link Payabli.InternalServerError}
22
+ * @throws {@link Payabli.ServiceUnavailableError}
23
+ *
24
+ * @example
25
+ * await client.payoutSubscription.createPayoutSubscription({
26
+ * body: {
27
+ * entryPoint: "d193cf9a46",
28
+ * paymentMethod: {
29
+ * method: "ach",
30
+ * achHolder: "Herman Coatings",
31
+ * achRouting: "021000021",
32
+ * achAccount: "3453445666",
33
+ * achAccountType: "checking"
34
+ * },
35
+ * paymentDetails: {
36
+ * totalAmount: 500,
37
+ * serviceFee: 0,
38
+ * currency: "USD"
39
+ * },
40
+ * vendorData: {
41
+ * vendorId: 1501
42
+ * },
43
+ * billData: [{
44
+ * invoiceNumber: "INV-5001",
45
+ * netAmount: "500",
46
+ * invoiceDate: "2025-08-01",
47
+ * dueDate: "2025-08-15"
48
+ * }],
49
+ * scheduleDetails: {
50
+ * startDate: "09/01/2025",
51
+ * endDate: "09/01/2026",
52
+ * frequency: "monthly"
53
+ * }
54
+ * }
55
+ * })
56
+ *
57
+ * @example
58
+ * await client.payoutSubscription.createPayoutSubscription({
59
+ * body: {
60
+ * entryPoint: "d193cf9a46",
61
+ * paymentMethod: {
62
+ * method: "vcard"
63
+ * },
64
+ * paymentDetails: {
65
+ * totalAmount: 250,
66
+ * serviceFee: 0
67
+ * },
68
+ * vendorData: {
69
+ * vendorId: 1501
70
+ * },
71
+ * billData: [{
72
+ * invoiceNumber: "INV-7820",
73
+ * netAmount: "250",
74
+ * invoiceDate: "2025-08-15",
75
+ * dueDate: "2025-09-01"
76
+ * }],
77
+ * scheduleDetails: {
78
+ * startDate: "09/01/2025",
79
+ * frequency: "weekly",
80
+ * endDate: "untilcancelled"
81
+ * }
82
+ * }
83
+ * })
84
+ */
85
+ createPayoutSubscription(request: Payabli.RequestPayoutSchedule, requestOptions?: PayoutSubscriptionClient.RequestOptions): core.HttpResponsePromise<Payabli.AddPayoutSubscriptionResponse>;
86
+ private __createPayoutSubscription;
87
+ /**
88
+ * Retrieves a single payout subscription's details. See [Manage payout subscriptions](/guides/pay-out-developer-payout-subscriptions-manage) for more information.
89
+ *
90
+ * @param {number} id - The payout subscription ID.
91
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
92
+ *
93
+ * @throws {@link Payabli.BadRequestError}
94
+ * @throws {@link Payabli.UnauthorizedError}
95
+ * @throws {@link Payabli.InternalServerError}
96
+ * @throws {@link Payabli.ServiceUnavailableError}
97
+ *
98
+ * @example
99
+ * await client.payoutSubscription.getPayoutSubscription(42)
100
+ */
101
+ getPayoutSubscription(id: number, requestOptions?: PayoutSubscriptionClient.RequestOptions): core.HttpResponsePromise<Payabli.GetPayoutSubscriptionResponse>;
102
+ private __getPayoutSubscription;
103
+ /**
104
+ * Updates a payout subscription's details. See [Manage payout subscriptions](/guides/pay-out-developer-payout-subscriptions-manage) for more information.
105
+ *
106
+ * @param {number} id - The payout subscription ID.
107
+ * @param {Payabli.UpdatePayoutSubscriptionBody} request
108
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
109
+ *
110
+ * @throws {@link Payabli.BadRequestError}
111
+ * @throws {@link Payabli.UnauthorizedError}
112
+ * @throws {@link Payabli.InternalServerError}
113
+ * @throws {@link Payabli.ServiceUnavailableError}
114
+ *
115
+ * @example
116
+ * await client.payoutSubscription.updatePayoutSubscription(42, {
117
+ * setPause: true
118
+ * })
119
+ *
120
+ * @example
121
+ * await client.payoutSubscription.updatePayoutSubscription(42, {
122
+ * setPause: false
123
+ * })
124
+ *
125
+ * @example
126
+ * await client.payoutSubscription.updatePayoutSubscription(42, {
127
+ * paymentDetails: {
128
+ * serviceFee: 0,
129
+ * totalAmount: 750
130
+ * },
131
+ * scheduleDetails: {
132
+ * endDate: "12/31/2026",
133
+ * frequency: "monthly",
134
+ * startDate: "01/01/2026"
135
+ * }
136
+ * })
137
+ */
138
+ updatePayoutSubscription(id: number, request: Payabli.UpdatePayoutSubscriptionBody, requestOptions?: PayoutSubscriptionClient.RequestOptions): core.HttpResponsePromise<Payabli.UpdatePayoutSubscriptionResponse>;
139
+ private __updatePayoutSubscription;
140
+ /**
141
+ * Deletes a payout subscription and prevents future payouts. See [Manage payout subscriptions](/guides/pay-out-developer-payout-subscriptions-manage) for more information.
142
+ *
143
+ * @param {number} id - The payout subscription ID.
144
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
145
+ *
146
+ * @throws {@link Payabli.BadRequestError}
147
+ * @throws {@link Payabli.UnauthorizedError}
148
+ * @throws {@link Payabli.InternalServerError}
149
+ * @throws {@link Payabli.ServiceUnavailableError}
150
+ *
151
+ * @example
152
+ * await client.payoutSubscription.deletePayoutSubscription(42)
153
+ */
154
+ deletePayoutSubscription(id: number, requestOptions?: PayoutSubscriptionClient.RequestOptions): core.HttpResponsePromise<Payabli.DeletePayoutSubscriptionResponse>;
155
+ private __deletePayoutSubscription;
156
+ }