Taking over negotiations from an employee of the same company.
The negotiation can only be taken over by a user from the shipper’s side with the appropriate permissions to take over the negotiations.
The offers-id identification number in request can be taken from the response of Get freight offers list or Get freight offer details requests.
PATCH
/ext/freights-api/v1/freights/offers/{offer-id}/takeover
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
PATCH /ext/freights-api/v1/freights/offers/{offer-id}/takeover 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 |
| version | Int | 4 | Yes | Current negotiation asking version — the same as returned in Get freight offers list or Get freight offer details. |
| with_unassignment | Boolean | False | Yes | True - the user from whom the negotiations were taken over loses the ability to participate in these negotiationsFalse - the user from whom the negotiations were taken over can still take part in these negotiations |
Example Request Body
{
"version": 2,
"with_unassignment": false
}Response Fields
| Attribute | Type | Example | Description |
| created_negotiation_id | String | “f00b6bb7-c256-46dc-83c9-dcd3b7085341” | New negotiation ID created during the takeover |
| negotiation_id | String | “f1b5ecb7-f5c3-4f55-8386–8e9e2e0a754a” | Id of the negotiation taken over |
Response Body
{
"created_negotiation_id": "f00b6bb7-c256-46dc-83c9-dcd3b7085341",
"negotiation_id": "f1b5ecb7-f5c3-4f55-8386-8e9e2e0a754a"
}Client errors (code 400)
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
Missing required fields
{
"detail": "Failed Validation",
"status": 422,
"title": "Unprocessable Entity",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"validation_messages": {
"version": {
"isDefined": "version should not be null or undefined",
"isInt": "version must be an integer number",
"isPositive": "version must be a positive number"
},
"with_unassignment": {
"isBoolean": "with_unassignment must be a boolean value",
"isDefined": "with_unassignment should not be null or undefined"
}
}
}Example error 2
Incorrect version number
{
"detail": "Negotiation version changed",
"status": 422,
"title": "Unprocessable Entity",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Example error 3
Inccorect offer id
{
"detail": "Negotiation not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}