> For the complete documentation index, see [llms.txt](https://guides.getalby.com/developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.getalby.com/developer-guide/developer-guide/lightning-tools/introduction/receiving-bitcoin-payments.md).

# Receiving Bitcoin Payments

How to receive bitcoin payments in your web app.

Using a lightning address is the easiest way to receive bitcoin payments over the lightning network.  Alby makes it particularly easy to receive bitcoin payments on your website with [*Lightning Tools*](#features-of-lightning-tools-backend) and [*Bitcoin Connect*](#accept-bitcoin-payments-frontend).&#x20;

### High-level Use Cases

* Accept bitcoin in your online shop
* Receive payments on your website
* Charge users for using your web service&#x20;

### Example

1. A user visits your site and makes a request to purchase a product that costs 100 sats.
2. Your backend requests an invoice from your lightning address, setting the amount as 100 sats, and returns it to the user.
3. The user pays the invoice using their favorite lightning wallet.
4. Your backend verifies that the invoice has been paid, and then sends the user their purchased product.

### Features of Lightning Tools (backend)

[Lightning Tools](https://github.com/getAlby/js-lightning-tools) is a Javascript library that makes this flow super simple by providing all the functions you need to receive bitcoin payments from your users and customers. Lightning Tools is a neutral set of tools to:&#x20;

* Interact with your lightning address
* Request a lightning invoice
* Verify payments in a programmatic way
* Boost a lightning address (paying in podcasting)
* Zap a lightning address (paying on Nostr)
* Pay for content behind a L402 monetized paywall (e.g. APIs)
* Convert bitcoin to fiat amounts
* Simplify requests to lightning providers

All you need is a lightning address. With [Lightning Tools](https://github.com/getAlby/js-lightning-tools) you can use any lightning address you like.&#x20;

*Are looking for some inspiration?*

{% hint style="info" %}
**Showcase**: Visit this bitcoin powered [**web shop**](https://bitcoin-shop.netlify.app/) from Tobi. He also wrote a very easy to follow and detailed [tutorial](https://tobiojuolape.hashnode.dev/how-to-build-a-simple-e-commerce-web-app-using-albys-lightning-tools) including code examples about building an e-commerce web app with bitcoin payments.&#x20;
{% endhint %}

### **Accept Bitcoin Payments (frontend)**

Use the **Bitcoin Connect** widget to enable seamless payments directly on your website. It provides an optimized, low-friction user experience that makes paying with Bitcoin simple and intuitive for your visitors.

<https://bitcoin-connect.com/>

<figure><img src="https://423669661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsvArWT5OWlpNFUBAUkGM%2Fuploads%2FAvBYT8TKeIHoFxZsO3q8%2Fimage.png?alt=media&amp;token=f0fe3792-cb89-4fca-9f99-7488135a8363" alt=""><figcaption></figcaption></figure>

**Give it a try and** [**let us know**](mailto:hello@getalby.com) **if we can assist.** ✉️


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guides.getalby.com/developer-guide/developer-guide/lightning-tools/introduction/receiving-bitcoin-payments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
