Skip to main content
POST
/
api
/
orders
/
export
Export orders as CSV
curl --request POST \
  --url https://app.sandbox.rio.trade/api/orders/export \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "email": "user@example.com",
  "id": "b49f4084b96e4fb76f5a496e",
  "userId": "b49f4084b96e4fb76f5a496e",
  "brokerId": "b49f4084b96e4fb76f5a496e",
  "startDate": "2024-01-01T00:00:00.000Z",
  "endDate": "2024-01-31T23:59:59.999Z",
  "fiat": "MXN",
  "crypto": "USDC",
  "status": "completed",
  "country": "Mexico",
  "minOrderSize": 100,
  "maxOrderSize": 10000,
  "orderStatusGroups": [
    "completed",
    "processing"
  ]
}
'
import requests

url = "https://app.sandbox.rio.trade/api/orders/export"

payload = {
    "email": "user@example.com",
    "id": "b49f4084b96e4fb76f5a496e",
    "userId": "b49f4084b96e4fb76f5a496e",
    "brokerId": "b49f4084b96e4fb76f5a496e",
    "startDate": "2024-01-01T00:00:00.000Z",
    "endDate": "2024-01-31T23:59:59.999Z",
    "fiat": "MXN",
    "crypto": "USDC",
    "status": "completed",
    "country": "Mexico",
    "minOrderSize": 100,
    "maxOrderSize": 10000,
    "orderStatusGroups": ["completed", "processing"]
}
headers = {
    "x-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-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    email: 'user@example.com',
    id: 'b49f4084b96e4fb76f5a496e',
    userId: 'b49f4084b96e4fb76f5a496e',
    brokerId: 'b49f4084b96e4fb76f5a496e',
    startDate: '2024-01-01T00:00:00.000Z',
    endDate: '2024-01-31T23:59:59.999Z',
    fiat: 'MXN',
    crypto: 'USDC',
    status: 'completed',
    country: 'Mexico',
    minOrderSize: 100,
    maxOrderSize: 10000,
    orderStatusGroups: ['completed', 'processing']
  })
};

fetch('https://app.sandbox.rio.trade/api/orders/export', 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/export",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'email' => 'user@example.com',
    'id' => 'b49f4084b96e4fb76f5a496e',
    'userId' => 'b49f4084b96e4fb76f5a496e',
    'brokerId' => 'b49f4084b96e4fb76f5a496e',
    'startDate' => '2024-01-01T00:00:00.000Z',
    'endDate' => '2024-01-31T23:59:59.999Z',
    'fiat' => 'MXN',
    'crypto' => 'USDC',
    'status' => 'completed',
    'country' => 'Mexico',
    'minOrderSize' => 100,
    'maxOrderSize' => 10000,
    'orderStatusGroups' => [
        'completed',
        'processing'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.sandbox.rio.trade/api/orders/export"

	payload := strings.NewReader("{\n  \"email\": \"user@example.com\",\n  \"id\": \"b49f4084b96e4fb76f5a496e\",\n  \"userId\": \"b49f4084b96e4fb76f5a496e\",\n  \"brokerId\": \"b49f4084b96e4fb76f5a496e\",\n  \"startDate\": \"2024-01-01T00:00:00.000Z\",\n  \"endDate\": \"2024-01-31T23:59:59.999Z\",\n  \"fiat\": \"MXN\",\n  \"crypto\": \"USDC\",\n  \"status\": \"completed\",\n  \"country\": \"Mexico\",\n  \"minOrderSize\": 100,\n  \"maxOrderSize\": 10000,\n  \"orderStatusGroups\": [\n    \"completed\",\n    \"processing\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	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/export")
  .header("x-api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"user@example.com\",\n  \"id\": \"b49f4084b96e4fb76f5a496e\",\n  \"userId\": \"b49f4084b96e4fb76f5a496e\",\n  \"brokerId\": \"b49f4084b96e4fb76f5a496e\",\n  \"startDate\": \"2024-01-01T00:00:00.000Z\",\n  \"endDate\": \"2024-01-31T23:59:59.999Z\",\n  \"fiat\": \"MXN\",\n  \"crypto\": \"USDC\",\n  \"status\": \"completed\",\n  \"country\": \"Mexico\",\n  \"minOrderSize\": 100,\n  \"maxOrderSize\": 10000,\n  \"orderStatusGroups\": [\n    \"completed\",\n    \"processing\"\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://app.sandbox.rio.trade/api/orders/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"user@example.com\",\n  \"id\": \"b49f4084b96e4fb76f5a496e\",\n  \"userId\": \"b49f4084b96e4fb76f5a496e\",\n  \"brokerId\": \"b49f4084b96e4fb76f5a496e\",\n  \"startDate\": \"2024-01-01T00:00:00.000Z\",\n  \"endDate\": \"2024-01-31T23:59:59.999Z\",\n  \"fiat\": \"MXN\",\n  \"crypto\": \"USDC\",\n  \"status\": \"completed\",\n  \"country\": \"Mexico\",\n  \"minOrderSize\": 100,\n  \"maxOrderSize\": 10000,\n  \"orderStatusGroups\": [\n    \"completed\",\n    \"processing\"\n  ]\n}"

response = http.request(request)
puts response.read_body

Authorizations

x-api-key
string
header
required

Body

application/json
email
string<email>
required

Email address to send the CSV file to

Example:

"user@example.com"

id
string

Order id by which you want to filter

Example:

"b49f4084b96e4fb76f5a496e"

userId
string

User id by which you want to filter

Example:

"b49f4084b96e4fb76f5a496e"

brokerId
string

Broker id by which you want to filter

Example:

"b49f4084b96e4fb76f5a496e"

startDate
string<date-time>

Start date for filtering orders

Example:

"2024-01-01T00:00:00.000Z"

endDate
string<date-time>

End date for filtering orders

Example:

"2024-01-31T23:59:59.999Z"

fiat
string

Fiat currency by which you want to filter

Example:

"MXN"

crypto
string

Crypto currency by which you want to filter

Example:

"USDC"

side
enum<string>

Order side by which you want to filter

Available options:
Buy,
Sell
status
string

Order status by which you want to filter

Example:

"completed"

country
string

Country by which you want to filter

Example:

"Mexico"

minOrderSize
number

Minimum order size to filter by

Required range: x >= 0
Example:

100

maxOrderSize
number

Maximum order size to filter by

Required range: x >= 0
Example:

10000

orderStatusGroups
string[]

Array of order status groups to filter by

Example:
["completed", "processing"]

Response

Export request accepted. CSV will be sent to the provided email.