Configure Auto Topup
configure_auto_topupSet the top-up amount and turn threshold-based automatic balance top-ups on or off to prevent orders failing from insufficient funds.
Instructions
Set the top-up amount, and/or turn auto top-up on or off.
amount_cents (integer US cents) is what a top-up adds, and it stands on its own: top_up_account_credit charges this same figure on demand, so setting it without enabling automation is a normal thing to do. Capped at $500 (50000) with a $5 floor when set through the API; a larger figure has to be set by the account holder at https://porkbun.com/account/api and is honoured as-is.
enabled: true (with threshold_cents) additionally makes it fire by itself: an order that drops the balance below threshold_cents charges the saved payment method for the amount and adds it — the way to stop an unattended workflow dead-ending on INSUFFICIENT_FUNDS. enabled: false stops it firing on a threshold but KEEPS the amount on file.
Confirm the numbers with the user before calling: this authorises charges to their card. No card is added or changed here, and none can be added over the API. Supports dry_run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | Deprecated alias of `amount_cents`, same unit (integer US cents). Send `amount_cents` instead. | |
| dry_run | No | If true, validate only — returns wouldSucceed and changes nothing. | |
| enabled | No | True to switch auto top-up on (threshold required, plus an amount either here or already on file), false to switch it off. Omit it to change only the amount. | |
| threshold | No | Deprecated alias of `threshold_cents`, same unit (integer US cents). Send `threshold_cents` instead. | |
| amount_cents | No | What a top-up adds, 500-50000 when set via the API. Can be sent on its own. E.g. 10000 = $100. Integer US cents: 803 means $8.03, not $803. | |
| threshold_cents | No | Balance below which a top-up fires. Required when enabling. E.g. 2000 = $20. Integer US cents: 803 means $8.03, not $803. |