Skip to content
Sign in Create account

Billing Auto Topup

PATCH /api/v1/billing/auto-topup

Updates the authenticated account’s auto top-up settings. enabled is required; threshold_cents and amount_cents are optional. Enabling requires an available saved payment method. Requires an authenticated user. Bearer access tokens need the billing.write ability, and the associated account needs the billing.change permission. The * wildcard also satisfies the bearer ability check. Browser session authentication uses the account permission check without a token-ability check. API-key credentials are not accepted. A bearer token missing its ability receives a 403 JSON body with error: "token_ability_missing", required: ["billing.write"], and have.

Authenticate with a portal session token.

Request body

application/json object

  • amount_cents integer
    Range: 2500 to 200000
  • enabled boolean required
  • threshold_cents integer
    Range: 100 to 20000

Generated sample

{
  "amount_cents": 2500,
  "enabled": true,
  "threshold_cents": 100
}

Responses

200 Auto top-up settings updated.

application/json object

  • amount_cents integer required
  • available boolean required
  • enabled boolean required
  • has_payment_method boolean required
  • payment_method object or null required

    Any keys are accepted.

  • threshold_cents integer required
  • unavailable_reason string or null required

Generated sample

{
  "amount_cents": 0,
  "available": true,
  "enabled": true,
  "has_payment_method": true,
  "payment_method": {},
  "threshold_cents": 0,
  "unavailable_reason": "string"
}
401 Authentication is missing or invalid.

application/json object

  • error object required
    • code string required
      Value: "unauthenticated"
    • message string required
403 The bearer token lacks the required ability or the authenticated account lacks the required permission.

application/json any

Any of

  • object
    • error string required
      Value: "token_ability_missing"
    • have array of string required
    • message string required
    • required array of string required
  • object
    • message string required
409 Auto top-up is unavailable while the account-level gate is active.

application/json object

  • available boolean required
    Value: false
  • error string required
    Value: "auto_topup_blocked"
  • message string required
  • unavailable_reason string required
    Value: "auto_topup_blocked"
422 The request failed validation or no saved payment method is available.

application/json object

  • error any required

    One of

    • string
    • object
      • code string
      • fields object

        Other keys: array of string

      • message string
    • object
      • code string
      • message string
429 The request was rate limited. API-generated responses are JSON;

Response headers

  • Retry-After string header

    Seconds to wait before retrying, when provided.

  • X-RateLimit-Scope string header

    Identifies the scope of the request limit, when provided.

application/json GenericError

  • error any

    One of

    • string
    • object

      Any keys are accepted.

  • error_code string
  • code string
  • message string
  • detail string
  • status any

    One of

    • string
    • integer
  • errors object

    Any keys are accepted.

text/html string