API Dashboard
Escrow API
Escrow Pay
CryptoExchange API :: Cancelling a transaction
Cancelling a transaction
Use this API to cancel an ongoing escrow transaction.
Cancel a transaction
Cancelling a request is as simple as making a patch request to https://cryptoexchange.com/api/v1/escrow/partner/transaction/id and setting the action field to rejected. You can optionally specify a cancellation reason by populating the reason.
If both the buyer and seller have agreed to the transaction then only the listed partner can cancel. If the transaction has already been completed or cancelled, then the cancel operation will fail.
If the API call is successful, it will return the updated transaction object.
curl "https://cryptoexchange.com/api/v1/escrow/partner/transactions/44165ddd-e469-415f-a7f0-e7f5a5c316e6" \
-X PATCH \
-H "Authorization:Bearer your-api-key" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '
{
"action": "rejected",
"reason": ""
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://cryptoexchange.com/api/v1/escrow/partner/transactions/44165ddd-e469-415f-a7f0-e7f5a5c316e6',
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization:Bearer your-api-key',
'Content-Type: application/json'
),
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => '
{
"action": "rejected",
"reason": ""
}'
));
$output = curl_exec($curl);
echo $output;
curl_close($curl);
Example Response
{
"id": "44165ddd-e469-415f-a7f0-e7f5a5c316e6"
}