Gabriel Deschênes Posted May 2, 2023 Share Posted May 2, 2023 (edited) 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 May 2, 2023 by Gabriel Deschênes Link to comment Share on other sites More sharing options...
Steel, Mark Posted May 3, 2023 Share Posted May 3, 2023 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 More sharing options...
Gabriel Deschênes Posted May 3, 2023 Author Share Posted May 3, 2023 That works. Error 500 is a weird error for a validation issue. Maybe return a 422 instead. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now