Prompt
How do I import customers and invoices into Zoho Books through API?
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
To import customers and invoices into Zoho Books via API, you generally do it in two steps:
- Create/insert customers
- Create/insert invoices using the customer IDs returned from step 1
Zoho Books does not usually support a single “bulk import everything” endpoint for customers + invoices together; instead you use the REST API endpoints for each module.
1) Prerequisites
a) Get OAuth access
Zoho Books API requires OAuth 2.0 authentication.
You’ll need:
access_tokenorganization_id
Typical header:
Authorization: Zoho-oauthtoken {access_token}
2) Create customers
Endpoint
POST /books/v3/contacts
Example request
curl -X POST "https://www.zohoapis.com/books/v3/contacts?organization_id=123456789" \
-H "Authorization: Zoho-oauthtoken 1000.xxxxx" \
-H "Content-Type: application/json" \
-d '{
"contact_name": "Acme Corp",
"company_name": "Acme Corp",
"contact_type": "customer",
"billing_address": {
"address": "123 Main St",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "USA"
},
"contact_persons": [
{
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@acme.com"
}
]
}'
Response
You’ll get a JSON response containing the created contact, including an contact_id you’ll use later for invoices.
3) Create invoices
Endpoint
POST /books/v3/invoices
Example request
curl -X POST "https://www.zohoapis.com/books/v3/invoices?organization_id=123456789" \
-H "Authorization: Zoho-oauthtoken 1000.xxxxx" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "1234567000000123456",
"date": "2026-11-03",
"due_date": "2026-12-03",
"line_items": [
{
"item_name": "Consulting Service",
"description": "Monthly consulting",
"rate": 500,
"quantity": 1
}
]
}'
Notes
customer_idmust be the Zoho contact/customer ID created in step 2.- Each invoice needs at least one
line_itemsentry. - You can include taxes, discounts, notes, terms, etc., depending on your account setup.
4) Typical import flow
If you’re importing from a CSV/database:
Step A: Read customers
For each customer record:
- Check if customer already exists
- If not, create via
POST /contacts - Save the returned
contact_idin your mapping table
Step B: Read invoices
For each invoice record:
- Look up the corresponding
contact_id - Create invoice via
POST /invoices - Save returned
invoice_id
5) Search existing customers before creating
To avoid duplicates, you can list/search contacts:
List contacts
GET /books/v3/contacts?organization_id=123456789
You can also use filters/search depending on your needs.
6) Common fields you may need
Customer/contact fields
contact_namecompany_namecontact_type: usually"customer"currency_idif you use multi-currencybilling_addressshipping_addresscontact_persons
Invoice fields
customer_iddatedue_dateline_itemsreference_numbernotestermsdiscounttax_id/ tax-related fields if applicable
7) Important implementation tips
- Use customer mapping: source customer ID → Zoho
contact_id - Handle API rate limits and retry failures
- Validate required fields before sending
- If creating many records, use batching on your side, but still call Zoho per record unless an endpoint explicitly supports bulk create
- Save API responses for troubleshooting
8) Example in Python
import requests
BASE_URL = "https://www.zohoapis.com/books/v3"
ORG_ID = "123456789"
ACCESS_TOKEN = "1000.xxxxx"
headers = {
"Authorization": f"Zoho-oauthtoken {ACCESS_TOKEN}",
"Content-Type": "application/json"
}
# Create customer
customer_payload = {
"contact_name": "Acme Corp",
"company_name": "Acme Corp",
"contact_type": "customer"
}
r = requests.post(
f"{BASE_URL}/contacts",
params={"organization_id": ORG_ID},
headers=headers,
json=customer_payload
)
customer_result = r.json()
contact_id = customer_result["contact"]["contact_id"]
# Create invoice for that customer
invoice_payload = {
"customer_id": contact_id,
"date": "2026-11-03",
"due_date": "2026-12-03",
"line_items": [
{
"item_name": "Consulting Service",
"rate": 500,
"quantity": 1
}
]
}
r2 = requests.post(
f"{BASE_URL}/invoices",
params={"organization_id": ORG_ID},
headers=headers,
json=invoice_payload
)
print(r2.json())
If you want, I can also give you:
- a CSV-to-Zoho Books import script,
- a Node.js example, or
- the exact JSON schema for customers and invoices.
Brands