zoho books api fix billing address error
How to Fix Zoho Books API Error: Billing Address Exceeds Character Limit & Use Address API Correctly
Introduction
If you receive this error when creating invoices via Zoho Books API:
Please ensure that the “billing_address” has less than 100 characters.
This happens because Zoho expects an address ID instead of a full inline billing address in your invoice payload. Let’s fix this step-by-step.
Step 1: Understand Zoho Books Address Handling
- Inline billing addresses longer than 100 chars are not accepted.
- Create addresses via Address API linked to contacts.
- Use the returned
address_id
in your invoice data.
Step 2: Create an Address for a Contact
Send a POST request to:
POST https://www.zohoapis.com/books/v3/contacts/{contact_id}/addresses?organization_id=YOUR_ORG_ID
Example payload:
{
"address": "123 Main St, Apartment 4B",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "USA",
"fax": "",
"phone": "123-456-7890"
}
Step 3: Get the Address ID from Response
The response includes:
{
"code": 0,
"message": "Address added successfully",
"address": {
"address_id": "987654321"
}
}
Step 4: Use the Address ID in Invoice Creation
Use billing_address_id
instead of billing_address
in invoice JSON:
{
"customer_id": "123456789",
"billing_address_id": "987654321",
...
}
Step 5: Example Invoice Creation API Call
curl -X POST "https://www.zohoapis.com/books/v3/invoices?organization_id=YOUR_ORG_ID" \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "123456789",
"billing_address_id": "987654321",
"invoice_number": "INV-1001",
"date": "2025-06-07",
"due_date": "2025-06-21",
"line_items": [
{
"item_id": "987654321",
"description": "Website development",
"rate": 1000,
"quantity": 1
}
]
}'
Category: