API basics
Zeyora API endpoints use tenant API credentials. Most endpoints expect a `connection` object with `api_key` and `api_secret`. Older ingestion endpoints accept a form field named `data` that contains a JSON string. Newer finance endpoints such as `create_invoice`, `create_credit_note` and `create_receipt` accept JSON payloads directly.
Authentication object
{
"connection": {
"api_key": "YOUR_API_KEY",
"api_secret": "YOUR_API_SECRET"
}
}
Endpoint reference
| Method | Endpoint | Use | Important fields |
|---|---|---|---|
| POST | /api/insert_lead |
Queue a lead payload for processing. | Form field `data` containing JSON with `connection` and lead/customer details. |
| POST | /api/insert_ticket |
Queue a support ticket payload. | Form field `data` containing JSON with `connection` and ticket details. |
| POST | /api/insert_order |
Queue an e-commerce/order payload. | `connection`, `customer`, `shipping_data`, `order_data`, `order_items`. |
| POST | /api/insert_product |
Create a product if the name/SKU does not already exist. | `product_data.product_name`, `category`, `assigned_person`; optional `sku`, `brand`, `model_number`. |
| POST | /api/insert_invoice |
Legacy invoice ingestion and processing endpoint. | `invoice_data.invoice_no` plus invoice payload and connection credentials. |
| POST | /api/get_purchased_items_list |
Return purchased items for a date. | `data.date` in a parseable date format. |
| POST | /api/get_invoice_details |
Return customer and item details for an invoice number. | `data.invoice_no`. |
| POST | /api/get_last_purchased_item_cost |
Return the latest purchase cost for a SKU. | `data.sku`. |
| POST | /api/get_latest_task_activity |
Return today task timer activity for customer-related tasks. | Authenticated `connection` object. |
| POST | /api/create_invoice |
Create an invoice immediately from raw JSON. | `data.customer_id`, `invoice_number`, `invoice_date`, `due_date`, `items[]`; warehouse may be required by tenant settings. |
| POST | /api/create_credit_note |
Create a credit note against an existing invoice. | `data.customer_id`, `invoice_number`, `credit_note_date`, `items[]`; optional `credit_note_number`. |
| POST | /api/create_receipt |
Create a receipt and allocate it to invoices. | `data.customer_id`, `payment_type`, `amount`, `invoices[]`; bank or cheque fields when required. |
| POST | /webchat/init |
Initialize a public website chat session. | `key`, optional visitor name/email/phone/page URL/referrer. |
| POST | /webchat/send |
Send a visitor message into Omni Inbox. | `key`, `session_id`, `conversation_id`, `message`. |
| GET | /webchat/poll |
Poll for outbound widget messages. | `key`, `session_id`, `conversation_id`, optional `after_id`. |
| POST | /webchat/validate_socket |
Validate a widget realtime socket connection. | `key`, `session_id`, `conversation_id`, `ws_token`. |
Create invoice example
POST /api/create_invoice
Content-Type: application/json
{
"connection": {
"api_key": "YOUR_API_KEY",
"api_secret": "YOUR_API_SECRET"
},
"data": {
"customer_id": 125,
"invoice_number": "INV-10045",
"invoice_date": "2026-08-08",
"due_date": "2026-08-22",
"currency": "AED",
"warehouse_id": 1,
"tax_included": 1,
"tax_percentage": 5,
"items": [
{
"name": "CRM Implementation",
"description": "Implementation and setup",
"qty": 1,
"rate": 2500,
"unit": "Service"
}
]
}
}
Create credit note example
POST /api/create_credit_note
Content-Type: application/json
{
"connection": {
"api_key": "YOUR_API_KEY",
"api_secret": "YOUR_API_SECRET"
},
"data": {
"customer_id": 125,
"invoice_number": "INV-10045",
"credit_note_number": "CN-10045",
"credit_note_date": "2026-08-09",
"currency": "AED",
"items": [
{
"name": "Service adjustment",
"qty": 1,
"rate": 250
}
]
}
}
Create receipt example
POST /api/create_receipt
Content-Type: application/json
{
"connection": {
"api_key": "YOUR_API_KEY",
"api_secret": "YOUR_API_SECRET"
},
"data": {
"customer_id": 125,
"payment_type": 1,
"amount": 2500,
"currency": "AED",
"invoices": [
{ "invoice_number": "INV-10045", "amount": 2500 }
]
}
}
Webchat example
POST /webchat/init
Content-Type: application/json
{
"key": "PUBLIC_WIDGET_KEY",
"name": "Visitor Name",
"email": "visitor@example.com",
"page_url": "https://example.com/contact"
}
Error handling
Most responses include `result` and `error`. Finance endpoints may also return `status`, `request_id`, record IDs and totals. Treat non-empty `error` as a failed or pending integration action. Some finance requests intentionally return pending messages when a customer, warehouse, invoice or item master has not been synced yet.