Errors
Every failure is a JSON object carrying a machine-readable error code, which never changes meaning, and a message written for people. Branch on the code; log or display the message.
{ "error": "insufficient_balance", "message": "wallet holds 0 tokens" }
Your request
| Code | HTTP | Meaning |
|---|---|---|
invalid_request | 400 | Something required is absent, or a field has the wrong shape. |
invalid_address | 400 | An address field (token, from, beneficiary, …) does not parse as one. |
invalid_amount | 400 | amount is zero, negative or not numeric, or a percentage was given on a buy. |
invalid_action | 400 | Only "buy" and "sell" are accepted. |
token_not_found | 404 | The address is not a Flap token on BNB Chain. Check you copied the token, not a pool. |
Trading
| Code | HTTP | Meaning |
|---|---|---|
insufficient_funds | 400 | Not enough BNB in from for the trade plus gas. The message states the balance and the requirement side by side. It has to be BNB on BNB Chain - a balance of USD1 or another asset does not pay for gas. |
insufficient_balance | 400 | Selling more tokens than the wallet holds, or paying with a quote asset you don't hold enough of. "100%" sells everything. |
slippage_exceeded | 400 | Between quoting and building, the price moved past what slippage allows. Re-request; on a volatile token, allow more. |
quote_asset_required | 400 | The token is priced in an asset Flap cannot swap BNB into (or out of). Hold the asset and buy with payWithQuote: true; sells pay out in the asset. |
buy_quota_exhausted | 400 | The token caps curve buys per wallet and this wallet has used its cap. |
amount_too_small | 400 | So little that the trade would return nothing. Increase amount. |
not_tradable | 409 | The token is not in a tradeable state right now (mid-migration, or blocked by Flap). Retry in a minute. |
insufficient_allowance | 400 | The spender lacks an allowance the trade relies on. Request again and an approve transaction is prepended. |
Sending
| Code | HTTP | Meaning |
|---|---|---|
not_ours | 400 | /api/send only broadcasts transactions this API built: Flap trades, launches, approvals to our router or Flap's Portal, and claims. Anything else is refused before it reaches the chain. |
wrong_chain | 400 | The signed transaction is for another chain id; this API relays BNB Chain (56). |
Creating a token
| Code | HTTP | Meaning |
|---|---|---|
invalid_pair_token | 400 | pairToken is not an address and not one of the known tickers (listed in the message). |
pair_token_not_approved | 400 | Flap doesn't accept that asset as a quote. Use BNB or one of the enabled assets. |
invalid_tax | 400 | buyTaxBps / sellTaxBps is above 10000. |
invalid_logo | 400 | logo is not a fetchable image URL or a valid base64 data: URL. |
launch_rate_limited | 400 | Flap limits how often one wallet may launch. Wait and retry. |
launcher_blocked | 400 | Flap has blocked from from launching. |
metadata_already_used | 400 | Another token already uses this metadata CID. Pin fresh metadata. |
name_blacklisted | 400 | Flap rejects this name or symbol. |
flap_disabled | 400 | Flap has paused launching or trading. Try later. |
missing_file | 400 | The multipart upload contained no file part. |
not_an_image | 400 | The file's content type is not image/*. |
file_too_large | 400 | Images are capped at 5 MB. |
invalid_upload | 400 | The multipart body could not be parsed. |
Creator revenue
| Code | HTTP | Meaning |
|---|---|---|
nothing_to_claim | 400 | No tax, LP fees or dividend is pending for this wallet on this token. The message notes how much Flap has already paid out on its own. |
not_beneficiary | 400 | Only the token's beneficiary can claim its LP fee share. |
not_graduated | 400 | LP fees exist only once the token has graduated to PancakeSwap. |
Limits
| Code | HTTP | Meaning |
|---|---|---|
rate_limited | 429 | Over 3 calls a second to a single endpoint from one IP. Retry-After: 1 says when to try again. |
too_many_connections | 429 | One launch-feed socket per IP is the cap; this would have been the second. |
Everything else
| Code | HTTP | Meaning |
|---|---|---|
revert | 400 | Simulation shows the transaction failing for a reason without its own code; message carries the decoded contract error. |
rpc_error | 502 | BNB Chain (or Flap's IPFS gateway) could not be reached. Retry. |
Passing every check here does not guarantee a landed trade: the price can still move past minOut before your transaction is mined, in which case it reverts and only gas is spent.