Cancel the claim

The method cancels the confirmed claim. You can cancel the claim using this method before the item is handed over to the courier. After that, you can cancel the order only by contacting the support service.


Claim cancellation can be paid or free. Free cancellation is available before the courier arrives at the departure point and paid cancellation is available before the courier starts moving to the pick-up point. To determine the type of cancellation, use the operation for getting information about the claim claims/cancel-info (field ''cancel_state'').


In the case of free cancellation, the claim status changes to cancelled. In case of paid cancellation, its status changes to cancelled_with_payment.

Request

POST

b2b.taxi.yandex.net/b2b/cargo/integration/v2/claims/cancel

Service URL

Query parameters

Name

Description

claim_id*

Type: string

Claim ID received at the claim creation stage

Min length: 32

Max length: 64

Headers

Name

Description

Accept-Language*

Type: string

Preferred response language. Examples: "en" — English

Example: en

Body

application/json
{
    "version": 1,
    "cancel_state": "free"
}

Name

Description

cancel_state*

Type: CancelState

Cancellation status (paid or free)

Example: free

Enum: free, paid

version*

Type: integer<int64>

Canceled claim version (int64)

Example: 1

CancelState

Cancellation status (paid or free)

Type

Description

CancelState

Example: free

Enum: free, paid

Responses

200 OK

Claim canceled

Body

application/json
{
    "id": "741cedf82cd464fa6fa16d87155c636",
    "status": "new",
    "version": 1,
    "user_request_revision": "string",
    "skip_client_notify": false
}

Name

Description

id*

Type: string

Claim ID obtained at the claim creation stage

Example: 741cedf82cd464fa6fa16d87155c636

Min length: 32

Max length: 64

skip_client_notify*

Type: boolean

status*

Type: ClaimStatus

Claim status. To learn more, see Status model

Example: new

Enum: new, estimating, estimating_failed, ready_for_approval, accepted, performer_lookup, performer_draft, performer_found, performer_not_found, pickup_arrived, ready_for_pickup_confirmation, pickuped, delivery_arrived, ready_for_delivery_confirmation, delivered, delivered_finish, returning, return_arrived, ready_for_return_confirmation, returned, returned_finish, failed, cancelled, cancelled_with_payment, cancelled_by_taxi, cancelled_with_items_on_hands

user_request_revision*

Type: string

The current version of changes in the claim entered by the user

version*

Type: integer<int64>

Claim version from the request (int64)

Example: 1

ClaimStatus

Claim status. To learn more, see Status model

Type

Description

ClaimStatus

Example: new

Enum: new, estimating, estimating_failed, ready_for_approval, accepted, performer_lookup, performer_draft, performer_found, performer_not_found, pickup_arrived, ready_for_pickup_confirmation, pickuped, delivery_arrived, ready_for_delivery_confirmation, delivered, delivered_finish, returning, return_arrived, ready_for_return_confirmation, returned, returned_finish, failed, cancelled, cancelled_with_payment, cancelled_by_taxi, cancelled_with_items_on_hands

400 Bad Request

Bad request

Body

application/json
{
    "code": "bad_request",
    "message": "Incorrect request body"
}

Name

Description

code*

Type: string

Error code

Example: bad_request

Enum: bad_request

message*

Type: string

Error description

Example: Incorrect request body

404 Not Found

Claim not found

Body

application/json
{
    "code": "not_found",
    "message": "Claim not found"
}

Name

Description

code*

Type: string

Error code

Example: not_found

Enum: not_found

message*

Type: string

Error description

Example: Claim not found

409 Conflict

Attempting to cancel the invalid claim version

Body

application/json
{
    "code": "inappropriate_status",
    "message": "Invalid action regarding the claim"
}

Name

Description

code*

Type: string

Error code

Example: inappropriate_status

Enum: inappropriate_status, free_cancel_is_unavailable, state_mismatch

message*

Type: string

Error description

Example: Invalid action regarding the claim