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?

Rookie Asked on July 28, 2020 in SuiteTalk.
Add Comment
4 Answer(s)

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

Intermediate Answered on July 28, 2020.
Add Comment

Thanks Chris, That worked but now I have moved on to my next challenge. The location, department and custom field of item

Rookie Answered on July 28, 2020.
Add Comment

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

Intermediate Answered on July 29, 2020.
Add Comment

I used this API and every time its returns empty body,but I want an invoice id and other details in response

Rookie Answered on January 21, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor