Hercle
REST
POST/api/v1/lightning/withdrawals

Create Lightning Withdrawal

Create a withdrawal via Lightning Network. Send the payment request to pay.

Auth:Bearer <api_key>
Tags:LightningWithdrawals

Request

cURL
curl -X POST https://publicapi.sandbox.hercle.financial/api/v1/lightning/withdrawals \
  -H "Authorization: Bearer eyJhb..." \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
Content-TypestringYesapplication/json

Request Body

Schema

object
paymentRequestHash*:string
// Encoded Lightning payment request to pay

Example

{
  "paymentRequestHash": "lnbc1..."
}

Response

Success Response Schema

FieldTypeDescription
paymentIdstringUnique identifier for the payment
statusstring
Status of the withdrawal request
Allowed values:
OPEN
CLOSED
amountBTCnumberWithdrawal amount in BTC
destinationPublicKeystringPublic key of the destination Lightning node

Responses

Withdrawal created successfully

201 application/json
{
  "paymentId": "xxxx",
  "status": "OPEN",
  "amountBTC": 0.001,
  "destinationPublicKey": "xxxx"
}

API Tester

Test this endpoint directly against the sandbox environment

Get your API key from Hercle Sandbox

https://publicapi.sandbox.hercle.financial/api/v1/lightning/withdrawals