Active freight publications can be canceled in bulk. It removes the freights from the list of freights visible to carriers. Ongoing negotiations with carriers are being rejected.
Cancellation is possible for freight published by any employee in your company. It possible to cancel max 10 freights in one request.
POST
/ext/freights-api/v1/cancelPublication
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.
Successful Response
Error Response
Request Header
POST /ext/freights-api/v1/cancelPublication 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}Request Parameters
| Attribute | Type | Example | Mandatory | Description |
| freight-id | Array of Int | 856796, 234578 | Yes | Freight identification numbers to cancel publication |
Example Request Body
[856796, 234578]Response Fields
| Attribute | Type | Example | Description |
| freights_publications | Array of Objects | List of accepted freights to cancel | |
| freights.id | Int | 856796 | Freight identification number |
Response Body
{
"freights_publications": [
{
"id": 856796
},
{
"id": 234578
}
]
}Client errors (code 4xx)
HTTP 4xx status codes indicate client errors, meaning that the request could not be processed due to an issue on the client side. Below is a list of request-specific errors.
Example error 1
No freights id in request or freights does not exists
{
"detail": "Can't find any publication to cancel",
"status": 404,
"title": "Not Found"
}Example error 2
Incorrect freight publication status
{
"detail": "Cancellation is not possible. Status of publication 'finished' is forbidden",
"status": 422,
"title": "Unprocessable Entity",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Example error 3
Too many freight ids in one request
{
"error": "Bulk limit reached. You can only cancel '10' per request"
}