Skip to main content

Place Bid

Places a new bid on a specified auction.

  • URI: /api/Bids
  • Method: POST
  • Authentication: Required (JWT)
  • Permission Required: Bids.Create (default value: "AuctionR:Bids:Create")

🔐 Permission values are configurable via the Permissions section in appsettings.json.


Request Body

Content-Type: application/json

FieldTypeRequiredDescription
auctionIdintYesIdentifier of the auction to bid on
bidderIdintYesIdentifier of the user placing bid
amountdecimalYesBid amount

Sample Request

POST /api/Bids HTTP/1.1
Authorization: Bearer {your_jwt_token}
Content-Type: application/json

{
"auctionId": 123,
"bidderId": 456,
"amount": 1700.00
}

Response

Status Code: 201 Created
Location Header: /api/Bids/{id} — URI of the newly created bid

Response Body Example

{
"success": true,
"message": "Bid placed successfully.",
"data": {
"id": 987,
"auctionId": 123,
"bidderId": 456,
"amount": 1700.0,
"timestamp": "2025-06-10T15:00:00Z"
}
}

Possible Error Responses

Status CodeMeaningWhen it Happens
400Bad RequestInput validation fails (e.g., missing/invalid fields)
401UnauthorizedJWT is missing or invalid
403ForbiddenCaller does not have permission to create bids
429Too Many RequestsRate limiting exceeded
500Internal Server ErrorUnexpected server-side error