LayerHopdocs

Error codes

INVALID_PARAMS

Invalid parameters: A required parameter is missing or malformed, or the request is not allowed for this provider.

Open in ClaudeOpen in ChatGPT
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/quote is missing (srcChain, srcToken, amount, dstChain, dstToken, sender, recipient).
  • amount is not an integer string in base units (for example "1.5" or "1e6").
  • slippageBps is outside 1–5000, or channel is not one of web, widget, bot, api.
  • quoteId (or signedTransaction) is missing from a POST body, or the body is not JSON.
  • POST /v1/orders/submit was called for a provider whose transactions are broadcast by the wallet (only submitViaApi transactions 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 as field: 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 provider value 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.