Issue while creating product

Topic summary

A developer is encountering difficulties creating products with multiple variants through the Shopify API. The payload structure appears malformed or incorrectly formatted in their current implementation.

Key Issue:

  • Products are not being created when variants are included
  • The developer has reviewed documentation but hasn’t found a clear solution

Proposed Solution:
A PageFly representative suggests restructuring the payload:

  • Nest the variants array within a “product” object instead of placing it directly in the main payload
  • Include image URLs within an “image” object using an “src” key
  • Keep the variants array structure the same, containing details for each variant (option, price, SKU)

Status: The discussion provides specific technical guidance on proper API payload formatting, with reference to official Shopify API documentation for variant creation. Implementation remains pending.

Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

I am currently working on integrating the Shopify API into our system to create products dynamically. However, I’ve encountered an issue when attempting to create products with multiple variants. Product is not creating with variants. Could you please provide guidance on how to achieve this using the Shopify API? I’ve thoroughly reviewed the documentation but haven’t found a clear solution.

i am using this payload

{ “file”: “https://cdn.pixabay.com/photo/2015/07/13/16/49/night-table-lamp-843461_1280.jpg”, “title”: “Manish Product111”, “SKU”: “Manish Product111”, “bar_code”: “Test bar code”, “weight”: 1, “dimensions”: “12*16”, “price”: 100, “cost_price”: 80, “wholesale_price”: 75, “variants”: [ { “option1”: “Red”, “price”: 10.00, “sku”: “red-variant-sku” } ] }

Hi @VaidbanV ,
This is Theodore from PageFly - Shopify Page Builder App.

Hi @Amandalman,
This is Theodore from PageFly - Shopify Page Builder App.

Instead of placing the variants array directly in the main payload, nest it within a “product” object. Include the image URL within an “image” object with an “src” key. The variants array itself can remain the same, containing details for each variant (option, price, SKU).

By making these adjustments and referring to the official Shopify API documentation for product creation with variants, you should be able to successfully create products with multiple variants through your system integration.

Best regards,
Theodore | PageFly

Best regards,
Theodore | PageFly