Archive freight

Archiv­ing select­ed freight cre­at­ed by any user of your com­pa­ny. You can archive freight with ongo­ing or com­plet­ed pub­li­ca­tion.

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.

Archiv­ing is avail­able for freight sta­tus unsuccesful_publication and in_progress. Freights with the sta­tus accept­ed are archived freights — per­form­ing the archiv­ing oper­a­tion for the accept­ed or closed freights does not change the freight sta­tus.

POST
/ext/freights-api/v1/freights/{freight-id}/archive
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
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 sta­tus codes typ­i­cal­ly indi­cate that the request is invalid, unau­tho­rized, or refers to a resource that can­not be found or processed due to client-side issues. Below is a list of sam­ple errors.

Example error 1

Incor­rect freight sta­tus for archiv­ing

{
    "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 com­pa­ny

{
    "detail": "Freight not found (id: 3772907)",
    "status": 404,
    "title": "Not Found",
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}