Im trying to create a customer via API. We have cu...
# ask-stanley-ai
j
Im trying to create a customer via API. We have custom fields that require creation how would we map these in the API “title”: “Bad Request”, “status”: 400, “oerrorDetails” [ { “detail”: “Error while accessing a resource. Please enter value(s) for: Department, Segment.“, “oerrorCode” “USER_ERROR”
c
AI generated answer (using internal Slack threads):
When creating a customer via API and you have custom fields that require creation, you can map these in the API by including them in your request body. For example, if you have a custom field called 'Department' and another called 'Segment', you would include these in your request body like so:
Copy code
json
{
  "Department": "Your Department Value",
  "Segment": "Your Segment Value",
  ...
}
However, the error message you're seeing indicates that the values for 'Department' and 'Segment' are not being provided in your request. Make sure you are including these fields with valid values in your request body. If you're using SuiteTalk, setting a value for a custom segment applied to a customer record can be a bit tricky. If you're using the 2019.2 API or later, it should appear like a "normal" custom field. You can set the
internalid
to a value, and
value->internalid
to the option that you want. However, making this account-independent can be challenging since the first
internalid
would change between accounts. One possible solution is to use external IDs, assuming these are populated consistently. Alternatively, you could use a saved search to populate a cross-reference table and look up the internal id using your account-independent variable + NetSuite account. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828110337
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.822316051
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819057226
Please provide your feedback on this answer.
Thank you for your feedback