> For the complete documentation index, see [llms.txt](https://guides.getalby.com/developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.getalby.com/developer-guide/developer-guide/alby-wallet-api/reference/api-reference/payments.md).

# Payments

## BOLT11 payment

Scope needed: `payments:send`

Pay a lightning invoice (bolt11)&#x20;

<mark style="color:green;">`POST`</mark> `https://api.getalby.com/payments/bolt11`

Pay a bolt11 invoice.

#### Request Body

| Name                                      | Type   | Description        |
| ----------------------------------------- | ------ | ------------------ |
| invoice<mark style="color:red;">\*</mark> | string | invoice to be paid |

{% tabs %}
{% tab title="200: OK Succesfully paid invoice" %}

```javascript
{
    "amount": 100,
    "description": "Alby invoice",
    "destination": "025c1d5d1b4c983cc6350fc2d756fbb59b4dc365e45e87f8e3afe07e24013e8220",
    "fee": 0,
    "payment_hash": "38caadbe0f6112d9b638e9ae24338f7e9bd930a3387100da776644e56965c9c1",
    "payment_preimage": "2f84e22556af9919f695d7761f404e98ff98058b7d32074de8c0c83bf63eecd7",
    "payment_request": "lnbcrt1u1p3d23dkpp58r92m0s0vyfdnd3caxhzgvu006dajv9r8pcspknhvezw26t9e8qsdq5g9kxy7fqd9h8vmmfvdjscqzpgxqyz5vqsp59efe44rg6cjl3xwh9glgx4ztcgwtg5l8uhry2v9v7s0zn2wpaz2s9qyyssq2z799an4pt4wtfy8yrk5ee0qqj7w5a74prz5tm8rulwez08ttlaz9xx7eqw7fe94y7t0600d03k55fyguyj24nd9tjmx6sf7dsxkk4gpkyenl8"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    "code": 10,
    "error": true,
    "message": "error"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
  "code": 8,
  "error": true,
  "message": "string"
}
```

{% endtab %}
{% endtabs %}

## Keysend payment

Scope needed: `payments:send`

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

## Keysend payment

<mark style="color:green;">`POST`</mark> `https://api.getalby.com/payments/keysend`

Make a spontaneous keysend payment, with optional custom records. See for example: <https://github.com/lightning/blips/blob/master/blip-0010.md>

#### Request Body

| Name                                          | Type               | Description                                                                                                  |
| --------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------ |
| amount<mark style="color:red;">\*</mark>      | int64              | Amount in satoshi. Must be a whole number greater than 0. (millisats are not supported)                      |
| destination<mark style="color:red;">\*</mark> | string             | Destination hex-string pubkey (a string starting with 02 or 03)                                              |
| memo                                          | string             | Internal memo                                                                                                |
| custom\_records                               | map\[string]string | map with custom records. See <https://www.webln.guide/building-lightning-apps/webln-reference/webln.keysend> |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "amount": 1000,
  "description": "string",
  "description_hash": "string",
  "destination": "string",
  "fee": 0,
  "custom_records": {},
  "payment_hash": "string",
  "payment_preimage": "string"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
  "code": 8,
  "error": true,
  "message": "string"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
  "code": 10,
  "error": true,
  "message": "string"
}
```

{% endtab %}
{% endtabs %}

## 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

<mark style="color:green;">`POST`</mark> `https://api.getalby.com/payments/keysend/multi`

Each of the payments can fail or succeed seperately.

#### Request Body

| Name                                       | Type  | Description                                                                        |
| ------------------------------------------ | ----- | ---------------------------------------------------------------------------------- |
| keysends<mark style="color:red;">\*</mark> | Array | Array of keysend objects as described in the body parameters of the section above. |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "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"
      }
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
  "code": 8,
  "error": true,
  "message": "string"
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
  "code": 10,
  "error": true,
  "message": "string"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://guides.getalby.com/developer-guide/developer-guide/alby-wallet-api/reference/api-reference/payments.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.
