Storspay Docs
Support

Money and amounts

Every amount is a decimal string in major units. Never a number.

Applies to the new routes.

Every amount is a string in major units, with exactly the currency's number of decimals:

{ "amount": "1000.00", "currency": "USD" }
{ "amount": "5000", "currency": "XOF" }
{ "amount": "1500000.00", "currency": "NGN" }

In your code

Parse amounts with a decimal library or as integer minor units. Don't convert them to floating-point numbers.

// "1000.00" USD → 100000 cents, without floats
const [whole, frac = ""] = "1000.00".split(".");
const minor = BigInt(whole) * 100n + BigInt(frac.padEnd(2, "0"));

Quotes

  1. POST /v1/quotes with intent: "payout" or "convert".
  2. The quote holds the amounts, the rate, our fee, any platform fee, the total and expiresAt.
  3. Use it once, for its intent only: a payout quote creates one payout; a convert quote one conversion.
  4. Expired → 409 QUOTE_EXPIRED: make a new quote. Used → 409 QUOTE_ALREADY_USED. Wrong intent → 422 QUOTE_INTENT_MISMATCH.

Quotes last 5 minutes (payout) and 60 seconds (convert). Transfers between Storspay accounts in the same currency need no quote.

September v1 API

The September v1 API sends and returns amounts as numbers (for example amountUsd), exactly as it was specified. It does not change. Use the new routes for decimal strings.