# Merchant Client Withdrawal

The endpoint places a withdrawal Request for a merchant on her generated Wallet address tied to an email address

## Withdrawal Request

<mark style="color:green;">`POST`</mark> `BaseUrl/api/merchantClientWithdrawal`

#### Request Body

| Name                                                         | Type    | Description                          |
| ------------------------------------------------------------ | ------- | ------------------------------------ |
| amount<mark style="color:red;">\*</mark>                     | Numbers | 10                                   |
| currency<mark style="color:red;">\*</mark>                   | Enum    | 3                                    |
| destinationAddress<mark style="color:red;">\*</mark>         | String  | Client Wallet\_Address               |
| merchantClientEmailAddress<mark style="color:red;">\*</mark> | String  | Client Email Address                 |
| networkChain<mark style="color:red;">\*</mark>               | Enum    | 1                                    |
| merchantReference<mark style="color:red;">\*</mark>          | String  | X-your-Unique-Ref('uuid'-preferably) |
| publicKey                                                    | String  | your PublicKey                       |

{% tabs %}
{% tab title="200: OK " %}

```
{
  "status": 1,
  "message": "string",
  "data": {
    "destinationAddress": "Client Wallet_Address",
    "paymentCurrency": 1,
    "networkChain": 1,
    "withdrawnAmount": 0,
    "transactionCharge": 0,
    "withdrawnAmountRequested": 0,
    "paymentDescription": "string",
    "merchantTransactionReference": "X-your-Unique-Ref('uuid'-preferably)",
    "switchWalletTransactionReference": "our-Unique-Ref",
    "transactionChargeCurrency": 1
  }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```
{
  "status": 0,
  "message": "string",
  "data": "string"
}
```

{% endtab %}
{% endtabs %}

**Code  Gist**&#x20;

<details>

<summary>Withdrawal Request <strong>Code gist</strong> </summary>

```
POST /api/merchantClientWithdrawal?api-version=1 HTTP/1.1
Host: testnet.switchwallet.io
Content-Type: application/json-patch+json; ver=1.0
Accept: text/plain; ver=1.0
Authorization: ApiKey 5128620015083006430

{
  "amount": 10,
  "currency": "3",
  "destinationAddress": "0x0fC0c413e80cef85a273930269E70D1B8C6cC146",
  "merchantClientEmailAddress": "merchantClientEmailAddress@mail.com",
  "networkChain": "1",
  "merchantReference": "xp-your-Ref",
  "publicKey": "your publicKey"
}
```

{% code title="Javascript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json-patch+json; ver=1.0");
myHeaders.append("Accept", "text/plain; ver=1.0");
myHeaders.append("Authorization", "ApiKey 5128620015083006430");

var raw = "{\n  \"amount\": 10,\n  \"currency\": \"3\",\n  \"destinationAddress\": \"0x0fC0c413e80cef85a273930269E70D1B8C6cC146\",\n  \"merchantClientEmailAddress\": \"merchantClientEmailAddress@mail.com\",\n  \"networkChain\": \"1\",\n  \"merchantReference\": \"xp-your-Ref\",\n  \"publicKey\": \"your publicKey\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://testnet.switchwallet.io/api/merchantClientWithdrawal?api-version=1", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endcode %}

</details>


---

# Agent Instructions: 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:

```
GET https://docs.switchwallet.io/api-calls/merchant-client-withdrawal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
