Delete contract
DELETE/api/auction/contract/:serviceCode
Permanently deletes the contract associated with an auction.
Requirements:
- The auction must be in 'closed' status
- There must be no associated delivery in 'in_progress' or 'completed' status
- The user must be a company administrator
- There must be no registered digital signatures
Actions performed:
- Deletes the contract PDF document from storage
- Clears contract references in the auction
- Logs the action in the audit history
- Notifies the carrier if they had already been informed
Validations performed:
- Verifies the auction exists and is closed
- Checks that there are no in-progress deliveries
- Validates user permissions
- Confirms there are no digital signatures
Usage example:
DELETE /api/auction/contract/ABC123
The response confirms successful deletion.
Request
Responses
- 200
- 400
- 401
- 409
Contract successfully deleted
Request error
Unauthorized
Conflict. Possible causes:
- Contract already signed by one party
- Delivery in progress or completed
- Concurrent operation in progress