Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Counterparts that represent an organization’s vendors or suppliers must have their address information associated with them. Tesouro allows you to create multiple addresses for a counterpart.

Add an address to a counterpart

To add an address to a counterpart, call POST /counterparts/{counterpart_id}/addresses:
curl -X POST 'https://api.sandbox.tesouro.com/v1/counterparts/{counterpart_id}/addresses' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "country": "US",
       "city": "Austin",
       "postal_code": "78701",
       "state": "TX",
       "line1": "123 Congress Ave",
       "line2": "Suite 100"
     }'
The successful response returns the information about the address including the ID:
{
  "country": "US",
  "city": "Austin",
  "postal_code": "78701",
  "state": "TX",
  "line1": "123 Congress Ave",
  "line2": "Suite 100",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "counterpart_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
After creating a new counterpart address, Tesouro stores all available counterpart addresses in array. You can also update the counterpart’s default billing and shipping addresses using the counterpart address ID issued after creating a counterpart. For more information, see Edit a counterpart.
Counterparts can use the same counterpart address for the default_shipping_address_id and default_billing_address_id fields.

List all addresses

To get information about all addresses associated with the specified counterpart, call
GET /counterparts/{counterpart_id}/addresses as shown:
curl -X GET 'https://api.sandbox.tesouro.com/v1/counterparts/{counterpart_id}/addresses' \
     -H 'X-Finops-Version: 2025-06-23' \
     -H 'X-Organization-Id: ORGANIZATION_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
The successful response returns an array of all counterpart addresses.

Retrieve an address

To get information about a specific address associated with the specified counterpart, call
GET /counterparts/{counterpart_id}/addresses/{address_id}.

Edit an address

To edit an existing address of the specified counterpart, call
PATCH /counterparts/{counterpart_id}/addresses/{address_id}.

Delete an address

Only non-default addresses can be deleted. To delete an existing address from the list of addresses associated with the specified counterpart, call
DELETE /counterparts/{counterpart_id}/addresses/{addresses_id}.
The default billing and shipping addresses of a counterpart cannot be deleted. Attempts to delete these addresses will return an error.