Solution brief · Paid APIs (L402)

Turn your API into a paid service with L402

Build paid APIs with L402, using your Phoenixd node to receive Lightning payments and your application to control access.

Charging for data, content, or compute means connecting payments to access permissions. L402 provides a payment and authentication flow over HTTP that you can implement in your application or middleware, backed by your Phoenixd node.

A practical approach

The integration can stay close to the way your product already works. Connect your application to the Phoenixd API and build payment flows around your users' needs.

Connect your node. Use your Phoenixd node as the Lightning payment backend for your application or compatible L402 middleware.

Issue a payment challenge. Set your price and return HTTP 402 with a Lightning invoice and a credential bound to its payment hash.

Grant paid access. Validate the credential and payment preimage when the client retries, then serve the resource according to your access policy.

Your team controls the experience, payment policies, and application logic. Use Phoenixd's payment primitives to build an integration that fits your product.

Ready to explore paid apis (l402) with your Phoenixd node?

Get Started