curl --request GET \
--url https://api.despezzas.com/v2/business/dre \
--header 'Authorization: Basic <encoded-value>'const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.despezzas.com/v2/business/dre', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.despezzas.com/v2/business/dre"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.despezzas.com/v2/business/dre"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"basis": "cash",
"by_category": [
{
"amount": 1800000,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"dre_group": "custos",
"name": "Fornecedores"
}
],
"by_cost_center": [
{
"amount": 300000,
"cost_center_id": "a9b8c7d6-e5f4-4a3b-8c2d-1e0f9a8b7c6d",
"name": "Marketing"
}
],
"groups": {
"custos": 1800000,
"deducoes": 270000,
"despesas_operacionais": 900000,
"financeiro": 45000,
"investimento": 0,
"receita": 4500000,
"retiradas": 600000
},
"lines": [
{
"amount": 885000,
"key": "resultado_liquido"
}
],
"month": "2026-09",
"uncategorized": 0,
"compare": {
"basis": "cash",
"by_category": [
{
"amount": 1800000,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"dre_group": "custos",
"name": "Fornecedores"
}
],
"by_cost_center": [
{
"amount": 300000,
"cost_center_id": "a9b8c7d6-e5f4-4a3b-8c2d-1e0f9a8b7c6d",
"name": "Marketing"
}
],
"groups": {
"custos": 1800000,
"deducoes": 270000,
"despesas_operacionais": 900000,
"financeiro": 45000,
"investimento": 0,
"receita": 4500000,
"retiradas": 600000
},
"lines": [
{
"amount": 885000,
"key": "resultado_liquido"
}
],
"month": "2026-08",
"uncategorized": 0
},
"variation": {
"resultado_liquido": 65000
}
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}DRE
Escopo necessário: read.
curl --request GET \
--url https://api.despezzas.com/v2/business/dre \
--header 'Authorization: Basic <encoded-value>'const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.despezzas.com/v2/business/dre', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.despezzas.com/v2/business/dre"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.despezzas.com/v2/business/dre"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"basis": "cash",
"by_category": [
{
"amount": 1800000,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"dre_group": "custos",
"name": "Fornecedores"
}
],
"by_cost_center": [
{
"amount": 300000,
"cost_center_id": "a9b8c7d6-e5f4-4a3b-8c2d-1e0f9a8b7c6d",
"name": "Marketing"
}
],
"groups": {
"custos": 1800000,
"deducoes": 270000,
"despesas_operacionais": 900000,
"financeiro": 45000,
"investimento": 0,
"receita": 4500000,
"retiradas": 600000
},
"lines": [
{
"amount": 885000,
"key": "resultado_liquido"
}
],
"month": "2026-09",
"uncategorized": 0,
"compare": {
"basis": "cash",
"by_category": [
{
"amount": 1800000,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"dre_group": "custos",
"name": "Fornecedores"
}
],
"by_cost_center": [
{
"amount": 300000,
"cost_center_id": "a9b8c7d6-e5f4-4a3b-8c2d-1e0f9a8b7c6d",
"name": "Marketing"
}
],
"groups": {
"custos": 1800000,
"deducoes": 270000,
"despesas_operacionais": 900000,
"financeiro": 45000,
"investimento": 0,
"receita": 4500000,
"retiradas": 600000
},
"lines": [
{
"amount": 885000,
"key": "resultado_liquido"
}
],
"month": "2026-08",
"uncategorized": 0
},
"variation": {
"resultado_liquido": 65000
}
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}Authorizations
HTTP Basic com o token como usuário e o secret como senha: curl -u dpz_tk_…:dpz_sk_…. Crie a chave em https://despezzas.com/settings/api-keys.
Query Parameters
Mês (YYYY-MM). Padrão: mês atual.
"2026-09"
Regime. Padrão: cash.
cash, accrual "cash"
Comparação. Padrão: none.
none, previous, last_year "none"
Response
Sucesso.
DRE simplificado do mês. Com compare, traz também o mês comparado e a variação por linha.
Regime.
cash, accrual "cash"
Total por categoria.
Show child attributes
Show child attributes
Gasto líquido por centro de custo.
Show child attributes
Show child attributes
Total por grupo do DRE.
Show child attributes
Show child attributes
{
"custos": 1800000,
"deducoes": 270000,
"despesas_operacionais": 900000,
"financeiro": 45000,
"investimento": 0,
"receita": 4500000,
"retiradas": 600000
}
Linhas calculadas, na ordem do demonstrativo.
Show child attributes
Show child attributes
Mês (YYYY-MM).
"2026-09"
Movimento sem categoria. Em centavos.
0
Mês comparado (só com compare=previous|last_year).
Show child attributes
Show child attributes
Variação por linha (mês − comparado), só com compare.
Show child attributes
Show child attributes
{ "resultado_liquido": 65000 }