Bananas - Jeff Davidson 310-395-9300 jeff@very-advanced.com
All responses will have the form
{
"message": "Description of what happened",
"data": "Mixed type holding the content of the response"
}Definitions detail only the expected value of the data field:
Definition
POST /update_values
Arguments
"sell_price":stringprice at which bananas are sold - default 0.35"buy_price":stringcost of bananas for purchase - default - 0.20"days_fresh":stringnumber of days bananas stay fresh - default 10
This will update the values for buy and sell prices. If field is NULL, current value will not be updated
Definition
POST /purchase`
Arguments
"total":stringtotal number of bananas sold"date":stringdate bananas were sold with format YYYY-MM-DD
Multiple daily transactions are allowed! If the date already exists, a second order for the same date will be created
Response
201 OKon success
{
"total": "100",
"date": "YYYY-MM-DD",
},Definition
`POST /sell
Arguments
"total":stringtotal number of bananas sold"date":stringdate bananas were sold with format YYYY-MM-DD
Multiple daily transactions are allowed! If the date already exists, a second order for the same date will be created
Response
201 Createdon success
{
"total": "100",
"date": "YYYY-MM-DD",
},`GET /metrics
Arguments
"start_date":stringdate bananas were sold with format YYYY-MM-DD"end_date":stringdate bananas were sold with format YYYY-MM-DD
Response
404 Not Founddate range not found201 OKon success
{
"inventory": "50",
"expired": "10",
"total_sold": "100",
"profit": "1200"
}