This topic can no longer be replied to because it has been locked.

Order PATCH and POST API calls to Mailchimp failing witth 404
Gravatar
Joined: 2017-03-13
Posts: 4
Hi team,

I have installed the module and have it almost working.

However order data API calls seem to be failing. The result is the same;
"response": {
"type": "http:\/\/developer.mailchimp.com\/documentation\/mailchimp\/guides\/error-glossary\/",
"title": "Resource Not Found",
"status": 404,
"detail": "The requested resource could not be found.",
"instance": ""
}
I'm currently out of ideas. Has anyone come across this issue before? Any solutions?

Thanks
Sam
Gravatar
Joined: 2012-03-08
Posts: 843
Hi Sam,

thanks for choosing our extensions.
That's only happens with orders?
Do you have the request file for this? (you can read at this)

Best

Gravatar
Joined: 2017-03-13
Posts: 4
Hi Gonzalez,

Yes I do, I don't see how I could send the file to you though?

Thanks
Sam
Gravatar
Joined: 2017-03-13
Posts: 4
Hi Gonzalez,

This is the request and response.

Thanks

#######Request

{
"operations":[
{
"method":"PUT",
"path":"\/ecommerce\/stores\/idString\/products\/933\/variants\/933",
"operation_id":"PRO_2017-03-21-13-40-04-14009200_933",
"body":"{\"id\":\"933\",\"title\":\"You and Me Little Bear\",\"url\":\"http:\\\/\\\/url\",\"sku\":\"SKU\",\"price\":\"999.0000\",\"inventory_quantity\":98,\"image_url\":\"http:\\\/\\\/url",\"backorders\":\"0\",\"visibility\":\"4\"}"
},
{
"method":"PATCH",
"path":"\/ecommerce\/stores\/idString\/orders\/798",
"operation_id":"ORD_2017-03-21-13-40-04-47890400_798",
"body":"{\"id\":\"798\",\"currency_code\":\"GBP\",\"order_total\":\"999.0000\",\"tax_total\":\"999.000\",\"discount_total\":0,\"shipping_total\":\"0.0000\",\"financial_status\":\"paid\",\"processed_at_foreign\":\"2017-03-21 13:37:11\",\"updated_at_foreign\":\"2017-03-21 13:37:12\",\"lines\":[{\"id\":\"1\",\"product_id\":\"933\",\"product_variant_id\":\"933\",\"quantity\":1,\"price\":\"999\",\"discount\":\"0.0000\"}],\"order_url\":\"https:\\\/\\\/url\",\"customer\":{\"first_name\":\"name\",\"last_name\":\"name\",\"address\":{\"address1\":\"address line 1\",\"address2\":\"place\",\"city\":\"place\",\"province\":\"-\",\"postal_code\":\"123445\",\"country\":\"United Kingdom\",\"country_code\":\"GB\"},\"orders_count\":1,\"total_spent\":999},\"billing_address\":{\"address1\":\"place 1\",\"address2\":\"place 2\",\"city\":\"place 3\",\"province\":\"-\",\"postal_code\":\"12345\",\"country\":\"United Kingdom\",\"country_code\":\"GB\",\"name\":\"name333\"},\"shipping_address\":{\"name\":\"prope3 rr\",\"address1\":\"prope\",\"address2\":\"ploed\",\"city\":\"loper\",\"province\":\"-\",\"postal_code\":\"loper\",\"country\":\"United Kingdom\",\"country_code\":\"GB\"}}"
}
]
}



########Response
[
{
"status_code": 200,
"operation_id": "PRO_2017-03-21-13-40-04-14009200_933",
"response": {
"id": "#id",
"title": "#title",
"url": "http:\/\/url",
"sku": "SKU",
"price": 999,
"inventory_quantity": 999,
"image_url": "http:\/\/url",
"backorders": "0",
"visibility": "4",
"created_at": "2017-03-02T11:25:29+00:00",
"updated_at": "2017-03-21T13:40:10+00:00",
"_links": [
{
"rel": "self",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/idString\/products\/933\/variants\/933",
"method": "GET",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/Response.json"
},
{
"rel": "parent",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/idString\/products\/933",
"method": "GET",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/CollectionResponse.json"
},
{
"rel": "update",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/idString\/products\/933\/variants\/933",
"method": "PATCH",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/Response.json",
"schema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/PATCH.json"
},
{
"rel": "upsert",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/idString\/products\/933\/variants\/933",
"method": "PUT",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/Response.json",
"schema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/PUT.json"
},
{
"rel": "delete",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/idString\/products\/933\/variants\/933",
"method": "DELETE"
}
]
}
},
{
"status_code": 404,
"operation_id": "ORD_2017-03-21-13-40-04-47890400_798",
"response": {
"type": "http:\/\/developer.mailchimp.com\/documentation\/mailchimp\/guides\/error-glossary\/",
"title": "Resource Not Found",
"status": 404,
"detail": "The requested resource could not be found.",
"instance": ""
}
}
]
Gravatar
Joined: 2014-08-07
Posts: 2628
Hello,

Can you confirm you have the latest version of the extension installed? This is 1.1.5.
I think the problem with that order is the "-" under province. Can you check if other failing orders have the same problem?

Regards,
Santiago.
Gravatar
Joined: 2017-03-13
Posts: 4
Hi Santiago,

I have 1.1.5 installed.
I have created a small override module to remove the province field when a "-" is present but I still get the same problem. This occurs on all orders, regardless of province.

I have noticed that I am also getting Product update failures, with the error message;
"The parent product must already exist in order to use PUT on the Variants endpoint. "
However I only have simple products and not configurable ones.
The url on the order requests is also using the /variants parameter, I wonder if this might be the cause of the request failure?

I've included the product request and response error to show you;


Thanks

########## Request
{
"operations": [{
"method": "PUT",
"path": "\/ecommerce\/stores\/hash\/products\/1342\/variants\/1342",
"operation_id": "PRO_2017-03-23-15-35-03-15657100_1342",
"body": "{\"id\":\"1342\",\"title\":\"Title\",\"url\":\"url",\"sku\":\"SKU\",\"price\":\"9999.000\",\"inventory_quantity\":10,\"image_url\":\"url",\"backorders\":\"0\",\"visibility\":\"4\"}"
}, {
"method": "PUT",
"path": "\/ecommerce\/stores\/hash\/products\/1341\/variants\/1341",
"operation_id": "PRO_2017-03-23-15-35-03-15657100_1341",
"body": "{\"id\":\"1341\",\"title\":\"title\",\"url\":\"url",\"sku\":\"sku",\"price\":\"9999.99\",\"inventory_quantity\":5,\"image_url\":\"url",\"backorders\":\"0\",\"visibility\":\"4\"}"
}]
}



######### Response
[
{
"status_code": 400,
"operation_id": "PRO_2017-03-23-15-35-03-15657100_1342",
"response": {
"type": "http:\/\/developer.mailchimp.com\/documentation\/mailchimp\/guides\/error-glossary\/",
"title": "Parent Product Does Not Exist",
"status": 400,
"detail": "The parent product must already exist in order to use PUT on the Variants endpoint.",
"instance": ""
}
},
{
"status_code": 200,
"operation_id": "PRO_2017-03-23-15-35-03-15657100_1341",
"response": {
"id": "1341",
"title": "title",
"url": "http:\/\/url",
"sku": "SKU",
"price": 9999,
"inventory_quantity": 9999,
"image_url": "url",
"backorders": "0",
"visibility": "4",
"created_at": "2017-03-23T14:25:09+00:00",
"updated_at": "2017-03-23T15:35:09+00:00",
"_links": [
{
"rel": "self",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/02ec69bb49b7fbe371f7aa4661aa88d7\/products\/1341\/variants\/1341",
"method": "GET",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/Response.json"
},
{
"rel": "parent",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/02ec69bb49b7fbe371f7aa4661aa88d7\/products\/1341",
"method": "GET",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/CollectionResponse.json"
},
{
"rel": "update",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/02ec69bb49b7fbe371f7aa4661aa88d7\/products\/1341\/variants\/1341",
"method": "PATCH",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/Response.json",
"schema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/PATCH.json"
},
{
"rel": "upsert",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/02ec69bb49b7fbe371f7aa4661aa88d7\/products\/1341\/variants\/1341",
"method": "PUT",
"targetSchema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/Response.json",
"schema": "https:\/\/us15.api.mailchimp.com\/schema\/3.0\/Definitions\/Ecommerce\/Stores\/Products\/Variants\/PUT.json"
},
{
"rel": "delete",
"href": "https:\/\/us15.api.mailchimp.com\/3.0\/ecommerce\/stores\/02ec69bb49b7fbe371f7aa4661aa88d7\/products\/1341\/variants\/1341",
"method": "DELETE"
}
]
}
}
]
Gravatar
Joined: 2014-08-07
Posts: 2628
Hello,

I think the best is for you to send a support request to mailchimp@ebizmarts-desk.zendesk.com
That way you can share the entire files and not just some portions.

Regards,
Santiago.

NEWSLETTER

Subscribe to our newsletter to receive emails and useful news articles