# Habilitar recarga por limite mínimo em $50, recarregar $100
curl -X PUT "https://app.talkover.ai/api/v1/auto-topup/settings" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"is_enabled": true,
"threshold_amount": 50,
"recharge_amount": 100,
"payment_method_id": "pm_uuid_1"
}'
# Habilitar recarga mensal agendada de $200 no dia 1º
curl -X PUT "https://app.talkover.ai/api/v1/auto-topup/settings" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"is_enabled": true,
"scheduled_payment_enabled": true,
"scheduled_amount": 200,
"day_of_month": 1,
"payment_method_id": "pm_uuid_1"
}'
{
"success": true,
"data": {
"is_enabled": true,
"threshold_amount": 50.00,
"recharge_amount": 100.00,
"scheduled_payment_enabled": false,
"payment_method_id": "pm_uuid_1",
"daily_limit": 500.00,
"updated_at": "2024-01-15T13:00:00Z"
}
}
Cobrança e Recarga Automática
Atualizar Configurações de Recarga Automática
Configurar recarga automática baseada em limite mínimo ou agendada
PUT
/
api
/
v1
/
auto-topup
/
settings
# Habilitar recarga por limite mínimo em $50, recarregar $100
curl -X PUT "https://app.talkover.ai/api/v1/auto-topup/settings" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"is_enabled": true,
"threshold_amount": 50,
"recharge_amount": 100,
"payment_method_id": "pm_uuid_1"
}'
# Habilitar recarga mensal agendada de $200 no dia 1º
curl -X PUT "https://app.talkover.ai/api/v1/auto-topup/settings" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"is_enabled": true,
"scheduled_payment_enabled": true,
"scheduled_amount": 200,
"day_of_month": 1,
"payment_method_id": "pm_uuid_1"
}'
{
"success": true,
"data": {
"is_enabled": true,
"threshold_amount": 50.00,
"recharge_amount": 100.00,
"scheduled_payment_enabled": false,
"payment_method_id": "pm_uuid_1",
"daily_limit": 500.00,
"updated_at": "2024-01-15T13:00:00Z"
}
}
Atualizar Configurações de Recarga Automática
Configure ou atualize a recarga automática. Você pode habilitar a recarga baseada em limite mínimo (cobrança automática quando o saldo cai abaixo dethreshold_amount), recarga mensal agendada (cobrança automática em um dia específico), ou ambas.
Endpoint
PUT /api/v1/auto-topup/settings
Cabeçalhos da requisição
string
obrigatório
Token Bearer para autenticação. Formato:
Bearer talq_your_environment_token_herestring
obrigatório
Deve ser definido como
application/jsonCorpo da requisição
boolean
Chave principal da recarga automática. Quando
false, nem as recargas por limite mínimo nem as agendadas são disparadas.number
Limite mínimo para disparo, na moeda da conta. Faixa:
1–1000. Quando o saldo cai abaixo deste valor, uma recarga é enfileirada.number
Valor cobrado a cada vez que o limite mínimo é atingido. Faixa:
1–1000.boolean
Habilita recargas mensais agendadas, em adição (ou em substituição) à recarga baseada em limite mínimo.
number
Valor cobrado no dia agendado. Faixa:
1–1000. Obrigatório quando scheduled_payment_enabled é true.integer
Dia do mês para recargas agendadas. Faixa:
1–28 (evita situações específicas de fim de mês).string
ID do método de pagamento a ser cobrado. Deve ser um método já salvo na conta — veja Listar Métodos de Pagamento.
Exemplos
# Habilitar recarga por limite mínimo em $50, recarregar $100
curl -X PUT "https://app.talkover.ai/api/v1/auto-topup/settings" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"is_enabled": true,
"threshold_amount": 50,
"recharge_amount": 100,
"payment_method_id": "pm_uuid_1"
}'
# Habilitar recarga mensal agendada de $200 no dia 1º
curl -X PUT "https://app.talkover.ai/api/v1/auto-topup/settings" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{
"is_enabled": true,
"scheduled_payment_enabled": true,
"scheduled_amount": 200,
"day_of_month": 1,
"payment_method_id": "pm_uuid_1"
}'
Resposta
{
"success": true,
"data": {
"is_enabled": true,
"threshold_amount": 50.00,
"recharge_amount": 100.00,
"scheduled_payment_enabled": false,
"payment_method_id": "pm_uuid_1",
"daily_limit": 500.00,
"updated_at": "2024-01-15T13:00:00Z"
}
}
Observações
- O
daily_limité definido pelo seu plano e não pode ser modificado via API. Entre em contato com o suporte para solicitar um aumento. - Para desativar completamente a recarga automática, envie
{"is_enabled": false}ou utilize Desativar Recarga Automática. - Após atualizar, execute Testar Recarga Automática para verificar se o método de pagamento funciona.
Esta página foi útil?