Cancel a partner transaction safely with idempotent retries
curl --request POST \
--url https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-KEY": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'X-API-KEY': '<api-key>'}
};
fetch('https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Idempotency-Key: <idempotency-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"amount": "161500.00",
"crypto_amount": "100.00",
"crypto_currency": "usdt",
"deposit_address": "TUr4xexampleaddress",
"expires_at": "2026-02-12T12:00:00Z",
"id": "01917f00-7b4c-7f56-8a2b-15998d58c9f3",
"merchant_id": "mrc_001",
"merchant_reference": "order-4551",
"network": "trc20",
"rate": "1615.00",
"status": "cancelled",
"terminal_id": "term_01"
},
"message": "Transaction cancelled",
"success": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "CONFLICT",
"message": "Transaction cannot be cancelled in status completed",
"timestamp": "2026-02-12T12:00:00Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Partner API
Cancel a partner transaction safely with idempotent retries
Cancels a partner transaction when the current state allows cancellation. Reuse the same Idempotency-Key for retries of the same cancellation intent.
POST
/
partner
/
transactions
/
{id}
/
cancel
Cancel a partner transaction safely with idempotent retries
curl --request POST \
--url https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-KEY": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'X-API-KEY': '<api-key>'}
};
fetch('https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Idempotency-Key: <idempotency-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.cashweb.cash/api/v1/partner/transactions/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"amount": "161500.00",
"crypto_amount": "100.00",
"crypto_currency": "usdt",
"deposit_address": "TUr4xexampleaddress",
"expires_at": "2026-02-12T12:00:00Z",
"id": "01917f00-7b4c-7f56-8a2b-15998d58c9f3",
"merchant_id": "mrc_001",
"merchant_reference": "order-4551",
"network": "trc20",
"rate": "1615.00",
"status": "cancelled",
"terminal_id": "term_01"
},
"message": "Transaction cancelled",
"success": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "CONFLICT",
"message": "Transaction cannot be cancelled in status completed",
"timestamp": "2026-02-12T12:00:00Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Headers
Idempotency key for safe retries
Path Parameters
Partner transaction identifier
Response
Transaction cancelled
Standard API response wrapper for all successful responses
⌘I