Taking over the negotiations

Tak­ing over nego­ti­a­tions from an employ­ee of the same com­pa­ny.
The nego­ti­a­tion can only be tak­en over by a user from the ship­per’s side with the appro­pri­ate per­mis­sions to take over the nego­ti­a­tions.

The offers-id iden­ti­fi­ca­tion num­ber in request can be tak­en 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 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
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
AttributeTypeExam­pleManda­to­ryDescrip­tion
ver­sionInt4YesCur­rent nego­ti­a­tion ask­ing ver­sion — the same as returned in Get freight offers list or Get freight offer details.
with_unassignmentBooleanFalseYesTrue - the user from whom the nego­ti­a­tions were tak­en over los­es the abil­i­ty to par­tic­i­pate in these nego­ti­a­tions
False - the user from whom the nego­ti­a­tions were tak­en over can still take part in these nego­ti­a­tions
Example Request Body
{
  "version": 2,
  "with_unassignment": false
}
Response Fields
AttributeTypeExam­pleDescrip­tion
created_negotiation_idString“f00b6b­b7-c256-46dc-83c9-dcd3b7085341”New nego­ti­a­tion ID cre­at­ed dur­ing the takeover
negotiation_idString“f1b5ecb7-f5c3-4f55-8386–8e9e2e0a754a”Id of the nego­ti­a­tion tak­en over
Response Body
{
    "created_negotiation_id": "f00b6bb7-c256-46dc-83c9-dcd3b7085341",
    "negotiation_id": "f1b5ecb7-f5c3-4f55-8386-8e9e2e0a754a"
}

Client errors (code 400)

HTTP 4xx sta­tus codes indi­cate client errors, mean­ing that the request could not be processed due to an issue on the client side. Below is a list of request-spe­cif­ic errors.

Example error 1

Miss­ing 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

Incor­rect ver­sion num­ber

{
    "detail": "Negotiation version changed",
    "status": 422,
    "title": "Unprocessable Entity",
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example error 3

Inc­corect offer id

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