Freight created in your company can be deleted if it’s in a new status (freight was never published).
The freight-id identification number in method call can be taken from response after creating the freight or by downloading the freight list.
DELETE
/ext/freights-api/v1/freights/{freight-id}
Request Authorization
Every request MUST include a valid access token obtained during the user authorization process, provided using the Bearer token scheme in the Authorization header.
Request
Successful Response
Error Response
Request Header
DELETE /ext/freights-api/v1/freights/{freight-id} HTTP/1.1
Host: api.platform.trans.eu
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access_token)
Api-key: {unique_app_api-key}Successful Response
204 No ContentClient errors (code 4xx)
Errors with HTTP status code 404 indicate that the requested resource could not be found on the server. HTTP status code 403 indicates the inappropriate freight status
Example error 1
Freight does not exists
{
"detail": "Freight not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Example error 2
Freight does not have the correct status (new status)
{
"detail": "Deleting freight (id: 678870) with status 'unsuccessful_publication' is forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}