Ajustar dia de fechamento
curl --request PATCH \
--url https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"closing_day": 5
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({closing_day: 5})
};
fetch('https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId}"
payload = { "closing_day": 5 }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId}"
payload := strings.NewReader("{\n \"closing_day\": 5\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"updated": 4,
"bill": {
"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
Ajustar dia de fechamento
Muda o dia de fechamento (e vencimento) do cartão e recalcula as faturas no alcance de edition_type.
Escopo necessário: write.
PATCH
/
v2
/
bills
/
closing-date
/
by-card
/
{cardId}
Ajustar dia de fechamento
curl --request PATCH \
--url https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"closing_day": 5
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({closing_day: 5})
};
fetch('https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId}"
payload = { "closing_day": 5 }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.despezzas.com/v2/bills/closing-date/by-card/{cardId}"
payload := strings.NewReader("{\n \"closing_day\": 5\n}")
req, _ := http.NewRequest("PATCH", 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))
}{
"updated": 4,
"bill": {
"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 cartão.
Example:
"c4d5e6f7-0a1b-4c2d-9e3f-4a5b6c7d8e9f"
Body
application/json
Novo dia de fechamento (1–31).
Example:
5
Fatura de referência (alternativa a edition_date).
Example:
null
Novo dia de vencimento (1–31). Ignorado em cartões Open Finance (o banco define).
Example:
12
Mês de referência (YYYY-MM-DD).
Example:
"2026-09-01"
Alcance: só a fatura de edition_date/bill_id, dela em diante, ou todas.
Available options:
THIS, THIS_AND_NEXT, ALL Example:
"THIS_AND_NEXT"