Configurar recarga automática
curl --request PATCH \
--url https://api.ararahq.com/v1/wallet/auto-recharge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"threshold": 502.5,
"amount": 2510
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, threshold: 502.5, amount: 2510})
};
fetch('https://api.ararahq.com/v1/wallet/auto-recharge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/wallet/auto-recharge"
payload = {
"enabled": True,
"threshold": 502.5,
"amount": 2510
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/wallet/auto-recharge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'threshold' => 502.5,
'amount' => 2510
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"enabled": true,
"threshold": 123,
"amount": 123,
"lastAttemptAt": "2023-11-07T05:31:56Z",
"lastFailureReason": "<string>"
}Carteira
Configurar recarga automática
Ativar exige cartão cadastrado (409 CONFLICT sem ele). Se o saldo já
estiver no limite ao ativar, a cobrança acontece na hora.
Permissão: ADMIN.
PATCH
/
v1
/
wallet
/
auto-recharge
Configurar recarga automática
curl --request PATCH \
--url https://api.ararahq.com/v1/wallet/auto-recharge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"threshold": 502.5,
"amount": 2510
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true, threshold: 502.5, amount: 2510})
};
fetch('https://api.ararahq.com/v1/wallet/auto-recharge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/wallet/auto-recharge"
payload = {
"enabled": True,
"threshold": 502.5,
"amount": 2510
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/wallet/auto-recharge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'threshold' => 502.5,
'amount' => 2510
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"enabled": true,
"threshold": 123,
"amount": 123,
"lastAttemptAt": "2023-11-07T05:31:56Z",
"lastFailureReason": "<string>"
}Authorizations
Chave de API da Arara (ara_live_...), enviada no header Authorization: Bearer ara_live_.... Crie e gerencie as chaves no painel: https://app.ararahq.com/dashboard/apikeys. O valor completo aparece uma única vez, na criação.
Body
application/json