Exemplos cURL
Os exemplos usam variáveis de ambiente. Troque os ID_... pelos IDs reais da sua empresa (você os obtém nas listagens).
export TESSELYS_URL="https://erp-api.ideros.api.br/external/v1"
export TESSELYS_API_KEY="tesselys_ak_..."
export TESSELYS_SECRET="..."
Autenticação
curl -s -X POST "$TESSELYS_URL/auth" \
-H "Content-Type: application/json" \
-H "x-api-key: $TESSELYS_API_KEY" \
-d "{\"secret\": \"$TESSELYS_SECRET\"}"
Guardando os tokens (requer jq):
RESP=$(curl -s -X POST "$TESSELYS_URL/auth" \
-H "Content-Type: application/json" \
-H "x-api-key: $TESSELYS_API_KEY" \
-d "{\"secret\": \"$TESSELYS_SECRET\"}")
export ACCESS_TOKEN=$(echo "$RESP" | jq -r .accessToken)
export COMPANY_TOKEN=$(echo "$RESP" | jq -r .companyToken)
Quando o accessToken vencer (401) ou a sessão da empresa vencer (403 com COMPANY_SESSION_EXPIRED), rode o mesmo comando de novo.
Pessoas
Listar, filtrando por código externo
curl -G "$TESSELYS_URL/persons" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
--data-urlencode "page=1" \
--data-urlencode "limit=25" \
--data-urlencode 'relations={"where":{"externalCode":"ERP-000123"}}'
Buscar por ID
curl "$TESSELYS_URL/persons/ID_DA_PESSOA" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN"
Criar pessoa jurídica
curl -X POST "$TESSELYS_URL/persons" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"personType": "COMPANY",
"name": "Tech Solutions Tecnologia Ltda",
"socialName": "Tech Solutions",
"documentNumber": "12345678000195",
"genre": "INDEFINITE",
"classifications": ["CUSTOMER"],
"externalCode": "ERP-000123"
}'
Criar pessoa física
curl -X POST "$TESSELYS_URL/persons" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"personType": "INDIVIDUAL",
"name": "Maria Oliveira",
"socialName": "Maria",
"documentNumber": "12345678909",
"genre": "FEMALE",
"classifications": ["CUSTOMER"]
}'
Acrescentar um e-mail
curl -X POST "$TESSELYS_URL/person-emails" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "personId": "ID_DA_PESSOA", "email": "financeiro@techsolutions.com.br", "isMain": true }'
Atualizar
curl -X PUT "$TESSELYS_URL/persons/ID_DA_PESSOA" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "tags": ["vip"] }'
Negócios
Listar os ganhos, do mais recente para o mais antigo
curl -G "$TESSELYS_URL/deals" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
--data-urlencode 'relations={"where":{"status":"WINNER"},"orderBy":{"updatedAt":"desc"}}'
Criar
curl -X POST "$TESSELYS_URL/deals" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Licença anual — Tech Solutions",
"dealType": "COMMERCIAL",
"responsibleUserId": "ID_DO_USUARIO",
"customerId": "ID_DA_PESSOA",
"isExternallyVisible": false,
"isRenewal": false
}'
Lançamentos financeiros
Listar as receitas que vencem em novembro
curl -G "$TESSELYS_URL/financial-entries" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
--data-urlencode "limit=100" \
--data-urlencode 'relations={"where":{"typeCategory":"REVENUE","originalDueDate":{"gte":"2026-11-01","lte":"2026-11-30"}},"orderBy":{"originalDueDate":"asc"}}'
Criar uma conta a receber
curl -X POST "$TESSELYS_URL/financial-entries" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"personId": "ID_DA_PESSOA",
"typeCategory": "REVENUE",
"financialCategoryId": "ID_DA_CATEGORIA",
"bankAccountId": "ID_DA_CONTA",
"originalAmount": 1500,
"originalDueDate": "2026-12-10",
"dueDate": "2026-12-10",
"totalInstallments": 1,
"paymentMethod": "PIX",
"entrySource": "DETACHED",
"isExternallyVisible": false
}'
Chamados
curl -X POST "$TESSELYS_URL/tickets" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"requestedByType": "CUSTOMER",
"title": "Erro ao acessar relatório",
"description": "Ao abrir o relatório financeiro aparece uma mensagem de erro.",
"category": "INCIDENT",
"priority": "HIGH"
}'
Contabilidade
Balancete do mês
curl -G "$TESSELYS_URL/accounting-reports/trial-balance" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
--data-urlencode "startDate=2026-10-01" \
--data-urlencode "endDate=2026-10-31"
Balanço numa data
curl -G "$TESSELYS_URL/accounting-reports/balance-sheet" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "x-company-token: $COMPANY_TOKEN" \
--data-urlencode "referenceDate=2026-10-31"
Dicas
curl -Gcom--data-urlencodecodifica o JSON derelationspara você.- Acrescente
-ipara ver os cabeçalhos da resposta (X-RateLimit-Remaining,X-Request-ID). - Na busca por ID, uma resposta
{}significa que o registro não existe ou é de outra empresa.
Ainda com dúvida?
A nossa equipe ajuda você a configurar e usar esse recurso.