We are trying to update products via the Product API so that they have a published date set sometime in the future.
We have found some old posts suggesting to use the publish_on field and some others that suggest adding the header `X-Shopify-Api-Features` = `future-publishables` to the call. Neither of these solutions seem to be working now.
Does anyone know a solution that currently works?
Thanks in advance!
You can use the "published_at" field to published date set sometime in the future.
For more details please check this link: https://help.shopify.com/en/api/reference/products/product#create
Sorry to break the bad news, but as far as I am aware of, you cannot set future publishing dates on resources as of yet. Still waiting for response from Shopify as to why not / when yes this will be available given that the API is already prepped for it and we're just missing access scopes.
Meanwhile, you can set the published_at field to null i.e. it won't be published. Once you want to publish it, you will need to update the product yet again - won't happen on its own. You cannot set published_at to a future date - think of it - published << past tense so how would that work with a future date?
Agreed, it is not documented, probably for a reason. Which also means it is use at your own risk.
Side note, I think we ran into an issue with this functionality. IF you submit a future date/time that falls too close to the current time (my best guess right now is within 24 hours or same day) then Shopify decides to go ahead and publish it NOW. I have not 100% proven this, it is just my best guess.
So my advice would be to make sure you take steps to avoid submitting a publish_on date that is within 24 hours of now. I have actually taken steps to avoid it within 48 hours just to be safe. In my case the products were all set up to publish at the right time then a message was sent with the same time it already had in the system but because it was same day Shopify just went ahead and published it at the time of the updated_at for no reason.