Find or create Counterparty
curl --request POST \
--url https://api.sandbox.trio.com.br/banking/counterparties \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Random",
"tax_number": "12345678910"
}
'import requests
url = "https://api.sandbox.trio.com.br/banking/counterparties"
payload = {
"name": "Random",
"tax_number": "12345678910"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Random', tax_number: '12345678910'})
};
fetch('https://api.sandbox.trio.com.br/banking/counterparties', 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://api.sandbox.trio.com.br/banking/counterparties",
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([
'name' => 'Random',
'tax_number' => '12345678910'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://api.sandbox.trio.com.br/banking/counterparties"
payload := strings.NewReader("{\n \"name\": \"Random\",\n \"tax_number\": \"12345678910\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.sandbox.trio.com.br/banking/counterparties")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Random\",\n \"tax_number\": \"12345678910\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/counterparties")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Random\",\n \"tax_number\": \"12345678910\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "018df099-093e-cfd1-4500-4c9392eb5d8a",
"inserted_at": "2026-07-02T19:00:14.821966Z",
"name": "participant_1",
"tax_number": "12345678910",
"updated_at": "2026-07-02T19:00:14.821974Z"
}
}{
"error": {
"error_code": "UNAUTHORIZED",
"error_message": "Invalid credentials"
}
}{
"error": {
"error_code": "INTEGRATION_ERROR",
"error_message": "An unexpected issue occurred"
}
}Counterparties
Create Counterparty
Create a new counterparty
POST
/
banking
/
counterparties
Find or create Counterparty
curl --request POST \
--url https://api.sandbox.trio.com.br/banking/counterparties \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Random",
"tax_number": "12345678910"
}
'import requests
url = "https://api.sandbox.trio.com.br/banking/counterparties"
payload = {
"name": "Random",
"tax_number": "12345678910"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Random', tax_number: '12345678910'})
};
fetch('https://api.sandbox.trio.com.br/banking/counterparties', 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://api.sandbox.trio.com.br/banking/counterparties",
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([
'name' => 'Random',
'tax_number' => '12345678910'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://api.sandbox.trio.com.br/banking/counterparties"
payload := strings.NewReader("{\n \"name\": \"Random\",\n \"tax_number\": \"12345678910\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.sandbox.trio.com.br/banking/counterparties")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Random\",\n \"tax_number\": \"12345678910\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/counterparties")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Random\",\n \"tax_number\": \"12345678910\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "018df099-093e-cfd1-4500-4c9392eb5d8a",
"inserted_at": "2026-07-02T19:00:14.821966Z",
"name": "participant_1",
"tax_number": "12345678910",
"updated_at": "2026-07-02T19:00:14.821974Z"
}
}{
"error": {
"error_code": "UNAUTHORIZED",
"error_message": "Invalid credentials"
}
}{
"error": {
"error_code": "INTEGRATION_ERROR",
"error_message": "An unexpected issue occurred"
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
The create counterparty attributes
Response
Counterparty
Body response of the counterparty
Body params counterparty data
Show child attributes
Show child attributes
Example:
{
"id": "018df099-093e-cfd1-4500-4c9392eb5d8a",
"inserted_at": "2026-07-02T19:00:14.821966Z",
"name": "participant_1",
"tax_number": "05964110000197",
"updated_at": "2026-07-02T19:00:14.821974Z"
}
⌘I

