REST
POST
/api/v1/invoicesCreate Lightning Invoice
Create an invoice via Lightning Network. Send the BTC amount and (optionally) a memo. expiryHours defaults to 24 and can go up to 720 (1 month).
Auth:Bearer <api_key>
Tags:LightningInvoices
Request
cURL
curl -X POST https://publicapi.sandbox.hercle.financial/api/v1/invoices \
-H "Authorization: Bearer eyJhb..." \
-H "Content-Type: application/json" \
-d '{"key": "value"}'Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
| Content-Type | string | Yes | application/json |
Request Body
Schema
object
amountBtc*:number
// Amount of BTC to be invoicedexpiryHours*:number
// Expiry time in hours (default: 24, max: 720)memo:string
// Optional memo for the invoiceExample
{
"amountBtc": 0.001,
"expiryHours": 24,
"memo": "Payment for services"
}Response
Success Response Schema
Invoice created successfully
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the invoice |
encodedPaymentRequest | string | Encoded Lightning payment request |
expiresAt | string | ISO 8601 timestamp when the invoice expires |
Responses
Invoice created successfully
201 application/json
{
"id": "xxxx",
"encodedPaymentRequest": "lnbc1...",
"expiresAt": "2024-03-28T16:03:12.456Z"
}API Tester
Test this endpoint directly against the sandbox environment
Get your API key from Hercle Sandbox
https://publicapi.sandbox.hercle.financial/api/v1/invoices