Download PDF contract
GET/api/auction/contract/:serviceCode
Generate and download the PDF contract for a closed and signed auction.Requirements:- Auction in 'closed' status with valid serviceCode- Signatures complete (company and carrier)- User belongs to the owner company or is the winning carrierInternal process:1. Validate auction status and signatures2. Generate PDF using 'file_contract' template3. Include data for: - Auction (origin, destination, dates) - Contracting company - Winning carrier - Terms and conditions4. Configure headers for direct downloadFields included in the contract:- Auction data (serviceCode - e.g., VIGMURnT4FN, dates, addresses)- Party information (names, contacts)- Agreed price and payment conditions- Country-specific legal termsUsage example:GET /api/auction/contract/ABC123The response is a PDF stream with headers for automatic download.
Request
Responses
- 200
- 400
- 401
- 404
PDF Contract successfully generated.
Response Headers
Header for download with filename.Format: attachment; filename=CONTRACT_{serviceCode}.pdfExample: attachment; filename=CONTRACT_ABC123.pdf
application/pdf
Request error
Unauthorized
Contract not found. Possible causes:- Auction does not exist- Contract was not previously generated- Insufficient permissions