Bad Request (publications; expected Array to be a Hash).)

Highlighted
New Member
12 0 0

Hey guys,

 

We just upgraded one of our private apps from a very old version to the latest version. Now when creating products in shopify, I get the error:

Response code = 400. Response message = Bad Request (publications; expected Array to be a Hash).)

 

However, I do not set "publications" in my request, nor do I even see a field called this for the product API, nor am I aware that we use this "publications" functionality at all.

 

The only arrays I see us sending are the list of variants (only one element), and list of metafields (many elements).

0 Likes
Highlighted
New Member
12 0 0

The problem was that I forgot to upgrade the API version of the private app in our prod account. This error seems to occur if you use the 2020-01 API version against a private app that's set to use an old one from 2019.

0 Likes
Highlighted
Shopify Partner
71 0 17

I'm getting this error with Smart collections intermittently. I'm using the 2020-04 version through and through.

 

In my case, I get it once in a while when updating a Smart collection.

0 Likes
Highlighted
New Member
12 0 0

I am also still seeing this error occasionally while creating shopify products... looking into it.

0 Likes
Highlighted
Tourist
11 0 3

Hey @parkerjm, Did you ever figure this out? I've seen this a few times randomly also, but no idea why. I'm also not setting the `publications` field at all. 99% of the time I can create products with no problem, but every once in a while this error pops up for no apparent reason.

Highlighted
New Member
12 0 0

yeah, we still have the same issue. same as you, 99% of the time it's fine... we're also not setting the `publications` field. must be some internal thing the API is doing that's causing a failure in certain cases. wish I had more info.

0 Likes
Highlighted
New Member
2 0 0

I am having this problem when trying to create products via the API. I am currently using the API to import around 37k products with variants in to Shopify. After 27k products I am suddenly getting this error. Very strange as nothing has changed in my import script. Every single attempt to add a product now returns this error. I have tried simplifying the product I am sending to only contain the required fields and no variants and I am still getting this error. I am using a supported version of the API. I have also tried deleting the private app and creating a new one but no joy.

 

Really hoping someone at Shopify can help with this. 

0 Likes
Highlighted
New Member
2 0 0

It looks like I have hit the 50k API variant limit so I think the issue might be related to this. It might be related - hoping support can increase our API limit for our initial product import 🤞

0 Likes
Highlighted
New Member
12 0 0

hmm I will have to check my call rate to see if the error is associated with large spikes in product creation

0 Likes
Highlighted
Shopify Partner
71 0 17

Quick bump to say that I've started getting this again too: 400 Bad Request {"errors":{"publications":"expected Array to be a Hash"}

Looks like it's on this endpoint each time (REST Admin API):
PUT /admin/api/2020-04/smart_collections/{collectionId}.json

In each case I'm doing a simple update to a Smart collection to set it to published. This only happens a few times every couple weeks or so.

The plot thickens! lol

0 Likes