Thank you in advance for your help with this!
Hi we have just started using the Sage API and were able to create a customer. However, when we attempt to populate the address and contact info we get a "MalformedRequestBody" error. I think the syntax is correct and all of the PHP variables contain the appropriate data, so I'm thinking there must be a required field that is missing such as "type ID" or some other required field. here is the block of code that is causing the error:
CURLOPT_POSTFIELDS => '{
"contact": {
"name": "' . $company . '",
"contact_type_ids": [
"Customer"
],
"main_address": {
"address_line_1": "' . $street1 . '",
"address_line_2": "' . $street2 . '",
"city": "' . $city . '",
"postal_code": "' . $zip . '",
"region": "' . $state . '",
"is_main_address": true
},
"delivery_address": {
"address_line_1": "' . $street1 . '",
"address_line_2": "' . $street2 . '",
"city": "' . $city . '",
"postal_code": "' . $zip . '",
"region": "' . $state . '",
"is_main_address": false
},
"main_contact_person": {
"name": "' . $firstname . ' ' . $lastname . '",
"job_title": "' . $title . '",
"telephone": "' . $phone . '",
"mobile": "' . $mobile . '",
"email": "' . $email . '",
"is_preferred_contact": true
}
}',