Netsuite rest api transform SO to item Fulfillment
I keep having this error message for a long while which drive me super crazy right now. Does anyone has ideas how to get rid of it?
Error Message: “Error while accessing a resource. You must have at least one valid line item for this transaction”
Code:
response1 = self.client_controller.post(url=’https://XXXXXX.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/{XXXX}/!transform/itemFulfillment’, headers=self.headers, data=json.dumps(item_fullfil_obj))
item_fullfil_obj = {
"createdDate":"2024-06-05",
"createdFrom":{
"id":"5325997"
},
"custbody_bv_employee":{
"id":"5188"
},
"customForm":{
"id":"183"
},
"department": {
"id":"1"
},
"entity":{
"id":"318"
},
"exchangeRate":1.0,
"location":{
"id":"609"
},
"shipstatus":"C",
"status":"C",
"tranDate":"2024-06-03",
"subsidiary":{
"id":"2"
},
"item":{
"items": [
{
"class":{
"id":"43"
},
"department":{
"id":"1"
},
"excludeFromRateRequest":False,
"inventoryDetail":{
"inventoryAssignment":{
"items":[
{
"internalId":2820203,
"inventoryDetail":2821220,
"inventoryStatus":{
"id":"1"
},
"quantity":1.0,
"quantityAvailable":334.0
}
]
},
"item":{
"id":"2525"
},
"quantity":1.0,
"location":{
"id": "609"
},
"toLocation": {
"id":"-1"
},
"unit":"1"
},
"item":{
"id":"2525"
},
"itemFxAmount":29.9,
"itemName":"BV-BA1",
"itemReceive":True,
"itemType":"InvtPart",
"itemUnitPrice":29.9,
"itemUpc":"813076020380",
"line":0,
"location":{
"id":"609"
},
"orderLine":4,
"quantity":1.0,
"quantityRemaining":1.0,
"quantityRemainingDisplay":1.0,
"units":"1",
"unitsDisplay":"PC"
}
]
},
"orderId":5325997,
"orderType":"SalesOrd",
"package":{
"items":[{
"packageWeight":4.0
}]
},
"tranDate":"2024-06-05"
}
highly appreciated
also tried { “item”:{ “items”:[ { “orderLine”:1, “location”:609, “itemreceive”: true } ] }}, it returned the same error.
Xiaosong Zhan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.