{
  "$schema": "../rpc-schema-draft.json",
  "type": "object",
  "added": "v23.02",
  "rpc": "signinvoice",
  "title": "Low-level invoice signing",
  "description": [
    "The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage."
  ],
  "request": {
    "required": [
      "invstring"
    ],
    "additionalProperties": false,
    "properties": {
      "invstring": {
        "type": "string",
        "description": [
          "Bolt11 form, but the final signature is ignored. Minimal sanity checks are done."
        ]
      }
    }
  },
  "response": {
    "required": [
      "bolt11"
    ],
    "additionalProperties": false,
    "properties": {
      "bolt11": {
        "type": "string",
        "description": [
          "The bolt11 string."
        ]
      }
    }
  },
  "errors": [
    "The following error codes may occur:",
    "",
    "- -1: Catchall nonspecific error."
  ],
  "author": [
    "Carl Dong [contact@carldong.me](mailto:contact@carldong.me) is mainly responsible."
  ],
  "see_also": [
    "lightning-createinvoice(7)",
    "lightning-invoice(7)",
    "lightning-listinvoices(7)",
    "lightning-delinvoice(7)",
    "lightning-getroute(7)",
    "lightning-sendpay(7)",
    "lightning-offer(7)"
  ],
  "resources": [
    "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
  ],
  "examples": [
    {
      "request": {
        "id": "example:signinvoice#1",
        "method": "signinvoice",
        "params": {
          "invstring": "lnbcrt100n1pnt2bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000"
        }
      },
      "response": {
        "bolt11": "lnbcrt100n1pnt2bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000"
      }
    },
    {
      "request": {
        "id": "example:signinvoice#2",
        "method": "signinvoice",
        "params": [
          "lnbcrt100n1pnt2bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000"
        ]
      },
      "response": {
        "bolt11": "lnbcrt100n1pnt2bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000"
      }
    }
  ]
}
