# Pay invoice

## Paying an Invoice

The Clinch SDK provides the ability to handle user payments through the `onPayInvoice` callback. This callback is triggered when the Clinch web app requests a payment to be made. Your implementation of `onPayInvoice` should receive the invoice and either pay it immediately, or show a confirmation popup.

In the case of Clinch, the invoice is returned as a bolt11 invoice, which is a payment request format used for the Lightning Network.

When the invoice is paid, the Clinch web up will update to allow the user to play their match. The invoice is checked for payment by our server.

## **Implementing the `onPayInvoice` Callback**

The `onPayInvoice` callback will receive an object that includes the bolt11 invoice string. You should handle the payment process paying the invoice on behalf of your user.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thndr.io/integration/lightning-iframe/pay-invoice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
