Skip to content

[Bug]: amount parameter not overriding BOLT11 amount when paying lightning invoices #6937

@b4oshany

Description

@b4oshany

What is your BTCPay version?

v2.2.1+790616d2a

How did you deploy BTCPay Server?

Docker on Lunanode

What happened?

amount parameter not overriding BOLT11 amount

Endpoint:
POST /api/v1/stores/{storeId}/lightning/{cryptoCode}/invoices/pay
(Reference: [BTCPay API Docs](https://docs.btcpayserver.org/API/Greenfield/v1/#operation/StoreLightningNodeApi_PayInvoice))

According to the documentation, the amount parameter in the request body should override the amount specified in the BOLT11 invoice.
However, in practice, the amount value passed in the request does not override the value encoded in the BOLT11 invoice — the payment still uses the amount embedded in the invoice.


Steps to Reproduce

  1. Create a BOLT11 invoice in Speed Wallet with 39,700 sats
  2. Send a POST request to the endpoint with a valid BOLT11 invoice and include a custom amount field, which is 29,700.
  3. Observe that the payment is processed using the original BOLT11 invoice amount, not the amount supplied in the request.

Expected behavior:
The payment should use the amount value provided in the request payload, overriding the amount embedded in the BOLT11 invoice (as stated in the API documentation).

Actual behavior:
The payment always uses the original amount from the BOLT11 invoice, ignoring the amount parameter.

How did you encounter this bug?

  1. Create a BOLT11 invoice in Speed Wallet with 39700 sats
  2. Send a POST request to the endpoint with a valid BOLT11 invoice and include a custom amount field, which is 21700.
  3. Observe that the payment is processed using the original BOLT11 invoice amount, not the amount supplied in the request.

Are you sure this is a bug report?

  • I confirm this is a bug report

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIQuestions and issues related to APILightningIssues related to Lightning Networkneed-infoRequires more information

    Type

    No type

    Projects

    Status

    Done ✅

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions