Withdraw last offer

With­draw­al of own offer in the freight nego­ti­a­tion process.
An offer may be with­drawn until a par­tic­i­pant in the nego­ti­a­tions sub­mits their own pro­pos­al.

The ver­sion and user ID para­me­ters in the request body are option­al, but it is rec­om­mend­ed to pro­vide them with cor­rect val­ues to ensure that the user who with­draws the offer sees its lat­est ver­sion.

The offers-id iden­ti­fi­ca­tion num­ber in request can be tak­en from the response of Get freight offer details request for pub­lish­er’s side or from Get freight pro­pos­al by id request for par­tic­i­pan­t’s side of nego­ti­a­tions.

POST
/ext/freights-api/v1/freights/offers/{offer-id}/withdraw
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/offers/{offer-id}/withdraw 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
target_employee_idString1013865–1NoUser’s Trans ID.
Des­ig­nat­ing a per­son whose offer is being with­drawn.
ver­sionInt4NoCur­rent nego­ti­a­tion ask­ing ver­sion — the same as returned in Get freight offers list or Get freight offer details (for pub­lish­er’s side) or returned in Get freight pro­pos­al (for par­tic­i­pan­t’s side)
Example Request Body
{
 "target_employee_id": "1013865-1",
 "version": 4
}
Response Fields
AttributeTypeExam­pleDescrip­tion
negotiation_idString474325c3-c743-4c53-b986-157bce61­ca6bNego­ti­a­tion id
Response Body
{
    "negotiation_id": "474325c3-c743-4c53-b986-157bce61ca6b"
}

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

Incor­rect nego­ti­a­tions sta­tus for with­draw

{
    "detail": "Active offer was not made by negotiation owner",
    "status": 422,
    "title": "Unprocessable Entity",
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example error 2

Nego­ti­a­tion already fin­ished

{
    "detail": "Auction is already canceled",
    "status": 422,
    "title": "Unprocessable Entity",
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example error 3

Incor­rect offer-id

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