Prompt
How do I create customers and invoices in Zoho Books through an API?
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
To create customers and invoices in Zoho Books via API, you generally do this in two steps:
- Create (or find) the customer/contact
- Create the invoice using that customer/contact ID
Below is the typical flow with example requests.
1) Prerequisites
You need:
- A Zoho Books organization ID
- An OAuth access token
- The correct API domain for your data center, for example:
- US:
https://www.zohoapis.com/books/v3 - EU:
https://www.zohoapis.eu/books/v3 - IN:
https://www.zohoapis.in/books/v3 - AU:
https://www.zohoapis.com.au/books/v3 - JP:
https://www.zohoapis.jp/books/v3 - CA:
https://www.zohoapis.ca/books/v3
- US:
You’ll include the access token in the header:
Authorization: Zoho-oauthtoken <access_token>
2) Create a customer in Zoho Books
In Zoho Books, customers are managed as contacts.
You create them using the Contacts API.
Endpoint
POST /contacts
Example cURL
curl --request POST \
--url 'https://www.zohoapis.com/books/v3/contacts?organization_id=YOUR_ORG_ID' \
--header 'Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"contact_name": "Acme Corp",
"company_name": "Acme Corp",
"contact_type": "customer",
"email": "billing@acme.com",
"phone": "555-123-4567",
"billing_address": {
"address": "123 Main St",
"city": "Austin",
"state": "TX",
"zip": "78701",
"country": "USA"
}
}'
Response
You’ll get back a contact object containing an contact_id like:
{
"contact": {
"contact_id": "123456789000012345"
}
}
Save that contact_id — you’ll need it for invoices.
3) Create an invoice
Endpoint
POST /invoices
Important
The invoice must reference the customer via customer_id.
Example cURL
curl --request POST \
--url 'https://www.zohoapis.com/books/v3/invoices?organization_id=YOUR_ORG_ID' \
--header 'Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "123456789000012345",
"date": "2026-11-03",
"due_date": "2026-11-10",
"line_items": [
{
"name": "Consulting Services",
"description": "Monthly consulting retainer",
"rate": 100,
"quantity": 2
}
]
}'
Response
You’ll get an invoice object with an invoice_id:
{
"invoice": {
"invoice_id": "123456789000067890"
}
}
4) Common fields for invoice line items
A line item usually includes:
name— item/service namedescription— optional descriptionrate— unit pricequantity— number of unitstax_id— if applicableitem_id— if you already have an item in Zoho Books
Example:
"line_items": [
{
"name": "Website Design",
"description": "Landing page design",
"rate": 500,
"quantity": 1
},
{
"name": "Development",
"rate": 75,
"quantity": 10
}
]
5) Full workflow example
Step 1: Create customer
POST /contacts
Step 2: Capture contact_id
Step 3: Create invoice
POST /invoices
with:
{
"customer_id": "contact_id_from_step_2",
"line_items": [...]
}
6) Optional: Search for existing customer before creating
If you don’t want duplicates, list or search contacts first:
GET /contacts?organization_id=YOUR_ORG_ID&contact_name=Acme
Then reuse the existing contact_id if found.
7) Notes and gotchas
- Zoho Books API uses OAuth 2.0, not basic auth.
- Make sure your OAuth token has the required scopes, such as:
ZohoBooks.contacts.CREATEZohoBooks.invoices.CREATE
- The
organization_idis required as a query parameter. - If your account uses a different data center, the base URL must match it.
- Some invoice fields depend on your organization settings, such as taxes, currency, and payment terms.
8) If you want to do it in code
JavaScript example
const orgId = "YOUR_ORG_ID";
const token = "YOUR_ACCESS_TOKEN";
async function createCustomer() {
const res = await fetch(`https://www.zohoapis.com/books/v3/contacts?organization_id=${orgId}`, {
method: "POST",
headers: {
"Authorization": `Zoho-oauthtoken ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
contact_name: "Acme Corp",
company_name: "Acme Corp",
contact_type: "customer",
email: "billing@acme.com"
})
});
return res.json();
}
async function createInvoice(contactId) {
const res = await fetch(`https://www.zohoapis.com/books/v3/invoices?organization_id=${orgId}`, {
method: "POST",
headers: {
"Authorization": `Zoho-oauthtoken ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
customer_id: contactId,
date: "2026-11-03",
due_date: "2026-11-10",
line_items: [
{ name: "Consulting Services", rate: 100, quantity: 2 }
]
})
});
return res.json();
}
If you want, I can also provide:
- a Python example,
- a Postman collection setup,
- or a complete end-to-end script that creates a customer and invoice automatically.
Brands