Skip to main content
POST
/
api
/
v1
/
billing
/
drawdown
Setup drawdown billing
curl --request POST \
  --url https://staging.api.rye.com/api/v1/billing/drawdown \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "minBalanceSubunits": 200000,
  "targetBalanceSubunits": 1000000,
  "chargeAutomatically": true
}
'
{
  "drawdown": {
    "balance": {
      "currencyCode": "USD",
      "amountSubunits": 1500
    },
    "config": {
      "chargeAutomatically": true,
      "currency": "USD",
      "minBalanceSubunits": 200000,
      "targetBalanceSubunits": 1000000
    },
    "enabled": true
  }
}

Authorizations

Authorization
string
header
required

Rye API key

Body

application/json

Drawdown settings to configure

minBalanceSubunits
integer<int32>
required

Minimum balance threshold in smallest currency unit (e.g. cents). A top-up is triggered when balance falls below this value.

Required range: x >= 10
Example:

200000

targetBalanceSubunits
integer<int32>
required

Target balance in smallest currency unit (e.g. cents). When balance drops below minBalanceSubunits, a top-up invoice is created to replenish to this amount.

Required range: x >= 100
Example:

1000000

chargeAutomatically
boolean

Whether to automatically charge the invoice when created. Defaults to true if not specified.

Example:

true

Response

Updated billing configuration

drawdown
object
required