Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when syncing with MailChimp #348

Closed
darekkosyl opened this issue Jun 23, 2017 · 3 comments · Fixed by #387
Closed

Errors when syncing with MailChimp #348

darekkosyl opened this issue Jun 23, 2017 · 3 comments · Fixed by #387
Assignees
Labels

Comments

@darekkosyl
Copy link

Mailchimp for Magento 1.1.7
Magento v 1.9.3.3
We are getting a lot of Mailchimp errors during sync (see below) which is confusing to me because we chose NOT to pass customer address in 'Customer Fields Mapping'and all the errors relate to address.province_code. Could you please have a quick look and give me some pointers how to tackle it?
ERROR RESPONSE:
{ "status_code": 400, "operation_id": "storeid-3_CUS_2017-06-22-17-05-13-77961000_2461", "response": { "type": "http:\/\/developer.mailchimp.com\/documentation\/mailchimp\/guides\/error-glossary\/", "title": "Invalid Resource", "status": 400, "detail": "The resource submitted could not be validated. For field-specific details, see the 'errors' array.", "instance": "", "errors": [ { "field": "address.province_code", "message": "Schema describes string, NULL found instead" } ] } },

SUCCESS RESPONSE:
{ "status_code": 200, "operation_id": "storeid-3_CUS_2017-06-22-17-05-13-77961000_2475", "response": { "id": "2475", "email_address": "[email protected]", "opt_in_status": false, "company": "", "first_name": "John", "last_name": "Bain", "orders_count": 0, "total_spent": 0, "address": { "address1": "", "address2": "", "city": "", "province": "", "province_code": "", "postal_code": "", "country": "", "country_code": "" }, "created_at": "2017-06-22T17:06:22+00:00", "updated_at": "2017-06-22T17:06:22+00:00", "_links": [ { "rel": "self", "href": "https:\/\/us5.api.mailchimp.com\/3.0\/ecommerce\/stores\/0e90a3057a770ce9648328e8c3249a16\/customers\/2475", "method": "GET", "targetSchema": "https:\/\/us5.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Customers\/Response.json" }, { "rel": "parent", "href": "https:\/\/us5.api.mailchimp.com\/3.0\/ecommerce\/stores\/0e90a3057a770ce9648328e8c3249a16\/customers", "method": "GET", "targetSchema": "https:\/\/us5.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Customers\/CollectionResponse.json" }, { "rel": "update", "href": "https:\/\/us5.api.mailchimp.com\/3.0\/ecommerce\/stores\/0e90a3057a770ce9648328e8c3249a16\/customers\/2475", "method": "PATCH", "targetSchema": "https:\/\/us5.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Customers\/Response.json", "schema": "https:\/\/us5.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Customers\/PATCH.json" }, { "rel": "upsert", "href": "https:\/\/us5.api.mailchimp.com\/3.0\/ecommerce\/stores\/0e90a3057a770ce9648328e8c3249a16\/customers\/2475", "method": "PUT", "targetSchema": "https:\/\/us5.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Customers\/Response.json", "schema": "https:\/\/us5.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Customers\/PUT.json" }, { "rel": "delete", "href": "https:\/\/us5.api.mailchimp.com\/3.0\/ecommerce\/stores\/0e90a3057a770ce9648328e8c3249a16\/customers\/2475", "method": "DELETE" } ] } },
customer_fields_mapping

@centerax
Copy link
Collaborator

can you check the batch data sent for that error PUT so we can see where a NULL value is being sent?

@darekkosyl
Copy link
Author

See below for one example.
{ "status_code": 400, "operation_id": "storeid-1_CUS_2017-06-23-16-05-05-11552600_297", "response": { "type": "http:\/\/developer.mailchimp.com\/documentation\/mailchimp\/guides\/error-glossary\/", "title": "Invalid Resource", "status": 400, "detail": "The resource submitted could not be validated. For field-specific details, see the 'errors' array.", "instance": "", "errors": [ { "field": "address.province_code", "message": "Schema describes string, NULL found instead" } ] } },

{"method":"PUT","path":"\/ecommerce\/stores\/4c52ba8a67d1eebe27b1b5a7e6a3e169\/customers\/297","operation_id":"storeid-1_CUS_2017-06-23-16-05-05-11552600_297","body":"{\"id\":\"297\",\"email_address\":\"[email protected]\",\"first_name\":\"Matthew\",\"last_name\":\"Hulse\",\"opt_in_status\":false,\"orders_count\":3,\"total_spent\":58.94,\"address\":{\"address1\":\"17 Broomfield Close\",\"city\":\"Winsford\",\"province_code\":null,\"postal_code\":\"CW7 2US\",\"country\":\"United Kingdom\",\"country_code\":\"GB\"}}"}

@Santiagoebizmarts
Copy link
Contributor

Hello @darekkosyl
Customer address is sent automatically, this is not the same as Subscriber address which is what you removed.
For your case you can modify the file at app/code/community/Ebizmarts/MailChimp/Api/Customers.php with the same change as in the commit referenced above.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants