Archiving selected freight created by any user of your company. You can archive freight with ongoing or completed publication.
The freight-id identification number in method call can be taken from response after creating the freight or by downloading the freight list.
Archiving is available for freight status unsuccesful_publication and in_progress. Freights with the status accepted are archived freights — performing the archiving operation for the accepted or closed freights does not change the freight status.
POST
/ext/freights-api/v1/freights/{freight-id}/archive
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
POST /ext/freights-api/v1/freights/{freight-id}/archive 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}Response Body
{
"message": "Freight has been successfully archived"
}Client errors (code 400)
HTTP 40x status codes typically indicate that the request is invalid, unauthorized, or refers to a resource that cannot be found or processed due to client-side issues. Below is a list of sample errors.
Example error 1
Incorrect freight status for archiving
{
"detail": "Archiving freight (id: 3772908) with status 'new' is forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Example error 2
Freight id does not exists in your company
{
"detail": "Freight not found (id: 3772907)",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}