Docs
Billing ›

Set billing auto reload

PUT/v1/billing/auto-reload

Set billing auto reload.

Requestcurl
  1. curl -X PUT https://agental.io/v1/billing/auto-reload \
  2. -H "Authorization: Bearer $AGENTAL_API_KEY" \
  3. -H "Content-Type: application/json" \
  4. -d '{"dollars":1}'
Answer200 OK · AutoReload
  1. {
  2. "autoReload": {
  3. "dollars": integer,
  4. },
  5. }

The auto-reload as it is now.

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Body

dollarsrequired
integer 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
autoReload
objectnull1 field
dollars
integer
The top-up charged, in whole US dollars.

Errors and other answers

409billing_not_configured Stripe does not sell here.
409no_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.