RE: SuiteTalk REST – Error Setting Fields When Transforming PO to Vendor Bill
Hi everyone,
I’m new to NetSuite and am trying to create a Vendor Bill from a Purchase Order using the “Transform to vendorBill” endpoint described here. Just providing the PO’s ID works, but I need to configure some fields in the Vendor Bill like Due Date.
The documentation says you can provide a vendorBill in the request body, but it doesn’t say how it should be formatted. Whatever JSON I try to send gets this error in response: “HTTP400 – {“type”:”
https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1″,”title”:”Bad Request”,”status”:400,”o:errorDetails”:[{“detail”:”Invalid content in the request body.”,”o:errorCode”:”INVALID_CONTENT”}]}
“
I’ve tried formatting the body in a few ways like these:
transform_json = { "vendorBill" : { "fields" : { "dueDate" : "8/26/2022" } } } transform_json = { "fields" : { "dueDate" : "8/26/2022" } } transform_json = { "dueDate" : "8/26/2022", }
I’ve considered trying just editing the fields on the Vendor Bill after it’s created, but I’d have to look up its Id with a query or something because the response from transforming the PO with no JSON body is a 204 No Content. That’s not the best way to do this, is it?
Does anyone have experience with this endpoint or setting record fields like this?
Thanks!
Hi,
If you’re still looking for a solution to this, try this as your body: