> 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.md).

# Generate Wallet

Generate a new wallet address for a customer.

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

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

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

```
{
  "network": "bitcoin",
  "customer": "{\"email\":\"jean@email.com\",\"first_name\":\"Jean\",\"last_name\":\"Billy\"}"
}
```

#### **Request Parameters** <a href="#request-body" id="request-body"></a>

| Parameter | Type             | Required | Description                                                                             |
| --------- | ---------------- | -------- | --------------------------------------------------------------------------------------- |
| network   | string           | Yes      | Network code to parse in requests. Use values like `bitcoin`, `erc20`, `bep20`, `trc20` |
| customer  | string \| object | Yes      | Customer details. JSON string or object with `email`, `first_name`, `last_name`         |

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

```
curl -X POST https://service.roqqu.com/v1/wallets/generate-wallet \
  -H "Content-Type: application/json" \
  -d '{
    "network": "bitcoin",
    "customer": "{\"email\":\"jean@email.com\",\"first_name\":\"Jean\",\"last_name\":\"Billy\"}"
  }'
```

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

```
{
  "status": "success",
  "message": "wallet generated successfully",
  "data": {
    "address": "3KVmcuvX6vPVKYiyKz6DjVmhZvnkKbA1zu"
  }
}
```

#### **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 / missing customer fields:**

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

**Missing required body field:**

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