Skip to content

billing.autoTopup.save

Change auto top-up.

Reference

PUT/api/v1/billing/auto-topup

Auth
API key in X-API-Key
Content
application/json
Returns
200 · Response Save Auto Topup Api V1 Billing Auto Topup Put

Set it. Admin-gated, because it authorises money to leave. Saving always clears ``paused_reason``: a customer who has come here and changed something is telling us to try again, and leaving them paused with no way to resume would mean support tickets for a self-service action.

Arguments

ArgumentInTypeRequiredDescription
enabledbodybooleanrequired
amount_paisebodyintegerrequiredCredit to buy each time, in paise, net of GST.
trigger_daysbodyintegerdefault 5Top up when this many days of credit remain, judged on recent spending. The debit runs a clear day after we notify you, so this needs to be more than one.
trigger_paisebodyintegerdefault 15000Also top up below this balance outright, for when there is not enough recent spending to judge runway from.
monthly_cap_paisebodyintegerdefault 0Never spend more than this in a calendar month. 0 is no money cap.
max_per_monthbodyintegerdefault 4Never top up more than this many times in a calendar month.

Example request

curl -X PUT "https://api.decibyl.ai/api/v1/billing/auto-topup" \
  -H "X-API-Key: dcb_your_key" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true,"amount_paise":1,"trigger_days":5,"trigger_paise":15000,"monthly_cap_paise":0,"max_per_month":4}'

Response

{}

Errors

StatusWhen
404Not found
422Validation Error