Jump to content

Error 500 while changing main_address


 Share

Recommended Posts

Whenever I add or change main_address of a contact, I get a 500 error:

[
  {
     "$severity": "error",
     "$dataCode": "UnexpectedError",
     "$message": "An unexpected error occurred.",
     "$source": ""
  }
]

Here's my request:

PUT https://api.accounting.sage.com/v3.1/contacts/1c183acd2c1540c1b2e4e6d94a6a4c2e


{
  "contact": {
    "name": "[TEST] NEW CUSTOMER",
    "contact_type_ids": [
      "CUSTOMER"
    ],
    "main_address": {
      "address_line_1": "1470 Centre St",
      "city": "Vaughan",
      "postal_code": "L4J3N1",
      "name": "Tony Abshire",
      "region": "ON",
      "country": "CA",
      "is_main_address": true
    }
  }
}

But if I omit the main_address field, the update works. Thanks for looking into it.

Edited by Gabriel Deschênes
Link to comment
Share on other sites

Hi Gabriel,

Thank you for your question.

You're passing country which is an invalid parameter and needs to be changed to country_id. 

 

{
  "contact": {
    "name": "[TEST] NEW CUSTOMER",
    "contact_type_ids": [
      "CUSTOMER"
    ],
    "main_address": {
      "address_line_1": "1470 Centre St",
      "city": "Vaughan",
      "postal_code": "L4J3N1",
      "name": "Tony Abshire",
      "region": "ON",
      "country_id": "CA",
      "is_main_address": true
    }
  }
}

Thanks

Mark

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...