# Creating Static Wallet

You can create a static address in a specific currency and network using this endpoint. The static address will be associated with a unique trackId, and if a `callbackUrl` is set, your server will be notified of any payments received to that address. This allows you to receive transactions to the static address regardless of the amount and time.

> Please note that static addresses with no transactions for six months will be revoked.

<mark style="color:green;">`POST`</mark> `https://api.oxapay.com/merchants/request/staticaddress`

#### Request Body

<table><thead><tr><th width="141">Name</th><th width="100">Type</th><th width="511">Description</th></tr></thead><tbody><tr><td>merchant<mark style="color:red;">*</mark></td><td>string</td><td>Your merchant API key for authentication and authorization.</td></tr><tr><td>callbackUrl</td><td>string</td><td>The URL where payment information will be sent. Use this to receive notifications about payments made to the static address.</td></tr><tr><td>network</td><td>string</td><td>The blockchain <a href="supported-networks">network</a> on which the static address should be created. If not specified, the default network will be used.</td></tr><tr><td>currency<mark style="color:red;">*</mark></td><td>string</td><td>The specific <a href="supported-currencies">currency</a> for which you want to create a static address.</td></tr><tr><td>email</td><td>string</td><td>Provide the payer's email address for reporting purposes.</td></tr><tr><td>orderId</td><td>string</td><td>Specify a unique order ID for reference in your system.</td></tr><tr><td>description</td><td>string</td><td>Provide order details or any additional information that will be shown in different reports.</td></tr></tbody></table>

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

```json
{
    "result": integer, // The result code indicates the success or failure of the request.
    "message": string, // A message providing additional information about the result.
    "address": string // The generated static address for the specified currency and network.
}
```

{% endtab %}
{% endtabs %}

Please note that a successful request will return a result code 100. In case of any issues or validation problems, refer to the corresponding [result codes](https://docs.oxapay.com/legacy/api-reference/result-code-table) for further details.

### Example codes

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

```bash
curl -X POST https://api.oxapay.com/merchants/request/staticaddress \
  -d '{
    "merchant": "YOUR_MERCHANT_API_KEY",
    "currency": "BTC",
    "callbackUrl": "https://example.com/callback",
    "description": "Order #12345",
    "orderId": "ORD-12345",
    "email": "customer@example.com"
  }'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$url = 'https://api.oxapay.com/merchants/request/staticaddress';

$data = array(
    'merchant' => 'YOUR_MERCHANT_API_KEY',
    'currency' => 'BTC',
    'callbackUrl' => 'https://example.com/callback',
    'description' => 'Order #12345',
    'orderId' => 'ORD-12345',
    'email' => 'customer@example.com'
);

$options = array(
    'http' => array(
        'header' => 'Content-Type: application/json',
        'method'  => 'POST',
        'content' => json_encode($data),
    ),
);

$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$result = json_decode($response);
var_dump($result);
?>
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const axios = require('axios');
const url = 'https://api.oxapay.com/merchants/request/staticaddress';
const data = JSON.stringify({
    merchant: 'YOUR_MERCHANT_API_KEY',
    currency: 'BTC',
    callbackUrl: 'https://example.com/callback',
    description: 'Order #12345',
    orderId: 'ORD-12345',
    email: 'customer@example.com'
});

axios.post(url, data)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = 'https://api.oxapay.com/merchants/request/staticaddress'
data = {
    'merchant': 'YOUR_MERCHANT_API_KEY',
    'currency': 'BTC',
    'callbackUrl': 'https://example.com/callback',
    'description': 'Order #12345',
    'orderId': 'ORD-12345',
    'email': 'customer@example.com'
}

response = requests.post(url, data=json.dumps(data))
result = response.json()
print(result)
```

{% endtab %}
{% endtabs %}

Please note that you need to replace `YOUR_MERCHANT_API_KEY` with your actual merchant API key in the code snippets.
