I'm trying to add a new customer address using Magento 2 REST API in C#. I'm using POST /V1/customers/:id. I keep getting the below error. Where do I find the regionId? Is there another API I can use to get it because I can't easily query the Magento database everytime.
{
"message":"%fieldName is a required field.",
"parameters":{
"fieldName":"regionId"
}
}
Here is the JSON request:
{
"customer":{
"email":"[email protected]",
"firstname":"John",
"lastname":"Doe",
"websiteId":"1",
"addresses":[
{
"customer_id":"1",
"firstname":"John",
"lastname":"Doe",
"company":"ABC Manufacturing",
"telephone":"555-555-5555",
"city":"Boston",
"region":"Massachusetts",
"postcode":"02115",
"country_id":"US",
"street":[
"123 Main Street",
"PO Box 321"
]
}
]
}
}