auctions
biddingLog
{
'id': <auction-id>,
'seller': <userId>,
'item_type': <example: neelam>,
'quantity': <example: 10>,
'highest_bidder': <userId>,
'highest_bid': <example: 200 dinero | default: initial_price>,
'start_time': <unix-timestamp>,
'end_time': <unix-timestamp>,
'bidders': [<userId>, <userId>]
}
{
'id': <auction-id>,
'seller': <userId>,
'item_type': <example: neelam>,
'quantity': <example: 10>,
'initial_price': <example: 100 dinero>,
'highest_bidder': <userId>,
'highest_bid': <example: 200 dinero | default: initial_price>,
'start_time': <unix-timestamp>,
'end_time': <unix-timestamp>,
'bidders_and_bids': [
{
'bidder': <userId>,
'bid': <number>,
'timestamp': <unix-timestamp>
}
],
}
Route | Description |
---|---|
GET /auctions | Returns all available auctions metadata |
GET /auctions/:id | Returns detailed auction data for one auction |
POST /auctions | Creates a new auction |
POST /bid/:id | Place new bid |
Returns active (ongoing) auctions
- Params
None - Query
None - Body
None - Headers
Content-Type: application/json - Cookie
None - Success Response:
- Code: 200
- Content:
{
message: 'Auctions returned successfully!'
auctions: [
{Auctions Metadata object},
{Auctions Metadata object},
{Auctions Metadata object}
]
}
- Error Response:
- Code: 500
- Content:
{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }
- Content:
- Code: 500
Get detailed information for an auction
-
Params
Required:id=[string]
-
Query
None -
Body
None -
Headers
Content-Type: application/json -
Cookie
None -
Success Response:
-
Code: 200
- Content:
{Auction Details Object}
- Content:
-
Error Response:
- Code: 500
- Content:
{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }
- Content:
- Code: 500
Creates a new auction
- Params
None - Query
None - Body
{ 'item_type': <example: neelam>, 'quantity': <example: 10>, 'initial_price': <example: 100>, 'end_time': <unix_timestamp> }
- Headers
Content-Type: application/json - Cookie
rds-session:<JWT>
- Success Response:
- Code: 201
- Content:
{ message: 'Auction created successfully!'}
- Content:
- Code: 201
- Error Response:
- Code: 401
- Content:
{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }
- Content:
- Code: 500
- Content:
{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }
- Content:
- Code: 401
Place a new bid when auctionId is given
- Params
Required:id=[string]
- Query
None - Headers
Content-Type: application/json - Cookie
rds-session:<JWT>
- Body
{ bid: <number> }
- Success Response:
- Code: 201
- Content:
{ 'message': 'Successfully placed bid!'}
- Content:
- Code: 201
- Error Response:
- Code: 401
- Content:
{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'User cannot be authenticated' }
- Content:
- Code: 403
- Content:
{ 'statusCode': 403, 'error': 'Forbidden', 'message': 'Your bid was not higher than current one!' / 'You do not have sufficient money' / 'You do not have a wallet!' }
- Code: 404
- Content:
{ 'statusCode': 404, 'error': 'Not Found', 'message': 'Auction doesn't exist' }
- Content:
- Code: 500
- Content:
{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }
- Content:
- Code: 401