Skip to main content
To let users deposit Bitcoin faster and with lower fees, you can use the Bitcoin Lightning Network. Lightning is a second-layer protocol built on top of Bitcoin that enables fast, low-cost payments by processing transactions off-chain instead of recording each one directly on the Bitcoin blockchain. This guide outlines the main features of Lightning payments and provides an example of how to implement a Bitcoin Lightning deposit form using AlphaPo.

Key characteristics of Lightning payments

Bitcoin Lightning deposits use Lightning invoices instead of standard BTC wallet addresses. A Lightning invoice is a payment request that contains the amount to pay and the details needed to complete the transaction. Example Lightning invoice:
lnbcrt1m1p5u93tfpp53wwjfugpyypf68mgwjfzq99x8cghlurxwpp680r9uyvd8qxkjulqdqqcqzysxqzuysp5fdzuturj4cttdaafw09j739adh4slxxqynnjpl6n208wqfc8ny6q9qxpqysgqgdgwm5hdt736pm3jkn0spp85zwx0023vlxj8s0fjkha55wtyg5hjxvmkjl6ee4ztxrc75j3q7qzxua7r28qujlvc3ykmaklczwccmkspazvfhu
Lightning invoice rules
  • Each invoice is created for a specific amount and can only be paid once.
  • The invoice contains the exact payment amount, so it must be paid in full and exactly as issued. Partial payments and overpayments are not possible.
  • The invoice expires 15 minutes after it is created. The exact expiration time is included in the API response when the Lightning invoice is generated.
  • The amount cannot be changed after the invoice is created.
  • The maximum supported amount is 0.045 BTCLN. For larger deposits, use the Bitcoin network.

How the payment form can be implemented

1

Display a Generate Lightning invoice form to a user

Add an Amount field for the user to fill in:
Image 3
2

Send POST /addresses/take to AlphaPo

After the user enters an amount and clicks Generate, your site should send a POST request to the /addresses/take endpoint.
POST /api/v2/addresses/take HTTP/1.1
Host: app.alphapo.net
X-Processing-Key: <api-key>
X-Processing-Signature: <api-key>
Content-Type: application/json
Accept: */*
    
{
  "currency": "BTCLN",
  "foreign_id": "1909242403",
  "amount": 0.0025
}
3

Process the API response

Extract the Lightning invoice from the address field in the API response:
{
  "data": {
    "id": 240379058,
    "currency": "BTCLN",
    "address": "lnbcrt1m1p5u93tfpp53wwjfugpyypf68mgwjfzq99x8cghlurxwpp680r9uyvd8qxkjulqdqqcqzysxqzuysp5fdzuturj4cttdaafw09j739adh4slxxqynnjpl6n208wqfc8ny6q9qxpqysgqgdgwm5hdt736pm3jkn0spp85zwx0023vlxj8s0fjkha55wtyg5hjxvmkjl6ee4ztxrc75j3q7qzxua7r28qujlvc3ykmaklczwccmkspazvfhu",
    "tag": null,
    "foreign_id": "1909242403",
    "expires_at": 1774373101
  }
}
4

Show the Lightning invoice to the user

Generate a QR code for the user to scan, or provide an Open wallet button:
Image 4
5

Payment successful

Wait for a deposit callback from AlphaPo where status is confirmed, then show a deposit confirmation message.
Image

Adding an Open wallet button on mobile

To let users pay Lightning invoices on mobile, you can add an Open wallet button with a Lightning deeplink. When the user taps the button, a compatible Lightning wallet opens with the payment details pre-filled. Lightning deeplink example:
lightning:lnbcrt1m1p5u93tfpp53wwjfugpyypf68mgwjfzq99x8cghlurxwpp680r9uyvd8qxkjulqdqqcqzysxqzuysp5fdzuturj4cttdaafw09j739adh4slxxqynnjpl6n208wqfc8ny6q9qxpqysgqgdgwm5hdt736pm3jkn0spp85zwx0023vlxj8s0fjkha55wtyg5hjxvmkjl6ee4ztxrc75j3q7qzxua7r28qujlvc3ykmaklczwccmkspazvfhu
How it works
  1. The customer taps the link on their mobile device.
  2. Your site opens the lightning:lnbc... deeplink.
  3. If the customer has a compatible wallet site installed, it opens with the invoice ready to pay.
  4. If no compatible wallet is installed, the deeplink does not open and the customer may see an error such as No Lightning wallet is installed on your device.

Additional details

  • Bitcoin withdrawals using the Lightning Network are not supported. To withdraw funds, first exchange BTCLN to BTC or another supported currency. Exchanges between BTCLN and BTC are always at a 1:1 rate with no fees.
  • You can also convert BTCLN to any supported currency and withdraw in a single step by using the /withdrawal/crypto endpoint with the convert_to parameter set to the target currency.
  • For more details about the /addresses/take endpoint, refer to Generate a crypto address.
Last modified on June 7, 2026