An OpenAPI-compatible API for interacting with Spark. With a lightweight payments API to enable backend payment flows on Spark, no Javascript required.
Use the Wallets API to do everything you can do with the Spark SDK, from creating a Lightning invoice to sending stablecoins, all over a REST API.
curl -X 'POST' \
'http://localhost:3000/wallet/lightning/create' \
-H 'accept: application/json' \
-H 'spark-network: MAINNET' \
-H 'spark-mnemonic: pledge bid coral pitch slight cabbage slice mobile sound swallow brush luxury' \
-H 'Content-Type: application/json' \
-d '{
"amount": 10,
"memo": "Sparkproxy rocks!",
"expirySeconds": 86400
}'
Check out the API documentation for more examples!
Use the Payments API to build backend payment flows. Allow users to pay with any asset, from Bitcoin to stablecoins, with webhooks to manage the payment lifecycle.
curl -X 'POST' \
'http://localhost:3000/payment' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"network": "MAINNET",
"webhook_url": "https://your-webhook-url.com/webhook",
"spark_address": "sp1pgssxfl73kl4z0zdr3rp2v9dcvsuwk7h77ctylk5eds9ylqs3lpftnxy5eatep",
"offers": [
{ "asset": "BITCOIN", "amount": 1000 },
{ "asset": "TOKEN", "amount": 1000, "tokenIdentifier": "tkn1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq" }
]
}'
Note that the funds are automatically swept to the Spark address you specified before the webhook is sent.