elyxa

API Reference

Complete API documentation for Elyxa payment integration

API Reference

The Elyxa API allows you to integrate cryptocurrency payments into your applications. All API requests should be made to https://elyxa.app.

Authentication

All API requests require authentication using your API key. Include it in the request header:

Authorization: Bearer YOUR_API_KEY

Base URL

https://elyxa.app/api

Creating an Invoice

Create a new payment invoice for your customers.

POST /payments/invoices

Request Body:

{
  "amount": "25.50",
  "currency": "USD",
  "paymentMethods": ["BITCOIN", "LIGHTNING", "LITECOIN"]
}

Response:

{
    "invoiceId": "WfW5Dd1ASHSj4ZHhMC5yTA",
    "expiryTime": 1754875443,
    "paymentMethods": [
        {
            "paymentMethodId": "LIGHTNING",
            "destination": "lnbc213980n1p5fjs40pp5mvgl2pht4a6tfs73hthwmatpcmxrfj5kyl2c57pwmzvkpq2j8v7sdp02pskjepqw3hjqjtww3shxetwvsszsnmjv3jhygzfgsazq2gcqzzsxqzuzsp5jrlfu2t0pvdwsjgscxzjeyhv48hqzr5spph6hd8nhn2q4dnhxhvs9qxpqysgqd2x8w9np79lkfh2v8lumgj3nm40mgv536d9xm9cwal6x6vqzlk5n0z2cv2s7gdfq9zhlh0sf0dr3svgv4fu2e8zyl9ucr83w28u632gpeq2u37",
            "paymentLink": "lightning:lnbc213980n1p5fjs40pp5mvgl2pht4a6tfs73hthwmatpcmxrfj5kyl2c57pwmzvkpq2j8v7sdp02pskjepqw3hjqjtww3shxetwvsszsnmjv3jhygzfgsazq2gcqzzsxqzuzsp5jrlfu2t0pvdwsjgscxzjeyhv48hqzr5spph6hd8nhn2q4dnhxhvs9qxpqysgqd2x8w9np79lkfh2v8lumgj3nm40mgv536d9xm9cwal6x6vqzlk5n0z2cv2s7gdfq9zhlh0sf0dr3svgv4fu2e8zyl9ucr83w28u632gpeq2u37",
            "amount": "0.00021398",
            "currency": "BTC"
        },
        {
            "paymentMethodId": "BITCOIN",
            "destination": "bc1qj2fq492m79e0unp2vvej26468dk3vr50tw3zhj",
            "paymentLink": "bitcoin:bc1qj2fq492m79e0unp2vvej26468dk3vr50tw3zhj?amount=0.00021398",
            "amount": "0.00021398",
            "currency": "BTC"
        },
        {
            "paymentMethodId": "LITECOIN",
            "destination": "ltc1qgxszmp8qg08h33dmm7lh64zf3mlzfvkvjqgsjj",
            "paymentLink": "litecoin:ltc1qgxszmp8qg08h33dmm7lh64zf3mlzfvkvjqgsjj?amount=0.20837766",
            "amount": "0.20837766",
            "currency": "LTC"
        }
    ],
    "success": true
}

Setting Up Webhooks

Receive real-time updates about payment status changes by configuring webhooks.

Webhook Events

  • invoice.paid - Invoice has been paid
  • invoice.expired - Invoice has expired
  • invoice.cancelled - Invoice was cancelled

Webhook Payload Examples

Invoice Paid Event

{
  "event": "invoice.paid",
  "invoiceId": "WfW5Dd1ASHSj4ZHhMC5yTA",
  "amount": 25.50,
  "currency": "USD",
  "status": "paid",
  "paidAmount": 25.50,
  "paidAt": "2024-01-15T10:25:00Z",
  "paymentMethods": [
    {
      "methodId": "BITCOIN",
      "isPaid": true,
      "paidAmount": 25.50,
      "paidAt": "2024-01-15T10:25:00Z"
    }
  ],
  "metadata": {},
  "timestamp": 1705314300000
}

Invoice Expired Event

{
  "event": "invoice.expired",
  "invoiceId": "WfW5Dd1ASHSj4ZHhMC5yTA",
  "amount": 25.50,
  "currency": "USD",
  "status": "expired",
  "paymentMethods": [
    {
      "methodId": "BITCOIN",
      "isPaid": false
    }
  ],
  "metadata": {},
  "timestamp": 1705314300000
}

Invoice Cancelled Event

{
  "event": "invoice.cancelled",
  "invoiceId": "WfW5Dd1ASHSj4ZHhMC5yTA",
  "amount": 25.50,
  "currency": "USD",
  "status": "cancelled",
  "paymentMethods": [
    {
      "methodId": "BITCOIN",
      "isPaid": false
    }
  ],
  "metadata": {},
  "timestamp": 1705314300000
}