curl --request POST \
--url https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>'const options = {
method: 'POST',
headers: {'x-idempotency-key': '<x-idempotency-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations"
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-idempotency-key", "<x-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))
}{
"type": "https://docs.dakota.xyz/api-reference/errors#invalid-request",
"title": "Invalid request or transaction cannot be cancelled.",
"status": 400,
"detail": "Invalid request or transaction cannot be cancelled.",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#authentication-error",
"title": "Unauthorized",
"status": 401,
"detail": "Unauthorized",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Forbidden",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Not found",
"status": 404,
"detail": "Not found",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#internal-error",
"title": "Unexpected error",
"status": 500,
"detail": "Unexpected error",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}Cancel a transaction
Create a cancellation event for a cancellable transaction.
curl --request POST \
--url https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations \
--header 'x-api-key: <api-key>' \
--header 'x-idempotency-key: <x-idempotency-key>'const options = {
method: 'POST',
headers: {'x-idempotency-key': '<x-idempotency-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations"
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.platform.dakota.xyz/transactions/{transaction_id}/cancellations"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-idempotency-key", "<x-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))
}{
"type": "https://docs.dakota.xyz/api-reference/errors#invalid-request",
"title": "Invalid request or transaction cannot be cancelled.",
"status": 400,
"detail": "Invalid request or transaction cannot be cancelled.",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#authentication-error",
"title": "Unauthorized",
"status": 401,
"detail": "Unauthorized",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Forbidden",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#not-found",
"title": "Not found",
"status": 404,
"detail": "Not found",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}{
"type": "https://docs.dakota.xyz/api-reference/errors#internal-error",
"title": "Unexpected error",
"status": 500,
"detail": "Unexpected error",
"instance": "https://api.platform.dakota.xyz/transactions/example-id/cancellations",
"request_id": "req_01hzy6y7v8w9x0y1z2a3b4c5d6"
}Authorizations
Headers
Unique key to ensure request idempotency. If the same key is used within a certain time window, the original response will be returned instead of executing the request again.
Sandbox-only. Applies a preset failure or behavior mode for the request, selecting a coherent combination of error step, status, and message. The full set of scenarios is also exposed dynamically via GET /sandbox/scenarios along with descriptions and per-rail applicability.
Effective only on https://api.platform.sandbox.dakota.xyz. Ignored in production.
happy_path, delayed_settlement, insufficient_funds, compliance_block, invalid_account, provider_maintenance, network_congestion, kyb_manual_review, kyb_rejected, kyb_expired, network_timeout, intermittent_errors, account_frozen, document_expired, invalid_swift "insufficient_funds"
Sandbox-only. Names the pipeline step at which the injected error fires. Pair with X-Sandbox-Error-Status and (optionally) X-Sandbox-Error-Message to drive a deterministic failure mode at a known point in the request lifecycle. Values longer than 100 characters are ignored.
Effective only on https://api.platform.sandbox.dakota.xyz. Ignored in production.
transaction_processing, compliance_check, account_validation, provider_call, kyb_submission, kyb_approval, network_call 100"provider_call"
Sandbox-only. Sets the HTTP status code returned when the sandbox injects an error at the configured step (see X-Sandbox-Error-Step). Must be a valid HTTP status code in the range 100-599; values outside that range are ignored. Status codes >= 400 cause the request to short-circuit immediately with a structured error response.
Effective only on https://api.platform.sandbox.dakota.xyz. Ignored in production.
100 <= x <= 599503
Sandbox-only. Sets the human-readable message field of the injected sandbox error response. Truncated values longer than 500 characters are ignored.
Effective only on https://api.platform.sandbox.dakota.xyz. Ignored in production.
500"Provider temporarily unavailable for maintenance."
Path Parameters
Unique identifier of the transaction. KSUID is a 27-character globally unique ID that combines a timestamp with a random component. Used for all entity identifiers in the Dakota platform.
27^[0-9A-Za-z]{27}$"1NFHrqBHb3cTfLVkFSGmHZqdDPi"
Response
Transaction cancelled successfully.
Was this page helpful?

