Delete freight

Freight cre­at­ed in your com­pa­ny can be delet­ed if it’s in a new sta­tus (freight was nev­er pub­lished).

The freight-id iden­ti­fi­ca­tion num­ber in method call can be tak­en from response after cre­at­ing the freight or by down­load­ing the freight list.

DELETE
/ext/freights-api/v1/freights/{freight-id}
Request Authorization

Every request MUST include a valid access token obtained dur­ing the user autho­riza­tion process, pro­vid­ed using the Bear­er token scheme in the Autho­riza­tion head­er.

Successful 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 Content

Client errors (code 4xx)

Errors with HTTP sta­tus code 404 indi­cate that the request­ed resource could not be found on the serv­er. HTTP sta­tus code 403 indi­cates the inap­pro­pri­ate freight sta­tus

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 cor­rect sta­tus (new sta­tus)

{
    "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"
}