Gyvar docs

Create an invoice

Returns the payable invoice for your `reference`, creating it if needed. A retry with the same `reference` gets the same invoice back while it can still be paid. Once it is paid or expires, the same `reference` creates a new one. Needs the `receive` capability.

POST
/lightning/invoices

Authorization

KeyID Timestamp Nonce Signature
X-Gyvar-Key<token>

Your key id, gyv_k_live_... or gyv_k_sandbox_....

In: header

X-Gyvar-Timestamp<token>

Unix seconds. Must be within 5 minutes of our clock.

In: header

X-Gyvar-Nonce<token>

A unique value per request. Replays are rejected.

In: header

X-Gyvar-Signature<token>

Ed25519 signature over the canonical string. See the Signing guide.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

amount_sat*integer

Amount in sats.

Range1 <= value
reference*string

Your id for this payment, e.g. an order number. The idempotency key.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/lightning/invoices" \  -H "Content-Type: application/json" \  -d '{    "amount_sat": 25000,    "reference": "order_1001"  }'
{  "data": {    "invoice": "lnbc250u1p5x9k2dpp5qv8n3l7c2w4e6r8t0y2u4i6o8p0a2s4d6f8g0h2j4k6l8z0x2c4v6b8n0m2q4w6e8r0tsp5w3e5r7t9y1u3i5o7p9a1s3d5f7g9h1j3k5l7z9x1c3v5b7n9m1q3w5e7r9qyysgqcqpcxqyz5vq",    "amount_sat": 25000,    "reference": "order_1001",    "expires_at": "2026-09-01T11:04:11Z"  }}