# Cancel or refund a card transfer

`POST /accounts/{accountID}/transfers/{transferID}/reversals`

API version: `v2026.07.00`. Send `X-Moov-Version: v2026.07.00` to get the behavior described here.

> AI agents: search and read all Moov docs with the docs MCP server at https://docs.moov.io/mcp (no API key). Setup: https://docs.moov.io/guides/developer-tools/mcp-ai/docs-mcp/index.md

Reverses a card transfer by initiating a cancellation or refund depending on the transaction status.
In v2026.10 and later, reversing an auth-capture `card-payment` transfer with no captures cancels the entire `capturableAmount`.
In those API versions, an auth-capture `card-payment` transfer with one final capture is canceled or refunded depending on its processing state.
Auth-capture `card-payment` transfers with a non-final capture or multiple captures are not supported in those API versions.
Read our [reversals guide](https://docs.moov.io/guides/money-movement/accept-payments/card-acceptance/reversals/) 
to learn more.

To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need 
to specify the `/accounts/{accountID}/transfers.write` scope.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Moov-Version` | header | string |  | Set this header to v2026.07.00 to use the API described in this specification. When omitted, the server defaults to v2024.01.00, the earliest supported version, which may not match the behavior documented here. An unrecognized well-formed version uses the latest supported version that is not newer than the requested version, when one exists. For example, `v2026.08.00` uses `v2026.07.00`. A malformed value, such as `2022`, returns a `404` response. Values: `v2026.07.00`. |
| `x-idempotency-key` | header | string | Yes | Prevents duplicate reversals from being created. |
| `accountID` | path | string | Yes | The Moov account ID. |
| `transferID` | path | string | Yes | The transfer ID to reverse. |

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `amount` | integer (int64) | Yes | Amount to reverse. Before v2026.10, specify the amount in integer cents. For supported auth-capture `card-payment` reversals in v2026.10 and later, a transfer with no captures uses the full `capturableAmount`. For those transfers with one final capture, a cancellation uses the full capture amount, while a refund may be partial. |
| `amountDetails` | object |  | Breakdown of the reversed amount. |
| `amountDetails.surcharge` | object |  | The amount of surcharge to refund. It should be proportional to the surcharge on the original transfer. This field applies only when the reversal results in a refund. |
| `amountDetails.surcharge.currency` | string | Yes | A 3-letter ISO 4217 currency code. |
| `amountDetails.surcharge.valueDecimal` | string | Yes | A decimal-formatted numerical string that represents up to 9 decimal place precision. For example, $12.987654321 is '12.987654321'. |

## Response 200

Successfully initiated a reversal.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `cancellation` | object |  | Send exactly one of `cancellation`, `refund`. Cancellation of a transfer. |
| `cancellation.cancellationID` | string | Yes |  |
| `cancellation.status` | string | Yes | Values: `pending`, `completed`, `failed`. |
| `cancellation.createdOn` | string (date-time) | Yes |  |
| `refund` | object |  | Send exactly one of `cancellation`, `refund`. Details of a card refund. |
| `refund.refundID` | string | Yes | Identifier for the refund. |
| `refund.createdOn` | string (date-time) | Yes |  |
| `refund.updatedOn` | string (date-time) | Yes |  |
| `refund.status` | string | Yes | Values: `created`, `pending`, `completed`, `failed`. |
| `refund.amount` | object | Yes |  |
| `refund.amountDetails` | object |  |  |
| `refund.cardDetails` | object |  |  |

## Response 202

Successfully initiated a reversal but an error occurred while waiting for a synchronous response.

Same fields as the 200 response.

## Errors

| Status | Meaning |
| --- | --- |
| 400 | The server could not understand the request due to invalid syntax. |
| 401 | The request contained missing or expired authentication. |
| 403 | The user is not authorized to make the request. |
| 404 | The requested resource was not found. |
| 409 | The request conflicted with the current state of the target resource. |
| 422 | The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields. |
| 429 | Request was refused due to rate limiting. |
| 500 | The request failed due to an unexpected error. |
| 504 | The request failed because a downstream service failed to respond. |

## Examples

### cURL

```bash
curl -X POST "https://api.moov.io/accounts/{accountID}/transfers/{transferID}/reversals" \
  -H "Authorization: Bearer {token}" \
  -H "X-Moov-Version: v2026.07.00" \
  -H "X-Idempotency-Key: 7d8f2a64-4b1e-4c3a-9f2d-1e5b6c7a8d90" \
  -d '{
  "amount": 0
}'
```

### Typescript (SDK)

```typescript
import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.transfers.createReversal({
    xIdempotencyKey: "b91d00b2-4ecb-4eb4-a67f-d6f76c0b7ad8",
    accountID: "f225b49d-911b-440b-baed-6065968b69cb",
    transferID: "a17b29e2-4af6-4c9d-ad3a-dd0ded2966ad",
    createReversal: {
      amount: 1000,
      amountDetails: {
        surcharge: {
          currency: "USD",
          valueDecimal: "12.987654321",
        },
      },
    },
  });

  console.log(result);
}

run();
```

Full reference with SDK examples in every language: https://docs.moov.io/api/money-movement/refunds/cancel/
