curl -i https://YOUR-WORKER/api/data curl -H "X-Payment-Hash: HASH" -H "X-Payment-Preimage: PREIMAGE" https://YOUR-WORKER/api/data
import requests
r = requests.get(url)
challenge = r.json()
# Pay challenge["payment_request"] before continuing.
data = requests.get(url, headers={"X-Payment-Hash": challenge["payment_hash"], "X-Payment-Preimage": preimage}).json()const challenge = await (await fetch(url)).json();
// Pay challenge.payment_request before continuing.
const response = await fetch(url, {headers: {"X-Payment-Hash": challenge.payment_hash, "X-Payment-Preimage": preimage}});Important: invoices are mainnet, preimages are one-time receipts, and expired challenges require a new invoice.