This endpoint is used to fetch the transaction history of an user.
https://api.exchangecopter.com/Transaction/BRL/Deposits
GET
import axios from 'axios';
const getWithdrawals = async () => {
const apiUrl = 'https://api.exchangecopter.com/Transaction/BRL/Deposits';
const queryParams = {
limit: 10, // Replace with the desired limit or leave it default at 10. Min value is 1 max value is 50.
before: 'string',
after: 'string',
recipientId: 'DEFAULT', // Always default in this param.
userId: "your_userId_here"
};
const headers = {
Authorization: 'Bearer your-token-here', // Replace 'your-token-here' with the actual authentication token
Accept: 'application/json',
'Content-Type': 'application/json',
};
try {
const response = await axios.get(apiUrl, {
params: queryParams,
headers: headers,
});
console.log('API Response:', response.data);
} catch (error) {
console.error('API Error:', error);
}
};
// Example function call
getWithdrawals();
Response 200
{
"data": {
"id": "6a0b14a9-023c-4198-9ada-6e4684213340",
"code": "804a46a7-7012-4159-8782-1090e85e4afa",
"type": "STATIC",
"amount": 4990, // Remember that amoun is in cents. So 1 BRL is = 100.
"paidAmount": null,
"payload": "00020126580014BR.GOV.BCB.PIX01368ad59cd0-cd85-45eb-a443-b8824285c5f352040000530398654041.295802BR5924RPO GESTAO DE PAGAMENTOS6008SO PAULO6108000000006224052046193bc0333a468fa1ee6304A3E1",
"payer": {
"name": "Bruce Wayne",
"taxId": "37515868066"
},
"split": [
{
"value": 990,
"recipientId": "009cb956-3b58-4731-927f-20225600b35b"
}
],
"status": "PROCESSED",
"createdAt": "2022-06-06T11:48:21Z",
"processedAt": "2022-06-06T11:48:26Z",
"expiresAt": "2022-06-07T11:48:26Z",
"paidAt": null,
"failedAt": null,
"metadata": {
"CUSTOM_FIELD_NAME": "CUSTOM_FIELD_VALUE"
}
}
}
| Status | Description | Final Status |
|---|---|---|
| CREATED | Indicates that the payment was received. | NO |
| PROCESSED | Indicates that the payment was processed by provider but needs confirmation. | NO |
| ERROR | Indicates that an error has occurred. | YES |
| PAID | Indicates that the payment was confirmed. | YES |
| FAILED | Indicates that the payment was not processed. | YES |
| REFUNDED | Indicates that the payment was refunded (by a medpix, anti-fraud checker or user request) | YES |
Response 400 or 500
{
"data": {
"message": "There is a problem with the service.",
"description": error,
}
}