Generate contract for auction
POST/api/auction/contract
Create a preliminary contract for a closed auction with an assigned winner.
Requirements:
- The auction must be in 'closed' status
- Must have an assigned winner (bidWinner)
- The user must be a company administrator
- No previous contract should exist
Internal process:
- Validate that the auction meets the requirements
- Generate a PDF document using the 'file_contract' template
- Store the PDF in S3/local storage
- Update the auction with a reference to the contract
- Notify the winning carrier
Mandatory fields in body:
- serviceCode: Auction identifier. Format: 3 letters of origin, 3 letters of destination and 5 random alphanumeric characters (e.g.: VIGMURnT4FN).
- award_price: Agreed price (must be >= bid_current)
- special_conditions: Special terms (optional)
- payment_terms: Payment conditions (optional)
Example of body request:
{
serviceCode: ABC123,
award_price: 1200,
special_conditions: Fragile cargo - handle with care,
payment_terms: 50% advance, 50% upon delivery
}
The response includes the updated auction with the contract data.
Request
Responses
- 200
- 400
- 401
- 409
Single Auction
Request error
Unauthorized
Conflict. Possible causes:
- Auction already has a contract generated
- Concurrent operation in progress