Bitnob Lightning API

Lightning invoices and payments.

GitHub OpenAPI

Operations 7

POST /api/lightning/decode Decode a BOLT11 invoice #
GET /api/lightning/invoices List invoices #
POST /api/lightning/invoices Create an invoice #
GET /api/lightning/invoices/{id} Get an invoice #
POST /api/lightning/invoices/{id}/simulate-payment Simulate an invoice payment #
POST /api/lightning/pay Pay an invoice #
POST /api/lightning/preview Preview a payment #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/bitnob:bitnob-lightning-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

bitnob-lightning-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bitnob API requests Lightning API
  version: 1.0.0
  description: 'What you send to the Bitnob API: path and query parameters, request bodies and auth headers. Responses are left out; see the full Bitnob API spec for those.'
servers:
- description: Production
  url: https://api.bitnob.com
security:
- ClientId: []
  Timestamp: []
  Nonce: []
  Signature: []
- ClientId: []
  Secret: []
tags:
- description: Lightning invoices and payments.
  name: Lightning
paths:
  /api/lightning/decode:
    post:
      tags:
      - Lightning
      summary: Decode a BOLT11 invoice
      description: Decodes a BOLT11 invoice without paying it.
      operationId: lightningDecodePaymentRequest
      requestBody:
        content:
          application/json:
            examples:
              bolt11:
                summary: A BOLT11 invoice
                value:
                  request: lntbs250u1pw46zs384j6ff29pjfku659r74elt0ncftqayts7vg9x70ylelrf0996hyxdm3w5x3s3vzskf9zh7af4qzcjhm9h5gvctyv9jn6tjh0ljjs8t04z5jgug5fst9rezzhj0x0gxy82glweanvd3zpr20g9y3j0jwz7aahh02m4267kqygqvr3zqrn9sehrfjkll2e7jxj808dztnqza2umu
              lightning_uri:
                summary: 'The same invoice as a lightning: URI'
                value:
                  request: lightning:lntbs250u1pw46zs384j6ff29pjfku659r74elt0ncftqayts7vg9x70ylelrf0996hyxdm3w5x3s3vzskf9zh7af4qzcjhm9h5gvctyv9jn6tjh0ljjs8t04z5jgug5fst9rezzhj0x0gxy82glweanvd3zpr20g9y3j0jwz7aahh02m4267kqygqvr3zqrn9sehrfjkll2e7jxj808dztnqza2umu
            schema:
              $ref: '#/components/schemas/LightningPaymentRequestInput'
        required: true
  /api/lightning/invoices:
    get:
      tags:
      - Lightning
      summary: List invoices
      description: Lists your incoming invoices and outgoing payments, newest first.
      operationId: lightningListInvoices
      parameters:
      - description: Page number.
        example: 1
        in: query
        name: page
        schema:
          default: 1
          minimum: 1
          type: integer
      - description: Results per page. Above 100 is treated as 100; below 1 as 20.
        example: 20
        in: query
        name: page_size
        schema:
          default: 20
          maximum: 100
          minimum: 1
          type: integer
      - description: Filter by invoice status.
        example: paid
        in: query
        name: status
        schema:
          enum:
          - pending
          - paid
          - expired
          - failed
          - settled
          type: string
      - description: Filter by direction.
        example: incoming
        in: query
        name: direction
        schema:
          enum:
          - incoming
          - outgoing
          type: string
    post:
      tags:
      - Lightning
      summary: Create an invoice
      description: Creates a BOLT11 invoice to receive a payment. Reusing a reference returns the existing invoice.
      operationId: lightningCreateInvoice
      requestBody:
        content:
          application/json:
            examples:
              basic:
                summary: An invoice for 25,000 sats
                value:
                  amount: 25000
                  description: Order 1042 - Acme Logistics Ltd
                  reference: inv_sbx_4f9c2a71
              customer_with_expiry:
                summary: For a customer, expiring in an hour
                value:
                  amount: 25000
                  customer_id: 019a3a01-2c4d-7e5f-8a6b-7c8d9e0f1a2b
                  description: Order 1042 - Acme Logistics Ltd
                  expiry: 3600
                  reference: inv_sbx_4f9c2a72
              sandbox_auto_settle:
                summary: 'Sandbox: settle automatically about five seconds later'
                value:
                  amount: 1500
                  auto_settle: true
                  description: Coffee
                  reference: inv_sbx_4f9c2a73
            schema:
              $ref: '#/components/schemas/LightningCreateInvoiceRequest'
        required: true
  /api/lightning/invoices/{id}:
    get:
      tags:
      - Lightning
      summary: Get an invoice
      description: Returns one invoice or outgoing payment. preimage is empty until it is paid.
      operationId: lightningGetInvoice
      parameters:
      - description: Invoice id
        example: 019a3b5c-8e21-7a40-9b1c-2d3e4f5a6b7c
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
  /api/lightning/invoices/{id}/simulate-payment:
    post:
      tags:
      - Lightning
      summary: Simulate an invoice payment
      description: Sandbox only. Pays one of your pending incoming invoices; the credit and webhook follow within a few seconds.
      operationId: lightningSimulateInvoicePayment
      parameters:
      - description: Invoice id
        example: 019a3b5c-8e21-7a40-9b1c-2d3e4f5a6b7c
        in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
  /api/lightning/pay:
    post:
      tags:
      - Lightning
      summary: Pay an invoice
      description: Pays a BOLT11 invoice from your BTC balance. max_fee caps the routing fee. Reusing a reference returns the original payment. Invoices without an amount can't be paid.
      operationId: lightningPay
      requestBody:
        content:
          application/json:
            examples:
              basic:
                summary: Pay an invoice
                value:
                  reference: ln_pay_20261029_0007
                  request: lntbs100u1psfxvjwamslq8gyzt7cdsg2lq9xlgju42fh4f4ztnn6x8t3gkszeucm4kztnps2n70fhffyspsky8dme2fvf6rz8pxw664023wf26j0xx8egk7yt6036kqdpahyk3dlz77xs2vhwf7exvthwpgmkcv0f3rwpdyempch0c5vedlhnct3hql2gzehces64uf62zs3pn2aw0qvlupctk84fa
              customer_with_fee_cap:
                summary: For a customer, capping the routing fee at 50 sats
                value:
                  customer_id: 019a3a01-2c4d-7e5f-8a6b-7c8d9e0f1a2b
                  max_fee: 50
                  reference: ln_pay_20261029_0008
                  request: lntbs100u1psfxvjwamslq8gyzt7cdsg2lq9xlgju42fh4f4ztnn6x8t3gkszeucm4kztnps2n70fhffyspsky8dme2fvf6rz8pxw664023wf26j0xx8egk7yt6036kqdpahyk3dlz77xs2vhwf7exvthwpgmkcv0f3rwpdyempch0c5vedlhnct3hql2gzehces64uf62zs3pn2aw0qvlupctk84fa
              fee_cap_as_string:
                summary: max_fee as a numeric string
                value:
                  max_fee: '50'
                  reference: ln_pay_20261029_0009
                  request: lightning:lntbs100u1psfxvjwamslq8gyzt7cdsg2lq9xlgju42fh4f4ztnn6x8t3gkszeucm4kztnps2n70fhffyspsky8dme2fvf6rz8pxw664023wf26j0xx8egk7yt6036kqdpahyk3dlz77xs2vhwf7exvthwpgmkcv0f3rwpdyempch0c5vedlhnct3hql2gzehces64uf62zs3pn2aw0qvlupctk84fa
            schema:
              $ref: '#/components/schemas/LightningSendPaymentRequest'
        required: true
  /api/lightning/preview:
    post:
      tags:
      - Lightning
      summary: Preview a payment
      description: Decodes an invoice, looks for a route and quotes the fee, without paying it. total is the amount plus the fee charged to your balance.
      operationId: lightningPreviewPayment
      requestBody:
        content:
          application/json:
            examples:
              bolt11:
                summary: Preview paying an invoice
                value:
                  request: lntbs100u1psfxvjwamslq8gyzt7cdsg2lq9xlgju42fh4f4ztnn6x8t3gkszeucm4kztnps2n70fhffyspsky8dme2fvf6rz8pxw664023wf26j0xx8egk7yt6036kqdpahyk3dlz77xs2vhwf7exvthwpgmkcv0f3rwpdyempch0c5vedlhnct3hql2gzehces64uf62zs3pn2aw0qvlupctk84fa
            schema:
              $ref: '#/components/schemas/LightningPaymentRequestInput'
        required: true
components:
  schemas:
    LightningSendPaymentRequest:
      properties:
        customer_id:
          description: Optional customer the payment is for. When set, the customer_lightning customer product must be enabled.
          format: uuid
          maxLength: 100
          type: string
        max_fee:
          description: Optional routing fee cap in sats, as a number or numeric string. Must be non-negative.
          oneOf:
          - minimum: 0
            type: integer
          - pattern: ^[0-9]*$
            type: string
        reference:
          description: Your unique reference; the idempotency key for the send.
          maxLength: 100
          type: string
        request:
          description: BOLT11 invoice to pay. A leading "lightning:" scheme is stripped. Between 90 and 2000 characters, with an ln + bc, tb, bcrt or sb prefix. A value that starts with ln but fails this format check, or that the node cannot decode, is answered 500.
          maxLength: 2000
          minLength: 90
          type: string
      required:
      - request
      - reference
      type: object
    LightningPaymentRequestInput:
      properties:
        request:
          description: BOLT11 invoice. A leading "lightning:" scheme is stripped; must start with "ln". Between 90 and 2000 characters, with an ln + bc, tb, bcrt or sb prefix. A value that starts with ln but fails this format check, or that the node cannot decode, is answered 500.
          maxLength: 2000
          minLength: 90
          type: string
      required:
      - request
      type: object
    LightningCreateInvoiceRequest:
      properties:
        amount:
          description: Invoice amount in sats (max 20,000,000).
          format: int64
          maximum: 20000000
          minimum: 1
          type: integer
        auto_settle:
          description: 'Sandbox only: the simulator settles the invoice about five seconds after creation. Refused with 422 in live.'
          type: boolean
        customer_id:
          description: Optional customer the invoice is for. When set, the customer_lightning customer product must be enabled.
          format: uuid
          maxLength: 100
          type: string
        description:
          description: Memo embedded in the BOLT11 invoice.
          maxLength: 500
          type: string
        expiry:
          description: Seconds until the invoice expires. Defaults to 86400.
          format: int32
          minimum: 1
          type: integer
        reference:
          description: Your unique reference. Reusing a reference returns the existing invoice.
          maxLength: 100
          type: string
      required:
      - amount
      - description
      - reference
      type: object
  securitySchemes:
    ClientId:
      type: apiKey
      in: header
      name: X-Auth-Client
      description: Your client id. Required in both auth modes.
    Nonce:
      type: apiKey
      in: header
      name: X-Auth-Nonce
      description: A unique random string for this request.
    Secret:
      type: apiKey
      in: header
      name: X-Auth-Secret
      description: 'Secret mode only: your client secret, sent instead of the timestamp, nonce and signature.'
    Signature:
      type: apiKey
      in: header
      name: X-Auth-Signature
      description: Hex HMAC-SHA256 of `{client_id}:{timestamp}:{nonce}:{body}` using your secret. The body is empty for GET.
    Timestamp:
      type: apiKey
      in: header
      name: X-Auth-Timestamp
      description: The current Unix time in seconds. Requests more than 5 minutes off are refused.