Last active
June 24, 2022 18:41
-
-
Save elishaukpong/877388f77b1e538298c4524882f6df9e to your computer and use it in GitHub Desktop.
REST API Endpoints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To Add a lot | |
POST base_url/sellers/{seller_id}/lots/create | |
Request Body | |
{ | |
weight:float|min_weight:500, | |
country_of_origin:string or id (if list of country db exiss and is seeded), | |
harvest_date:date_time, | |
cultivar: string | |
} | |
Response | |
{ | |
status_message: string, | |
status_code: int, | |
data: array | |
} | |
Validation Response //applicable on all routes | |
{ | |
status_message:string, | |
status_code:int, | |
errors: ['name':error_message] | |
} | |
To Update a lot | |
PATCH base_url/sellers/{seller_id}/lots/{lot_id}/update | |
//any field that needs to be updated has to be passed to the request body | |
Request Body | |
{ | |
weight:float|min_weight:500, | |
country_of_origin:string or id (if list of country db exiss and is seeded), | |
harvest_date:date_time, | |
cultivar: string | |
} | |
Response | |
{ | |
status_message: string, | |
status_code: int, | |
data: array | |
} | |
To Delete a lot | |
DELETE base_url/sellers/{seller_id}/lots/{lot_id}/delete | |
Request { | |
} | |
Response | |
{ | |
status_message: string, | |
status_code: int, | |
} | |
To bid on a lot | |
POST base_url/lots/{lot_id}/bids/create | |
Request { | |
buyer_id: int, | |
bid_per_kg: float, | |
duration_in_days: int | |
} | |
Response | |
{ | |
status_message: string, | |
status_code: int, | |
data:array | |
} | |
To list bids on a lot | |
GET base_url/lots/{lot_id}/bids | |
Request { | |
page:int | |
} | |
Response | |
{ | |
status_message: string, | |
status_code: int, | |
data:array | |
} | |
To start auction on lot | |
POST base_url/lots/{lot_id}/auction/create | |
Request { | |
bid_per_kg: float, | |
duration_in_days: int | |
} | |
Response | |
{ | |
status_message: string, | |
status_code: int, | |
data:array | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment