Open App

Invoices

Create and manage invoices.


List invoices

GET /v1/invoices

Query parameters

Parameter Type Description
pageSize integer Results per page (default 10, max 100)
pageIndex integer Zero-based page index (default 0)
search string Search by invoice number
inv_status integer 0=Open 1=Paid 2=Cancelled
cstid integer Filter by contact
inv_datetime_from date Filter invoices from date (YYYY-MM-DD)
inv_datetime_to date Filter invoices to date (YYYY-MM-DD)
sortBy string Field to sort by
sortOrder string asc | desc

Example response

{
  "success": true,
  "data": {
    "data": [
      {
        "inv_id": 8,
        "inv_number": "INV-0008",
        "customer_id": 10,
        "inv_status": 0,
        "total": 5250.00,
        "amount_due": 5250.00,
        "transaction_date": "2026-07-01",
        "due_date": "2026-07-31"
      }
    ],
    "current_page": 1,
    "total_records": 56,
    "total_pages": 6
  }
}

Get an invoice

GET /v1/invoices/{id}
Parameter Description
id The inv_id

Returns the invoice with its full line items and payment history.


Create an invoice

POST /v1/invoices
Content-Type: application/json

Request body

Field Type Required Description
customer_id integer yes Contact cstid
template_id integer yes Document template ID
items array yes Line items (min 1)
items[].item_id integer yes Item ID
items[].item_name string yes Item name
items[].quantity number yes Quantity
items[].price number yes Unit price
items[].type string yes item | header
items[].description string no Line description
items[].discount number no Discount value
items[].discount_type integer no 1=fixed amount, 2=percentage
items[].tax_id string no Tax ID
items[].tax_rate number no Tax rate %
transaction_date date no Invoice date (YYYY-MM-DD)
due_date date no Payment due date (YYYY-MM-DD)
reference string no Reference / PO number (max 255)
billing_address string no Billing address
shipping_address string no Shipping address
notes string no Notes
terms_conditions string no Terms and conditions
deal_id integer no Link to a deal
assigned_to integer no Assigned user ID
org_currency_id integer no Currency ID
conversion_rate number no Currency conversion rate
overall_discount number no Discount applied to total
overall_discount_type integer no 1=fixed, 2=percentage
tag_ids integer[] no Array of tag IDs

Example request

{
  "customer_id": 10,
  "template_id": 1,
  "transaction_date": "2026-07-01",
  "due_date": "2026-07-31",
  "reference": "PO-2026-001",
  "items": [
    {
      "item_id": 12,
      "item_name": "Consulting Services",
      "quantity": 10,
      "price": 500.00,
      "type": "item",
      "tax_rate": 5
    }
  ]
}

Example response

{
  "success": true,
  "message": "Invoice #INV-0008 has been created successfully",
  "data": {
    "inv_id": 8,
    "inv_number": "INV-0008"
  }
}

Update an invoice

PUT /v1/invoices/{id}
Content-Type: application/json

Same body structure as create. The id in the URL identifies the invoice.

Example response

{
  "success": true,
  "message": "Invoice INV-0008 has been updated successfully"
}

Delete an invoice

DELETE /v1/invoices/{id}
Parameter Description
id The inv_id

Example response

{
  "success": true,
  "message": "Invoice deleted successfully"
}