Gateway/Overview
Gateway
Accept Lightning payments for requests to your API using MPP or L402. Your application decides when payment is required and how much to charge. Nodana requests and verifies payment through your Phoenixd node.
Customers call your API, and payments arrive at your node. Prices are supplied by your backend for each paid operation.
How it works
- Your API asks Nodana to request payment for an operation.
- Nodana returns a payment ID and a challenge for your API to relay to the customer.
- The customer pays and retries. Your API sends the payment ID and credentials to Nodana.
- Nodana authorises paid access, and your API serves the result.
MPP flow
The agent's payment client combines the challenge with the preimage returned by its wallet to build the MPP credential. Your API returns the resource and payment receipt after Nodana verifies it.
L402 flow
The challenge contains a macaroon and an invoice. After paying, the agent's client sends the macaroon and preimage together as its L402 credential. Nodana verifies it and your API returns the resource.
Get started
- Accept payments: connect your API and handle paid requests.
- Authentication and permissions: create a key with gateway access.
- Payment IDs and status: track a payment and check its status.