Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: I am trying to upload product through rest api, return status is 200 but product is not uploaded

I am trying to upload product through rest api, return status is 200 but product is not uploaded

BatraSagar
Visitor
2 0 0


My Payload :
{
"product": {
"title": "Sample Product",
"body_html": "<p>This is a sample product description.</p>",
"vendor": "curtina",
"product_type": "test"
}
}


returning

{
"products": []
}

 

Replies 2 (2)

chetancrao
Shopify Partner
42 5 5

Hi @BatraSagar,

 

Thank you for reaching out to the Shopify community.

 

Please confirm if you have followed these steps to perform the product create operation at Shopify using REST.

 

ENDPOINT : https://{your-shopify-domain}/admin/api/2023-01/products.json
REQUEST METHOD : POST

PAYLOAD : 

{
    "product": {
        "title": "Sample Product",
        "body_html": "<p>This is a sample product description.</p>",
        "vendor": "curtina",
        "product_type": "test"
    }
}

 HEADER :

- If your app is custom then please use the app key and secret in the basic authentication, or in the endpoint itself like: https://{your-app-key}:{your-app-secret}@{your-shopify-domain}/admin/api/2023-01/products.json

- If your app is public, then pass X-Shopify-Access-Token: {your-app-access-token}

 

Document reference : https://shopify.dev/docs/api/admin-rest/2023-07/resources/product#post-products

 

If you find any difficulty while creating the product as explained above, please do not hesitate to reach back.

 

Thanks,

Cheetos || Recurpay Subscriptions

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
BatraSagar
Visitor
2 0 0

Yss, My app is public and I have already defined the header, attached snapshot

problem is still there