> ## Documentation Index
> Fetch the complete documentation index at: https://docs.teamfollowup.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the public API base URL: https://api.teamfollowup.ai/api.
> Authenticate public API requests with Authorization: Bearer YOUR_API_KEY.
> Use product-owned terms: agents, campaigns, projects (GoHighLevel sub-accounts), contacts, calls, outcomes, skills, cadences, phone numbers.
> Scope requests by locationId rather than projectName.
> Read the guide linked from each API reference group before recommending an endpoint.

# Set up rebilling for a sub-account

> Link your client's Stripe customer, set what you charge per minute, charge their card for a first top-up, and decide what happens when their wallet runs dry.

With rebilling on, a sub-account pays for its own calls from its own wallet,
at the rate you charge the client, and the client's card tops that wallet up.
This guide sets it up over the API. Every figure it touches is explained in
[Balances, spend and sub-account wallets](/billing/overview).

## Prerequisites

* An API key from an agency admin with the `billing:write` scope. To charge the
  client's card in the same step, the key also needs `billing:charge`.
* Your plan includes client rebilling, and Stripe Connect is connected for your
  agency. Without either, every sub-account change answers
  `CAPABILITY_NOT_AVAILABLE` or `STRIPE_NOT_CONNECTED` and nothing changes.
* The client exists as a customer on your connected Stripe account with a
  working card. Create customers and add cards in the dashboard; the API never
  takes card details.
* The sub-account's `locationId`, from
  [List sub-account wallets](/api-reference/billing/list-sub-account-wallets).

## Step 1: Turn rebilling on

Send the client rate and the Stripe customer to
[Update sub-account rebilling](/api-reference/billing/update-sub-account-rebilling):

```bash theme={"dark"}
curl -X PUT https://api.teamfollowup.ai/api/billing/sub-accounts/rrHDPw5RIR5ULeUlfSAR/rebilling \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "clientRatePerMinute": 0.45,
    "stripeCustomerId": "cus_Qx8LmVt2ZzYQ4p",
    "autoRecharge": { "enabled": true, "thresholdUSD": 25, "rechargeAmountUSD": 100 }
  }'
```

This links the customer, sets `clientRatePerMinute` and, when you include it,
sets `autoRecharge`, all or nothing. If any step fails, the sub-account goes
back to exactly what it had and the answer says why, for example
`NO_USABLE_CARD` when the customer has no working card, or
`PAYMENT_METHOD_SELECTION_REQUIRED` when it has several and no default.

A rate above \$10 a minute needs `confirmHighRate: true`, so a typo cannot price a
client out by accident.

## Step 2: Charge a first top-up

A freshly rebilled sub-account has an empty wallet. To turn rebilling on and
charge the client in one step, use
[Enable rebilling with a charge](/api-reference/billing/enable-rebilling-with-a-charge)
instead of step 1, with an `Idempotency-Key` header:

```bash theme={"dark"}
curl -X POST https://api.teamfollowup.ai/api/billing/sub-accounts/rrHDPw5RIR5ULeUlfSAR/rebilling/enable-with-charge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: rebill-bright-dental-2026-09-15" \
  -H "Content-Type: application/json" \
  -d '{ "clientRatePerMinute": 0.45, "stripeCustomerId": "cus_Qx8LmVt2ZzYQ4p", "charge": { "amountUSD": 100 } }'
```

The settings are saved first and the card charged last. A declined card puts
every setting back.

<Warning>
  The minutes a sub-account buys come out of your agency wallet. On a self-serve
  agency, a charge bigger than the minutes your wallet holds tops your wallet up
  first by charging your own billing card, so one call can charge two cards. If
  the client's card then fails, that top-up of your own wallet stands. If your
  wallet cannot be topped up, the call is refused before the client's card is
  touched.

  Name `thresholdUSD` and `rechargeAmountUSD` when you switch auto-recharge on.
  Left out on a sub-account that has never had them, they fall back to $50 and
      $200, and that second figure is what the client's card is charged each time.
</Warning>

If Stripe cannot say whether the payment went through, the answer is
`PAYMENT_RECONCILIATION_REQUIRED` with `rebillingLeftOn: true`: nothing is
rolled back, because the money may have moved.

To top up later, use [Charge a sub-account](/api-reference/billing/charge-a-sub-account).
Reuse an `Idempotency-Key` only to retry the same charge; a retry returns the
first answer and charges nothing.

## Step 3: Decide what happens when the wallet runs dry

With [Credit Guard](/api-reference/billing/update-sub-account-credit-guard) on,
the sub-account stops its own calls when its wallet is empty. With it off, your
wallet pays for those calls. Set it on many sub-accounts at once with
[Update Credit Guard for sub-accounts](/api-reference/billing/update-credit-guard-for-sub-accounts).

## Turning rebilling off

Send `{ "enabled": false }` to the same rebilling operation. In one step the
sub-account's unused minutes return to your wallet at what they cost you, its
auto-recharge goes off and its Stripe customer is unlinked. It is refused with
`PENDING_CREDITS_EXIST` while a client payment is waiting for credit.

<Warning>
  Minutes the client paid for become your credit. Nothing is refunded to the
  client, and the API cannot refund them: settle up with the client yourself.
</Warning>

## Next steps

* Check the result with [Get sub-account wallet](/api-reference/billing/get-sub-account-wallet).
* Share one client's customer across sub-accounts with
  [Link a Stripe customer](/api-reference/billing/link-a-stripe-customer).
* Read [Balances, spend and sub-account wallets](/billing/overview) for what
  every field means.
