Skip to main content
invalid_amount means a billing request carried an amount OpenType will not charge. Read this page when buying credits or configuring auto-recharge fails with a 400.

What happened

Routes:
  • POST /v1/billing/checkout
  • PUT /v1/billing/auto-recharge
Amounts are integers in micro-USD: 1,000,000 micros is $1 and 10,000 micros is one cent. Nothing was charged and no setting was changed. These are every message: The bounds:

How to fix

  1. Convert dollars to micros by multiplying by 1,000,000, and round to whole cents first: $25.00 is 25000000.
  2. Keep amount_micros between 5000000 and 1000000000.
  3. When you enable auto-recharge, send enabled, threshold_micros and amount_micros together.
  4. Send the corrected request. The refused one changed nothing.

Example

Buying $25 of credits. The call needs billing_write and returns a hosted Stripe checkout page; the credit arrives after payment.
Enabling auto-recharge: top up 20wheneverthebalancefallsbelow20 whenever the balance falls below 5.