API Error Codes

Whenever the Kaminari server detects an input error or something failed on server-side it will return an HTTP 403, 400 or 500 status code along with a JSON object containing error details:

{
    "code": 7,
    "message": "self-payment disallowed",
    "details": [
        {
            "@type": "type.googleapis.com/x.errors.v1.Error",
            "err_code": 408,
            "err_message": "self-payments disallowed"
        }
    ]
}

err_code and err_message is the most important file of response.

The err_code field can be used to programmatically detect the type of error. Here are the supported error codes:

  • 405 Limit to merchant creation exceeded.

  • 406 Invalid invoice. Invoice should be BOLT 11 standard.

  • 407 Invalid amount. Amount must be positive (>0).

  • 408 Self-payment disallowed.

  • 409 Invoice has already been paid, you could not pay one invoice twice.

  • 410 Insufficient funds.

  • 500 Error occurred on server-side, check err_message field.

  • 600 No route. LND could not find route to destination with given fee, or have exhausted inbound liquidity.

Last updated