i use the requests library. how can this be the default behavior? any way to return the ID of the item created?
def create_sales_order():
url = f"https://{url_account}.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder"
data = {
"entity": {
"id": "000"
},
"item": {
"items": [
{
"item": {
"id": 25
},
"quantity": 3,
"amount": 120
}
]
},
"memo": "give me money",
"Department": "109"
}
body = json.dumps(data)
response = client.post(url=url, headers=headers, data=body)
print(response.text)
Ok so it turns out that the header returned in the 204 empty response contains a link to the created item (Location is the key name in the json returned) , which is sufficient to do another get request and have all the info returned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With