> For the complete documentation index, see [llms.txt](https://roqqu-api-services.gitbook.io/ras/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roqqu-api-services.gitbook.io/ras/wallets/generate-wallet-for-self.md).

# Generate Wallet For Self

Generate a wallet address for the authenticated merchant.

**Endpoint:** `POST /wallets/generate-merchant-wallet`

**Authentication:** Required (`x-api-key` for live, `x-staging-api-key` for test)

#### Request Body <a href="#request-body-1" id="request-body-1"></a>

```
{
  "network": "bitcoin"
}
```

#### **Request Parameters**

| Parameter | Type   | Required | Description                                                                             |
| --------- | ------ | -------- | --------------------------------------------------------------------------------------- |
| network   | string | Yes      | Network code to parse in requests. Use values like `bitcoin`, `erc20`, `bep20`, `trc20` |

#### Example Request <a href="#example-request-8" id="example-request-8"></a>

```
curl -X POST https://service.roqqu.com/v1/wallets/generate-merchant-wallet \
  -H "Content-Type: application/json" \
  -d '{"network": "bitcoin"}'
```

#### Example Response <a href="#example-response-8" id="example-response-8"></a>

```
{
  "status": "success",
  "message": "wallet generated successfully",
  "data": {
    "address": "36jVM83y7K3iN8hkbLgzRrCKSQkuPwnrks"
  }
}
```

#### **Error Responses**

**Unsupported network:**

```
{
  "status": "fail",
  "message": "unsupported network"
}
```

**Wallet generation disabled for network:**

```
{
  "status": "fail",
  "message": "wallet generation not enabled for network"
}
```

**Wallet generation failed:**

```
{
  "status": "fail",
  "message": "wallet generation failed"
}
```

**Invalid merchant:**

```
{
  "status": "fail",
  "message": "Invalid merchant"
}
```

**Merchant does not exist:**

```
{
  "status": "fail",
  "message": "Merchant does not exist"
}
```

**Missing required body field:**

```
{
  "status": "fail",
  "message": "(network) not found in request body"
}
```
