From d4de78f1e867d313e36a762c08d7821d2d101490 Mon Sep 17 00:00:00 2001 From: stackregister <132720842+stackregister@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:30:45 +0000 Subject: [PATCH] Add description to POST v1/payments endpoint. (#1848) --- lnbits/core/views/api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index c4956bb3f..c1a1ad2aa 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -300,6 +300,14 @@ async def api_payments_pay_invoice(bolt11: str, wallet: Wallet): @core_app.post( "/api/v1/payments", + summary="Create or pay an invoice", + description=""" +This endpoint can be used both to generate and pay a BOLT11 invoice. +To generate a new invoice for receiving funds into the authorized account, +specify at least the first four fields in the POST body: `out: false`, `amount`, `unit`, and `memo`. +To pay an arbitrary invoice from the funds already in the authorized account, +specify `out: true` and use the `bolt11` field to supply the BOLT11 invoice to be paid. +""", status_code=HTTPStatus.CREATED, ) async def api_payments_create(