Scenario
When the user is creating a Sales Order record from their third-party system using REST API, only the country field is being populated in the shipping address sub-record even though the payload contains all other address fields.
Solution
Because NetSuite behaves differently depending on the country due to localization and other factors, the country field must always come first when sending REST API Requests.
In the UI, selecting countries with support for localization such as the US, the address’s state field is a drop-down list. For other countries, the State field is simply a free-text field.
Other fields of the address sub-record other fields in any order, but the country must always come first.
"addressBook": {
"items": [{
"label": "New York HQ",
"addressBookAddress": {
"country": { "id": "US" },
"state": "NY",
"zip": "10001",
"addressee": "Your Name"
}
}]
}
-----
Found this helpful? Let us know what you think by leaving a comment or a reaction below!