Automate now

Shopify API 2026 : Create A New Product Variant using Postman

By Beehexa Engineering TeamPublished Updated

Table of Contents

A variant is a new version of the product. Example: Colors or sizes. If you don’t create a new variant, you will have to treat shirts with 3 colors, yellow, blue, and green, as 3 separate products. Product Variant allows you to treat yellow, blue and green shirts as 3 variations of the same product as a shirt.

Each product has a maximum of 100 variants. For every business running on Shopify, new variants are required. So, today I will show you how to create a new product variant using Postman in Shopify.

Step 1: Generate API credentials from the Shopify admin

Generate API credentials from the Shopify admin

Generate API credentials from the Shopify admin

The Admin API section displays the app’s API key and password when you save the app’s details.

Step 2: Create A New Product Variant

 

https://{username}:{password}@{shop}.myshopify.com/admin/api/{api-version}/{resource}.json

 

    1. {username} – The API key that you generated.
    1. {password} – The API password that you generated.
    1. {shop} – The name of your development store.
    1. {api-version} – The supported API version that you want to use.
    1. {resource} – A resource endpoint from the REST Admin API.

Or you can copy this example in the Shopify Admin, remember to change {resource} to {products/product ID/variants}:

https://{api_key}:{admin_api_access_token}@{shop}.myshopify.com/admin/api/2021-10/products/4356051664959/variants.json

Example URL

 

Post

In the body section, enter this code, then click Send.

{
    "variant": {
        "option1": "Yellow",
        "price": "1.00"
    }
}

Response:

API will return the data like this.

{
    "variant": {
        "id": 39525900648511,
        "product_id": 4356051664959,
        "title": "Yellow",
        "price": "1.00",
        "sku": "",
        "position": 2,
        "inventory_policy": "deny",
        "compare_at_price": null,
        "fulfillment_service": "manual",
        "inventory_management": "shopify",
        "option1": "Yellow",
        "option2": null,
        "option3": null,
        "created_at": "2021-11-24T11:31:58+09:00",
        "updated_at": "2021-11-24T11:31:58+09:00",
        "taxable": true,
        "barcode": null,
        "grams": 0,
        "image_id": null,
        "weight": 0.0,
        "weight_unit": "kg",
        "inventory_item_id": 41620530987071,
        "inventory_quantity": 0,
        "old_inventory_quantity": 0,
        "requires_shipping": true,
        "admin_graphql_api_id": "gid://shopify/ProductVariant/39525900648511"
    }
}

Response

Step 3: Verify the result

In the admin, choose products, click all products, then search product by product id. 

Look at the variant area.

Variants area

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

I have shown you all steps to create a new product variant using Postman with Shopify API . If you have any questions, please comment below or refer to our Devdocs. 

If you still do not understand the tutorial’s content, you can watch the video below for a more overview.

Shopify API: Create a new product variant

Hopefully, you can do it!