ValidationError: Controller required on post to customers with controller included

I’m POSTing this to “customers” in my sandbox

  "type": "business",
  "businessName": "ACME Enterprises",
  "businessType": "corporation",
  "businessClassification": "9ed3813f-7d6f-11e3-8840-5404a6144203",
  "address1": "123 Main St",
  "city": "Nyack",
  "state": "NY",
  "postalCode": "10960-3113",
  "ein": "12-3456789",
  "correlationId": "rtBgjKvttYMctbfD8",
  "firstName": "Account",
  "lastName": "Admin",
  "email": "",
  "controller": {
    "firstName": "Jane",
    "lastName": "Controller",
    "title": "Comptroller",
    "dateOfBirth": "1994-04-28",
    "ssn": "4321",
    "address": {
      "address1": "321 Main St",
      "city": "New York Mills",
      "state": "NY",
      "postalCode": "13417-1226",
      "country": "US"

And I get this response:

  "status": 400,
  "headers": {},
  "body": {
    "code": "ValidationError",
    "message": "Validation error(s) present. See embedded errors list for more details.",
    "_embedded": {
      "errors": [
          "code": "Required",
          "message": "Controller required.",
          "path": "/controller",
          "_links": {}

I have included the controller, so what’s the issue?

Hi @gfb107, I believe the issue is that within the Controller address object that state needs to be changed to stateProvinceRegion for it to be a valid request. I’ll create a ticket on our end to see if we can update the path to “/controller/address/stateProvinceRegion” to give a better indication of what field is invalid in your request.

Hope this helps, please let us know if you have any follow up questions!

That was it!

1 Like