Scrub API
POST/v1/tools/add_creditfree

Add credit

A Stripe page that adds credit to pay as you go, as Account's Add credit does: $20, $50, $100, or any whole amount from $5 to $500. Credit never expires; on a plan, a top-up buys more work at the plan's rate. owed true instead pays what this workspace owes after a refund (plan_status says it), which pauses it until paid: the page is for that amount (at least $0.50, any more staying as credit), and paying lifts the pause. Given the draft they were about to run, the flow, or their Chat conversation, Stripe brings them back to it once they have paid, ready to run; paying runs nothing. The credit lands when it is paid there. Free to ask.

Fields

FieldTypeDefaultWhat it is
usdintegerNoneHow much, in US dollars; left out with owed true
owedbooleanNonetrue pays what this workspace owes after a refund, in place of usd
draftstringNoneThe person's draft they were about to run, draft_… from list_drafts: Stripe brings them back to it once they have paid
flowstringNoneThe flow they were about to run, flow_… from list_flows: Stripe brings them back to it once they have paid
chatstringNoneThe person's Chat conversation they were in, by its id: Stripe brings them back to it once they have paid

Call it

Request

curl -X POST https://app.scrub.app/v1/tools/add_credit \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Answer

{
  "ok": true,
  "result": {
    "…": "…"
  }
}

What result holds is said above.

Every call can also answer an error: what comes back. Try it with your key from Account.