@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,385 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.PayoutSubscriptionClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const Payabli = __importStar(require("../../../index.js"));
54
+ class PayoutSubscriptionClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * 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.
60
+ *
61
+ * @param {Payabli.RequestPayoutSchedule} request
62
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Payabli.BadRequestError}
65
+ * @throws {@link Payabli.UnauthorizedError}
66
+ * @throws {@link Payabli.InternalServerError}
67
+ * @throws {@link Payabli.ServiceUnavailableError}
68
+ *
69
+ * @example
70
+ * await client.payoutSubscription.createPayoutSubscription({
71
+ * body: {
72
+ * entryPoint: "d193cf9a46",
73
+ * paymentMethod: {
74
+ * method: "ach",
75
+ * achHolder: "Herman Coatings",
76
+ * achRouting: "021000021",
77
+ * achAccount: "3453445666",
78
+ * achAccountType: "checking"
79
+ * },
80
+ * paymentDetails: {
81
+ * totalAmount: 500,
82
+ * serviceFee: 0,
83
+ * currency: "USD"
84
+ * },
85
+ * vendorData: {
86
+ * vendorId: 1501
87
+ * },
88
+ * billData: [{
89
+ * invoiceNumber: "INV-5001",
90
+ * netAmount: "500",
91
+ * invoiceDate: "2025-08-01",
92
+ * dueDate: "2025-08-15"
93
+ * }],
94
+ * scheduleDetails: {
95
+ * startDate: "09/01/2025",
96
+ * endDate: "09/01/2026",
97
+ * frequency: "monthly"
98
+ * }
99
+ * }
100
+ * })
101
+ *
102
+ * @example
103
+ * await client.payoutSubscription.createPayoutSubscription({
104
+ * body: {
105
+ * entryPoint: "d193cf9a46",
106
+ * paymentMethod: {
107
+ * method: "vcard"
108
+ * },
109
+ * paymentDetails: {
110
+ * totalAmount: 250,
111
+ * serviceFee: 0
112
+ * },
113
+ * vendorData: {
114
+ * vendorId: 1501
115
+ * },
116
+ * billData: [{
117
+ * invoiceNumber: "INV-7820",
118
+ * netAmount: "250",
119
+ * invoiceDate: "2025-08-15",
120
+ * dueDate: "2025-09-01"
121
+ * }],
122
+ * scheduleDetails: {
123
+ * startDate: "09/01/2025",
124
+ * frequency: "weekly",
125
+ * endDate: "untilcancelled"
126
+ * }
127
+ * }
128
+ * })
129
+ */
130
+ createPayoutSubscription(request, requestOptions) {
131
+ return core.HttpResponsePromise.fromPromise(this.__createPayoutSubscription(request, requestOptions));
132
+ }
133
+ __createPayoutSubscription(request, requestOptions) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
136
+ const { idempotencyKey, body: _body } = request;
137
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
138
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ idempotencyKey: idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
139
+ const _response = yield core.fetcher({
140
+ 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, "PayoutSubscription"),
141
+ method: "POST",
142
+ headers: _headers,
143
+ contentType: "application/json",
144
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
145
+ requestType: "json",
146
+ body: _body,
147
+ 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,
148
+ 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,
149
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
150
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
151
+ logging: this._options.logging,
152
+ });
153
+ if (_response.ok) {
154
+ return {
155
+ data: _response.body,
156
+ rawResponse: _response.rawResponse,
157
+ };
158
+ }
159
+ if (_response.error.reason === "status-code") {
160
+ switch (_response.error.statusCode) {
161
+ case 400:
162
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
163
+ case 401:
164
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
165
+ case 500:
166
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
167
+ case 503:
168
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
169
+ default:
170
+ throw new errors.PayabliError({
171
+ statusCode: _response.error.statusCode,
172
+ body: _response.error.body,
173
+ rawResponse: _response.rawResponse,
174
+ });
175
+ }
176
+ }
177
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/PayoutSubscription");
178
+ });
179
+ }
180
+ /**
181
+ * Retrieves a single payout subscription's details. See [Manage payout subscriptions](/guides/pay-out-developer-payout-subscriptions-manage) for more information.
182
+ *
183
+ * @param {number} id - The payout subscription ID.
184
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
185
+ *
186
+ * @throws {@link Payabli.BadRequestError}
187
+ * @throws {@link Payabli.UnauthorizedError}
188
+ * @throws {@link Payabli.InternalServerError}
189
+ * @throws {@link Payabli.ServiceUnavailableError}
190
+ *
191
+ * @example
192
+ * await client.payoutSubscription.getPayoutSubscription(42)
193
+ */
194
+ getPayoutSubscription(id, requestOptions) {
195
+ return core.HttpResponsePromise.fromPromise(this.__getPayoutSubscription(id, requestOptions));
196
+ }
197
+ __getPayoutSubscription(id, requestOptions) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
200
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
201
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
202
+ const _response = yield core.fetcher({
203
+ 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, `PayoutSubscription/${core.url.encodePathParam(id)}`),
204
+ method: "GET",
205
+ headers: _headers,
206
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
207
+ 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,
208
+ 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,
209
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
210
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
211
+ logging: this._options.logging,
212
+ });
213
+ if (_response.ok) {
214
+ return {
215
+ data: _response.body,
216
+ rawResponse: _response.rawResponse,
217
+ };
218
+ }
219
+ if (_response.error.reason === "status-code") {
220
+ switch (_response.error.statusCode) {
221
+ case 400:
222
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
223
+ case 401:
224
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
225
+ case 500:
226
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
227
+ case 503:
228
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
229
+ default:
230
+ throw new errors.PayabliError({
231
+ statusCode: _response.error.statusCode,
232
+ body: _response.error.body,
233
+ rawResponse: _response.rawResponse,
234
+ });
235
+ }
236
+ }
237
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/PayoutSubscription/{id}");
238
+ });
239
+ }
240
+ /**
241
+ * Updates a payout subscription's details. See [Manage payout subscriptions](/guides/pay-out-developer-payout-subscriptions-manage) for more information.
242
+ *
243
+ * @param {number} id - The payout subscription ID.
244
+ * @param {Payabli.UpdatePayoutSubscriptionBody} request
245
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
246
+ *
247
+ * @throws {@link Payabli.BadRequestError}
248
+ * @throws {@link Payabli.UnauthorizedError}
249
+ * @throws {@link Payabli.InternalServerError}
250
+ * @throws {@link Payabli.ServiceUnavailableError}
251
+ *
252
+ * @example
253
+ * await client.payoutSubscription.updatePayoutSubscription(42, {
254
+ * setPause: true
255
+ * })
256
+ *
257
+ * @example
258
+ * await client.payoutSubscription.updatePayoutSubscription(42, {
259
+ * setPause: false
260
+ * })
261
+ *
262
+ * @example
263
+ * await client.payoutSubscription.updatePayoutSubscription(42, {
264
+ * paymentDetails: {
265
+ * serviceFee: 0,
266
+ * totalAmount: 750
267
+ * },
268
+ * scheduleDetails: {
269
+ * endDate: "12/31/2026",
270
+ * frequency: "monthly",
271
+ * startDate: "01/01/2026"
272
+ * }
273
+ * })
274
+ */
275
+ updatePayoutSubscription(id, request, requestOptions) {
276
+ return core.HttpResponsePromise.fromPromise(this.__updatePayoutSubscription(id, request, requestOptions));
277
+ }
278
+ __updatePayoutSubscription(id, request, requestOptions) {
279
+ return __awaiter(this, void 0, void 0, function* () {
280
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
281
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
282
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
283
+ const _response = yield core.fetcher({
284
+ 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, `PayoutSubscription/${core.url.encodePathParam(id)}`),
285
+ method: "PUT",
286
+ headers: _headers,
287
+ contentType: "application/json",
288
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
289
+ requestType: "json",
290
+ body: request,
291
+ 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,
292
+ 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,
293
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
294
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
295
+ logging: this._options.logging,
296
+ });
297
+ if (_response.ok) {
298
+ return {
299
+ data: _response.body,
300
+ rawResponse: _response.rawResponse,
301
+ };
302
+ }
303
+ if (_response.error.reason === "status-code") {
304
+ switch (_response.error.statusCode) {
305
+ case 400:
306
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
307
+ case 401:
308
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
309
+ case 500:
310
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
311
+ case 503:
312
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
313
+ default:
314
+ throw new errors.PayabliError({
315
+ statusCode: _response.error.statusCode,
316
+ body: _response.error.body,
317
+ rawResponse: _response.rawResponse,
318
+ });
319
+ }
320
+ }
321
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/PayoutSubscription/{id}");
322
+ });
323
+ }
324
+ /**
325
+ * Deletes a payout subscription and prevents future payouts. See [Manage payout subscriptions](/guides/pay-out-developer-payout-subscriptions-manage) for more information.
326
+ *
327
+ * @param {number} id - The payout subscription ID.
328
+ * @param {PayoutSubscriptionClient.RequestOptions} requestOptions - Request-specific configuration.
329
+ *
330
+ * @throws {@link Payabli.BadRequestError}
331
+ * @throws {@link Payabli.UnauthorizedError}
332
+ * @throws {@link Payabli.InternalServerError}
333
+ * @throws {@link Payabli.ServiceUnavailableError}
334
+ *
335
+ * @example
336
+ * await client.payoutSubscription.deletePayoutSubscription(42)
337
+ */
338
+ deletePayoutSubscription(id, requestOptions) {
339
+ return core.HttpResponsePromise.fromPromise(this.__deletePayoutSubscription(id, requestOptions));
340
+ }
341
+ __deletePayoutSubscription(id, requestOptions) {
342
+ return __awaiter(this, void 0, void 0, function* () {
343
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
344
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
345
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
346
+ const _response = yield core.fetcher({
347
+ 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, `PayoutSubscription/${core.url.encodePathParam(id)}`),
348
+ method: "DELETE",
349
+ headers: _headers,
350
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
351
+ 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,
352
+ 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,
353
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
354
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
355
+ logging: this._options.logging,
356
+ });
357
+ if (_response.ok) {
358
+ return {
359
+ data: _response.body,
360
+ rawResponse: _response.rawResponse,
361
+ };
362
+ }
363
+ if (_response.error.reason === "status-code") {
364
+ switch (_response.error.statusCode) {
365
+ case 400:
366
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
367
+ case 401:
368
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
369
+ case 500:
370
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
371
+ case 503:
372
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
373
+ default:
374
+ throw new errors.PayabliError({
375
+ statusCode: _response.error.statusCode,
376
+ body: _response.error.body,
377
+ rawResponse: _response.rawResponse,
378
+ });
379
+ }
380
+ }
381
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/PayoutSubscription/{id}");
382
+ });
383
+ }
384
+ }
385
+ exports.PayoutSubscriptionClient = PayoutSubscriptionClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,67 @@
1
+ import type * as Payabli from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * body: {
6
+ * entryPoint: "d193cf9a46",
7
+ * paymentMethod: {
8
+ * method: "ach",
9
+ * achHolder: "Herman Coatings",
10
+ * achRouting: "021000021",
11
+ * achAccount: "3453445666",
12
+ * achAccountType: "checking"
13
+ * },
14
+ * paymentDetails: {
15
+ * totalAmount: 500,
16
+ * serviceFee: 0,
17
+ * currency: "USD"
18
+ * },
19
+ * vendorData: {
20
+ * vendorId: 1501
21
+ * },
22
+ * billData: [{
23
+ * invoiceNumber: "INV-5001",
24
+ * netAmount: "500",
25
+ * invoiceDate: "2025-08-01",
26
+ * dueDate: "2025-08-15"
27
+ * }],
28
+ * scheduleDetails: {
29
+ * startDate: "09/01/2025",
30
+ * endDate: "09/01/2026",
31
+ * frequency: "monthly"
32
+ * }
33
+ * }
34
+ * }
35
+ *
36
+ * @example
37
+ * {
38
+ * body: {
39
+ * entryPoint: "d193cf9a46",
40
+ * paymentMethod: {
41
+ * method: "vcard"
42
+ * },
43
+ * paymentDetails: {
44
+ * totalAmount: 250,
45
+ * serviceFee: 0
46
+ * },
47
+ * vendorData: {
48
+ * vendorId: 1501
49
+ * },
50
+ * billData: [{
51
+ * invoiceNumber: "INV-7820",
52
+ * netAmount: "250",
53
+ * invoiceDate: "2025-08-15",
54
+ * dueDate: "2025-09-01"
55
+ * }],
56
+ * scheduleDetails: {
57
+ * startDate: "09/01/2025",
58
+ * frequency: "weekly",
59
+ * endDate: "untilcancelled"
60
+ * }
61
+ * }
62
+ * }
63
+ */
64
+ export interface RequestPayoutSchedule {
65
+ idempotencyKey?: Payabli.IdempotencyKey;
66
+ body: Payabli.PayoutSubscriptionRequestBody;
67
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { RequestPayoutSchedule } from "./RequestPayoutSchedule.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { PayoutSubscriptionClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.PayoutSubscriptionClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "PayoutSubscriptionClient", { enumerable: true, get: function () { return Client_js_1.PayoutSubscriptionClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,20 @@
1
+ import type * as Payabli from "../../../index.js";
2
+ /**
3
+ * Success response
4
+ *
5
+ * @example
6
+ * {
7
+ * responseText: "Success",
8
+ * isSuccess: true,
9
+ * responseData: 42,
10
+ * customerId: 1501
11
+ * }
12
+ */
13
+ export interface AddPayoutSubscriptionResponse {
14
+ isSuccess?: Payabli.IsSuccess | undefined;
15
+ responseText: Payabli.ResponseText;
16
+ /** The identifier of the newly created payout subscription. */
17
+ responseData: number;
18
+ /** The identifier of the vendor associated with the payout subscription. */
19
+ customerId?: Payabli.CustomerId | undefined;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import type * as Payabli from "../../../index.js";
2
+ /**
3
+ * Success response
4
+ */
5
+ export interface DeletePayoutSubscriptionResponse {
6
+ isSuccess?: Payabli.IsSuccess | undefined;
7
+ /**
8
+ * If `isSuccess` = true, this contains the identifier of the payout subscription.
9
+ *
10
+ * If `isSuccess` = false, this contains the reason for the failure.
11
+ */
12
+ responseData?: string | undefined;
13
+ responseText: Payabli.ResponseText;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });