Create a new user
curl --request POST \
--url https://app.sandbox.rio.trade/api/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"country": "MX",
"email": "john.doe@example.com",
"phoneNumber": "+526589562354",
"userType": "individual",
"address": {
"street1": "123 Main St",
"city": "Mexico City",
"state": "CDMX",
"postalCode": "12345",
"country": "MX",
"street2": "Apt 4B"
},
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"additionalInformation": {},
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
'import requests
url = "https://app.sandbox.rio.trade/api/users"
payload = {
"country": "MX",
"email": "john.doe@example.com",
"phoneNumber": "+526589562354",
"userType": "individual",
"address": {
"street1": "123 Main St",
"city": "Mexico City",
"state": "CDMX",
"postalCode": "12345",
"country": "MX",
"street2": "Apt 4B"
},
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"additionalInformation": {},
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
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({
country: 'MX',
email: 'john.doe@example.com',
phoneNumber: '+526589562354',
userType: 'individual',
address: {
street1: '123 Main St',
city: 'Mexico City',
state: 'CDMX',
postalCode: '12345',
country: 'MX',
street2: 'Apt 4B'
},
businessName: 'My Business Inc.',
firstName: 'John',
middleName: 'Michael',
lastName: 'Doe',
secondLastName: 'Smith',
additionalInformation: {},
brokerId: '655f4084b96e4fb76f5a0e6e'
})
};
fetch('https://app.sandbox.rio.trade/api/users', 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/users",
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([
'country' => 'MX',
'email' => 'john.doe@example.com',
'phoneNumber' => '+526589562354',
'userType' => 'individual',
'address' => [
'street1' => '123 Main St',
'city' => 'Mexico City',
'state' => 'CDMX',
'postalCode' => '12345',
'country' => 'MX',
'street2' => 'Apt 4B'
],
'businessName' => 'My Business Inc.',
'firstName' => 'John',
'middleName' => 'Michael',
'lastName' => 'Doe',
'secondLastName' => 'Smith',
'additionalInformation' => [
],
'brokerId' => '655f4084b96e4fb76f5a0e6e'
]),
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/users"
payload := strings.NewReader("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+526589562354\",\n \"userType\": \"individual\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"Mexico City\",\n \"state\": \"CDMX\",\n \"postalCode\": \"12345\",\n \"country\": \"MX\",\n \"street2\": \"Apt 4B\"\n },\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"additionalInformation\": {},\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\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/users")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+526589562354\",\n \"userType\": \"individual\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"Mexico City\",\n \"state\": \"CDMX\",\n \"postalCode\": \"12345\",\n \"country\": \"MX\",\n \"street2\": \"Apt 4B\"\n },\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"additionalInformation\": {},\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandbox.rio.trade/api/users")
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 \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+526589562354\",\n \"userType\": \"individual\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"Mexico City\",\n \"state\": \"CDMX\",\n \"postalCode\": \"12345\",\n \"country\": \"MX\",\n \"street2\": \"Apt 4B\"\n },\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"additionalInformation\": {},\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "66562bc04fe8bf83c577c178"
}{
"errors": [
{
"code": 19,
"message": "Not authorized"
}
]
}{
"errors": [
{
"code": 1,
"message": "User not found"
}
]
}Users API
Create a new user
POST
/
api
/
users
Create a new user
curl --request POST \
--url https://app.sandbox.rio.trade/api/users \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"country": "MX",
"email": "john.doe@example.com",
"phoneNumber": "+526589562354",
"userType": "individual",
"address": {
"street1": "123 Main St",
"city": "Mexico City",
"state": "CDMX",
"postalCode": "12345",
"country": "MX",
"street2": "Apt 4B"
},
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"additionalInformation": {},
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
'import requests
url = "https://app.sandbox.rio.trade/api/users"
payload = {
"country": "MX",
"email": "john.doe@example.com",
"phoneNumber": "+526589562354",
"userType": "individual",
"address": {
"street1": "123 Main St",
"city": "Mexico City",
"state": "CDMX",
"postalCode": "12345",
"country": "MX",
"street2": "Apt 4B"
},
"businessName": "My Business Inc.",
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"secondLastName": "Smith",
"additionalInformation": {},
"brokerId": "655f4084b96e4fb76f5a0e6e"
}
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({
country: 'MX',
email: 'john.doe@example.com',
phoneNumber: '+526589562354',
userType: 'individual',
address: {
street1: '123 Main St',
city: 'Mexico City',
state: 'CDMX',
postalCode: '12345',
country: 'MX',
street2: 'Apt 4B'
},
businessName: 'My Business Inc.',
firstName: 'John',
middleName: 'Michael',
lastName: 'Doe',
secondLastName: 'Smith',
additionalInformation: {},
brokerId: '655f4084b96e4fb76f5a0e6e'
})
};
fetch('https://app.sandbox.rio.trade/api/users', 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/users",
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([
'country' => 'MX',
'email' => 'john.doe@example.com',
'phoneNumber' => '+526589562354',
'userType' => 'individual',
'address' => [
'street1' => '123 Main St',
'city' => 'Mexico City',
'state' => 'CDMX',
'postalCode' => '12345',
'country' => 'MX',
'street2' => 'Apt 4B'
],
'businessName' => 'My Business Inc.',
'firstName' => 'John',
'middleName' => 'Michael',
'lastName' => 'Doe',
'secondLastName' => 'Smith',
'additionalInformation' => [
],
'brokerId' => '655f4084b96e4fb76f5a0e6e'
]),
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/users"
payload := strings.NewReader("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+526589562354\",\n \"userType\": \"individual\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"Mexico City\",\n \"state\": \"CDMX\",\n \"postalCode\": \"12345\",\n \"country\": \"MX\",\n \"street2\": \"Apt 4B\"\n },\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"additionalInformation\": {},\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\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/users")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+526589562354\",\n \"userType\": \"individual\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"Mexico City\",\n \"state\": \"CDMX\",\n \"postalCode\": \"12345\",\n \"country\": \"MX\",\n \"street2\": \"Apt 4B\"\n },\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"additionalInformation\": {},\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sandbox.rio.trade/api/users")
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 \"country\": \"MX\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+526589562354\",\n \"userType\": \"individual\",\n \"address\": {\n \"street1\": \"123 Main St\",\n \"city\": \"Mexico City\",\n \"state\": \"CDMX\",\n \"postalCode\": \"12345\",\n \"country\": \"MX\",\n \"street2\": \"Apt 4B\"\n },\n \"businessName\": \"My Business Inc.\",\n \"firstName\": \"John\",\n \"middleName\": \"Michael\",\n \"lastName\": \"Doe\",\n \"secondLastName\": \"Smith\",\n \"additionalInformation\": {},\n \"brokerId\": \"655f4084b96e4fb76f5a0e6e\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "66562bc04fe8bf83c577c178"
}{
"errors": [
{
"code": 19,
"message": "Not authorized"
}
]
}{
"errors": [
{
"code": 1,
"message": "User not found"
}
]
}Authorizations
Body
application/json
Country
Available options:
MX, PE, CO, US Example:
"MX"
User's email address.
Example:
"john.doe@example.com"
User's phone number.
Example:
"+526589562354"
Type of user.
Available options:
business, individual Example:
"individual"
Show child attributes
Show child attributes
Business name (required for business users).
Example:
"My Business Inc."
First name (required for individual users only).
Example:
"John"
Middle name (for individual users only).
Example:
"Michael"
Last name (required for individual users).
Example:
"Doe"
Second last name (for individual users only).
Example:
"Smith"
Additional information about the user (optional).
ID of the broker (optional).
Example:
"655f4084b96e4fb76f5a0e6e"
Response
OK
ID of the created user.
Example:
"66562bc04fe8bf83c577c178"
⌘I