Skip to content

Commit

Permalink
Add descriptions of handled notification types
Browse files Browse the repository at this point in the history
  • Loading branch information
dangeross committed Apr 4, 2024
1 parent 553c500 commit 989e6b6
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/notifications/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,57 @@ The Breez SDK Notification Plugin provides vendors the ability to receive events

This process involves using a Notification Delivery Service (NDS) acting as an intermediary host by the application developer. The NDS must provide a public facing webhook URL where a POST request can be sent to when a notification needs to be delivered to the application. The NDS then forwards the data sent in the webhook POST request via push notification to the application. When the application then receives the push notification then Breez SDK Notification Plugin can be used to process the event.

## Handled Types

The following notification types are handled by default by the Notification Plugin.

#### Payment Received

When an LSP intercepts a payment on the way to the user's node, the LSP will call the webhook with the POST data:
```json
{
"template": "payment_received",
"data": {
"payment_hash": "" // The payment hash that is in progress
}
}
```

#### Swap Confirmed

When the chain service confirms that there are funds available at the swap address when receiving a onchain payment, the chain service will call the webhook with the POST data:
```json
{
"template": "address_txs_confirmed",
"data": {
"address": "" // The address of the swap with confirmed funds
}
}
```

#### LNURL-pay

When an LNURL service receives a request for LNURL-pay info or an invoice, the LNURL service will first call the webhook with the POST data:
```json
{
"template": "lnurlpay_info",
"data": {
"callback_url": "", // The URL of the LNURL service
"reply_url": "" // The URL to reply to this request
}
}
```
Then to get an invoice with the POST data:
```json
{
"template": "lnurlpay_invoice",
"data": {
"amount": 0, // The amount in millisatoshis within the min/max sendable range
"reply_url": "" // The URL to reply to this request
}
}
```

## Next Steps
- **[Setup an NDS](setup_nds.md)** to receive webhook requests
- **[Register a webhook](register_webhook.md)** in your main application
Expand Down

0 comments on commit 989e6b6

Please sign in to comment.