forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlightning-invoicerequest.json
162 lines (162 loc) · 5.42 KB
/
lightning-invoicerequest.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"added": "v22.11",
"rpc": "invoicerequest",
"title": "Command for offering payments",
"description": [
"The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment."
],
"request": {
"required": [
"amount",
"description"
],
"additionalProperties": false,
"properties": {
"amount": {
"type": "msat",
"description": [
"A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
]
},
"description": {
"type": "string",
"description": [
"A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes."
]
},
"issuer": {
"type": "string",
"description": [
"Who is issuing it (i.e. you) if appropriate."
]
},
"label": {
"type": "string",
"description": [
"An internal-use name for the offer, which can be any UTF-8 string."
]
},
"absolute_expiry": {
"type": "u64",
"description": [
"The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`."
]
},
"single_use": {
"type": "boolean",
"description": [
"Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money)."
],
"default": "True"
}
}
},
"response": {
"required": [
"invreq_id",
"single_use",
"active",
"bolt12",
"used"
],
"additionalProperties": false,
"properties": {
"invreq_id": {
"type": "hash",
"description": [
"The SHA256 hash of all invoice_request fields less than 160."
]
},
"active": {
"type": "boolean",
"enum": [
true
],
"description": [
"Whether the invoice_request is currently active."
]
},
"single_use": {
"type": "boolean",
"description": [
"Whether the invoice_request will become inactive after we pay an invoice for it."
]
},
"bolt12": {
"type": "string",
"description": [
"The bolt12 string starting with lnr."
]
},
"used": {
"type": "boolean",
"enum": [
false
],
"description": [
"Whether the invoice_request has already been used."
]
},
"label": {
"type": "string",
"description": [
"The label provided when creating the invoice_request."
]
}
}
},
"errors": [
"On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not.",
"",
"- -1: Catchall nonspecific error."
],
"author": [
"Rusty Russell <<[email protected]>> is mainly responsible."
],
"see_also": [
"lightning-listinvoicerequests(7)",
"lightning-disableinvoicerequest(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:invoicerequest#1",
"method": "invoicerequest",
"params": {
"amount": 1000000,
"description": "Simple test"
}
},
"response": {
"invreq_id": "93f193cd2432d292f8b64af08942989d71c0a0366fb52d57ddb688c8fb066399",
"active": true,
"single_use": true,
"bolt12": "lnr1qqgypua5g7rp293k00s66ayvnv26czst2d5k6urvv5s8getnw3gzqp3zderpzxstt8927ynqg044h0egcd8n5h3n9g0u0v4h8ncc3yg02gps7sjqtqssytfzxcs2xkdy0lml0tzy0jzugmyj8kjn8zfzrgq9fsgurc72x82e7pq947t0ks7a4yejz8w79x4zj25s3pu6zrnw2e0v2ugdescpcqsq307z4p2dlxe92fv7xd43qut0pjkg4y094hupqyhsj8dlhvmmfng6sv",
"used": false
}
},
{
"request": {
"id": "example:invoicerequest#2",
"method": "invoicerequest",
"params": {
"amount": "10000sat",
"description": "Requesting for invoice",
"issuer": "clightning store"
}
},
"response": {
"invreq_id": "a621a0e8e8ea9aa97fd47ab9b140e413be7f4ea45377617e693eb7afe5a3dbf9",
"active": true,
"single_use": true,
"bolt12": "lnr1qqgx5t5hcw5ru9fgkhgxj4thjq4ugzsk2fjhzat9wd6xjmn8ypnx7u3qd9h8vmmfvdj3yyrrd35kw6r5de5kueeqwd6x7un92qsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzr6jqwvfdqzcyypz6g3kyz34nfrl7lm6c3rushzxey3a55ecjgs6qp2vz8q78j336k0sgpvamrunx5t6vdaeu7nmmlh5u6f0dnscasy2alyxq79f5wnc043gxrzyqt640dmuj7c94644j5ae6wfse7tsejwqnmc575ly9t38h4hf",
"used": false
}
}
]
}