How the Mocha QuickBill data model fits together, and the cross-cutting rules that apply to every endpoint — before you go looking up a specific one.
What this hub is for.
Welcome to the API Information Hub — your central resource for understanding and leveraging our platform's APIs. This hub is designed for developers, technical architects, and integration partners who are building robust, secure, and scalable applications on top of our services.
The sections below explain the four core things the API works with — Products, Customers, Invoices and Payments — and how they depend on each other. Read this first; the API Docs then cover each endpoint in detail.
| Resource | What it is | Depends on |
|---|---|---|
| Product | Something you sell — a physical item or a service. | Ledger accounts |
| Customer | The business or person you bill. | — |
| Invoice | A request for payment, made up of line items. | A customer and one or more products |
| Payment | Money received against an invoice. | An invoice |
What you sell and bill for.
A product is anything you put on an invoice line item. For now every product is a service you deliver — service is the only type the API supports.
revenue_account, expense_account and inventory_account must be set on a product. An invoice cannot be created against a product that is missing them.See Create a Product for the request and response.
Who your invoices are issued to.
A customer is the business or person you bill. Every invoice is issued against exactly one customer, so the customer record has to exist before you can raise an invoice.
See Create a Customer for the request and response.
Billing a customer for products.
An invoice brings a customer and one or more products together into a request for payment. Each line item points at a product and carries a quantity and a price, which can override the product's default.
INV- numbers. A dedicated endpoint returns the next one in the sequence — call it, then use the value it gives you when you create the invoice. The format varies between accounts, so treat what you get back as an opaque string.See Create an Invoice for the request and response.
Settling what is owed.
A payment records money received from a customer and applies it to the invoices it settles. It is the last step in the chain: products go on an invoice, the invoice goes to a customer, and the payment closes it out.
A payment is not tied to a single invoice. When a customer sends one amount covering three invoices, you record one payment and split it across all three in the same call — you do not record it three times. Each entry names the invoice and the amount applied to it, and those amounts have to add up to what the customer actually sent.
Applying a payment reduces the invoice's balance. Pay the full balance and the invoice is settled; pay less and the remainder stays outstanding, so you can record the rest later against the same invoice. The customer's own open_balance moves with it, so you can show what a customer owes without adding up their invoices yourself.
status does not move when part of it is paid — it stays open until it is settled. To show whether money has come in, compare balance against amount instead of reading the status.Payments carry their own PMT- reference, which is not the same thing as the INV- number on the invoice being paid. One payment covering three invoices has a single payment reference and three invoice numbers behind it. Keep the two apart in your own records.
See Receive a Payment for the request and response.
API key based authentication.
We support API key based authentication. Use a unique key per environment. API keys must be kept confidential and should not be exposed in frontend code.
The exact headers and a worked example are covered in Getting Started → Authentication.
Mandatory and recommended practices.
We take API security seriously. Here are our mandatory and recommended practices:
What changed and when.
Track all recent updates via our Developer Changelog: