> 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/withdrawals/confirm-withdrawal.md).

# Confirm Withdrawal

<mark style="color:blue;">**`POST`**</mark> `https://api.sfox.com/v1/user/withdraw/confirm`

Confirm a user's withdrawal request.

Once a withdrawal is initiated, a 6-digit OTP[^1] code will be sent to the user's email address.  Collect this code from the user and submit it along with the ID of the withdrawal using this request to confirm the user's withdrawal. Once confirmed, the withdrawal will begin processing.

{% hint style="info" %}
**Authentication:** This endpoint requires a [User Auth Token](https://docs.sfox.com/connect/rest-api/end-users/create-user-auth-token.md) for authentication. Requests using your Connect API Key will be rejected.
{% endhint %}

### Body Parameters

<table><thead><tr><th width="215">Name</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>otp</code></strong>  <mark style="color:red;">required</mark></td><td>string</td><td>The 6-digit OTP code sent to the user's email</td></tr><tr><td><strong><code>atx_id</code></strong> <mark style="color:red;">required</mark></td><td>number</td><td>The transaction ID (<code>atx_id</code>) of the withdrawal you are confirming</td></tr></tbody></table>

### Response Body

<table><thead><tr><th width="173.33333333333331">Key</th><th width="562">Description</th></tr></thead><tbody><tr><td><strong><code>success</code></strong></td><td>Whether the request for a new confirmation code was successful or not</td></tr><tr><td><strong><code>atx_id</code></strong></td><td>The transaction ID of the withdrawal you are requesting a code for</td></tr><tr><td><strong><code>tx_status</code></strong></td><td>The transaction status of the withdrawal</td></tr></tbody></table>

### Responses

<details>

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

```json
{
    "data": {
        "success": true,
        "atx_id": 1525624,
        "tx_status": 1160
    }
}
```

</details>

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

```shell
curl -X POST \
  -H 'Content-type: application/json' \
  -H "Authorization: Bearer ${USER_AUTH_TOKEN}" \
  --data '{ "otp": "123456",
          "atx_id": 987654 }'  \
'https://api.sfox.com/v1/user/withdraw/confirm'
```

{% endtab %}

{% tab title="NodeJS" %}

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

const config = {
  method: 'post',
  url: 'https://api.sfox.com/v1/user/withdraw/confirm',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer {process.env.USER_AUTH_TOKEN}`
  },
  data: {
   otp: '123456',
   atx_id: 987654
  }
}

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

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

data = requests.post(
  "https://api.sfox.com/v1/user/withdraw/confirm",
  headers={
    "Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}"
  },
  json={
    "otp": "123456",
    "atx_id": 987654
  }
)
print(data.status_code)
print(data.json())
```

{% endtab %}
{% endtabs %}

[^1]: One Time Password


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sfox.com/connect/rest-api/withdrawals/confirm-withdrawal.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
