How to create multiple products (item lines) in zoho books API when creating an invoice

922 Views Asked by At

I'm trying to create a Zoho books invoice through their API and I'm trying to include multiple item lines, how do I do that?

I tried

'line_items' => [
    [
        'item_id'           => '7131',
        'description'       => something
        'rate'              => somthing
        'quantity'          => something
    ]
]

duplicating this with the same tag and it goes through but only one product line was created then I tried changing it to line_items2 and I get this error

resulted in a 400 Bad Request response: {"code":15,"message":"Please ensure that the line_items2 has less than 100 characters."}

1

There are 1 best solutions below

1
On

For creating an Invoice with multiple line items in Zoho Books via API call, the line_items has to be in the below format:

"line_items": [
{
"item_id": "10114090XXXX29039",
"rate": 50000,
"description": "DESC",
"quantity": "1.00"
},
{
"item_id": "1011409XXXX43097",
"rate": 2550,
"description": "DESC",
"quantity": "1.00"
}
]

Once done, the Invoice with the multiple lines should be created in Zoho Books