Skip to main content

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

CodeHTTPMeaning
invalid_request400Something required is absent, or a field has the wrong shape.
invalid_address400An address field (token, from, beneficiary, …) does not parse as one.
invalid_amount400amount is zero, negative or not numeric, or a percentage was given on a buy.
invalid_action400Only "buy" and "sell" are accepted.
token_not_found404The address is not a Flap token on BNB Chain. Check you copied the token, not a pool.

Trading

CodeHTTPMeaning
insufficient_funds400Not 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_balance400Selling more tokens than the wallet holds, or paying with a quote asset you don't hold enough of. "100%" sells everything.
slippage_exceeded400Between quoting and building, the price moved past what slippage allows. Re-request; on a volatile token, allow more.
quote_asset_required400The 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_exhausted400The token caps curve buys per wallet and this wallet has used its cap.
amount_too_small400So little that the trade would return nothing. Increase amount.
not_tradable409The token is not in a tradeable state right now (mid-migration, or blocked by Flap). Retry in a minute.
insufficient_allowance400The spender lacks an allowance the trade relies on. Request again and an approve transaction is prepended.

Sending

CodeHTTPMeaning
not_ours400/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_chain400The signed transaction is for another chain id; this API relays BNB Chain (56).

Creating a token

CodeHTTPMeaning
invalid_pair_token400pairToken is not an address and not one of the known tickers (listed in the message).
pair_token_not_approved400Flap doesn't accept that asset as a quote. Use BNB or one of the enabled assets.
invalid_tax400buyTaxBps / sellTaxBps is above 10000.
invalid_logo400logo is not a fetchable image URL or a valid base64 data: URL.
launch_rate_limited400Flap limits how often one wallet may launch. Wait and retry.
launcher_blocked400Flap has blocked from from launching.
metadata_already_used400Another token already uses this metadata CID. Pin fresh metadata.
name_blacklisted400Flap rejects this name or symbol.
flap_disabled400Flap has paused launching or trading. Try later.
missing_file400The multipart upload contained no file part.
not_an_image400The file's content type is not image/*.
file_too_large400Images are capped at 5 MB.
invalid_upload400The multipart body could not be parsed.

Creator revenue

CodeHTTPMeaning
nothing_to_claim400No 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_beneficiary400Only the token's beneficiary can claim its LP fee share.
not_graduated400LP fees exist only once the token has graduated to PancakeSwap.

Limits

CodeHTTPMeaning
rate_limited429Over 3 calls a second to a single endpoint from one IP. Retry-After: 1 says when to try again.
too_many_connections429One launch-feed socket per IP is the cap; this would have been the second.

Everything else

CodeHTTPMeaning
revert400Simulation shows the transaction failing for a reason without its own code; message carries the decoded contract error.
rpc_error502BNB 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.