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
| Argument | In | Type | Required | Description |
|---|---|---|---|---|
enabled | body | boolean | required | |
amount_paise | body | integer | required | Credit to buy each time, in paise, net of GST. |
trigger_days | body | integer | default 5 | Top 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_paise | body | integer | default 15000 | Also top up below this balance outright, for when there is not enough recent spending to judge runway from. |
monthly_cap_paise | body | integer | default 0 | Never spend more than this in a calendar month. 0 is no money cap. |
max_per_month | body | integer | default 4 | Never 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
| Status | When |
|---|---|
404 | Not found |
422 | Validation Error |