This endpoint is used to fetch the transaction history of an user.
https://api.exchangecopter.com/Transaction/BRL/History
GET
import axios from 'axios';
const getWithdrawals = async () => {
const apiUrl = 'https://api.exchangecopter.com/Transaction/BRL/History';
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": "86cfd98a-dcc5-4b67-b8d7-841e4a9f37fd",
"code": "45447b68-09fc-4af9-be82-d7b4df00fc3b",
"amount": 990,
"method": "PIX",
"status": "PAID",
"createdAt": "2022-06-06T11:48:21Z",
"approvedAt": "2022-06-06T11:48:21Z",
"rejectedAt": null,
"paidAt": "2022-06-06T11:48:21Z",
"failedAt": null,
"failedReason": null,
"pixKey": null,
"bankAccount": {
"id": "a8a9c988-c2ba-44b9-af2d-ee6fcc00e269",
"code": "ade39877-cb26-42bc-b151-8e6eef84284d",
"type": "CHECKING",
"holderName": "Bruce Wayne",
"holderTaxId": "37515868066",
"holderType": "INDIVIDUAL",
"branchNumber": "0001",
"accountNumber": "11111-1",
"bankId": "60701190",
"status": "ACTIVE",
"createdAt": "2022-06-06T11:48:21Z",
"updatedAt": null,
"deletedAt": null,
"metadata": null
},
"recipient": {
"id": "80e579ff-e3a6-4573-84ff-30de777e7861",
"code": "a1fc515c-ce4a-45e0-8802-2696b2c0337a",
"name": "Bruce Wayne",
"taxId": "37515868066",
"type": "INDIVIDUAL",
"status": "ACTIVE",
"createdAt": "2022-06-08T15:02:00Z",
"updatedAt": null,
"deletedAt": null,
"metadata": null
},
"metadata": {
"CUSTOM_FIELD_NAME": "CUSTOM_FIELD_VALUE"
}
}
}
| Status | Description | Final Status |
|---|---|---|
| PENDING_APPROVAL | Indicates that the payment needs approval. | NO |
| APPROVED | Indicates that the payment was approved. | NO |
| PROCESSED | Indicates that the payment was processed. | NO |
| CREATED | Indicates that the payment was created. | NO |
| REJECTED | Indicates that the payment was rejected. | YES |
| REFUNDED | Indicates that the payment was refunded. | YES |
| FAILED | Indicates that the payment failed. | YES |
| PAID | Indicates that the payment was paid. | YES |
Response 400 or 500
{
"data": {
"message": "There is a problem with the service.",
"description": error,
}
}