Create Lnurl and Lightning address
https://sandboxapi.bitnob.co/api/v1/lnurl (opens in a new tab)
Create a new lnurl and lightning address
LNURL vs Lightning Address
A lightning address is a wrapper on top of lnurl. With LNURL you can always show the QR code, lightning address just makes it more human-friendly and readable.
The username you use to create the lnurl automatically becomes the lightning address in this case.
Body Parameters
Parameter | type | Required |
---|---|---|
identifier a unique username for this lnurl | string | Defaults to username |
tld the top level domain this lnurl will be hosted on | string | ✅ |
identifierType e.g email, bank account, username | string | Defaults to username |
customerEmail the email of the customer this lnurl is being created for | string | ✅ |
username the email of the customer this lnurl is being created for | string | ✅ |
satMinSendable the minimum amount in satoshis that can be received with this | int32 | Defaults to 1 |
satMaxSendable the maximum amount in satoshis that can sent to this lnurl | int32 | Defaults to 10000 |
image base64 encoded image to show when the address is encoded | string | |
description Description thats shows paying to LnUrl Address | string | Defaults to send money to { identififer } |
Request
lightning address/ Create lnurl
curl --request POST \
--url https://sandboxapi.bitnob.co/api/v1/lnurl \
--header 'Authorization: Bearer API-KEY' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"identifierType": "username",
"satMinSendable": 1,
"satMaxSendable": 1000000,
"description": "send money to { identififer }",
"identifier": "satoshi",
"tld": "bitcoin.org",
"customerEmail": "satoshi@bitcoin.org"
}
'
Responses
🟢 200 - Result example
{
"status": true,
"message": "lnurl successfully created",
"data": {
"tld": "bitcoin.org",
"identifier": "satoshi",
"identifierType": "username",
"lnUrl": "LNURL1DP68GURN8GHJ7UM5V9NKJMN894SHQ6FWVEKX7AM9WF6X7UPW0PUH5TEWWAJKCMPDDDHX7AMW9ACXKTNP8QMNSE3WV4JRXC3SX3JRGERZXYERJCFNVG6KZTMVDE6HYMRS9AEKZAR0WD5XJJE6N7Y",
"lnUrlQR": "https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=LNURL1DP68GURN8GHJ7UM5V9NKJMN894SHQ6FWVEKX7AM9WF6X7UPW0PUH5TEWWAJKCMPDDDHX7AMW9ACXKTNP8QMNSE3WV4JRXC3SX3JRGERZXYERJCFNVG6KZTMVDE6HYMRS9AEKZAR0WD5XJJE6N7Y",
"lnUrlTag": "payRequest",
"satMinSendable": "1",
"satMaxSendable": "1000000",
"description": null,
"image": null,
"id": "8d215442-d4ac-4246-bb15-b1086d6c8d91",
"createdAt": "2021-12-05T00:26:33.457Z",
"updatedAt": "2021-12-05T00:26:33.457Z"
}
}
Last updated on