contracts_request_cancel
Sends a cancellation request for an active escrow contract, offering the counterparty to close the deal and return the payment and both pledges to their owners.
This call is made by side A (normally the buyer). It broadcasts a transaction carrying a cancellation template that side B may accept with contracts_accept_cancel within the given period. The contract must be in state 2 (contract accepted) or state 5 (cancel proposal sent) — calling it again from state 5 replaces the pending request with a fresh one. Cancellation is not unilateral: until side B accepts, the contract stays active and side A can still call contracts_release.
Request
{
"jsonrpc": "2.0",
"id": 0,
"method": "contracts_request_cancel",
"params": {
"contract_id": "b6f2c3d18e47a05b9c2d4e6f81a30b57cd94e2f16a8b0c37d5e19f4a2b6c08d3",
"expiration_period": 86400,
"fee": 10000000000
}
}
Request parameters
- contract_id - string; hex-encoded identifier of the contract to be cancelled, as reported by
contracts_get_all. - expiration_period - unsigned int; number of seconds, counted from the moment the request is sent, during which side B may accept the cancellation. It determines the contract's
cancel_expiration_time; after it passes, the cancellation template can no longer be used and the contract remains active. - fee - unsigned int; fee paid by side A for the cancellation request transaction, in atomic units (1 coin = 10^12 atomic units). It is spent from this wallet's ordinary balance, not from the escrowed coins.
Response
{
"id": 0,
"jsonrpc": "2.0",
"result": {}
}
Response information
The result object is empty. A successful call means the cancellation request transaction was built and broadcast; failures are reported as a JSON-RPC error. Once confirmed, the contract shows state 5 (cancel proposal sent) and a non-zero cancel_expiration_time in contracts_get_all.