> For the complete documentation index, see [llms.txt](https://xaigate.gitbook.io/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xaigate.gitbook.io/api-docs/api-documentation/withdraw.md).

# Withdraw

This API allows you to withdraw funds from a sub-user's wallet.

<mark style="color:green;">`POST`</mark> `https://wallet-api.xaigate.com/api/v1/withdraw`

**Parameter content type: application/json**

#### Request Body

| Name                                              | Type   | Description                                |
| ------------------------------------------------- | ------ | ------------------------------------------ |
| apiKey<mark style="color:red;">\*</mark>          | String | fdda9f03-6409-43eb-a6ef-e1f6cea71c2e       |
| userId<mark style="color:red;">\*</mark>          | String | 097f35dd-a806-43ef-ab0d-f121cb11567e       |
| coin<mark style="color:red;">\*</mark>            | Stirng | ETH                                        |
| receivedAddress<mark style="color:red;">\*</mark> | String | 0x41053c22ac13c77daa6d65a4d235de7c38cc0c85 |
| amount<mark style="color:red;">\*</mark>          | String | 0.1                                        |
| networkId<mark style="color:red;">\*</mark>       | String | 1                                          |

{% tabs %}
{% tab title="200 Success" %}

```javascript
{
    "name"="Wilson",
    "owner": {
        "id": "sha7891bikojbkreuy",
        "name": "Samuel Passet",
    "species": "Dog",}
    "breed": "Golden Retriever",
}
```

{% endtab %}

{% tab title="401 Bad Request" %}

{% endtab %}
{% endtabs %}

### Request Parameter <a href="#request-parameter" id="request-parameter"></a>

| Parameter                                                  | Type   | Sample Value     |
| ---------------------------------------------------------- | ------ | ---------------- |
| apiKey <mark style="color:red;">(required)</mark>          | String | ​                |
| userId <mark style="color:red;">(required)</mark>          | String | ​                |
| receivedAddress <mark style="color:red;">(required)</mark> | String |                  |
| coin <mark style="color:red;">(required)</mark>            | String | ​                |
| amount <mark style="color:red;">(required)</mark>          | String |                  |
| networkId <mark style="color:red;">(required)</mark>       | String | Enum: 1, 56, TRX |

### Example Value <a href="#example-value-1" id="example-value-1"></a>

```
{
  "apiKey": "033e15ee-3de7-4a93-800a-ae131b73c237",
  "userId": "b3e36e1a-296f-4198-bda1-180c51aff14a",
  "receivedAddress": "0x41053c22ac13c77daa6d65a4d235de7c38cc0c85",
  "coin": "ETH",
  "amount": 0.1,
  "networkId": 1
}
```

### Response (200 Ok - https status code) <a href="#response-200-ok-https-status-code" id="response-200-ok-https-status-code"></a>

| Response        | Type   | Sample Value |
| --------------- | ------ | ------------ |
| id              | String | ​            |
| txid            | String | ​            |
| explorerUrl     | String |              |
| amount          | String |              |
| transactionFees | String |              |
| processingFees  | String |              |
| totalAmount     | String |              |
| toAddress       | String |              |
| walletId        | String |              |
| coinShortName   | String |              |
| date            | String |              |

### Example Value <a href="#example-value-1" id="example-value-1"></a>

```
{
  "id": "9f715070-cfd1-4aac-894a-f7e205729888",
  "txid": "replaceable_dcf11e0f-1ba4-4689-8105-3cd01f313db7",
  "explorerUrl": "https://sepolia.etherscan.io/tx/replaceable_dcf11e0f-1ba4-4689-8105-3cd01f313db7",
  "amount": "0.0487",
  "transactionFees": "0.0013",
  "processingFees": "0.0001",
  "totalAmount": "0.05",
  "toAddress": "0xD72F3aF2C1DaB33780ddd10e0d826e70598E4fe7",
  "walletId": "f70b0cbb-d86f-4bb8-a75f-578fbd201f35",
  "coinShortName": "ETH",
  "date": "2023-12-19T09:27:43.806112Z"
}
```
