LSP REST API (BLIP-0051)

Magma's BLIP-0051-compatible REST endpoints for Lightning Service Provider integration. Buy inbound capacity from standard LSP clients.

Magma exposes a BLIP-0051–compatible REST interface so any LSP-aware Lightning client can purchase inbound capacity from the marketplace without speaking GraphQL.

This is the right surface to use when:

  • Your client already implements LSPS1 (most LND, LDK, and Phoenix integrations do).
  • You want a thin HTTP-only path without managing a GraphQL client.
  • You're integrating with mobile wallets or embedded devices.

Otherwise, the GraphQL API gives you more control (custom asset types, marketplace browsing, conditional offers).


Endpoint

https://magma.amboss.tech/api/lsp/v1/{type}

{type} selects which Magma seller pool fulfils the order:

typePool
recommendedAmboss's recommended sellers - ranked by reliability and uptime.
cheapestThe lowest-priced seller on the marketplace at request time.

All endpoints are public - no API key required.


1. GET /{type}/get_info

Returns the LSP's capabilities and constraints. Call this once at startup to learn what the LSP supports.

curl https://magma.amboss.tech/api/lsp/v1/recommended/get_info
const res = await fetch(
  "https://magma.amboss.tech/api/lsp/v1/recommended/get_info",
);
const info = await res.json();
console.log("Min client balance:", info.min_initial_client_balance_sat);
console.log("Min LSP balance:   ", info.min_initial_lsp_balance_sat);
console.log("LSP URIs:          ", info.uris);

Response

{
  "min_required_channel_confirmations": 0,
  "min_funding_confirms_within_blocks": 6,
  "supports_zero_channel_reserve": false,
  "max_channel_expiry_blocks": 12960,
  "min_initial_client_balance_sat": "0",
  "max_initial_client_balance_sat": "0",
  "min_initial_lsp_balance_sat": "500000",
  "max_initial_lsp_balance_sat": "100000000",
  "min_channel_balance_sat": "500000",
  "max_channel_balance_sat": "100000000",
  "uris": [
    "[email protected]:9735",
    "[email protected]:9735"
  ]
}

Field reference

FieldTypeMeaning
min_required_channel_confirmationsnumberConfirmations the LSP requires before considering the channel open.
min_funding_confirms_within_blocksnumberMax blocks the LSP will wait for the funding TX to confirm.
supports_zero_channel_reservebooleanWhether the LSP can open a channel with 0 reserve.
max_channel_expiry_blocksnumberThe longest channel commitment available, in blocks.
min_initial_client_balance_sat / max_initial_client_balance_satstringRange for the client side at open (currently 0 - Magma sells inbound only).
min_initial_lsp_balance_sat / max_initial_lsp_balance_satstringRange for the LSP side at open (this is your inbound).
min_channel_balance_sat / max_channel_balance_satstringOverall channel-size bounds.
urisstring[]Connection strings (pubkey@host:port) the LSP can be reached on.

uris is a Magma extension to the BLIP-0051 spec - vanilla BLIP-0051 has uris only in the get_order response. Including it in get_info lets clients connect to the LSP before placing an order.


2. POST /{type}/create_order

Reserves an inbound channel. The response includes a BOLT11 invoice the client must pay.

curl -X POST https://magma.amboss.tech/api/lsp/v1/recommended/create_order \
  -H "Content-Type: application/json" \
  -d '{
    "lsp_balance_sat": "2000000",
    "client_balance_sat": "0",
    "required_channel_confirmations": 6,
    "funding_confirms_within_blocks": 6,
    "channel_expiry_blocks": 4320,
    "token": "",
    "announce_channel": false,
    "public_key": "03abc...xyz"
  }'
const res = await fetch(
  "https://magma.amboss.tech/api/lsp/v1/recommended/create_order",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      lsp_balance_sat: "2000000",      // 2M sats of inbound capacity
      client_balance_sat: "0",          // Magma doesn't push outbound to clients
      required_channel_confirmations: 6,
      funding_confirms_within_blocks: 6,
      channel_expiry_blocks: 4320,      // ~30 days
      token: "",                        // Optional referral / customisation token
      announce_channel: false,          // Public or private channel
      public_key: "03abc...xyz",        // Your node's pubkey
    }),
  },
);

const order = await res.json();
console.log("Pay this invoice:", order.payment.bolt11.invoice);
console.log("Order ID:        ", order.order_id);

Request body

FieldRequiredTypeDescription
lsp_balance_satstringLSP-side balance at channel open. This is your inbound capacity.
client_balance_satstringClient-side balance at channel open. Magma only sells inbound, so pass "0".
required_channel_confirmationsnumberConfirmations before the client considers the channel live.
funding_confirms_within_blocksnumberMax blocks to wait for the funding TX.
channel_expiry_blocksnumberLock duration in blocks. Must be ≤ max_channel_expiry_blocks from get_info.
tokenstringOptional referral / opaque token. Pass "" if unused.
refund_onchain_addressstringOn-chain address for refunds (when on-chain payment is used).
announce_channelbooleantrue for a publicly-announced channel; false for a private channel.
public_keystringYour node's pubkey. The LSP will connect to and open a channel with this peer.

Response

{
  "order_id": "ec562479-a4b8-44f4-95b4-150b310832de",
  "lsp_balance_sat": "2000000",
  "client_balance_sat": "0",
  "required_channel_confirmations": 6,
  "funding_confirms_within_blocks": 6,
  "channel_expiry_blocks": 4320,
  "token": "",
  "created_at": "2026-06-10T12:00:00.000Z",
  "announce_channel": false,
  "order_state": "CREATED",
  "payment": {
    "bolt11": {
      "state": "EXPECT_PAYMENT",
      "expires_at": "2026-06-12T12:00:00.000Z",
      "fee_total_sat": "12500",
      "order_total_sat": "12500",
      "invoice": "lnbc125u1p..."
    }
  },
  "channel": null
}

Pay payment.bolt11.invoice from your Lightning wallet. Once it lands, the LSP opens the channel.


3. GET /{type}/get_order?order_id={id}

Polls an order's state. Call this until order_state is COMPLETED (channel opened) or FAILED.

curl "https://magma.amboss.tech/api/lsp/v1/recommended/get_order?order_id=ec562479-a4b8-44f4-95b4-150b310832de"
const url = new URL(
  "https://magma.amboss.tech/api/lsp/v1/recommended/get_order",
);
url.searchParams.set("order_id", orderId);

const order = await fetch(url).then((r) => r.json());

if (order.order_state === "COMPLETED") {
  console.log("Channel funded:", order.channel.funding_outpoint);
}

The response shape matches create_order. Once the channel is open, the channel field is populated:

{
  "order_state": "COMPLETED",
  "payment": { "bolt11": { "state": "PAID", "...": "..." } },
  "channel": {
    "funded_at": "2026-06-10T12:15:00.000Z",
    "funding_outpoint": "5e8a3f...:0",
    "expires_at": "2026-07-10T12:15:00.000Z"
  }
}

Order state reference

order_state

ValueMeaning
CREATEDOrder created, awaiting payment.
COMPLETEDLSP has published the funding transaction.
FAILEDOrder failed (payment timeout, LSP couldn't fund, etc.).

payment.bolt11.state

ValueMeaning
EXPECT_PAYMENTInvoice unpaid.
HOLDPayment landed and is held in the HODL invoice (LSP must open channel to claim).
PAIDLSP has claimed the payment - channel is open.
REFUNDEDPayment refunded (LSP failed to open channel).

Errors

The LSP API uses standard HTTP status codes:

StatusWhen
400 Bad RequestRequest body or query params malformed.
404 Not Foundorder_id doesn't exist or isn't associated with this type.
500 Internal Server ErrorLSP unable to satisfy the request (e.g. no node available, downstream failure).

The body is a Nest exception object:

{ "statusCode": 404, "message": "Order not found" }

Reference flow


Next steps