> For the complete documentation index, see [llms.txt](https://docs.tylt.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tylt.money/tylt-embedded-wallet-service/transactions/receive-crypto.md).

# Receive Crypto

**Get Wallet Address**

Retrieves a blockchain wallet address through which the end user can receive crypto-assets.

### Endpoint

```http
GET /whitelabel/wallet/getWalletAddress
```

### Request Headers

```http
x-tlp-apikey: <api-key>
x-tlp-signature: <hmac-signature>
```

### Query Parameters

Provide at least one of the following user identifiers: `endUserEmail`, `endUserId`, or `externalUserId`.

| Field            |        | Required    | Description                                          |
| ---------------- | -----: | ----------- | ---------------------------------------------------- |
| `endUserEmail`   | String | Conditional | End user’s registered email                          |
| `endUserId`      | Number | Conditional | Tylt's end-user ID                                   |
| `externalUserId` | String | Conditional | Merchant’s own user identifier                       |
| `networkId`      | Number | Yes         | Id of the network                                    |
| `networkSymbol`  | String | Yes         | Blockchain network for the requested wallet address. |

### Example Request

```http
GET /whitelabel/wallet/getWalletAddress?externalUserId=user-10021&currency=USDT&network=TRON
```

The exact query object must be signed:

```json
{
 
  "endUserId": 20001, // Optional: Provide one user identifier only
  "endUserEmail": "joe@example.com", // Optional: Alternative to endUserId and externalUserId
  "externalUserId": "user-10021", // Optional: Alternative to endUserId and endUserEmail
  "networkId": 123,
  "networkSymbol": "TRX"
}
```

> The names `currency` and `network` in this example must be confirmed against the deployed wallet-address API schema.

### Code Snippet

{% tabs %}
{% tab title="JavaScript (Axios)" %}

```javascript
import crypto from 'crypto';
import axios from 'axios';

const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

const queryParams = {
{
  endUserId: 20001, // Optional: Provide one user identifier only
  endUserEmail: "joe@example.com", // Optional: Alternative to endUserId and externalUserId
  externalUserId: "user-10021", // Optional: Alternative to endUserId and endUserEmail
  networkId: 123,
  networkSymbol: "TRX"
}

const rawPayload = JSON.stringify(queryParams);
const signature = crypto.createHmac('sha256', apiSecret).update(rawPayload).digest('hex');

const headers = {
    'x-tlp-apikey': apiKey,
    'x-tlp-signature': signature
};

const queryString = new URLSearchParams(queryParams).toString();
axios.get(`https://api.tylt.money/whitelabel/wallet/getWalletAddress?${queryString}`, { headers })
    .then(response => console.log(response.data))
    .catch(error => console.error('Error:', error.response ? error.response.data : error.message));
```

{% endtab %}
{% endtabs %}

### Example Response

```json
{
  "msg": "",
  "data": {
    "publicAddress": "0x809c80216f826fc31493ff2db05b7286942ceb1cf"
  }
}
```

> The final response fields depend on the underlying wallet-address controller.

### How Receiving Crypto Works

1. The merchant requests the end user’s wallet address.
2. The merchant displays the address and applicable blockchain network.
3. The sender transfers crypto to the displayed address.
4. Tylt detects the blockchain transaction.
5. The transaction is processed after the required network confirmations.
6. The end user’s wallet balance is updated.
7. The merchant can retrieve the transaction through the transaction-history APIs.

### Merchant Responsibilities

The merchant should clearly display:

* The supported token
* The supported network
* The wallet address
* Any minimum deposit amount
* The required number of blockchain confirmations
* A warning not to send unsupported assets or use an unsupported network

Sending an unsupported asset or using an incorrect blockchain network may result in permanent loss of funds.

### Possible Errors

| HTTP Status | Message                                                         | Description                                                |
| ----------- | --------------------------------------------------------------- | ---------------------------------------------------------- |
| `400`       | `One of endUserEmail, endUserId or externalUserId is required.` | No end-user identifier was supplied                        |
| `400`       | Validation error                                                | Token or network information is missing or invalid         |
| `401`       | `Api Key authentication failed!`                                | API authentication failed                                  |
| `403`       | `API key or owner is inactive.`                                 | API access or merchant account is inactive                 |
| `403`       | `IP not whitelisted.`                                           | Request originated from an unauthorized IP                 |
| `403`       | `End user is suspended.`                                        | The end user is suspended                                  |
| `403`       | KYC approval required                                           | The user has not completed the required verification       |
| `404`       | `End user not found for this owner.`                            | No matching user exists under the merchant                 |
| `404`       | Wallet address not found                                        | No address is available for the requested asset or network |

***
