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 a valid serviceCode
- Complete signatures (company and carrier)
- User belongs to the owner company or is the winning carrier
Internal process:
- Validates auction status and signatures
- Generates PDF using the 'file_contract' template
- Includes data for:
- Auction (origin, destination, dates)
- Hiring company
- Winning carrier
- Terms and conditions
- Configures headers for direct download
Fields included in the contract:
- Auction data (serviceCode - e.g., VIGMURnT4FN, dates, addresses)
- Party information (names, contacts)
- Agreed price and payment conditions
- Country-specific legal terms
Usage example:
GET /api/auction/contract/ABC123
The response is a PDF stream with headers for automatic download.
Request
Responses
- 200
- 400
- 401
- 404
PDF contract successfully generated
Response Headers
Content-Disposition
Header for file download with filename.
Format: attachment; filename=CONTRACT_{serviceCode}.pdf
Example: attachment; filename=CONTRACT_ABC123.pdf
Content-Type
application/pdf
Request error
Unauthorized
Contract not found. Possible causes:
- Auction does not exist
- Contract not previously generated
- Insufficient permissions