The following is the ideal flow Zaprite would like to have when using the Galoy API.
Zaprite should have it's own API key that we store as an environment variable in our Next JS app.
1. Create public invoices on a user's behalf
2. Watch for settlement of those invoices
Zaprite users can sign-up and add their Bitcoin Beach handle to Zaprite's database, via our UI.
We will generate a Bitcoin Beach public invoice on the Zaprite user's behalf, using our API key and their handle.
We need to also attach custom metadata to the POST request, as follows:
"metadata": {
"userId": "QNmM7hHzi6vjbi15BSu9",
"docId": "M7hNmHzi15Bidi6vjbSQ",
"ref": "l4c9wAxjt8A7QUqZr7Dh"
}This metadata should be stored on your side, and sent back with the webhook payload.
We need to have the ability to create a subscription that watches all invoices that have been generated using our API key.
The webhook should deliver a payload to our endpoint whenever an invoice is settled. This payload should include the custom metadata that we sent with the original POST request to create the invoice.