Server integrations
Your server with an organisation key and webhooks.
Your own server syncing with ZiloOne: an online shop sending invoices, a warehouse system reading stock, an ERP taking receipts. Nobody signs in, so it uses an organisation key.
- An admin makes the keyIn Control › API keys: the permissions it needs, the person it acts as (their role and branches apply, so pick or make a person with just enough access), the server's IP addresses, and an expiry.
- Keep it secretOn the server only, in its secret store or environment, never in code or a browser.
- Call the API
const zilo = (path, init = {}) => fetch(`https://api.zilomail.in${path}`, { ...init, headers: { Authorization: `Bearer ${process.env.ZILO_KEY}`, "Content-Type": "application/json", ...init.headers } }); // A paid shop order → a receipt against its invoice await zilo("/v1/invoice/receipts", { method: "POST", headers: { "Idempotency-Key": `order-${order.id}` }, // one receipt per order, however often it runs body: JSON.stringify({ customerId, date: order.paidOn, amount: order.total, accountId: BANK, mode: "UPI", reference: order.utr, allocations: [{ invoiceId, amount: order.total }] }), }); - Hear about changesAdd a webhook in Control › Webhooks (approvals decided, mail received, files uploaded…) instead of polling. See Webhooks.
Using a stable key for a natural id#
An Idempotency-Key made from your own id (order-1182) makes a sync safe to run twice: within 24 hours the second run gets the first answer back.