@moovio/sdk 0.21.0 → 0.21.2

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 (71) hide show
  1. package/bin/mcp-server.js +79 -61
  2. package/bin/mcp-server.js.map +11 -10
  3. package/examples/package-lock.json +1 -1
  4. package/hooks/hooks.d.ts +3 -2
  5. package/hooks/hooks.d.ts.map +1 -1
  6. package/hooks/hooks.js.map +1 -1
  7. package/hooks/moov-version-hook.d.ts +6 -0
  8. package/hooks/moov-version-hook.d.ts.map +1 -0
  9. package/hooks/moov-version-hook.js +12 -0
  10. package/hooks/moov-version-hook.js.map +1 -0
  11. package/hooks/registration.d.ts.map +1 -1
  12. package/hooks/registration.js +3 -1
  13. package/hooks/registration.js.map +1 -1
  14. package/hooks/types.d.ts +2 -6
  15. package/hooks/types.d.ts.map +1 -1
  16. package/jsr.json +1 -1
  17. package/lib/config.d.ts +3 -3
  18. package/lib/config.js +3 -3
  19. package/lib/sdks.d.ts.map +1 -1
  20. package/lib/sdks.js +5 -6
  21. package/lib/sdks.js.map +1 -1
  22. package/mcp-server/mcp-server.js +1 -1
  23. package/mcp-server/server.js +1 -1
  24. package/package.json +1 -1
  25. package/src/hooks/hooks.ts +2 -2
  26. package/src/hooks/moov-version-hook.ts +9 -0
  27. package/src/hooks/registration.ts +4 -1
  28. package/src/hooks/types.ts +2 -7
  29. package/src/lib/config.ts +3 -3
  30. package/src/lib/sdks.ts +6 -7
  31. package/src/mcp-server/mcp-server.ts +1 -1
  32. package/src/mcp-server/server.ts +1 -1
  33. package/docs/sdks/accounts/README.md +0 -1038
  34. package/docs/sdks/accountterminalapplications/README.md +0 -371
  35. package/docs/sdks/adjustments/README.md +0 -185
  36. package/docs/sdks/applepay/README.md +0 -572
  37. package/docs/sdks/authentication/README.md +0 -191
  38. package/docs/sdks/avatars/README.md +0 -95
  39. package/docs/sdks/bankaccounts/README.md +0 -951
  40. package/docs/sdks/branding/README.md +0 -407
  41. package/docs/sdks/capabilities/README.md +0 -380
  42. package/docs/sdks/cardissuing/README.md +0 -533
  43. package/docs/sdks/cards/README.md +0 -544
  44. package/docs/sdks/disputes/README.md +0 -1085
  45. package/docs/sdks/endtoendencryption/README.md +0 -174
  46. package/docs/sdks/enrichedaddress/README.md +0 -95
  47. package/docs/sdks/enrichedprofile/README.md +0 -95
  48. package/docs/sdks/feeplans/README.md +0 -921
  49. package/docs/sdks/files/README.md +0 -293
  50. package/docs/sdks/images/README.md +0 -616
  51. package/docs/sdks/industries/README.md +0 -91
  52. package/docs/sdks/institutions/README.md +0 -184
  53. package/docs/sdks/issuingtransactions/README.md +0 -465
  54. package/docs/sdks/onboarding/README.md +0 -389
  55. package/docs/sdks/paymentlinks/README.md +0 -615
  56. package/docs/sdks/paymentmethods/README.md +0 -187
  57. package/docs/sdks/ping/README.md +0 -91
  58. package/docs/sdks/products/README.md +0 -616
  59. package/docs/sdks/receipts/README.md +0 -180
  60. package/docs/sdks/representatives/README.md +0 -603
  61. package/docs/sdks/scheduling/README.md +0 -1018
  62. package/docs/sdks/statements/README.md +0 -194
  63. package/docs/sdks/support/README.md +0 -505
  64. package/docs/sdks/sweeps/README.md +0 -571
  65. package/docs/sdks/terminalapplications/README.md +0 -460
  66. package/docs/sdks/transfers/README.md +0 -1136
  67. package/docs/sdks/underwriting/README.md +0 -331
  68. package/docs/sdks/wallets/README.md +0 -416
  69. package/docs/sdks/wallettransactions/README.md +0 -202
  70. package/examples/README.md +0 -31
  71. package/test/README.md +0 -14
@@ -1,1136 +0,0 @@
1
- # Transfers
2
- (*transfers*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [generateOptions](#generateoptions) - Generate available payment method options for one or multiple transfer participants depending on the accountID or paymentMethodID you
9
- supply in the request body.
10
-
11
- The accountID in the route should the partner's accountID.
12
-
13
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
14
-
15
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
16
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
17
- * [create](#create) - Move money by providing the source, destination, and amount in the request body.
18
-
19
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
20
-
21
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
22
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
23
- * [list](#list) - List all the transfers associated with a particular Moov account.
24
-
25
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
26
-
27
- When you run this request, you retrieve 200 transfers at a time. You can advance past a results set of 200 transfers by using the `skip` parameter (for example,
28
- if you set `skip`= 10, you will see a results set of 200 transfers after the first 10). If you are searching a high volume of transfers, the request will likely
29
- process very slowly. To achieve faster performance, restrict the data as much as you can by using the `StartDateTime` and `EndDateTime` parameters for a limited
30
- period of time. You can run multiple requests in smaller time window increments until you've retrieved all the transfers you need.
31
-
32
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
33
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
34
- * [get](#get) - Retrieve full transfer details for an individual transfer of a particular Moov account.
35
-
36
- Payment rail-specific details are included in the source and destination. Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/)
37
- to learn more.
38
-
39
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
40
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
41
- * [update](#update) - Update the metadata contained on a transfer.
42
-
43
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
44
-
45
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
46
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
47
- * [createCancellation](#createcancellation) - Initiate a cancellation for a card, ACH, or queued transfer.
48
-
49
- To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
50
- to specify the `/accounts/{accountID}/transfers.write` scope.
51
- * [getCancellation](#getcancellation) - Get details of a cancellation for a transfer.
52
-
53
- To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
54
- to specify the `/accounts/{accountID}/transfers.read` scope.
55
- * [initiateRefund](#initiaterefund) - Initiate a refund for a card transfer.
56
-
57
- **Use the [Cancel or refund a card transfer](https://docs.moov.io/api/money-movement/refunds/cancel/) endpoint for more comprehensive cancel and refund options.**
58
- See the [reversals](https://docs.moov.io/guides/money-movement/accept-payments/card-acceptance/reversals/) guide for more information.
59
-
60
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
61
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
62
- * [listRefunds](#listrefunds) - Get a list of refunds for a card transfer.
63
-
64
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
65
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
66
- * [getRefund](#getrefund) - Get details of a refund for a card transfer.
67
-
68
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
69
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
70
- * [createReversal](#createreversal) - Reverses a card transfer by initiating a cancellation or refund depending on the transaction status.
71
- Read our [reversals guide](https://docs.moov.io/guides/money-movement/accept-payments/card-acceptance/reversals/)
72
- to learn more.
73
-
74
- To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
75
- to specify the `/accounts/{accountID}/transfers.write` scope.
76
-
77
- ## generateOptions
78
-
79
- Generate available payment method options for one or multiple transfer participants depending on the accountID or paymentMethodID you
80
- supply in the request body.
81
-
82
- The accountID in the route should the partner's accountID.
83
-
84
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
85
-
86
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
87
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
88
-
89
- ### Example Usage
90
-
91
- <!-- UsageSnippet language="typescript" operationID="createTransferOptions" method="post" path="/accounts/{accountID}/transfer-options" -->
92
- ```typescript
93
- import { Moov } from "@moovio/sdk";
94
-
95
- const moov = new Moov({
96
- xMoovVersion: "v2024.01.00",
97
- security: {
98
- username: "",
99
- password: "",
100
- },
101
- });
102
-
103
- async function run() {
104
- const result = await moov.transfers.generateOptions({
105
- accountID: "deafe3cf-31d4-4dcc-8176-3d6bf8bb4f04",
106
- createTransferOptions: {
107
- source: {},
108
- destination: {},
109
- amount: {
110
- currency: "USD",
111
- value: 1204,
112
- },
113
- },
114
- });
115
-
116
- console.log(result);
117
- }
118
-
119
- run();
120
- ```
121
-
122
- ### Standalone function
123
-
124
- The standalone function version of this method:
125
-
126
- ```typescript
127
- import { MoovCore } from "@moovio/sdk/core.js";
128
- import { transfersGenerateOptions } from "@moovio/sdk/funcs/transfersGenerateOptions.js";
129
-
130
- // Use `MoovCore` for best tree-shaking performance.
131
- // You can create one instance of it to use across an application.
132
- const moov = new MoovCore({
133
- xMoovVersion: "v2024.01.00",
134
- security: {
135
- username: "",
136
- password: "",
137
- },
138
- });
139
-
140
- async function run() {
141
- const res = await transfersGenerateOptions(moov, {
142
- accountID: "deafe3cf-31d4-4dcc-8176-3d6bf8bb4f04",
143
- createTransferOptions: {
144
- source: {},
145
- destination: {},
146
- amount: {
147
- currency: "USD",
148
- value: 1204,
149
- },
150
- },
151
- });
152
- if (res.ok) {
153
- const { value: result } = res;
154
- console.log(result);
155
- } else {
156
- console.log("transfersGenerateOptions failed:", res.error);
157
- }
158
- }
159
-
160
- run();
161
- ```
162
-
163
- ### Parameters
164
-
165
- | Parameter | Type | Required | Description |
166
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
167
- | `request` | [operations.CreateTransferOptionsRequest](../../models/operations/createtransferoptionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
168
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
169
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
170
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
171
-
172
- ### Response
173
-
174
- **Promise\<[operations.CreateTransferOptionsResponse](../../models/operations/createtransferoptionsresponse.md)\>**
175
-
176
- ### Errors
177
-
178
- | Error Type | Status Code | Content Type |
179
- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
180
- | errors.GenericError | 400 | application/json |
181
- | errors.TransferOptionsValidationError | 422 | application/json |
182
- | errors.APIError | 4XX, 5XX | \*/\* |
183
-
184
- ## create
185
-
186
- Move money by providing the source, destination, and amount in the request body.
187
-
188
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
189
-
190
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
191
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
192
-
193
- ### Example Usage
194
-
195
- <!-- UsageSnippet language="typescript" operationID="createTransfer" method="post" path="/accounts/{accountID}/transfers" -->
196
- ```typescript
197
- import { Moov } from "@moovio/sdk";
198
-
199
- const moov = new Moov({
200
- xMoovVersion: "v2024.01.00",
201
- security: {
202
- username: "",
203
- password: "",
204
- },
205
- });
206
-
207
- async function run() {
208
- const result = await moov.transfers.create({
209
- xIdempotencyKey: "d6903402-776f-48d6-8fba-0358959d34e5",
210
- accountID: "ea9f2225-403b-4e2c-93b0-0eda090ffa65",
211
- createTransfer: {
212
- source: {
213
- paymentMethodID: "9506dbf6-4208-44c3-ad8a-e4431660e1f2",
214
- },
215
- destination: {
216
- paymentMethodID: "3f9969cf-a1f3-4d83-8ddc-229a506651cf",
217
- },
218
- amount: {
219
- currency: "USD",
220
- value: 32945,
221
- },
222
- description: "Transfer from card to wallet",
223
- metadata: {
224
- "optional": "metadata",
225
- },
226
- },
227
- });
228
-
229
- console.log(result);
230
- }
231
-
232
- run();
233
- ```
234
-
235
- ### Standalone function
236
-
237
- The standalone function version of this method:
238
-
239
- ```typescript
240
- import { MoovCore } from "@moovio/sdk/core.js";
241
- import { transfersCreate } from "@moovio/sdk/funcs/transfersCreate.js";
242
-
243
- // Use `MoovCore` for best tree-shaking performance.
244
- // You can create one instance of it to use across an application.
245
- const moov = new MoovCore({
246
- xMoovVersion: "v2024.01.00",
247
- security: {
248
- username: "",
249
- password: "",
250
- },
251
- });
252
-
253
- async function run() {
254
- const res = await transfersCreate(moov, {
255
- xIdempotencyKey: "d6903402-776f-48d6-8fba-0358959d34e5",
256
- accountID: "ea9f2225-403b-4e2c-93b0-0eda090ffa65",
257
- createTransfer: {
258
- source: {
259
- paymentMethodID: "9506dbf6-4208-44c3-ad8a-e4431660e1f2",
260
- },
261
- destination: {
262
- paymentMethodID: "3f9969cf-a1f3-4d83-8ddc-229a506651cf",
263
- },
264
- amount: {
265
- currency: "USD",
266
- value: 32945,
267
- },
268
- description: "Transfer from card to wallet",
269
- metadata: {
270
- "optional": "metadata",
271
- },
272
- },
273
- });
274
- if (res.ok) {
275
- const { value: result } = res;
276
- console.log(result);
277
- } else {
278
- console.log("transfersCreate failed:", res.error);
279
- }
280
- }
281
-
282
- run();
283
- ```
284
-
285
- ### Parameters
286
-
287
- | Parameter | Type | Required | Description |
288
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
289
- | `request` | [operations.CreateTransferRequest](../../models/operations/createtransferrequest.md) | :heavy_check_mark: | The request object to use for the request. |
290
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
291
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
292
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
293
-
294
- ### Response
295
-
296
- **Promise\<[operations.CreateTransferResponse](../../models/operations/createtransferresponse.md)\>**
297
-
298
- ### Errors
299
-
300
- | Error Type | Status Code | Content Type |
301
- | ------------------------------ | ------------------------------ | ------------------------------ |
302
- | errors.GenericError | 400 | application/json |
303
- | errors.Transfer | 409 | application/json |
304
- | errors.TransferValidationError | 422 | application/json |
305
- | errors.APIError | 4XX, 5XX | \*/\* |
306
-
307
- ## list
308
-
309
- List all the transfers associated with a particular Moov account.
310
-
311
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
312
-
313
- When you run this request, you retrieve 200 transfers at a time. You can advance past a results set of 200 transfers by using the `skip` parameter (for example,
314
- if you set `skip`= 10, you will see a results set of 200 transfers after the first 10). If you are searching a high volume of transfers, the request will likely
315
- process very slowly. To achieve faster performance, restrict the data as much as you can by using the `StartDateTime` and `EndDateTime` parameters for a limited
316
- period of time. You can run multiple requests in smaller time window increments until you've retrieved all the transfers you need.
317
-
318
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
319
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
320
-
321
- ### Example Usage
322
-
323
- <!-- UsageSnippet language="typescript" operationID="listTransfers" method="get" path="/accounts/{accountID}/transfers" -->
324
- ```typescript
325
- import { Moov } from "@moovio/sdk";
326
-
327
- const moov = new Moov({
328
- xMoovVersion: "v2024.01.00",
329
- security: {
330
- username: "",
331
- password: "",
332
- },
333
- });
334
-
335
- async function run() {
336
- const result = await moov.transfers.list({
337
- skip: 60,
338
- count: 20,
339
- accountID: "0579c895-4d2b-4024-8092-f71b80ab5d00",
340
- });
341
-
342
- console.log(result);
343
- }
344
-
345
- run();
346
- ```
347
-
348
- ### Standalone function
349
-
350
- The standalone function version of this method:
351
-
352
- ```typescript
353
- import { MoovCore } from "@moovio/sdk/core.js";
354
- import { transfersList } from "@moovio/sdk/funcs/transfersList.js";
355
-
356
- // Use `MoovCore` for best tree-shaking performance.
357
- // You can create one instance of it to use across an application.
358
- const moov = new MoovCore({
359
- xMoovVersion: "v2024.01.00",
360
- security: {
361
- username: "",
362
- password: "",
363
- },
364
- });
365
-
366
- async function run() {
367
- const res = await transfersList(moov, {
368
- skip: 60,
369
- count: 20,
370
- accountID: "0579c895-4d2b-4024-8092-f71b80ab5d00",
371
- });
372
- if (res.ok) {
373
- const { value: result } = res;
374
- console.log(result);
375
- } else {
376
- console.log("transfersList failed:", res.error);
377
- }
378
- }
379
-
380
- run();
381
- ```
382
-
383
- ### Parameters
384
-
385
- | Parameter | Type | Required | Description |
386
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
387
- | `request` | [operations.ListTransfersRequest](../../models/operations/listtransfersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
388
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
389
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
390
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
391
-
392
- ### Response
393
-
394
- **Promise\<[operations.ListTransfersResponse](../../models/operations/listtransfersresponse.md)\>**
395
-
396
- ### Errors
397
-
398
- | Error Type | Status Code | Content Type |
399
- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
400
- | errors.ListTransfersValidationError | 422 | application/json |
401
- | errors.APIError | 4XX, 5XX | \*/\* |
402
-
403
- ## get
404
-
405
- Retrieve full transfer details for an individual transfer of a particular Moov account.
406
-
407
- Payment rail-specific details are included in the source and destination. Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/)
408
- to learn more.
409
-
410
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
411
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
412
-
413
- ### Example Usage
414
-
415
- <!-- UsageSnippet language="typescript" operationID="getTransfer" method="get" path="/accounts/{accountID}/transfers/{transferID}" -->
416
- ```typescript
417
- import { Moov } from "@moovio/sdk";
418
-
419
- const moov = new Moov({
420
- xMoovVersion: "v2024.01.00",
421
- security: {
422
- username: "",
423
- password: "",
424
- },
425
- });
426
-
427
- async function run() {
428
- const result = await moov.transfers.get({
429
- transferID: "960cf5a2-50a3-4914-ad86-d54c022bf5df",
430
- accountID: "31113f7b-9f68-44e9-9338-6d8e655c7c96",
431
- });
432
-
433
- console.log(result);
434
- }
435
-
436
- run();
437
- ```
438
-
439
- ### Standalone function
440
-
441
- The standalone function version of this method:
442
-
443
- ```typescript
444
- import { MoovCore } from "@moovio/sdk/core.js";
445
- import { transfersGet } from "@moovio/sdk/funcs/transfersGet.js";
446
-
447
- // Use `MoovCore` for best tree-shaking performance.
448
- // You can create one instance of it to use across an application.
449
- const moov = new MoovCore({
450
- xMoovVersion: "v2024.01.00",
451
- security: {
452
- username: "",
453
- password: "",
454
- },
455
- });
456
-
457
- async function run() {
458
- const res = await transfersGet(moov, {
459
- transferID: "960cf5a2-50a3-4914-ad86-d54c022bf5df",
460
- accountID: "31113f7b-9f68-44e9-9338-6d8e655c7c96",
461
- });
462
- if (res.ok) {
463
- const { value: result } = res;
464
- console.log(result);
465
- } else {
466
- console.log("transfersGet failed:", res.error);
467
- }
468
- }
469
-
470
- run();
471
- ```
472
-
473
- ### Parameters
474
-
475
- | Parameter | Type | Required | Description |
476
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
477
- | `request` | [operations.GetTransferRequest](../../models/operations/gettransferrequest.md) | :heavy_check_mark: | The request object to use for the request. |
478
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
479
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
480
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
481
-
482
- ### Response
483
-
484
- **Promise\<[operations.GetTransferResponse](../../models/operations/gettransferresponse.md)\>**
485
-
486
- ### Errors
487
-
488
- | Error Type | Status Code | Content Type |
489
- | --------------- | --------------- | --------------- |
490
- | errors.APIError | 4XX, 5XX | \*/\* |
491
-
492
- ## update
493
-
494
- Update the metadata contained on a transfer.
495
-
496
- Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
497
-
498
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
499
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
500
-
501
- ### Example Usage
502
-
503
- <!-- UsageSnippet language="typescript" operationID="updateTransfer" method="patch" path="/accounts/{accountID}/transfers/{transferID}" -->
504
- ```typescript
505
- import { Moov } from "@moovio/sdk";
506
-
507
- const moov = new Moov({
508
- xMoovVersion: "v2024.01.00",
509
- security: {
510
- username: "",
511
- password: "",
512
- },
513
- });
514
-
515
- async function run() {
516
- const result = await moov.transfers.update({
517
- transferID: "de30c075-4245-4d62-bfb3-f76d4d7d3b9c",
518
- accountID: "18a7907d-2f89-493a-b15a-3aad91c24496",
519
- patchTransfer: {
520
- metadata: {
521
- "optional": "metadata",
522
- },
523
- },
524
- });
525
-
526
- console.log(result);
527
- }
528
-
529
- run();
530
- ```
531
-
532
- ### Standalone function
533
-
534
- The standalone function version of this method:
535
-
536
- ```typescript
537
- import { MoovCore } from "@moovio/sdk/core.js";
538
- import { transfersUpdate } from "@moovio/sdk/funcs/transfersUpdate.js";
539
-
540
- // Use `MoovCore` for best tree-shaking performance.
541
- // You can create one instance of it to use across an application.
542
- const moov = new MoovCore({
543
- xMoovVersion: "v2024.01.00",
544
- security: {
545
- username: "",
546
- password: "",
547
- },
548
- });
549
-
550
- async function run() {
551
- const res = await transfersUpdate(moov, {
552
- transferID: "de30c075-4245-4d62-bfb3-f76d4d7d3b9c",
553
- accountID: "18a7907d-2f89-493a-b15a-3aad91c24496",
554
- patchTransfer: {
555
- metadata: {
556
- "optional": "metadata",
557
- },
558
- },
559
- });
560
- if (res.ok) {
561
- const { value: result } = res;
562
- console.log(result);
563
- } else {
564
- console.log("transfersUpdate failed:", res.error);
565
- }
566
- }
567
-
568
- run();
569
- ```
570
-
571
- ### Parameters
572
-
573
- | Parameter | Type | Required | Description |
574
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
575
- | `request` | [operations.UpdateTransferRequest](../../models/operations/updatetransferrequest.md) | :heavy_check_mark: | The request object to use for the request. |
576
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
577
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
578
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
579
-
580
- ### Response
581
-
582
- **Promise\<[operations.UpdateTransferResponse](../../models/operations/updatetransferresponse.md)\>**
583
-
584
- ### Errors
585
-
586
- | Error Type | Status Code | Content Type |
587
- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
588
- | errors.PatchTransferValidationError | 422 | application/json |
589
- | errors.APIError | 4XX, 5XX | \*/\* |
590
-
591
- ## createCancellation
592
-
593
- Initiate a cancellation for a card, ACH, or queued transfer.
594
-
595
- To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
596
- to specify the `/accounts/{accountID}/transfers.write` scope.
597
-
598
- ### Example Usage
599
-
600
- <!-- UsageSnippet language="typescript" operationID="createCancellation" method="post" path="/accounts/{accountID}/transfers/{transferID}/cancellations" -->
601
- ```typescript
602
- import { Moov } from "@moovio/sdk";
603
-
604
- const moov = new Moov({
605
- xMoovVersion: "v2024.01.00",
606
- security: {
607
- username: "",
608
- password: "",
609
- },
610
- });
611
-
612
- async function run() {
613
- const result = await moov.transfers.createCancellation({
614
- accountID: "10ae862c-6658-4f87-967d-46e995737204",
615
- transferID: "36c80a6c-ceb2-4e5d-a437-8a39afdfdc58",
616
- });
617
-
618
- console.log(result);
619
- }
620
-
621
- run();
622
- ```
623
-
624
- ### Standalone function
625
-
626
- The standalone function version of this method:
627
-
628
- ```typescript
629
- import { MoovCore } from "@moovio/sdk/core.js";
630
- import { transfersCreateCancellation } from "@moovio/sdk/funcs/transfersCreateCancellation.js";
631
-
632
- // Use `MoovCore` for best tree-shaking performance.
633
- // You can create one instance of it to use across an application.
634
- const moov = new MoovCore({
635
- xMoovVersion: "v2024.01.00",
636
- security: {
637
- username: "",
638
- password: "",
639
- },
640
- });
641
-
642
- async function run() {
643
- const res = await transfersCreateCancellation(moov, {
644
- accountID: "10ae862c-6658-4f87-967d-46e995737204",
645
- transferID: "36c80a6c-ceb2-4e5d-a437-8a39afdfdc58",
646
- });
647
- if (res.ok) {
648
- const { value: result } = res;
649
- console.log(result);
650
- } else {
651
- console.log("transfersCreateCancellation failed:", res.error);
652
- }
653
- }
654
-
655
- run();
656
- ```
657
-
658
- ### Parameters
659
-
660
- | Parameter | Type | Required | Description |
661
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
662
- | `request` | [operations.CreateCancellationRequest](../../models/operations/createcancellationrequest.md) | :heavy_check_mark: | The request object to use for the request. |
663
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
664
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
665
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
666
-
667
- ### Response
668
-
669
- **Promise\<[operations.CreateCancellationResponse](../../models/operations/createcancellationresponse.md)\>**
670
-
671
- ### Errors
672
-
673
- | Error Type | Status Code | Content Type |
674
- | ------------------- | ------------------- | ------------------- |
675
- | errors.GenericError | 400 | application/json |
676
- | errors.APIError | 4XX, 5XX | \*/\* |
677
-
678
- ## getCancellation
679
-
680
- Get details of a cancellation for a transfer.
681
-
682
- To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
683
- to specify the `/accounts/{accountID}/transfers.read` scope.
684
-
685
- ### Example Usage
686
-
687
- <!-- UsageSnippet language="typescript" operationID="getCancellation" method="get" path="/accounts/{accountID}/transfers/{transferID}/cancellations/{cancellationID}" -->
688
- ```typescript
689
- import { Moov } from "@moovio/sdk";
690
-
691
- const moov = new Moov({
692
- xMoovVersion: "v2024.01.00",
693
- security: {
694
- username: "",
695
- password: "",
696
- },
697
- });
698
-
699
- async function run() {
700
- const result = await moov.transfers.getCancellation({
701
- accountID: "55cb62c2-22e4-4a36-bd53-3b9adc77ee81",
702
- transferID: "bc13b680-bac3-432e-bf44-e9aa6426cbb2",
703
- cancellationID: "770cb4b5-d5b0-4e8b-995b-86b790296ba5",
704
- });
705
-
706
- console.log(result);
707
- }
708
-
709
- run();
710
- ```
711
-
712
- ### Standalone function
713
-
714
- The standalone function version of this method:
715
-
716
- ```typescript
717
- import { MoovCore } from "@moovio/sdk/core.js";
718
- import { transfersGetCancellation } from "@moovio/sdk/funcs/transfersGetCancellation.js";
719
-
720
- // Use `MoovCore` for best tree-shaking performance.
721
- // You can create one instance of it to use across an application.
722
- const moov = new MoovCore({
723
- xMoovVersion: "v2024.01.00",
724
- security: {
725
- username: "",
726
- password: "",
727
- },
728
- });
729
-
730
- async function run() {
731
- const res = await transfersGetCancellation(moov, {
732
- accountID: "55cb62c2-22e4-4a36-bd53-3b9adc77ee81",
733
- transferID: "bc13b680-bac3-432e-bf44-e9aa6426cbb2",
734
- cancellationID: "770cb4b5-d5b0-4e8b-995b-86b790296ba5",
735
- });
736
- if (res.ok) {
737
- const { value: result } = res;
738
- console.log(result);
739
- } else {
740
- console.log("transfersGetCancellation failed:", res.error);
741
- }
742
- }
743
-
744
- run();
745
- ```
746
-
747
- ### Parameters
748
-
749
- | Parameter | Type | Required | Description |
750
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
751
- | `request` | [operations.GetCancellationRequest](../../models/operations/getcancellationrequest.md) | :heavy_check_mark: | The request object to use for the request. |
752
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
753
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
754
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
755
-
756
- ### Response
757
-
758
- **Promise\<[operations.GetCancellationResponse](../../models/operations/getcancellationresponse.md)\>**
759
-
760
- ### Errors
761
-
762
- | Error Type | Status Code | Content Type |
763
- | --------------- | --------------- | --------------- |
764
- | errors.APIError | 4XX, 5XX | \*/\* |
765
-
766
- ## initiateRefund
767
-
768
- Initiate a refund for a card transfer.
769
-
770
- **Use the [Cancel or refund a card transfer](https://docs.moov.io/api/money-movement/refunds/cancel/) endpoint for more comprehensive cancel and refund options.**
771
- See the [reversals](https://docs.moov.io/guides/money-movement/accept-payments/card-acceptance/reversals/) guide for more information.
772
-
773
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
774
- you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
775
-
776
- ### Example Usage
777
-
778
- <!-- UsageSnippet language="typescript" operationID="initiateRefund" method="post" path="/accounts/{accountID}/transfers/{transferID}/refunds" -->
779
- ```typescript
780
- import { Moov } from "@moovio/sdk";
781
-
782
- const moov = new Moov({
783
- xMoovVersion: "v2024.01.00",
784
- security: {
785
- username: "",
786
- password: "",
787
- },
788
- });
789
-
790
- async function run() {
791
- const result = await moov.transfers.initiateRefund({
792
- xIdempotencyKey: "8d9af6b8-67e1-4efa-8188-68039f34097d",
793
- accountID: "cb6ae9f9-afab-4f06-9eb0-8abf54a3ada2",
794
- transferID: "04022119-95be-4ef4-9dd4-b3782f6aa7b9",
795
- createRefund: {
796
- amount: 1000,
797
- },
798
- });
799
-
800
- console.log(result);
801
- }
802
-
803
- run();
804
- ```
805
-
806
- ### Standalone function
807
-
808
- The standalone function version of this method:
809
-
810
- ```typescript
811
- import { MoovCore } from "@moovio/sdk/core.js";
812
- import { transfersInitiateRefund } from "@moovio/sdk/funcs/transfersInitiateRefund.js";
813
-
814
- // Use `MoovCore` for best tree-shaking performance.
815
- // You can create one instance of it to use across an application.
816
- const moov = new MoovCore({
817
- xMoovVersion: "v2024.01.00",
818
- security: {
819
- username: "",
820
- password: "",
821
- },
822
- });
823
-
824
- async function run() {
825
- const res = await transfersInitiateRefund(moov, {
826
- xIdempotencyKey: "8d9af6b8-67e1-4efa-8188-68039f34097d",
827
- accountID: "cb6ae9f9-afab-4f06-9eb0-8abf54a3ada2",
828
- transferID: "04022119-95be-4ef4-9dd4-b3782f6aa7b9",
829
- createRefund: {
830
- amount: 1000,
831
- },
832
- });
833
- if (res.ok) {
834
- const { value: result } = res;
835
- console.log(result);
836
- } else {
837
- console.log("transfersInitiateRefund failed:", res.error);
838
- }
839
- }
840
-
841
- run();
842
- ```
843
-
844
- ### Parameters
845
-
846
- | Parameter | Type | Required | Description |
847
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
848
- | `request` | [operations.InitiateRefundRequest](../../models/operations/initiaterefundrequest.md) | :heavy_check_mark: | The request object to use for the request. |
849
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
850
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
851
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
852
-
853
- ### Response
854
-
855
- **Promise\<[operations.InitiateRefundResponse](../../models/operations/initiaterefundresponse.md)\>**
856
-
857
- ### Errors
858
-
859
- | Error Type | Status Code | Content Type |
860
- | ---------------------------- | ---------------------------- | ---------------------------- |
861
- | errors.GenericError | 400 | application/json |
862
- | errors.CardAcquiringRefund | 409 | application/json |
863
- | errors.RefundValidationError | 422 | application/json |
864
- | errors.APIError | 4XX, 5XX | \*/\* |
865
-
866
- ## listRefunds
867
-
868
- Get a list of refunds for a card transfer.
869
-
870
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
871
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
872
-
873
- ### Example Usage
874
-
875
- <!-- UsageSnippet language="typescript" operationID="listRefunds" method="get" path="/accounts/{accountID}/transfers/{transferID}/refunds" -->
876
- ```typescript
877
- import { Moov } from "@moovio/sdk";
878
-
879
- const moov = new Moov({
880
- xMoovVersion: "v2024.01.00",
881
- security: {
882
- username: "",
883
- password: "",
884
- },
885
- });
886
-
887
- async function run() {
888
- const result = await moov.transfers.listRefunds({
889
- accountID: "03f5baaa-f5d8-44bd-90db-868745fe66e8",
890
- transferID: "6b1aa1a1-bff1-43b9-9126-2806fdc9c732",
891
- });
892
-
893
- console.log(result);
894
- }
895
-
896
- run();
897
- ```
898
-
899
- ### Standalone function
900
-
901
- The standalone function version of this method:
902
-
903
- ```typescript
904
- import { MoovCore } from "@moovio/sdk/core.js";
905
- import { transfersListRefunds } from "@moovio/sdk/funcs/transfersListRefunds.js";
906
-
907
- // Use `MoovCore` for best tree-shaking performance.
908
- // You can create one instance of it to use across an application.
909
- const moov = new MoovCore({
910
- xMoovVersion: "v2024.01.00",
911
- security: {
912
- username: "",
913
- password: "",
914
- },
915
- });
916
-
917
- async function run() {
918
- const res = await transfersListRefunds(moov, {
919
- accountID: "03f5baaa-f5d8-44bd-90db-868745fe66e8",
920
- transferID: "6b1aa1a1-bff1-43b9-9126-2806fdc9c732",
921
- });
922
- if (res.ok) {
923
- const { value: result } = res;
924
- console.log(result);
925
- } else {
926
- console.log("transfersListRefunds failed:", res.error);
927
- }
928
- }
929
-
930
- run();
931
- ```
932
-
933
- ### Parameters
934
-
935
- | Parameter | Type | Required | Description |
936
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
937
- | `request` | [operations.ListRefundsRequest](../../models/operations/listrefundsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
938
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
939
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
940
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
941
-
942
- ### Response
943
-
944
- **Promise\<[operations.ListRefundsResponse](../../models/operations/listrefundsresponse.md)\>**
945
-
946
- ### Errors
947
-
948
- | Error Type | Status Code | Content Type |
949
- | --------------- | --------------- | --------------- |
950
- | errors.APIError | 4XX, 5XX | \*/\* |
951
-
952
- ## getRefund
953
-
954
- Get details of a refund for a card transfer.
955
-
956
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
957
- you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
958
-
959
- ### Example Usage
960
-
961
- <!-- UsageSnippet language="typescript" operationID="getRefund" method="get" path="/accounts/{accountID}/transfers/{transferID}/refunds/{refundID}" -->
962
- ```typescript
963
- import { Moov } from "@moovio/sdk";
964
-
965
- const moov = new Moov({
966
- xMoovVersion: "v2024.01.00",
967
- security: {
968
- username: "",
969
- password: "",
970
- },
971
- });
972
-
973
- async function run() {
974
- const result = await moov.transfers.getRefund({
975
- transferID: "e90d3386-c5b2-4e2b-b841-efc590eba6c0",
976
- accountID: "bbb69538-edaa-4a0b-b107-f46f2da89864",
977
- refundID: "8e12687e-a4e8-46c9-9e11-a57bbd781e44",
978
- });
979
-
980
- console.log(result);
981
- }
982
-
983
- run();
984
- ```
985
-
986
- ### Standalone function
987
-
988
- The standalone function version of this method:
989
-
990
- ```typescript
991
- import { MoovCore } from "@moovio/sdk/core.js";
992
- import { transfersGetRefund } from "@moovio/sdk/funcs/transfersGetRefund.js";
993
-
994
- // Use `MoovCore` for best tree-shaking performance.
995
- // You can create one instance of it to use across an application.
996
- const moov = new MoovCore({
997
- xMoovVersion: "v2024.01.00",
998
- security: {
999
- username: "",
1000
- password: "",
1001
- },
1002
- });
1003
-
1004
- async function run() {
1005
- const res = await transfersGetRefund(moov, {
1006
- transferID: "e90d3386-c5b2-4e2b-b841-efc590eba6c0",
1007
- accountID: "bbb69538-edaa-4a0b-b107-f46f2da89864",
1008
- refundID: "8e12687e-a4e8-46c9-9e11-a57bbd781e44",
1009
- });
1010
- if (res.ok) {
1011
- const { value: result } = res;
1012
- console.log(result);
1013
- } else {
1014
- console.log("transfersGetRefund failed:", res.error);
1015
- }
1016
- }
1017
-
1018
- run();
1019
- ```
1020
-
1021
- ### Parameters
1022
-
1023
- | Parameter | Type | Required | Description |
1024
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1025
- | `request` | [operations.GetRefundRequest](../../models/operations/getrefundrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1026
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1027
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1028
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1029
-
1030
- ### Response
1031
-
1032
- **Promise\<[operations.GetRefundResponse](../../models/operations/getrefundresponse.md)\>**
1033
-
1034
- ### Errors
1035
-
1036
- | Error Type | Status Code | Content Type |
1037
- | --------------- | --------------- | --------------- |
1038
- | errors.APIError | 4XX, 5XX | \*/\* |
1039
-
1040
- ## createReversal
1041
-
1042
- Reverses a card transfer by initiating a cancellation or refund depending on the transaction status.
1043
- Read our [reversals guide](https://docs.moov.io/guides/money-movement/accept-payments/card-acceptance/reversals/)
1044
- to learn more.
1045
-
1046
- To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
1047
- to specify the `/accounts/{accountID}/transfers.write` scope.
1048
-
1049
- ### Example Usage
1050
-
1051
- <!-- UsageSnippet language="typescript" operationID="createReversal" method="post" path="/accounts/{accountID}/transfers/{transferID}/reversals" -->
1052
- ```typescript
1053
- import { Moov } from "@moovio/sdk";
1054
-
1055
- const moov = new Moov({
1056
- xMoovVersion: "v2024.01.00",
1057
- security: {
1058
- username: "",
1059
- password: "",
1060
- },
1061
- });
1062
-
1063
- async function run() {
1064
- const result = await moov.transfers.createReversal({
1065
- xIdempotencyKey: "b91d00b2-4ecb-4eb4-a67f-d6f76c0b7ad8",
1066
- accountID: "f225b49d-911b-440b-baed-6065968b69cb",
1067
- transferID: "a17b29e2-4af6-4c9d-ad3a-dd0ded2966ad",
1068
- createReversal: {
1069
- amount: 1000,
1070
- },
1071
- });
1072
-
1073
- console.log(result);
1074
- }
1075
-
1076
- run();
1077
- ```
1078
-
1079
- ### Standalone function
1080
-
1081
- The standalone function version of this method:
1082
-
1083
- ```typescript
1084
- import { MoovCore } from "@moovio/sdk/core.js";
1085
- import { transfersCreateReversal } from "@moovio/sdk/funcs/transfersCreateReversal.js";
1086
-
1087
- // Use `MoovCore` for best tree-shaking performance.
1088
- // You can create one instance of it to use across an application.
1089
- const moov = new MoovCore({
1090
- xMoovVersion: "v2024.01.00",
1091
- security: {
1092
- username: "",
1093
- password: "",
1094
- },
1095
- });
1096
-
1097
- async function run() {
1098
- const res = await transfersCreateReversal(moov, {
1099
- xIdempotencyKey: "b91d00b2-4ecb-4eb4-a67f-d6f76c0b7ad8",
1100
- accountID: "f225b49d-911b-440b-baed-6065968b69cb",
1101
- transferID: "a17b29e2-4af6-4c9d-ad3a-dd0ded2966ad",
1102
- createReversal: {
1103
- amount: 1000,
1104
- },
1105
- });
1106
- if (res.ok) {
1107
- const { value: result } = res;
1108
- console.log(result);
1109
- } else {
1110
- console.log("transfersCreateReversal failed:", res.error);
1111
- }
1112
- }
1113
-
1114
- run();
1115
- ```
1116
-
1117
- ### Parameters
1118
-
1119
- | Parameter | Type | Required | Description |
1120
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1121
- | `request` | [operations.CreateReversalRequest](../../models/operations/createreversalrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1122
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1123
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1124
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1125
-
1126
- ### Response
1127
-
1128
- **Promise\<[operations.CreateReversalResponse](../../models/operations/createreversalresponse.md)\>**
1129
-
1130
- ### Errors
1131
-
1132
- | Error Type | Status Code | Content Type |
1133
- | ------------------------------ | ------------------------------ | ------------------------------ |
1134
- | errors.GenericError | 400, 409 | application/json |
1135
- | errors.ReversalValidationError | 422 | application/json |
1136
- | errors.APIError | 4XX, 5XX | \*/\* |