Pagar fatura
curl --request POST \
--url https://api.despezzas.com/v1/bills/pay/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 185000,
"date": "2026-09-10",
"payment_account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 185000,
date: '2026-09-10',
payment_account_id: '3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f'
})
};
fetch('https://api.despezzas.com/v1/bills/pay/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.despezzas.com/v1/bills/pay/{id}"
payload = {
"amount": 185000,
"date": "2026-09-10",
"payment_account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.despezzas.com/v1/bills/pay/{id}"
payload := strings.NewReader("{\n \"amount\": 185000,\n \"date\": \"2026-09-10\",\n \"payment_account_id\": \"3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}{
"creditTransaction": {
"amount": 25990,
"createdAt": "2026-09-01T09:00:00.000Z",
"date": "2026-09-15T00:00:00.000Z",
"id": "8f1c2a34-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"installments": 1,
"is_expense": true,
"paid": true,
"title": "Supermercado Pão de Açúcar",
"type": "FIXED",
"updatedAt": "2026-09-15T14:32:10.000Z",
"account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f",
"bill_id": null,
"billed_at": null,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"competence_date": null,
"connected_transaction_id": null,
"contact_id": null,
"cost_center_id": null,
"credit_card_id": null,
"currency": "BRL",
"description": "Compra do mês",
"document_number": null,
"excluded_dates": [],
"frequency": "MONTHLY",
"installment_number": null,
"is_bill_payment": false,
"is_full_amount": false,
"is_previous_balance": false,
"is_remote": true,
"logo_url": null,
"merchant_cnae": null,
"merchant_cnpj": null,
"merchant_name": null,
"operation_type": null,
"paid_at": "2026-09-15T14:32:10.000Z",
"payment_dates": [],
"profile_id": null,
"reconciled_at": null,
"reconciled_by_user_id": null,
"reconciled_with_transaction_id": null,
"show_on_balance": true,
"subcategory_id": "d7e8f9a0-b1c2-4d3e-8f4a-5b6c7d8e9f0a",
"user_id": "0d6b923c-3392-424e-a152-2ee32474e8d5"
},
"debitTransaction": {
"amount": 25990,
"createdAt": "2026-09-01T09:00:00.000Z",
"date": "2026-09-15T00:00:00.000Z",
"id": "8f1c2a34-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"installments": 1,
"is_expense": true,
"paid": true,
"title": "Supermercado Pão de Açúcar",
"type": "FIXED",
"updatedAt": "2026-09-15T14:32:10.000Z",
"account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f",
"bill_id": null,
"billed_at": null,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"competence_date": null,
"connected_transaction_id": null,
"contact_id": null,
"cost_center_id": null,
"credit_card_id": null,
"currency": "BRL",
"description": "Compra do mês",
"document_number": null,
"excluded_dates": [],
"frequency": "MONTHLY",
"installment_number": null,
"is_bill_payment": false,
"is_full_amount": false,
"is_previous_balance": false,
"is_remote": true,
"logo_url": null,
"merchant_cnae": null,
"merchant_cnpj": null,
"merchant_name": null,
"operation_type": null,
"paid_at": "2026-09-15T14:32:10.000Z",
"payment_dates": [],
"profile_id": null,
"reconciled_at": null,
"reconciled_by_user_id": null,
"reconciled_with_transaction_id": null,
"show_on_balance": true,
"subcategory_id": "d7e8f9a0-b1c2-4d3e-8f4a-5b6c7d8e9f0a",
"user_id": "0d6b923c-3392-424e-a152-2ee32474e8d5"
},
"updatedBill": {
"balance": 0,
"closing_date": "2026-09-03T00:00:00.000Z",
"costs": 0,
"credit_card_id": "c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f",
"expiring_date": "2026-09-10T00:00:00.000Z",
"id": "f6a7b8c9-d0e1-4f2a-8b3c-4d5e6f7a8b9c",
"paid": 185000,
"status": "PAID",
"value": 185000,
"createdAt": "2026-09-01T09:00:00.000Z",
"isPending": false,
"profile_id": null,
"updatedAt": "2026-09-15T14:32:10.000Z",
"user_id": "0d6b923c-3392-424e-a152-2ee32474e8d5"
}
}{
"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"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}Faturas
Pagar fatura
Registra o pagamento de uma fatura a partir de uma conta: cria o débito na conta e o crédito no cartão e atualiza a fatura. amount em centavos. Aceita o header Idempotency-Key para repetir a chamada com segurança.
Escopo necessário: write.
POST
/
v1
/
bills
/
pay
/
{id}
Pagar fatura
curl --request POST \
--url https://api.despezzas.com/v1/bills/pay/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 185000,
"date": "2026-09-10",
"payment_account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 185000,
date: '2026-09-10',
payment_account_id: '3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f'
})
};
fetch('https://api.despezzas.com/v1/bills/pay/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.despezzas.com/v1/bills/pay/{id}"
payload = {
"amount": 185000,
"date": "2026-09-10",
"payment_account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.despezzas.com/v1/bills/pay/{id}"
payload := strings.NewReader("{\n \"amount\": 185000,\n \"date\": \"2026-09-10\",\n \"payment_account_id\": \"3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}{
"creditTransaction": {
"amount": 25990,
"createdAt": "2026-09-01T09:00:00.000Z",
"date": "2026-09-15T00:00:00.000Z",
"id": "8f1c2a34-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"installments": 1,
"is_expense": true,
"paid": true,
"title": "Supermercado Pão de Açúcar",
"type": "FIXED",
"updatedAt": "2026-09-15T14:32:10.000Z",
"account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f",
"bill_id": null,
"billed_at": null,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"competence_date": null,
"connected_transaction_id": null,
"contact_id": null,
"cost_center_id": null,
"credit_card_id": null,
"currency": "BRL",
"description": "Compra do mês",
"document_number": null,
"excluded_dates": [],
"frequency": "MONTHLY",
"installment_number": null,
"is_bill_payment": false,
"is_full_amount": false,
"is_previous_balance": false,
"is_remote": true,
"logo_url": null,
"merchant_cnae": null,
"merchant_cnpj": null,
"merchant_name": null,
"operation_type": null,
"paid_at": "2026-09-15T14:32:10.000Z",
"payment_dates": [],
"profile_id": null,
"reconciled_at": null,
"reconciled_by_user_id": null,
"reconciled_with_transaction_id": null,
"show_on_balance": true,
"subcategory_id": "d7e8f9a0-b1c2-4d3e-8f4a-5b6c7d8e9f0a",
"user_id": "0d6b923c-3392-424e-a152-2ee32474e8d5"
},
"debitTransaction": {
"amount": 25990,
"createdAt": "2026-09-01T09:00:00.000Z",
"date": "2026-09-15T00:00:00.000Z",
"id": "8f1c2a34-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"installments": 1,
"is_expense": true,
"paid": true,
"title": "Supermercado Pão de Açúcar",
"type": "FIXED",
"updatedAt": "2026-09-15T14:32:10.000Z",
"account_id": "3a9e7d21-4b5c-4d6e-8f70-1a2b3c4d5e6f",
"bill_id": null,
"billed_at": null,
"category_id": "b1a2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"competence_date": null,
"connected_transaction_id": null,
"contact_id": null,
"cost_center_id": null,
"credit_card_id": null,
"currency": "BRL",
"description": "Compra do mês",
"document_number": null,
"excluded_dates": [],
"frequency": "MONTHLY",
"installment_number": null,
"is_bill_payment": false,
"is_full_amount": false,
"is_previous_balance": false,
"is_remote": true,
"logo_url": null,
"merchant_cnae": null,
"merchant_cnpj": null,
"merchant_name": null,
"operation_type": null,
"paid_at": "2026-09-15T14:32:10.000Z",
"payment_dates": [],
"profile_id": null,
"reconciled_at": null,
"reconciled_by_user_id": null,
"reconciled_with_transaction_id": null,
"show_on_balance": true,
"subcategory_id": "d7e8f9a0-b1c2-4d3e-8f4a-5b6c7d8e9f0a",
"user_id": "0d6b923c-3392-424e-a152-2ee32474e8d5"
},
"updatedBill": {
"balance": 0,
"closing_date": "2026-09-03T00:00:00.000Z",
"costs": 0,
"credit_card_id": "c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f",
"expiring_date": "2026-09-10T00:00:00.000Z",
"id": "f6a7b8c9-d0e1-4f2a-8b3c-4d5e6f7a8b9c",
"paid": 185000,
"status": "PAID",
"value": 185000,
"createdAt": "2026-09-01T09:00:00.000Z",
"isPending": false,
"profile_id": null,
"updatedAt": "2026-09-15T14:32:10.000Z",
"user_id": "0d6b923c-3392-424e-a152-2ee32474e8d5"
}
}{
"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"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "Credenciais de API inválidas",
"statusCode": 401,
"error": "Unauthorized"
}Authorizations
basicAuthapiSecret & apiToken
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.
Path Parameters
Identificador do recurso.
Example:
"8f1c2a34-5b6d-4e7f-8a9b-0c1d2e3f4a5b"
Body
application/json