curl --request POST \
--url https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data @- <<EOF
{
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"first_name": "Mary",
"last_name": "O'Brien",
"email": "contact@example.org",
"phone": "5551235476",
"title": "Ms."
}
EOFimport requests
url = "https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts"
payload = {
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"first_name": "Mary",
"last_name": "O'Brien",
"email": "contact@example.org",
"phone": "5551235476",
"title": "Ms."
}
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: {
city: 'New York',
country: 'US',
line1: '456 Fifth Avenue',
postal_code: '10001',
line2: '<string>',
state: '<string>'
},
first_name: 'Mary',
last_name: 'O\'Brien',
email: 'contact@example.org',
phone: '5551235476',
title: 'Ms.'
})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts', 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.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts",
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([
'address' => [
'city' => 'New York',
'country' => 'US',
'line1' => '456 Fifth Avenue',
'postal_code' => '10001',
'line2' => '<string>',
'state' => '<string>'
],
'first_name' => 'Mary',
'last_name' => 'O\'Brien',
'email' => 'contact@example.org',
'phone' => '5551235476',
'title' => 'Ms.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-organization-id>"
],
]);
$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.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts"
payload := strings.NewReader("{\n \"address\": {\n \"city\": \"New York\",\n \"country\": \"US\",\n \"line1\": \"456 Fifth Avenue\",\n \"postal_code\": \"10001\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"first_name\": \"Mary\",\n \"last_name\": \"O'Brien\",\n \"email\": \"contact@example.org\",\n \"phone\": \"5551235476\",\n \"title\": \"Ms.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"city\": \"New York\",\n \"country\": \"US\",\n \"line1\": \"456 Fifth Avenue\",\n \"postal_code\": \"10001\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"first_name\": \"Mary\",\n \"last_name\": \"O'Brien\",\n \"email\": \"contact@example.org\",\n \"phone\": \"5551235476\",\n \"title\": \"Ms.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": {\n \"city\": \"New York\",\n \"country\": \"US\",\n \"line1\": \"456 Fifth Avenue\",\n \"postal_code\": \"10001\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"first_name\": \"Mary\",\n \"last_name\": \"O'Brien\",\n \"email\": \"contact@example.org\",\n \"phone\": \"5551235476\",\n \"title\": \"Ms.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"counterpart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "Mary",
"is_default": true,
"last_name": "O'Brien",
"email": "contact@example.org",
"phone": "5551235476",
"title": "Ms."
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": {
"message": "<string>"
}
}Create a counterpart contact
curl --request POST \
--url https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-finops-version: <x-finops-version>' \
--header 'x-organization-id: <x-organization-id>' \
--data @- <<EOF
{
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"first_name": "Mary",
"last_name": "O'Brien",
"email": "contact@example.org",
"phone": "5551235476",
"title": "Ms."
}
EOFimport requests
url = "https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts"
payload = {
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"first_name": "Mary",
"last_name": "O'Brien",
"email": "contact@example.org",
"phone": "5551235476",
"title": "Ms."
}
headers = {
"x-finops-version": "<x-finops-version>",
"x-organization-id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-finops-version': '<x-finops-version>',
'x-organization-id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: {
city: 'New York',
country: 'US',
line1: '456 Fifth Avenue',
postal_code: '10001',
line2: '<string>',
state: '<string>'
},
first_name: 'Mary',
last_name: 'O\'Brien',
email: 'contact@example.org',
phone: '5551235476',
title: 'Ms.'
})
};
fetch('https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts', 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.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts",
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([
'address' => [
'city' => 'New York',
'country' => 'US',
'line1' => '456 Fifth Avenue',
'postal_code' => '10001',
'line2' => '<string>',
'state' => '<string>'
],
'first_name' => 'Mary',
'last_name' => 'O\'Brien',
'email' => 'contact@example.org',
'phone' => '5551235476',
'title' => 'Ms.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-finops-version: <x-finops-version>",
"x-organization-id: <x-organization-id>"
],
]);
$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.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts"
payload := strings.NewReader("{\n \"address\": {\n \"city\": \"New York\",\n \"country\": \"US\",\n \"line1\": \"456 Fifth Avenue\",\n \"postal_code\": \"10001\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"first_name\": \"Mary\",\n \"last_name\": \"O'Brien\",\n \"email\": \"contact@example.org\",\n \"phone\": \"5551235476\",\n \"title\": \"Ms.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-finops-version", "<x-finops-version>")
req.Header.Add("x-organization-id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts")
.header("x-finops-version", "<x-finops-version>")
.header("x-organization-id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"city\": \"New York\",\n \"country\": \"US\",\n \"line1\": \"456 Fifth Avenue\",\n \"postal_code\": \"10001\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"first_name\": \"Mary\",\n \"last_name\": \"O'Brien\",\n \"email\": \"contact@example.org\",\n \"phone\": \"5551235476\",\n \"title\": \"Ms.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.tesouro.com/finops/v1/counterparts/{counterpart_id}/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-finops-version"] = '<x-finops-version>'
request["x-organization-id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": {\n \"city\": \"New York\",\n \"country\": \"US\",\n \"line1\": \"456 Fifth Avenue\",\n \"postal_code\": \"10001\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"first_name\": \"Mary\",\n \"last_name\": \"O'Brien\",\n \"email\": \"contact@example.org\",\n \"phone\": \"5551235476\",\n \"title\": \"Ms.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address": {
"city": "New York",
"country": "US",
"line1": "456 Fifth Avenue",
"postal_code": "10001",
"line2": "<string>",
"state": "<string>"
},
"counterpart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "Mary",
"is_default": true,
"last_name": "O'Brien",
"email": "contact@example.org",
"phone": "5551235476",
"title": "Ms."
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"error": {
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The ID of the entity that owns the requested resource.
"9d2b4c8f-2087-4738-ba91-7359683c49a4"
Path Parameters
Body
The contact person for an organization.
The address of a contact person.
Show child attributes
Show child attributes
The first name of a contact person.
100"Mary"
The last name of a contact person.
100"O'Brien"
The email address of a contact person.
"contact@example.org"
The phone number of a contact person
100"5551235476"
The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
100"Ms."
Response
Successful Response
The contact person for an organization.
The address of a contact person.
Show child attributes
Show child attributes
The first name of a contact person.
100"Mary"
The last name of a contact person.
100"O'Brien"
The email address of a contact person.
"contact@example.org"
The phone number of a contact person
100"5551235476"
The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
100"Ms."
Was this page helpful?