Cancel order
curl --request POST \
--url https://app.sandbox.rio.trade/api/orders/{id}/cancel \
--header 'x-api-key: <api-key>'import requests
url = "https://app.sandbox.rio.trade/api/orders/{id}/cancel"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.sandbox.rio.trade/api/orders/{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://app.sandbox.rio.trade/api/orders/{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 => [
"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://app.sandbox.rio.trade/api/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
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://app.sandbox.rio.trade/api/orders/{id}/cancel")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandbox.rio.trade/api/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "6660bdefd6c964829d63fcb8",
"quoteId": "6660bdefd6c964829d63fcb7",
"userId": "66290ac8bd3903485989f82e",
"clientReferenceId": "my-reference-1234",
"status": "awaitingPayment",
"flow": "fiatToCrypto",
"origin": {
"asset": "MXN",
"amount": 1000,
"country": "MX"
},
"destination": {
"asset": "USDC",
"amount": 54.76,
"country": "MX"
},
"fixedLeg": "origin",
"pricingDetails": {
"fees": [
{
"type": "processing",
"amount": 20,
"asset": "MXN",
"tax": 3.2
}
]
},
"settlement": {
"mode": "deliverable",
"timing": "default",
"valueDateOffset": 1,
"effectiveValueDateOffset": 1,
"valueDate": "2026-10-12T18:00:00.000Z",
"payment": {
"asset": "MXN",
"amount": 1000,
"rail": "bankTransfer",
"network": "polygon",
"dueDate": "2026-10-12T18:00:00.000Z",
"status": "awaitingFunds",
"amountSettled": 0,
"bankAccountId": "66733d33222710ab2785dc62",
"addressId": "66733d33222710ab2785dc62",
"instructions": {
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"blockchainMemo": "<string>",
"bankName": "STP",
"companyName": "Rio Transfer S.A.P.I. de C.V.",
"companyAddress": "<string>",
"bankAddress": "<string>",
"accountHolderName": "John Doe",
"accountNumber": "99998888",
"routingNumber": "<string>",
"reference": "9f5676",
"CLABE": "646180000000000001",
"CCI": "<string>",
"RUC": "<string>",
"RFC": "RBL123456789",
"NIT": "<string>",
"USBankTransferMethod": "wire"
},
"transactions": [
{
"amount": 1000,
"createdAt": "2026-10-12T18:00:00.000Z",
"blockchainTxId": "0x66ec2a9d4e1f6b7c8d9e0f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e",
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"SPEITrackingNumber": "TRK20261012001",
"SPIDTrackingNumber": "<string>",
"CEPLink": "https://www.banxico.org.mx/cep/",
"reference": "9f5676",
"accountHolderName": "John Doe",
"accountNumber": "<string>",
"CCI": "<string>",
"CLABE": "014027000000000008"
}
],
"bulkBankPaymentId": "<string>",
"bulkCryptoPaymentId": "<string>"
},
"payout": {
"asset": "USDC",
"amount": 54.76,
"rail": "blockchain",
"network": "polygon",
"dueDate": "2026-10-12T18:00:00.000Z",
"status": "awaitingFunds",
"amountSettled": 0,
"bankAccountId": "66733d33222710ab2785dc62",
"addressId": "66733d33222710ab2785dc62",
"instructions": {
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"blockchainMemo": "<string>",
"bankName": "STP",
"companyName": "Rio Transfer S.A.P.I. de C.V.",
"companyAddress": "<string>",
"bankAddress": "<string>",
"accountHolderName": "John Doe",
"accountNumber": "99998888",
"routingNumber": "<string>",
"reference": "9f5676",
"CLABE": "646180000000000001",
"CCI": "<string>",
"RUC": "<string>",
"RFC": "RBL123456789",
"NIT": "<string>",
"USBankTransferMethod": "wire"
},
"transactions": [
{
"amount": 1000,
"createdAt": "2026-10-12T18:00:00.000Z",
"blockchainTxId": "0x66ec2a9d4e1f6b7c8d9e0f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e",
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"SPEITrackingNumber": "TRK20261012001",
"SPIDTrackingNumber": "<string>",
"CEPLink": "https://www.banxico.org.mx/cep/",
"reference": "9f5676",
"accountHolderName": "John Doe",
"accountNumber": "<string>",
"CCI": "<string>",
"CLABE": "014027000000000008"
}
],
"bulkBankPaymentId": "<string>",
"bulkCryptoPaymentId": "<string>"
}
},
"marketPrice": 0.056,
"netPrice": 0.05476,
"type": "market",
"limitNetPrice": 0.0555,
"timeInForceStartsAt": "2026-10-12T18:00:00.000Z",
"timeInForceEndsAt": "2026-10-12T18:00:00.000Z",
"attributes": [
"fixedPrice"
],
"notes": "Note",
"payoutTransferLimit": 475000,
"paymentReceivedAt": "2026-10-12T18:00:00.000Z",
"expiredQuotes": [],
"parentOrderId": "<string>",
"invoice": {
"PDFLink": "<string>",
"XMLLink": "<string>"
},
"informationalFees": {
"serviceFeeFiat": 0,
"serviceFeeFiatTax": 0
},
"createdAt": "2026-10-12T18:00:00.000Z"
}{
"errors": [
{
"code": 19,
"message": "Not authorized"
}
]
}Orders API
Cancel order
POST
/
api
/
orders
/
{id}
/
cancel
Cancel order
curl --request POST \
--url https://app.sandbox.rio.trade/api/orders/{id}/cancel \
--header 'x-api-key: <api-key>'import requests
url = "https://app.sandbox.rio.trade/api/orders/{id}/cancel"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.sandbox.rio.trade/api/orders/{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://app.sandbox.rio.trade/api/orders/{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 => [
"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://app.sandbox.rio.trade/api/orders/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
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://app.sandbox.rio.trade/api/orders/{id}/cancel")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandbox.rio.trade/api/orders/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "6660bdefd6c964829d63fcb8",
"quoteId": "6660bdefd6c964829d63fcb7",
"userId": "66290ac8bd3903485989f82e",
"clientReferenceId": "my-reference-1234",
"status": "awaitingPayment",
"flow": "fiatToCrypto",
"origin": {
"asset": "MXN",
"amount": 1000,
"country": "MX"
},
"destination": {
"asset": "USDC",
"amount": 54.76,
"country": "MX"
},
"fixedLeg": "origin",
"pricingDetails": {
"fees": [
{
"type": "processing",
"amount": 20,
"asset": "MXN",
"tax": 3.2
}
]
},
"settlement": {
"mode": "deliverable",
"timing": "default",
"valueDateOffset": 1,
"effectiveValueDateOffset": 1,
"valueDate": "2026-10-12T18:00:00.000Z",
"payment": {
"asset": "MXN",
"amount": 1000,
"rail": "bankTransfer",
"network": "polygon",
"dueDate": "2026-10-12T18:00:00.000Z",
"status": "awaitingFunds",
"amountSettled": 0,
"bankAccountId": "66733d33222710ab2785dc62",
"addressId": "66733d33222710ab2785dc62",
"instructions": {
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"blockchainMemo": "<string>",
"bankName": "STP",
"companyName": "Rio Transfer S.A.P.I. de C.V.",
"companyAddress": "<string>",
"bankAddress": "<string>",
"accountHolderName": "John Doe",
"accountNumber": "99998888",
"routingNumber": "<string>",
"reference": "9f5676",
"CLABE": "646180000000000001",
"CCI": "<string>",
"RUC": "<string>",
"RFC": "RBL123456789",
"NIT": "<string>",
"USBankTransferMethod": "wire"
},
"transactions": [
{
"amount": 1000,
"createdAt": "2026-10-12T18:00:00.000Z",
"blockchainTxId": "0x66ec2a9d4e1f6b7c8d9e0f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e",
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"SPEITrackingNumber": "TRK20261012001",
"SPIDTrackingNumber": "<string>",
"CEPLink": "https://www.banxico.org.mx/cep/",
"reference": "9f5676",
"accountHolderName": "John Doe",
"accountNumber": "<string>",
"CCI": "<string>",
"CLABE": "014027000000000008"
}
],
"bulkBankPaymentId": "<string>",
"bulkCryptoPaymentId": "<string>"
},
"payout": {
"asset": "USDC",
"amount": 54.76,
"rail": "blockchain",
"network": "polygon",
"dueDate": "2026-10-12T18:00:00.000Z",
"status": "awaitingFunds",
"amountSettled": 0,
"bankAccountId": "66733d33222710ab2785dc62",
"addressId": "66733d33222710ab2785dc62",
"instructions": {
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"blockchainMemo": "<string>",
"bankName": "STP",
"companyName": "Rio Transfer S.A.P.I. de C.V.",
"companyAddress": "<string>",
"bankAddress": "<string>",
"accountHolderName": "John Doe",
"accountNumber": "99998888",
"routingNumber": "<string>",
"reference": "9f5676",
"CLABE": "646180000000000001",
"CCI": "<string>",
"RUC": "<string>",
"RFC": "RBL123456789",
"NIT": "<string>",
"USBankTransferMethod": "wire"
},
"transactions": [
{
"amount": 1000,
"createdAt": "2026-10-12T18:00:00.000Z",
"blockchainTxId": "0x66ec2a9d4e1f6b7c8d9e0f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e",
"blockchainAddress": "0xAf56edF88c429F1D6858f9E47731FF53F6d34D0C",
"SPEITrackingNumber": "TRK20261012001",
"SPIDTrackingNumber": "<string>",
"CEPLink": "https://www.banxico.org.mx/cep/",
"reference": "9f5676",
"accountHolderName": "John Doe",
"accountNumber": "<string>",
"CCI": "<string>",
"CLABE": "014027000000000008"
}
],
"bulkBankPaymentId": "<string>",
"bulkCryptoPaymentId": "<string>"
}
},
"marketPrice": 0.056,
"netPrice": 0.05476,
"type": "market",
"limitNetPrice": 0.0555,
"timeInForceStartsAt": "2026-10-12T18:00:00.000Z",
"timeInForceEndsAt": "2026-10-12T18:00:00.000Z",
"attributes": [
"fixedPrice"
],
"notes": "Note",
"payoutTransferLimit": 475000,
"paymentReceivedAt": "2026-10-12T18:00:00.000Z",
"expiredQuotes": [],
"parentOrderId": "<string>",
"invoice": {
"PDFLink": "<string>",
"XMLLink": "<string>"
},
"informationalFees": {
"serviceFeeFiat": 0,
"serviceFeeFiatTax": 0
},
"createdAt": "2026-10-12T18:00:00.000Z"
}{
"errors": [
{
"code": 19,
"message": "Not authorized"
}
]
}Requirements to consume the endpoint.
Create and modify role
The user must have the role to create and modify.
User approved
The user must be approved in at least one country.
Response
OK
Current status. These are the statuses an order moves through on a normal flow. Which ones it sees depends on the flow. Other statuses can appear depending on the circumstances of the order.
Available options:
awaitingTimeInForceToStart, awaitingLimitPriceCondition, timeInForceEnded, created, addressCheckPassed, awaitingPayment, processing, paid, incorrectAmountPaid, sourcingLiquidity, liquiditySourced, filled, complete, depositAddressCreated, awaitingBankPayoutDetails, bankPayoutDetailsAdded, depositConfirmed, awaitingPayout, bankPaymentDetailsAdded, awaitingAsyncPayment, awaitingAsyncPayout, cancelled, expired Example:
"awaitingPayment"