Unable To Add Products To Cart via API On Products Uploaded Through API

Unable To Add Products To Cart via API On Products Uploaded Through API

brendanj
Shopify Partner
3 0 0

Hello,

 

When uploading products to a store via the API, I am unable to add these products to a cart via the Storefront API.

 

When creating products manually within Shopify, these products work fine with the Cart API.

 

I have tried filling out all product fields and filling out minimal product fields, but both not working. 

 

When creating the product manually on Shopify, any amount of fields will work fine, don't even need to add inventory for it to work.

 

However, any products uploaded through the API, don't work when being added to the cart via API.

 

Any help would be appreciated. 

 

Regards,

Brendan

Replies 5 (5)

SBD_
Shopify Staff
1829 271 414

Hey @brendanj 

 

Can you confirm the products are published to the channel trying to add them to the cart (screenshot), and their available quantity is >0?

 

Are you seeing a specific error message?

Scott | Developer Advocate @ Shopify 

brendanj
Shopify Partner
3 0 0

Hi,

 

Yes, the products are available on the store and can be added to the cart -

brendanj_0-1705640508634.png

 

The products will return 'null' when trying to add to the cart via API.

 

brendanj_1-1705640542501.png

 

Products created within Shopify will work fine - 

brendanj_2-1705640603987.png

 

Cheers,

Brendan

 

SBD_
Shopify Staff
1829 271 414

Are you able to DM me store URL / example product?

Scott | Developer Advocate @ Shopify 

brendanj
Shopify Partner
3 0 0

Sure

SBD_
Shopify Staff
1829 271 414

For anyone following along: products aren't automatically published to every channel. You can publish them using the PublishablePublish mutation.

Scott | Developer Advocate @ Shopify