Creating invoices via REST API
I am having trouble with creating invoices via the rest API. In particular how to correctly add a line item. Does anyone have any sample requests for creating an invoice including invoice items?
Hi,
There’s a really handy sample Postman collection here:
https://netsuite.custhelp.com/app/answers/detail/a_id/86958
And based off that, the minimal amount you need for an Invoice will be something like this:
{ "entity": { "id": 1 }, "item": { "items":[ { "item": { "id": 12 }, "rate": 10, "amount": 10 } ] } }
Thanks,
Chris
Thanks Chris, That worked but now I have moved on to my next challenge. The location, department and custom field of item
Hi,
It seems that location may be a challenge based on this other recent question:
https://netsuiteprofessionals.com/question/set-item-location-via-rest-api-when-creating-a-new-sales-order/
I’ve just done a quick test with Department and that seems to have the same issue too for some reason!?!
There’s some suggestions on that other ticket as to what you might be able to do to work around this apparent limitation.
That said, I don’t believe that you should have any issues with custom fields based on my testing – just use the field name in the line level object of the JSON.
Thanks,
Chris
I used this API and every time its returns empty body,but I want an invoice id and other details in response