INVALID_PARAMS
Invalid parameters: A required parameter is missing or malformed, or the request is not allowed for this provider.
| HTTP status | Retry |
|---|---|
400 |
no |
Where it comes from: GET /v1/quote, POST /v1/orders, POST /v1/orders/submit, GET /v1/orders/{provider}/{id}; also mapped from provider validation errors.
Causes#
- A required query parameter of
GET /v1/quoteis missing (srcChain,srcToken,amount,dstChain,dstToken,sender,recipient). amountis not an integer string in base units (for example"1.5"or"1e6").slippageBpsis outside 1–5000, orchannelis not one ofweb,widget,bot,api.quoteId(orsignedTransaction) is missing from a POST body, or the body is not JSON.POST /v1/orders/submitwas called for a provider whose transactions are broadcast by the wallet (onlysubmitViaApitransactions can be submitted).GET /v1/orders/{provider}/{id}names a provider that is not loaded in this API instance.- A provider rejected an address or slippage value (for example Relay
INVALID_RECIPIENT, deBridge affiliate fee over its cap).
How to fix#
- Read
error.message: it lists each failing field asfield: reason. - Convert human amounts to base units with the token's
decimals(see GET /v1/tokens). - Only call submit when
tx.vm === "svm" && tx.submitViaApi; otherwise send the transaction from the wallet. - Use a
providervalue returned by the quote you are tracking.
Example response#
JSON
{
"error": {
"code": "INVALID_PARAMS",
"message": "amount: amount must be an integer string in base units",
"requestId": "0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21",
"docsUrl": "https://docs.layerhop.com/errors/INVALID_PARAMS"
}
}See Error handling & retries for a retry strategy, and the error catalog for every code.