Skip to main content

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- It must have an assigned winner (bidWinner)- The user must be a company administrator- No previous contract must have been generatedInternal process:1. Validate that the auction meets the requirements2. Generate a PDF document using the 'file_contract' template3. Store the PDF in S3/local storage4. Update the auction with a reference to the contract5. Notify the winning carrierMandatory fields in the 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 request body:json{ 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

Individual auction