This Api can be used in two different ways: by cloning the project or by using your preferred client, such as Insomnia or Postman.
To clone the project, run the following command:
git clone https://github.com/NivaldoFarias/valex-api.git
Then, navigate to the project folder and run the following command:
npm install
Finally, start the server:
npm start
You can now access the API's endpoints by navigating to http://localhost:5000/
or to the deployed URL https://valex-project-api.herokuapp.com/
. If needed, import one of the provided Request Collections files into your preferred client and test the endpoints!
In this section, you will find the API's endpoints and their respective descriptions, along with the request and response examples. All data is sent and received as JSON.
Cards /cards
Payments /payments
Recharges /recharges
{
"employeeId": "1",
"cardType": "health"
}
{
"Content-Type": "application/json",
"x-api-key": "this-is-a-needlessly-long-placeholder-api-key"
}
Status Code | Description | Properties |
---|---|---|
201 | Created | data: { securityCode } |
400 | Missing Headers | error: { message, details } |
401 | Unauthenticated | error: { message, details } |
403 | Forbidden | error: { message, details } |
404 | Not Found | error: { message, details } |
422 | Invalid Input | error: { message, details } |
500 | Internal Server Error | error: { message, details } |
{
"cardId": "3",
"securityCode": "616",
"password": "1234"
}
{
"Content-Type": "application/json"
}
Status Code | Description | Properties |
---|---|---|
200 | OK | data: {} |
403 | Forbidden | error: { message, details } |
404 | Not Found | error: { message, details } |
422 | Invalid Input | error: { message, details } |
500 | Internal Server Error | error: { message, details } |
{
"cardId": "3",
"password": "1234"
}
{
"Content-Type": "application/json"
}
Status Code | Description | Properties |
---|---|---|
200 | OK | data: {} |
403 | Forbidden | error: { message, details } |
404 | Not Found | error: { message, details } |
422 | Invalid Input | error: { message, details } |
500 | Internal Server Error | error: { message, details } |
{
"cardId": "3",
"password": "1234"
}
{
"Content-Type": "application/json"
}
Status Code | Description | Properties |
---|---|---|
200 | OK | data: {} |
403 | Forbidden | error: { message, details } |
404 | Not Found | error: { message, details } |
422 | Invalid Input | error: { message, details } |
500 | Internal Server Error | error: { message, details } |
{
"card": {
"id": 3,
"password": "1234"
},
"businessId": 5,
"amount": 1000
}
{
"Content-Type": "application/json"
}
Status Code | Description | Properties |
---|---|---|
201 | Created | data: {} |
403 | Forbidden | error: { message, details } |
404 | Not Found | error: { message, details } |
422 | Invalid Input | error: { message, details } |
500 | Internal Server Error | error: { message, details } |
{
"cardId": 3,
"amount": 1000
}
{
"Content-Type": "application/json",
"x-api-key": "this-is-a-needlessly-long-placeholder-api-key"
}
Status Code | Description | Properties |
---|---|---|
201 | Created | data: {} |
400 | Missing Headers | error: { message, details } |
401 | Unauthenticated | error: { message, details } |
403 | Forbidden | error: { message, details } |
404 | Not Found | error: { message, details } |
422 | Invalid Input | error: { message, details } |
500 | Internal Server Error | error: { message, details } |
In the following Youtube link I included all Youtube content I used or refered to while studying for this project. Hope you enjoy it!