core-lightning/doc/schemas/lightning-disableoffer.json
Vincenzo Palazzo 1e1edfd073 offer: allow re-enabling a previously disabled offer
Sometimes, for various reasons, a user disables an offer
and then wants to re-enable it. This should be allowed because,
from the CLN point of view, it is just an internal state.

If a user has constraints on the description of the invoice
because they are using services that link some sort of user ID
to an offer, it is important for the user to be able to re-enable the
offer, not create a new one. Creating a new offer would
require a different description.

Link: https://github.com/ElementsProject/lightning/issues/7360
Co-Developed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-08-11 11:27:10 +09:30

109 lines
2.7 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"additionalProperties": false,
"rpc": "disableoffer",
"title": "Command for removing an offer",
"warning": "experimental-offers only",
"description": [
"The **disableoffer** RPC command disables an offer, so that no further invoices will be given out.",
"",
"We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer)."
],
"request": {
"required": [
"offer_id"
],
"properties": {
"offer_id": {
"type": "hash",
"description": [
"The id we use to identify this offer."
]
}
}
},
"response": {
"required": [
"offer_id",
"active",
"single_use",
"bolt12",
"used"
],
"properties": {
"offer_id": {
"type": "hash",
"description": [
"The merkle hash of the offer."
]
},
"active": {
"type": "boolean",
"enum": [
false
],
"description": [
"Whether the offer can produce invoices/payments."
]
},
"single_use": {
"type": "boolean",
"description": [
"Whether the offer is disabled after first successful use."
]
},
"bolt12": {
"type": "string",
"description": [
"The bolt12 string representing this offer."
]
},
"used": {
"type": "boolean",
"description": [
"Whether the offer has had an invoice paid / payment made."
]
},
"label": {
"type": "string",
"description": [
"The label provided when offer was created."
]
}
},
"pre_return_value_notes": [
"Note: the returned object is the same format as **listoffers**."
]
},
"author": [
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
],
"see_also": [
"lightning-enableoffer(7)",
"lightning-offer(7)",
"lightning-listoffers(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:disableoffer#1",
"method": "disableoffer",
"params": {
"offer_id": "b791f88cebf775853112c30828e116487f4d6c252d669372532b468bc7de8a24"
}
},
"response": {
"offer_id": "b791f88cebf775853112c30828e116487f4d6c252d669372532b468bc7de8a24",
"active": false,
"single_use": false,
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqv0gfqq2zp8kven9wgs8gmeqg35hxctzd3j3vggz953rvg9rtxj8lalh43z8epwydjfrmffn3y3p5qz5cywpu09rr4vs",
"used": false
}
}
]
}