RE: REST API to upsert invoice line items

I need to be able to upsert line items in a NetSuite invoice with updated information from an external system.

I’ve tried to apply an internalId and externalId to the line item so I can target for update, however it doesn’t appear to be saved against the line item when GETing it back from the API.

 

My invoice creation payload is

{
"tranDate": "2021-07-12", 
"dueDate": "2021-07-19", 
"externalId": "sysA_INV-34698", 
"amountPaid": 0, 
"entity": {
    "id": 3127
},
"item": {
    "items": [ 
        {
            "item": { 
                "id": 374
            }, 
            "internalId": "sysA_INV-34698_JOBID-4875398"
            "quantity": 1, 
            "rate": 534.54
        }
    ]
}
}

 

any ideas how I can update/upsert a line item, or do I have to delete all items and re add them every time?

CousinLarry Rookie Asked on July 12, 2021 in SuiteCloud.
Add Comment
3 Answers

Removing lines is equivalent to deleting and recreating the lines in the ui, the link betweeen the parent line is lost.

You also want to look at the linked documentation closer, you dont update individual lines

Intermediate Answered on July 12, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.