List Cryptocurrencies
This endpoint returns all cryptocurrencies available for your account. Use this route to consult the necessary data to create deposit order requests.
Endpoint
- Method: GET
https://api.xgateglobal.com/deposit/company/cryptocurrencies
Test Integration
Use the form below to simulate the list of cryptocurrencies.
Test: List Deposit Cryptocurrencies
Request
The request does not require a body, only the authentication Headers.
Required Headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer <your_token> | The JWT token obtained from login. |
Responses
Success (200 OK)
Returns a list (array) of objects, where each object is a cryptocurrency.
[
{
"_id": "67339b18ca5**************",
"name": "USDT",
"symbol": "USDT",
"coinGecko": "tether",
"updatedDate": "2024-1**************",
"createdDate": "2024-1**************",
"__v": 0,
"uid": "01KH7K88H**************"
},
{
"_id": "67339b2bca5**************",
"name": "USDC",
"symbol": "USDC",
"coinGecko": "usdc",
"updatedDate": "2024-1**************",
"createdDate": "2024-1**************",
"__v": 0,
"uid": "01KH7K4C0BZ**************"
}
]
Common Errors
| Status | Message | Likely Reason |
|---|---|---|
| 401 | Unauthorized | • Invalid or expired token. • Invalid or missing Header. • IP not allowed. |
| 500 | Internal Server Error | Internal server error. Contact support. |
How to Use
The main purpose of listing cryptocurrencies is to allow the selection of the correct cryptocurrency to create a deposit order (Deposit Order).
The response from this endpoint provides the Complete Object of the cryptocurrency, allowing the construction of the order creation payload.
The Integration Flow
- List the currencies: Call this endpoint (
GET /deposit/company/cryptocurrencies). - Selection: Identify the desired cryptocurrency in the list (usually by filtering by
nameorsymbol, e.g., "USDT"). - Submission: You must pass the object within the
cryptocurrencyproperty in the deposit order creation payload. In the cryptocurrency deposit creation documentation, the required values are shown.
Practical Example
1. What you receive when listing cryptocurrencies:
[
{
"_id": "67339b18ca5**************",
"name": "USDT",
"symbol": "USDT",
"coinGecko": "tether",
"updatedDate": "2024-1**************",
"createdDate": "2024-1**************",
"__v": 0,
"uid": "01KH7K88H**************"
},
{
"_id": "67339b2bca5**************",
"name": "USDC",
"symbol": "USDC",
"coinGecko": "usdc",
"updatedDate": "2024-1**************",
"createdDate": "2024-1**************",
"__v": 0,
"uid": "01KH7K4C0BZ**************"
}
]
2. How you should send it in the deposit (POST /deposit):
You will take the above object and inject it within cryptocurrency:
{
"amount": 2,
"customerId": "672f40**************",
"currency": {
"_id": "6728f0a2cb************",
"name": "BRL",
"type": "PIX",
"createdDate": "2024-1************",
"updatedDate": "2026-0************",
"__v": 0,
"symbol": "R$"
},
"cryptocurrency": {
"_id": "67339b2bca5**************",
"name": "USDC",
"symbol": "USDC",
"coinGecko": "usdc",
"updatedDate": "2024-1**************",
"createdDate": "2024-1**************",
"__v": 0,
"uid": "01KH7K4C0BZ**************"
},
"externalId": "67ce09d**************"
}
Each piece of this JSON will be explained on the cryptocurrency deposit order creation page.
Integration
- Node.js
This integration example uses the Axios library in Node.js.
Installing Axios:
npm install axios
JavaScript Example:
const axios = require("axios");
(async () => {
const email = "your_email@domain.com";
const password = "**********";
try {
const url_api = "https://api.xgateglobal.com"
const login = await axios.post(`${url_api}/auth/token`, { email, password });
const { data } = await axios.get(`${url_api}/deposit/company/cryptocurrencies`, {
headers: {
"Authorization": `Bearer ${login.data.token}`
}
});
console.log(data); // Response
} catch (error) {
console.log(error.response.data.message) // Error
}
})()