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!

DieselDino Rookie Asked on August 2, 2022 in SuiteTalk.
Add Comment
1 Answers

Hi,

If you’re still looking for a solution to this, try this as your body:

{
“duedate”:”2022-12-13″
}
where the date is in the format “YYYY-MM-DD”, assuming your using the endpoint POST /purchaseOrder/{id}/!transform/vendorBill.
Alternatively, you could set the payment terms and NetSuite will calculate the due date for you.
Rookie Answered on November 28, 2022.
Add Comment

Your Answer

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