Configurar a recarga automática
curl --request PUT \
--url https://api.validator.blubash.io/v1/billing/auto-recharge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"amount": "1000.00",
"threshold": "200.00"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, amount: '1000.00', threshold: '200.00'})
};
fetch('https://api.validator.blubash.io/v1/billing/auto-recharge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.validator.blubash.io/v1/billing/auto-recharge"
payload = {
"enabled": True,
"amount": "1000.00",
"threshold": "200.00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"amount": "1000.0000",
"disabled_reason": null,
"enabled": true,
"has_payment_method": true,
"threshold": "200.0000"
}Recargas e cobrança
Configurar a recarga automática
Liga ou desliga a recarga automática e define threshold e amount (omitidos mantêm o valor atual). Ligada, quando o saldo disponível fica abaixo de threshold cobramos amount no cartão salvo, sem você presente.
- Ligar exige um cartão salvo (
POST /v1/billing/payment-method); sem cartão, 409. - No máximo 3 tentativas de recarga automática por dia (São Paulo, padrão) e uma cobrança em andamento por vez.
- Se o banco pedir autenticação (3DS), enviamos o evento
auto_recharge.action_requiredcom um link de pagamento. - Na 3ª falha seguida ela é desligada (
disabled_reason: "failed_3_times", eventoauto_recharge.disabled); ligar de novo zera a contagem.
Escopo exigido: billing. Bloqueada para workspace suspenso (403 workspace_suspended).
PUT
/
v1
/
billing
/
auto-recharge
Configurar a recarga automática
curl --request PUT \
--url https://api.validator.blubash.io/v1/billing/auto-recharge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"amount": "1000.00",
"threshold": "200.00"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, amount: '1000.00', threshold: '200.00'})
};
fetch('https://api.validator.blubash.io/v1/billing/auto-recharge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.validator.blubash.io/v1/billing/auto-recharge"
payload = {
"enabled": True,
"amount": "1000.00",
"threshold": "200.00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"amount": "1000.0000",
"disabled_reason": null,
"enabled": true,
"has_payment_method": true,
"threshold": "200.0000"
}Authorizations
Body
application/json
Response
A configuração salva.