Skip to main content
The first steps for integrating with Tesouro are to:
  1. Activate your developer account
  2. Receive your API access key credentials
  3. Create and authenticate your first JSON Web Token (JWT) to Tesouro.
When to UseIf you are starting to integrate with Tesouro

Access your organization’s API access key credentials

Your organization’s API access key and secret are created by Tesouro and shared with you. To receive access:
  1. Have your designated team lead submit your access request to support@tesouro.com. The request should include your:
    • First name
    • Last name
    • Job role
    • Company name
    • Email
    • Mobile number or a secondary email for purposes of verification
  2. Tesouro will email you an API access key and secret that will require passwordless authentication via email address.

Create and authenticate your JWT

Create a JWT, then add it to the header of your call to query the Tesouro Sandbox environment
Authentication Request
POST /openid/connect/token
curl --location 'https://api.sandbox.tesouro.com/openid/connect/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'client_id=CLIENT_ID' \
  --data-urlencode 'client_secret=CLIENT_SECRET'
Authentication Response
{
  "access_token": "efJhbGcifiJv4zI1NiIsInR5cCI6IkpXVCJ9.eyJ0X2FwaWtleSI6Iml1bm5p9EtYTk1IYjNudGJIZTRZYVVER9JiTT0iLCJ0X29yZ2lkIjoiZWRhMGU5MmItMmRkNS00ZWE2LWI0YjgtZTIyYmRiODVjYjVjIiwidF9wcmVzaWQiOiIwOTUyZmEwMi1hOWUzLTRjMjgtYjEyOC00MTIxODY5MzEwZTQiLCJzY29wZXMiOiJ7fSIsIm5iZiI6MTY4OTk2MjQzNywiZXhwIjoxNjg5OTY0MjM3LCJpYXQiOjE2ODk5NjI0MzcsImlzcyI6Imh0dHBzOi8vYXV0aC50ZXNvdXJvLmNvbSIsImF1ZCI6Imh0dHBzOi8vdGVzb3Vyby5jb20ifQ.M7o-I9Rdb3fjOXsoAmR5NSSbF_Vs2WdHWpenstDLn7M",
  "token_type": "Bearer",
  "expires_in": 3600
}
Example Request
POST /graphql
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ADD_TOKEN_HERE" \
  -d '{
      "query": "query MyOrganization {
        organization {
          id
          businessName
        }
      }",
      "variables": {}
    }' \
  https://api.sandbox.tesouro.com/graphql
Example Response
{
  "data": {
    "organization": {
      "id": "66f41f51-cc83-440b-948f-afe3d4c57406",
      "businessName": "Tesouro Docs Playground (Sandbox)"
    }
  }
}
For production, use https://api.tesouro.com instead of https://api.sandbox.tesouro.com with production credentials

Additional resources

Learn more about JWTs