Billing ›
Set billing auto reload
PUT
/v1/billing/auto-reloadSet billing auto reload.
Requestcurl
- curl -X PUT https://agental.io/v1/billing/auto-reload \
- -H "Authorization: Bearer $AGENTAL_API_KEY" \
- -H "Content-Type: application/json" \
- -d '{"dollars":1}'
Answer200 OK · AutoReload
- {
- "autoReload": {
- "dollars": integer,
- },
- }
The auto-reload as it is now.
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Body
dollarsrequiredinteger or null | The top-up the card is charged for when the credits run out, in whole US dollars, from 15 to 100000, with the bonus a top-up of that size has. null turns the auto-reload off. |
Returns
200 The auto-reload as it is now. At most 3 reloads are charged in a day, and a card that would not pay is not asked again for a day, or until the auto-reload is set again.
AutoReload1 field
autoReloadobjectnull1 field
dollarsinteger
The top-up charged, in whole US dollars.
Errors and other answers
| 409 | billing_not_configured Stripe does not sell here. |
| 409 | no_card the account has no card saved at Stripe: save one, or buy a plan or a top-up. |
| 503 | billing_unavailable. The payment provider did not answer. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.