> For the complete documentation index, see [llms.txt](https://docs.sfox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfox.com/connect/rest-api/transfers/cancel-transfer.md).

# Cancel Transfer

<mark style="color:red;">**`DELETE`**</mark> `https://api.sfox.com/v1/enterprise/transfer/:transfer_id`

Once a `Payment` transfer has been initiated, the funds for that transfer will be on hold until processed or canceled. To cancel a transfer, use this endpoint to release those funds being held and to cancel the processing of the transfer.

### Path Parameters

<table><thead><tr><th width="256">Name</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>transfer_id</code> <mark style="color:red;">required</mark></td><td>string</td><td>Partner generated transfer and idempotency ID</td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;"><strong>200 OK</strong></mark></summary>

```json
{
    "data": {
        "success": true
    }
}
```

</details>

<details>

<summary><mark style="color:red;"><strong>422 Unprocessable Content</strong></mark></summary>

```json
{
    "error": "Transfer with transfer_id 7735757c-863e-4e07-9b84-af186424ebae not found."
}
```

```json
{
    "error": "Funds transfer is not pending verification."
}
```

</details>

### Example Requests

{% tabs %}
{% tab title="Shell" %}

```bash
curl -X DELETE \
 -H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
 'https://api.sfox.com/v1/enterprise/transfer/7735757c-863e-4e07-9b84-af186424ebae'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

const config = {
  method: 'delete',
  url: 'https://api.sfox.com/v1/enterprise/transfer/7735757c-863e-4e07-9b84-af186424ebae',
  headers: {
    'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
  }
}

axios(config)
    .then((response) => {
      console.log(response.status)
      console.log(response.data)
    })
    .catch((err) => {
      console.error(err.response.status)
      console.error(err.response.data)
    });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

data = requests.delete(
  "https://api.sfox.com/v1/enterprise/transfer/confirm/7735757c-863e-4e07-9b84-af186424ebae",
  headers={
    "Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}"
  }
)
print(data.status_code)
print(data.json())
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sfox.com/connect/rest-api/transfers/cancel-transfer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
