Create webhook endpoints to receive real-time notifications of the user's settled invoices.
Want to use webhooks for your own Alby account? create a webhook in our developer dashboard
Create a webhook endpoint
Scope needed: invoices:read
Creates a new webhook endpoint to receive notifications of settled invoices. Settled invoices are sent to the provided url as a POST request. Requests are sent with SVIX.
The endpoint_secret in the response body should be saved by the client in order to verify webhook posts to url. See the SVIX documentation on how to verify requests.
POSThttps://api.getalby.com/webhook_endpoints
Creates a new webhook endpoint.
Request Body
Name
Type
Description
description
String
url*
String
Webhook URL
filter_types*
String[]
One or more invoice event types to filter webhook events. Supported values are ["invoice.incoming.settled", "invoice.outgoing.settled"]
{"url": "https://webhook.site/2d10f6a2-8860-48af-8c25-379a3c921d30","description": "An example endpoint","filter_types": ["invoice.settled" ],"created_at": "2023-05-02T07:35:03.867Z","id": "ep_2PECYp6CLXBbAqyFnhbxFUXM2ZR","endpoint_secret": "whsec_QE8DIo3EtwlPmkOGCmxYyAcAxnpArzP/"}
{"amount":21,"boostagram": {"action":"boost","app_name":"webln demo","message":"hello from webln","name":"satoshi","sender_name":"bumi","value_msat_total":21000 },"comment":"hello from webln","created_at":"2023-05-03T08:22:23.030Z","creation_date":1683102142,"currency":"btc","custom_records": {"696969":"cWQ5VVgxYVNKUTVMcmkxRWx6U3o=","7629169":"eyJhY3Rpb24iOiJib29zdCIsInZhbHVlX21zYXRfdG90YWwiOjIxMDAwLCJhcHBfbmFtZSI6IndlYmxuIGRlbW8iLCJzZW5kZXJfbmFtZSI6ImJ1bWkiLCJuYW1lIjoic2F0b3NoaSIsIm1lc3NhZ2UiOiJoZWxsbyBmcm9tIHdlYmxuIn0=" },"description_hash":null,"expires_at":"2023-05-03T08:37:22.000Z","expiry":900,"fiat_currency":"USD","fiat_in_cents":1,"identifier":"QMYTg3PKDskease4svYJbM28","keysend_message":null,"memo":"","metadata":null,"payer_name":"bumi","payer_pubkey":null,"payment_hash":"0f2e034d7bcd321ae7e0382f4bd29e4562802b41f9f2b301aa2b055a1c638c84","payment_request":"","r_hash_str":"0f2e034d7bcd321ae7e0382f4bd29e4562802b41f9f2b301aa2b055a1c638c84","settled":true,"settled_at":"2023-05-03T08:22:22.000Z","state":"SETTLED","type":"incoming","value":21}
Get a webhook endpoint
Scope needed: invoices:read
Get details about a created webhook endpoint.
GEThttps://api.getalby.com/webhook_endpoints/{id}
Gets a webhook endpoint.
Path Parameters
Name
Type
Description
id*
String
The id of the webhook endpoint
{"url": "https://webhook.site/2d10f6a2-8860-48af-8c25-379a3c921d30","description": "An example endpoint","filter_types": ["invoice.settled" ],"created_at": "2023-05-02T07:35:03.867Z","id": "ep_2PECYp6CLXBbAqyFnhbxFUXM2ZR"}
Delete a webhook endpoint
Scope needed: invoices:read
Delete a webhook endpoint to stop receiving notifications of settled invoices.