Add description to POST v1/payments endpoint. (#1848)

This commit is contained in:
stackregister 2023-08-18 09:30:45 +00:00 committed by GitHub
parent 1fd4d9d514
commit d4de78f1e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(