4.2. Cancel claim
Cancels a claim that was confirmed. The operation can be performed within a limited time period.
Claim cancelation can be paid or free. Free cancelation is available until the performer arrives at point A, paid cancelation is available until the performer starts moving to pick up the cargo. To find out the cancellation type, use the claims/cancel-info operation (the cancel_state field).
In the case of free cancellation, the claim switches to the 'cancelled' status, and in the case of paid cancellation, it switches to the 'cancelled_with_payment' status.
HTTP Request
POST b2b.taxi.yandex.net/b2b/cargo/integration/v2/claims/cancel\
?claim_id={string}
Query Parameters
claim_id * | string Claim ID, received upon creation of claim |
claim_id * | string Claim ID, received upon creation of claim |
* Required parameter
Header Parameters
Accept-Language * | string Preferred language of response. Examples: "ru" — Russian, "en" — English |
Accept-Language * | string Preferred language of response. Examples: "ru" — Russian, "en" — English |
* Required parameter
Request Body
{ "cancel_state": string, "version": integer }
Copied to clipboard
Representation
Fields
cancel_state * | string Cancellation status (paid or free) Allowed values
|
version * | integer Canceled claim version (int64) |
* Required parameter
Responses
Code 200
Claim canceled
{ "id": string, "skip_client_notify": boolean, "status": string, "user_request_revision": string, "version": integer }
Copied to clipboard
Representation
Fields
id * | string Claim ID, received upon creation of claim |
skip_client_notify * | boolean |
status * | string Claim status Allowed values
|
user_request_revision * | string Current version of changes in the user's claim |
version * | integer Claim version from the request (int64) |
id * | string Claim ID, received upon creation of claim |
skip_client_notify * | boolean |
status * | string Claim status Allowed values
|
user_request_revision * | string Current version of changes in the user's claim |
version * | integer Claim version from the request (int64) |
* Required parameter
Code 400
Invalid request
{ "code": string, "message": string }
Copied to clipboard
Representation
Fields
code * | string String error code Allowed values
|
message * | string Human-readable error message |
* Required parameter
Code 404
Claim not found
{ "code": string, "message": string }
Copied to clipboard
Representation
Fields
code * | string String error code Allowed values
|
message * | string Human-readable error message |
* Required parameter
Code 409
Attempt to cancel an outdated version of the claim
{ "code": string, "message": string }
Copied to clipboard
Representation
Fields
code * | string String error code Allowed values
|
message * | string Human-readable error message |
* Required parameter
Example
Request:
curl -X POST "b2b.taxi.yandex.net/b2b/cargo/integration/v2/claims/cancel?claim_id={string}" \ -H "Accept-Language: {string}" \ -d '{ "cancel_state": "free", "version": 1 }'
Copied to clipboard
Responses:
{ "id": "741cedf82cd464fa6fa16d87155c636", "status": "new", "version": 1 }
Copied to clipboard
{ "code": "bad_request", "message": "Invalid request body" }
Copied to clipboard
{ "code": "not_found", "message": "Claim not found" }
Copied to clipboard
{ "code": "inappropriate_status", "message": "Invalid action on the claim" }
Copied to clipboard