Alby Developer Guide
User GuideDeveloper Portal
Alby Wallet API
Alby Wallet API
  • Reference
    • ๐Ÿ”Œ Integration - Getting started
    • ๐Ÿ”’ Authorization
    • ๐Ÿ”— API Reference
      • Account
      • Invoices
      • Payments
      • Webhook Endpoints
  • โšก Lightning Address Details Proxy
Powered by GitBook
LogoLogo

Our content

  • Website
  • Blog
  • GitHub

Follow us

  • Nostr
  • Twitter / X
  • Youtube

Contact us

  • E-mail
  • Community Chat
  • Open Hours

Your bitcoin & nostr companion / from ๐Ÿ with ๐Ÿงก

On this page
  • BOLT11 payment
  • Keysend payment
  • Keysend payment
  • Multi keysend payment
  • Make multiple keysend payments in 1 request

Was this helpful?

  1. Reference
  2. ๐Ÿ”— API Reference

Payments

Make payments through bolt11 or keysend.

BOLT11 payment

Scope needed: payments:send

Pay a lightning invoice (bolt11)

POST https://api.getalby.com/payments/bolt11

Pay a bolt11 invoice.

Request Body

Name
Type
Description

invoice*

string

invoice to be paid

{
    "amount": 100,
    "description": "Alby invoice",
    "destination": "025c1d5d1b4c983cc6350fc2d756fbb59b4dc365e45e87f8e3afe07e24013e8220",
    "fee": 0,
    "payment_hash": "38caadbe0f6112d9b638e9ae24338f7e9bd930a3387100da776644e56965c9c1",
    "payment_preimage": "2f84e22556af9919f695d7761f404e98ff98058b7d32074de8c0c83bf63eecd7",
    "payment_request": "lnbcrt1u1p3d23dkpp58r92m0s0vyfdnd3caxhzgvu006dajv9r8pcspknhvezw26t9e8qsdq5g9kxy7fqd9h8vmmfvdjscqzpgxqyz5vqsp59efe44rg6cjl3xwh9glgx4ztcgwtg5l8uhry2v9v7s0zn2wpaz2s9qyyssq2z799an4pt4wtfy8yrk5ee0qqj7w5a74prz5tm8rulwez08ttlaz9xx7eqw7fe94y7t0600d03k55fyguyj24nd9tjmx6sf7dsxkk4gpkyenl8"
}
{
    "code": 10,
    "error": true,
    "message": "error"
}
{
  "code": 8,
  "error": true,
  "message": "string"
}

Keysend payment

Scope needed: payments:send

Send a "spontaneous" payment (keysend). Used for push realtime/streaming push payments

Keysend payment

POST https://api.getalby.com/payments/keysend

Request Body

Name
Type
Description

amount*

int64

Amount in satoshi. Must be a whole number greater than 0. (millisats are not supported)

destination*

string

Destination hex-string pubkey (a string starting with 02 or 03)

memo

string

Internal memo

custom_records

map[string]string

{
  "amount": 1000,
  "description": "string",
  "description_hash": "string",
  "destination": "string",
  "fee": 0,
  "custom_records": {},
  "payment_hash": "string",
  "payment_preimage": "string"
}
{
  "code": 8,
  "error": true,
  "message": "string"
}
{
  "code": 10,
  "error": true,
  "message": "string"
}

Multi keysend payment

Scope needed: `payments:send` Send multiple spontaneous keysend payments. Useful for doing value4value splits. Request and response are an array of the single keysend payment request and response.

Make multiple keysend payments in 1 request

POST https://api.getalby.com/payments/keysend/multi

Each of the payments can fail or succeed seperately.

Request Body

Name
Type
Description

keysends*

Array

Array of keysend objects as described in the body parameters of the section above.

{
  "keysends": [
    {
      "error": {
        "code": 0,
        "error": false,
        "message": "string"
      },
      "keysend": {
        "amount": 100,
        "description": "test",
        "description_hash": "string",
        "destination": "0234",
        "fee": 1,
        "custom_records": {},
        "payment_hash": "paymenthash",
        "payment_preimage": "preimage"
      }
    }
  ]
}
{
  "code": 8,
  "error": true,
  "message": "string"
}
{
  "code": 10,
  "error": true,
  "message": "string"
}

Last updated 1 year ago

Was this helpful?

Make a spontaneous keysend payment, with optional custom records. See for example:

map with custom records. See

https://github.com/lightning/blips/blob/master/blip-0010.md
https://www.webln.guide/building-lightning-apps/webln-reference/webln.keysend