I'm integrating BTCPay Server and I keep getting a consistent HTTP 404 rom every Store/Invoice API endpoint that I've tried.
Interestingly, https://mainnet.demo.btcpayserver.org/api/v1/health returns 200 OK, so the server itself is reachable. Could this indicate that the demo instance doesn't expose the Greenfield Store API, that I'm using the wrong API base path/version, or that there's an issue with the Store ID or API key?
Is there a known BTCPay demo-environment limitation that would cause this behaviour? What is the correct endpoint/permission setup for creating and checking Lightning invoices via the API? Finally, if the demo instance is the problem, what's the quickest practical workaround for testing reliable Lightning payment creation and verification?
Measured this hour on
https://mainnet.demo.btcpayserver.org(GET /api/v1/health→ 200{"synchronized":true}).The demo does expose Greenfield. A consistent 404 is almost always a wrong path, not a missing Store API.
Correct routes return JSON 401, never 404, when you skip auth or send a fake key:
GET /api/v1/storesGET|POST /api/v1/stores/{storeId}/invoices— create/check invoicesGET|POST /api/v1/stores/{storeId}/lightning/BTC/invoices— LN node invoices (BTCcryptoCode is required)I hit these 404s on this demo:
/api/v1/storeand/api/v1/store/{id}(singular)/api/v1/stores/{id}/lightningand/lightning/BTC(incomplete)/api/v1/stores/{id}/lightning/invoices(missingBTC)/greenfield/api/v1/storesAuth header is
Authorization: token <apikey>(not Bearer). Fake key → 401ApiKey authentication failed: Unknown API Key. Missing key on a real Greenfield route → 401Authentication is required for accessing this endpoint. If you see 404, you are not on those routes.Demo limitation: shared public instance. Health is anonymous; store/invoice routes are not. There is no public Store ID. Register on that demo → Store → Settings → Access Tokens, with
btcpay.store.canviewinvoices+btcpay.store.cancreateinvoice(and lightning perms if you use the LN node API).Quickest workaround:
POST /api/v1/stores/{storeId}/invoicesbody{"amount":"1","checkout":{"paymentMethods":["BTC-LN"]}}thenGET /api/v1/stores/{storeId}/invoices/{invoiceId}for the BOLT11.If the demo store has no Lightning wallet, run your own BTCPay + LND/CLN/phoenixd, or a testnet instance. phoenixd's
/createinvoiceis a different API if you only need a BOLT11 without BTCPay.Thanks a lot, this is very helpful to say the least! I have a few follow-up questions to make sure that we’re testing the correct integration:
Store IDcause that, or should it always return401/403?POST /api/v1/stores/{storeId}/invoicesendpoint preferable to the direct/lightning/BTC/invoicesendpoint?Thank you again! 🙏🏻
Definitely curious about this one since I have faced a similar issue in the past 🤔