LNPay Docs
Search…
Sending Requests
This documentation uses a JSON body as the default.

Request Formats

Form Data

If no Content-Type is specified, the request will be interpreted as Form Data. Example invoice generation request.
curl
1
$ curl -u sak_XXXXXXX: \
2
-X POST \
3
-d num_satoshis=20 \
4
-d memo="Test invoice from the docs" \
5
https://api.lnpay.co/v1/user/wallet/wi_XXXXXXX/invoice
Copied!

JSON

JSON requests MUST contain the Content-Type: application/json header. Example invoice generation request.
curl
1
$ curl -u sak_XXXXXXX: \
2
-H "Content-Type: application/json" \
3
-X POST \
4
-d '{"num_satoshis":20, "memo":"Test invoice from the docs"}' \
5
https://api.lnpay.co/v1/user/wallet/wi_XXXXXXXX/invoice
Copied!

Limit response sizes

By default the objects are returned with all fields. You can limit the response to only the fields you want. You may want to do this if you are dealing with a device that has limited memory or just for speed sake.
curl
1
$ curl -u sak_XXXXXXX: \
2
https://api.lnpay.co/v1/lntx/lntx_XXXXXXX?fields=num_satoshis,settled
3
4
//Response
5
6
{"num_satoshis":5,"settled":1}
Copied!

Pagination

Most endpoints support pagination if it is a list-based GET request. page and per-page are supported
curl
1
$ curl -u sak_XXXXXXX: \
2
https://api.lnpay.co/v1/wallet/wakr_XXXXXX/transactions?page=2&per-page=100
Copied!
Last modified 4mo ago