Cancel an order
curl --request POST \
--url https://flash.definitive.fi/v1/orders/{orderId}/cancel \
--header 'Content-Type: application/json' \
--header 'x-definitive-api-key: <api-key>' \
--data '
{
"cancelMessage": "<string>",
"userSignature": "<string>"
}
'import requests
url = "https://flash.definitive.fi/v1/orders/{orderId}/cancel"
payload = {
"cancelMessage": "<string>",
"userSignature": "<string>"
}
headers = {
"x-definitive-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-definitive-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({cancelMessage: '<string>', userSignature: '<string>'})
};
fetch('https://flash.definitive.fi/v1/orders/{orderId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}Trading REST
Cancel an order
Cancel a previously submitted flash order.
Signature required. Construct the canonical UTF-8 cancel message and sign it with the funder wallet:
- Message format:
"Definitive Flash v1 — Cancel Order\nOrder: <orderId>"— identical bytes across EVM and SVM; only the signing primitive differs. - EVM chains — sign with EIP-191
personal_signover the message bytes; pass the 65-byte 0x-prefixed hex signature asuserSignature. - SVM (
solana) — sign with Ed25519 over the message bytes; pass the 64-byte base58 signature asuserSignature. - Echo the exact message text back as
cancelMessage.
Idempotent: cancelling an already-cancelled order returns 200, not 422.
POST
/
orders
/
{orderId}
/
cancel
Cancel an order
curl --request POST \
--url https://flash.definitive.fi/v1/orders/{orderId}/cancel \
--header 'Content-Type: application/json' \
--header 'x-definitive-api-key: <api-key>' \
--data '
{
"cancelMessage": "<string>",
"userSignature": "<string>"
}
'import requests
url = "https://flash.definitive.fi/v1/orders/{orderId}/cancel"
payload = {
"cancelMessage": "<string>",
"userSignature": "<string>"
}
headers = {
"x-definitive-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-definitive-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({cancelMessage: '<string>', userSignature: '<string>'})
};
fetch('https://flash.definitive.fi/v1/orders/{orderId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}Authorizations
Your Definitive API key.
Path Parameters
Flash order ID.
Body
application/json
UTF-8 plaintext the funder wallet signed. Format: "Definitive Flash v1 — Cancel Order\nOrder: ". Same bytes across EVM and SVM.
Minimum string length:
1Funder wallet signature over cancelMessage. Accepts 0x-prefixed hex (EVM convention) or base58 (Solana convention). EVM: 65 bytes from EIP-191 personal_sign. SVM: 64 bytes from Ed25519.
Minimum string length:
1Response
Order cancelled (or already cancelled)
Available options:
true