API
API
Our integrations are also available over a plain HTTP API if you want to use them from your own application.
If your platform is neither WooCommerce nor Shopify, you can use the same integrations directly over the API. Get in touch and we will send you the documentation and test keys.
Orders API (Lovable and custom-built shops)
If your shop was built in Lovable, Bolt, v0 or by hand, it sends every paid order to this address, and e-liides turns it into an invoice in your accounting software (Merit Aktiva, SmartAccounts, SimplBooks, Standard Books or Erply). Licences are ordered under the Lovable platform modules.
Address
POST https://www.eliides.ee/api/lovable/orders
Authentication
Authorization: Bearer <licence key>
Content-Type: application/json
The licence key in the "Authorization: Bearer <key>" header. The request must be made from the server side (e.g. a Supabase Edge Function) — the key must never reach the browser.
Fields
| Field | Description |
|---|---|
| id required | The shop's own unique order id (text). Sending the same order again is safe — it is invoiced once. |
| number required | The order number the customer sees. It becomes the invoice number (with the prefix set in the settings). |
| created_at required | When the order was placed, ISO 8601. |
| status required | "paid", "pending", "cancelled" or "refunded". Only paid orders are invoiced. |
| currency | Currency, "EUR" by default. |
| prices_include_tax | true if prices include VAT (the default), false if they are net prices. |
| total required | What the customer paid. Must equal the lines plus shipping, to within 0.05. |
| customer | first_name, last_name, email, phone; for a business also company, reg_code and vat_number. |
| billing_address | address1, address2, city, postal_code, country_code (two-letter ISO code). |
| shipping_address | Same shape as billing_address. Optional. |
| lines required | Order rows: sku, name, quantity, unit_price (price of one item), tax_rate (VAT %, e.g. 24), discount (the whole discount on the row). |
| shipping | Delivery: name, sku, price, tax_rate, discount. Leave out when delivery was free. |
| payment | method — a short code for the payment method, e.g. "montonio" (each method can be mapped to its own account in the settings); amount — the amount paid. |
Example order
{
"id": "6f1c2a0e-1b2d-4c9e-9a51-0d7e3f2b8c11",
"number": "1042",
"created_at": "2026-11-13T12:00:00Z",
"status": "paid",
"currency": "EUR",
"prices_include_tax": true,
"total": 57.29,
"customer": {
"first_name": "Mari",
"last_name": "Maasikas",
"email": "mari@example.com",
"phone": "+3725550000",
"company": null,
"reg_code": null,
"vat_number": null
},
"billing_address": {
"address1": "Tartu mnt 1",
"address2": null,
"city": "Tallinn",
"postal_code": "10115",
"country_code": "EE"
},
"shipping_address": null,
"lines": [
{
"sku": "TSHIRT-M",
"name": "T-shirt, M",
"quantity": 2,
"unit_price": 19.9,
"tax_rate": 24,
"discount": 0
},
{
"sku": "MUG-01",
"name": "Mug",
"quantity": 1,
"unit_price": 15,
"tax_rate": 24,
"discount": 1.5
}
],
"shipping": {
"name": "Parcel locker",
"sku": "SHIPPING",
"price": 3.99,
"tax_rate": 24,
"discount": 0
},
"payment": {
"method": "montonio",
"amount": 57.29
}
}
Code example
A helper for a Supabase Edge Function or Next.js server code. Call it from the payment provider's webhook once an order is paid, cancelled or refunded — never from the browser.
// Call from your server code once an order is paid, cancelled or refunded,
// e.g. in the payment provider's webhook handler. Never from the browser.
// `order` is the order in the format described above.
export async function sendToEliides(order: Record<string, unknown>) {
// Supabase Edge Function (Deno). In Node / Next.js: process.env.ELIIDES_API_KEY
const key = Deno.env.get("ELIIDES_API_KEY");
if (!key) throw new Error("ELIIDES_API_KEY is not set");
for (let attempt = 1; attempt <= 3; attempt++) {
try {
const res = await fetch("https://www.eliides.ee/api/lovable/orders", {
method: "POST",
headers: {
"Authorization": `Bearer ${key}`,
"Content-Type": "application/json",
},
body: JSON.stringify(order),
});
const body = await res.json().catch(() => ({}));
if (res.ok) return body; // { ok: true, state: "queued", ... }
if (res.status < 500) {
// 4xx: the key or the data is wrong. Retrying will not help;
// body.errors says what to fix.
console.error("e-liides refused the order", res.status, body);
return body;
}
} catch (error) {
console.error("e-liides could not be reached", error);
}
await new Promise((resolve) => setTimeout(resolve, 1000 * 2 ** attempt));
}
throw new Error("e-liides did not accept the order after 3 attempts");
}
Responses
| 201 / 200 | The order was received. The "state" field says what happens next: queued (invoiced within a few minutes), stored (waiting for the integration to be activated), ignored (not paid, no invoice), invoiced (already invoiced), credit_queued (credit invoice within a few minutes). |
| 422 | The data is not valid. The "errors" field says what to fix. |
| 401 / 402 / 403 | The key is missing or wrong, the licence has expired, or the key is not for a Lovable module. |
On a network error or a 5xx response, try again (e.g. 3 times with a growing delay). There is no point repeating a 4xx response.
Cancellations and refunds
When an order that has been invoiced is cancelled or fully refunded, send the same order again with status "cancelled" or "refunded". E-liides creates a credit invoice for the whole order, numbered like the original invoice with "-K" on the end. Credit invoices for partial refunds have to be made by hand in the accounting software. With Erply, credit invoices always have to be made by hand.
Connection test
An empty POST to the same address ending in /ping, with the same header, answers {"ok": true, ...} when the key works.
POST https://www.eliides.ee/api/lovable/ping