This is your first endpoint! Edit this page to start documenting your API.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Fetch All Wallets
This endpoint allows users to retrieve all wallets using an API KEY.
Authentication
ATTENTION: You Need an API Key Token to Access This Endpoint!
Click here to learn how to create an API Key Token → (API Key Token Guide
This endpoint requires an API KEY token and timestamp. The token must be sent in the api-token and timestamp in the x-timestamp header.
Example:
api-token: <your_api_key_here>
x-timestamp: <timestamp_value>
If the token is invalid or missing, the API will return:
{
"statusCode": 401,
"message": "Unauthorized"
}Endpoints
Retrieve all user wallets
Method: GET
URL: /token/wallets
Authentication: Required (API KEY Token) and (TIMESTAMP)
Description: Returns all wallets associated with the authenticated user.
Request Example
GET /token/wallets
api-token: <your_api_key_here>
x-timestamp: <timestamp_value>
Success Response (200)
[
{
"id": "12345",
"userId": "67890",
"type": "type_wallet",
"balance": 1000.50,
"createdAt": "2024-03-04T10:15:30Z"
},
{
"id": "54321",
"userId": "67890",
"type": "type_wallet",
"balance": 500.75,
"createdAt": "2024-03-02T09:30:45Z"
}
]Possible Errors
| Status Code | Message | Description |
|---|---|---|
| 401 | Unauthorized | Token is missing or invalid |
| 500 | Internal Server Error | Unexpected server error |
Usage Example
To retrieve wallets using curl:
curl -X GET "https://api.zaffex.com/token/wallets" \
-H "api-token: <your_api_key_here>"
-H "x-timestamp: <timestamp_value>"
Using JavaScript fetch:
fetch("https://api.zaffex.com/token/wallets", {
method: "GET",
headers: {
"api-token": "<your_api_key_here>",
"x-timestamp": "<timestamp_value>"
}
})
.then(response => response.json())
.then(data => console.log(data));Using TypeScript with fetch:
async function fetchWallets(apiKey: string, timestamp: string): Promise<void> {
try {
const response = await fetch("https://api.zaffex.com/token/wallets", {
method: "GET",
headers: {
"api-token": apiKey,
"x-timestamp": timestamp,
}
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
console.log("Wallets:", data);
} catch (error) {
console.error("Error fetching wallets:", error);
}
}
// Usage example:
fetchWallets("<your_api_key_here>", "<timestamp_here>"); 200Successful response