2021-01-08 05:15:47 +10:30
lightning-sendinvoice -- Command for send an invoice for an offer
=================================================================
SYNOPSIS
--------
2021-01-14 14:06:59 +10:30
**(WARNING: experimental-offers only)**
2021-01-08 05:15:47 +10:30
2023-03-06 14:09:12 +10:30
**sendinvoice** *invreq* *label* [*amount\_msat*] [*timeout*] [*quantity*]
2021-01-08 05:15:47 +10:30
DESCRIPTION
-----------
The **sendinvoice** RPC command creates and sends an invoice to the
2023-03-06 14:09:12 +10:30
issuer of an *invoice\_request* for it to pay: lightning-invoicerequest(7).
2021-01-08 05:15:47 +10:30
2021-07-01 13:58:57 +09:30
If **fetchinvoice-noconnect** is not specified in the configuation, it
will connect to the destination in the (currently common!) case where it
cannot find a route which supports `option_onion_messages` .
2023-03-06 14:09:12 +10:30
*invreq* is the bolt12 invoice\_request string beginning with "lnr1".
2021-01-08 05:15:47 +10:30
*label* is the unique label to use for this invoice.
2022-12-10 10:10:19 +02:00
*amount\_msat* is optional: it is required if the *offer* does not specify
2021-01-08 05:15:47 +10:30
an amount at all, or specifies it in a different currency. Otherwise
you may set it (e.g. to provide a tip), and if not it defaults to the
amount contained in the offer (multiplied by *quantity* if any).
*timeout* is how many seconds to wait for the offering node to pay the
2021-01-08 05:23:47 +10:30
invoice or return an error, default 90 seconds. This will also be the
timeout on the invoice that is sent.
2021-01-08 05:15:47 +10:30
*quantity* is optional: it is required if the *offer* specifies
2023-03-06 14:09:12 +10:30
*quantity\_max*, otherwise it is not allowed.
2021-01-08 05:15:47 +10:30
RETURN VALUE
------------
2021-06-16 10:40:17 +09:30
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
2022-09-06 07:03:09 +09:30
2021-06-16 10:40:17 +09:30
- **label** (string): unique label supplied at invoice creation
- **description** (string): description used in the invoice
2023-01-30 16:54:17 +10:30
- **payment\_hash** (hash): the hash of the *payment\_preimage* which will prove payment
2021-06-16 10:40:17 +09:30
- **status** (string): Whether it's paid, unpaid or unpayable (one of "unpaid", "paid", "expired")
2022-09-06 07:15:06 +09:30
- **expires\_at** (u64): UNIX timestamp of when it will become / became unpayable
2023-07-22 20:29:17 +09:30
- **created\_index** (u64): 1-based index indicating order this invoice was created in *(added v23.08)*
2022-09-06 07:15:06 +09:30
- **amount\_msat** (msat, optional): the amount required to pay this invoice
2021-06-16 10:40:17 +09:30
- **bolt12** (string, optional): the BOLT12 string
2023-07-22 20:29:17 +09:30
- **updated\_index** (u64, optional): 1-based index indicating order this invoice was changed (only present if it has changed since creation) *(added v23.08)*
2021-06-16 10:40:17 +09:30
If **status** is "paid":
2022-09-06 07:03:09 +09:30
2022-09-06 07:15:06 +09:30
- **pay\_index** (u64): Unique incrementing index for this payment
2022-11-10 21:03:13 -05:00
- **amount\_received\_msat** (msat): the amount actually received (could be slightly greater than *amount\_msat* , since clients may overpay)
2022-09-06 07:15:06 +09:30
- **paid\_at** (u64): UNIX timestamp of when it was paid
2023-01-30 16:54:17 +10:30
- **payment\_preimage** (secret): proof of payment
2021-09-03 19:37:59 +09:30
2021-06-16 10:40:17 +09:30
[comment]: # (GENERATE-FROM-SCHEMA-END)
2021-01-08 05:15:47 +10:30
The following error codes may occur:
- -1: Catchall nonspecific error.
- 1002: Offer has expired.
- 1003: Cannot find a route to the node making the offer.
- 1004: The node making the offer returned an error message.
- 1005: We timed out waiting for the invoice to be paid
AUTHOR
------
Rusty Russell < < rusty @rustcorp .com.au > > is mainly responsible.
SEE ALSO
--------
lightning-fetchinvoice(7).
RESOURCES
---------
Main web site: < https: / / github . com / ElementsProject / lightning >
2023-07-22 20:29:17 +09:30
[comment]: # ( SHA256STAMP:682cf05a868d744b3a70a4747d26a23ba802ffe3abc0cce4bd89683377be1930)