Shopify API - How to create a new draft product using Postman

Shopify API – How to create a new draft product using Postman

In this article, we will talk about how to create a new draft product using Postman.

Don’t confuse the unpublished product with the draft product.

A draft product doesn’t exist in inventory while an unpublished product is identified in inventory but not yet made public. 

Now, let’s dive into the article to know how to create a new draft product using Postman in Shopify API. 

If this is the first time you make a call in the Postman, you must generate API credentials from the Shopify admin

Step 1: Generate API credentials from Shopify Admin

Follow the process in How to build a custom app for Shopify in 2022? to know how to access Shopify API. 

  • After creating an app, remember the Admin API access token and the API key to send requests in the Postman. 

Step 2: Create a new draft product using Postman

Now we are ready to create a new draft product:

  • Log in to your Postman and create a new workspace
  • Create a new POST with this URL:
https://{API_key}:{admin_API_access_token}@{shop}.myshopify.com/admin/api/{api-version}/{resource}.json
Code language: JavaScript (javascript)
  1. {API_key} – The API key that you generated.
  2. {admin_API_access_token} – The admin API access token that you generated.
  3. {shop} – The name of your development store.
  4. {api-version} – The supported API version that you want to use.
  5. {resource} – A resource endpoint from the REST Admin API.

Or you can copy this example, remember change {resource} to {products}:

https://ed86d512a2c95387ffa25f67074a222b:[email protected]/admin/api/2022-01/products.json
Code language: JavaScript (javascript)
  • Paste the URL above.
create a new draft product
Shopify API - How to create a new draft product using Postman 5

In the body section, enter the code:

{ "product": { "title": "Burton Custom Freestyle 151", "body_html": "\u003cstrong\u003eGood snowboard!\u003c\/strong\u003e", "vendor": "Burton", "product_type": "Snowboard", "status": "draft" } }
Code language: JSON / JSON with Comments (json)
body_create a new draft product
Shopify API - How to create a new draft product using Postman 6

Parameters: 

  • product.title:”Burton Custom Freestyle 151″: The name of the product.
  • product.body_html:”<strong>Good snowboard!</strong>”: A description of the product. Supports HTML formatting.
  • product.vendor:”Burton”:  The name of the product’s vendor.
  • product.product_type:”Snowboard”: A categorization for the product used for filtering and searching products.
  • Product.status:”draft”: The status of the product

Then click Send

Response:

The API will return the new draft product information.

{ "product": { "id": 6939083112511, "title": "Burton Custom Freestyle 151", "body_html": "<strong>Good snowboard!</strong>", "vendor": "Burton", "product_type": "Snowboard", "created_at": "2022-05-10T10:51:22+09:00", "handle": "burton-custom-freestyle-151", "updated_at": "2022-05-10T10:51:22+09:00", "published_at": null, "template_suffix": null, "status": "draft", "published_scope": "web", "tags": "", "admin_graphql_api_id": "gid://shopify/Product/6939083112511", "variants": [ { "id": 39672784060479, "product_id": 6939083112511, "title": "Default Title", "price": "0.00", "sku": "", "position": 1, "inventory_policy": "deny", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": null, "option1": "Default Title", "option2": null, "option3": null, "created_at": "2022-05-10T10:51:22+09:00", "updated_at": "2022-05-10T10:51:22+09:00", "taxable": true, "barcode": null, "grams": 0, "image_id": null, "weight": 0.0, "weight_unit": "kg", "inventory_item_id": 41768407892031, "inventory_quantity": 0, "old_inventory_quantity": 0, "requires_shipping": true, "admin_graphql_api_id": "gid://shopify/ProductVariant/39672784060479" } ], "options": [ { "id": 9000180088895, "product_id": 6939083112511, "name": "Title", "position": 1, "values": [ "Default Title" ] } ], "images": [], "image": null } }
Code language: JSON / JSON with Comments (json)
response_create a new draft product
Shopify API - How to create a new draft product using Postman 7

Step 3: Verify the new draft product

After creating the draft product, we can check the draft product in Shopify Admin.

  • From Shopify Admin, choose products.
  • Search the draft product that you just created.
  • Click on the draft product.
after creating a new draft product
Shopify API - How to create a new draft product using Postman 8

As you can see, the new draft product has been created successfully.

The above are all steps to create a new draft product using Postman with Shopify API. If you have any questions, let us know in the comment below or refer to our Shopify api documentation.

These steps will be shown visually in the video below.

Shopify API – How to create a new draft product

Hopefully, you can do it!