Create Product

🔒

Requires write_product access scope. For more access scope

The Create Product API enables merchants to add new products to their store seamlessly. This endpoint supports detailed customization of product attributes, including title, price, inventory, and more.This API is especially useful for:

  1. Adding new products with tailored specifications such as descriptions, SEO details, and inventory settings.

  2. Simplifying product management with customizable fields like tags, variants, and vendor details.

Note: The operation is scoped to a specific shop, identified by its unique domain prefix (shopdomain), ensuring all updates are applied to the correct store.

Public Request Parameters

Parameter NameTypeRequiredParameter LocationParameter ValueDescription
Access-TokenStringYesHeaderBx-_5aV
eXNwl-4AB98s5xLV
yg0fNzGf

MuTpqtlBA
Used to authenticate API requests. Obtain an access token from the Access Token Guide.
Pass it in the Authorization header for every request.
Content-TypeStringYesHeaderapplication
/json
Indicates the media type of the request body. It tells the server how to parse the request and
the client how to interpret the response. For more details, visit Content-Type.

Public Response Parameters

Parameter NameTypeMandatoryParameter LocationExample ValueDescription
errorStringNoResponse Body{ "error": "store is not active" }Indicates an error encountered during the process. This field typically appears when the Access Token is missing or invalid. Example: { "error": "store is not active" }.
errorsArrayNoResponse Body{ "errors"["No Context"] }A list of errors that occurred during the request processing. Example: { "errors": [ "No Context" ] }.
Request-IdStringYesHeaderBx-_5aV
eXNwl-4AB98s5xLV
yg0fNzGf

MuTpqtlBA
A unique identifier for each request. It helps in identifying and debugging specific requests.

Error and Errors Clarification:

Added explanation that the error and errors fields are currently dependent on the API implementation, with plans for future unification.

Request Parameters

Body Parameters

ParameterTypeRequiredExampleDescription
titleStringYes"Test Product"The title of the product.
briefStringNo"Short description
of product"
A brief description of the product.
descriptionStringNo"Detailed
description here."
Detailed description of the product.
publishedBooleanNotrueIndicates if the product is published.
requires_shippingBooleanNofalseSpecifies if shipping is required for the product.
taxableBooleanNotrueIndicates if the product is taxable.
tagsStringNo"tag1,tag2"Tags for categorizing the product, separated by commas.
vendorStringNo"Vendor Name"Name of the vendor for the product.
vendor_urlStringNo"https://vendor-
website.com"
Vendor's URL.
noteStringNo"Additional notes"Notes associated with the product.
seo_titleStringNo"SEO Title"SEO-friendly title for the product.
seo_descriptionStringNo"SEO Description"SEO description for the product.
seo_keywordsStringNo"keyword1,keyword2"SEO keywords separated by commas.
handleStringNo"product-handle"URL handle for the product.
has_only_default_variantBooleanYestrueIndicates if the product has only a default variant. Defaults totrue.
inventory_trackingBooleanNotrueSpecifies if inventory tracking is enabled.
inventory_policyStringNo"continue"Inventory policy (e.g., continue, deny,auto_unpublished). Required if inventory_tracking is true.
need_variant_imageBooleanNofalseSpecifies if a variant image is needed. It's required if has_only_default_variant is false
spuStringNo"SPU12345"Stock-keeping unit (SPU) for the product.
fake_salesIntegerNo100Fake sales count for display purposes.
display_fake_salesBooleanNotrueWhether to display fake sales count.
optionsArray of options object No[{"name": "Size", "values":
["S", "M", "L"]}]
Product options like size or color.
options.nameStringRequired if new optionsSizeProduct option's name
options.valuesArray of StringsRequired if new options["S", "M", "L"]options list
imagesArray of image objectNo[{"src": "image_url",
"alt": "Alt text"}]
Images associated with the product.
images.srcStringRequired if new images"image_url"URL of the image.
images.widthIntegerNo100Width of the image in pixels.
images.heightIntegerNo100Height of the image in pixels.
images.altStringNo"Alt text"Alt text for the image.
variantsArray of variant object No[{"option1": "S",
"price": 19.99}]
Variants of the product, including price and options.
variants.option1StringNo"S"First option value.
variants.option2StringNo"Black"Second option value.
variants.option3StringNo"Light"Third option value.
variants.imageArray of image objectNo[{"src": "image_url", "alt": "Alt text"}]Images associated with the product.
variants.image.srcStringRequired if new variant.images"image_url"URL of the image.
variants.image.widthIntegerNo100Width of the image in pixels.
variants.image.heightIntegerNo100Height of the image in pixels.
variants.image.altStringNo"Alt text"Alt text for the image.
variants.compare_at_priceStringNo"29.99"The compare-at price for discounts.
variants.priceStringYes"29.99"The price of the variant, set it to "0.00" if you want to leave the price empty.
variants.skuStringNo"SKU12345"Stock Keeping Unit for the variant.
variants.barcodeStringNoBarcode of the variant.
variants.noteStringNo"123456789012"Additional notes about the variant.
variants.inventory_quantityIntegerNo100Available inventory quantity.
variants.weightStringNoThe weight of the variant.
variants.weight_unitStringNo"100"Possible value are: kg, g, lb, oz
variants.cost_priceStringNo"100"Cost price
variants.wholesale_priceArray of wholsesale priceNo[{"price": 8.99,
"min_quantity": 10}]
Wholesale pricing information.
variants.wholesale_price.
price
StringNo"8.99"The wholesale price for the variant.
variants.wholesale_price.
min_quantity
IntegerNo18Minimum quantity for the price.
mixed_wholesaleBooleanNotrueIndicates if mixed wholesale pricing is supported.
unique_tokenStringYes"e6cc4df1-d4f5-
4ad4-a019-2e0f3ddd6e63"
Unique token for idempotency verification.

Response Explanation

Successful Response


FieldTypeExampleDescription
product.idstring"9fb9f3c6-2300-42c1
-8593-d9008d7cfc09"
Unique identifier for the product.
product.titlestring"Stylish Shirt"Title of the product.
product.briefstring"A stylish shirt."Brief description or summary of the product.
product.descriptionstring""Full description of the product.
product.publishedbooleantrueIndicates whether the product is published.
product.requires_shippingbooleantrueIndicates if the product requires shipping.
product.taxablebooleantrueIndicates if the product is subject to tax.
product.tagsstring"shirt,stylish,cotton"Tags associated with the product, separated by commas.
product.vendorstring"Awesome Vendor"Name of the product vendor.
product.vendor_urlstring"https://awesomevendor.com"URL of the vendor's website.
product.inventory_quantityinteger300Total inventory available for the product.
product.published_atstring (ISO8601)"2024-12-03T19:02:30Z"Timestamp when the product was published.
product.created_atstring (ISO8601)"2024-12-03T19:02:30Z"Timestamp when the product was created.
product.updated_atstring (ISO8601)"2024-12-03T19:02:30Z"Timestamp when the product was last updated.
product.notestring"Special promotion item."Notes or special remarks about the product.
product.seo_titlestring"Buy Stylish Shirt Online"SEO-friendly title for the product.
product.seo_descriptionstring"Premium cotton"SEO-friendly description for the product.
product.seo_keywordsstring"shirt, cotton, stylish"SEO keywords for the product, separated by commas.
product.handlestring"stylish-shirt-zbxf"URL-friendly handle for the product.
product.has_only_default_variantbooleanfalseIndicates if the product has only the default variant.
product.inventory_trackingbooleantrueIndicates if inventory tracking is enabled for the product.
product.inventory_policystring"continue"Inventory policy for the product (e.g., "continue", "deny").
product.need_variant_imagebooleanfalseThe need_variant_image field is automatically set to true if any variant has an image; otherwise, it is set to false.
product.spustring"SS1234"Product's Stock Keeping Unit (SPU) identifier.
product.fake_salesinteger50Fake sales count for display purposes.
product.display_fake_salesbooleantrueIndicates if fake sales should be displayed.
product.mixed_wholesalebooleantrueIndicates if mixed wholesale pricing is allowed for the product.
product.image.srcstring"//img.fantaskycdn.
com/loading.png"
Source URL of the product's main image.
product.image.widthinteger100Width of the product's main image in pixels.
product.image.heightinteger100Height of the product's main image in pixels.
product.image.pathstring"loading.png"File path of the product's main image.
product.image.altstring""Alternative text for the product's main image.
product.imagesarray of image objectSee images fields belowArray of additional images for the product.
product.images[].idstring"15333433-a0d5-44c
9-941b-2c59ea07683e"
Unique identifier for the image.
product.images[].product_idstring"9fb9f3c6-2300-42c1
-8593-d9008d7cfc09"
ID of the product associated with the image.
product.images[].positioninteger1Position of the image in the gallery.
product.images[].srcstring"//img.fantaskycdn.
com/loading.png"
Source URL of the image.
product.images[].widthinteger100Width of the image in pixels.
product.images[].heightinteger100Height of the image in pixels.
product.images[].altstring""Alternative text for the image.
product.images[].created_atstring (ISO8601)"2024-12-03T19:02:30Z"Timestamp when the image was created.
product.images[].updated_atstring (ISO8601)"2024-12-03T19:02:30Z"Timestamp when the image was last updated.
product.optionsarray of options objectSee options fields belowArray of product options, like size and color.
product.options[].idstring"8e40555e-a152-45fc-
9587-fe85280701c5"
Unique identifier for the option.
product.options[].product_idstring"9fb9f3c6-2300-42c1-
8593-d9008d7cfc09"
ID of the product associated with the option.
product.options[].positioninteger1Position of the option.
product.options[].namestring"Size"Name of the option (e.g., "Size" or "Color").
product.options[].valuesarray of strings["Small", "Medium", "Large"]Array of possible values for the option.
product.variantsarray of variant objectSee variants fields belowArray of product variants.
product.variants[].idstring"d7c7f9ba-f824-46b6-
94af-1c2d1befaf27"
Unique identifier for the variant.
product.variants[].titlestring"Small-Red"Title of the variant.
product.variants[].option1string"Small"Value of the first option for the variant.
product.variants[].option2string"Red"Value of the second option for the variant.
product.variants[].pricestring"19.99"Price of the variant.
product.variants[].skustring"SS1234-RD-S"Stock Keeping Unit (SKU) for the variant.
product.variants[].
inventory_quantity
integer100Inventory quantity for the variant.
product.variants[].
wholesale_price
array of wholesale priceSee wholesale_price
fields below
Wholesale price information for the variant.
product.variants[].
wholesale_price[].price
string"19.99"Wholesale price for the variant.
product.variants[].
wholesale_price[].min_quantity
integer1Minimum quantity for the wholesale price.
product.categoryObjectCategory object Category information for the product.
product.category.idinteger368313940138040900The ID of the category
product.category.namestring "3"Category name
product.category.google_id.integer0Google category id
product.category.level.integer "3"Level of category
product.category.path.string"368313940138008142,
368313940138024526,
368313940138040910"
The full path of a category, consisting of a category id.

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray["Context"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorArray "store is not active"Indicates an error encountered during the process.

Request Examples

curl -X POST "https://shopdomain.myshoplaza.com/openapi/2022-01/products \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
  "product": {
    "title": "Stylish Shirt",
    "brief": "A stylish shirt.",
    "description": "",
    "published": true,
    "requires_shipping": true,
    "taxable": true,
    "tags": "shirt,stylish,cotton",
    "vendor": "Awesome Vendor",
    "vendor_url": "https://awesomevendor.com",
    "inventory_quantity": 300,
    "note": "Special promotion item.",
    "seo_title": "Buy Stylish Shirt Online",
    "seo_description": "Premium cotton",
    "seo_keywords": "shirt, cotton, stylish",
    "handle": "stylish-shirt-zbxf",
    "has_only_default_variant": false,
    "inventory_tracking": true,
    "inventory_policy": "continue",
    "need_variant_image": false,
    "spu": "SS1234",
    "fake_sales": 50,
    "display_fake_sales": true,
    "mixed_wholesale": true,
    "images": [
      {
        "src": "//img.fantaskycdn.com/loading.png",
        "width": 100,
        "height": 100,
        "alt": ""
      },
      {
        "src": "//img.fantaskycdn.com/loading.png",
        "width": 100,
        "height": 100,
        "alt": ""
      }
    ],
    "options": [
      {
        "name": "Size",
        "values": ["Small", "Medium", "Large", "Extra Large"]
      },
      {
        "name": "Color",
        "values": ["Red", "Blue", "Black"]
      }
    ],
    "variants": [
      {
        "title": "Small-Red",
        "option1": "Small",
        "option2": "Red",
        "compare_at_price": "29.99",
        "price": "19.99",
        "sku": "SS1234-RD-S",
        "barcode": "123456789012",
        "note": "Limited",
        "inventory_quantity": 100,
        "weight": "0.50",
        "weight_unit": "kg",
        "cost_price": "12.99",
        "wholesale_price": [
          {
            "price": "19.99",
            "min_quantity": 1
          }
        ]
      },
      {
        "title": "Medium-Blue",
        "option1": "Medium",
        "option2": "Blue",
        "compare_at_price": "29.99",
        "price": "19.99",
        "sku": "SS1234-BL-M",
        "barcode": "123456789013",
        "note": "Best-selling",
        "inventory_quantity": 200,
        "weight": "0.60",
        "weight_unit": "kg",
        "cost_price": "13.99",
        "wholesale_price": [
          {
            "price": "19.99",
            "min_quantity": 1
          }
        ]
      }
    ]
  }
}'

Success Response Example

{
    "product": {
        "id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
        "title": "Stylish Shirt",
        "brief": "A stylish shirt.",
        "description": "",
        "published": true,
        "requires_shipping": true,
        "taxable": true,
        "tags": "shirt,stylish,cotton",
        "vendor": "Awesome Vendor",
        "vendor_url": "https://awesomevendor.com",
        "inventory_quantity": 300,
        "published_at": "2024-12-09T23:39:00Z",
        "created_at": "2024-12-09T23:39:00Z",
        "updated_at": "2024-12-09T23:39:00Z",
        "note": "Special promotion item.",
        "seo_title": "Buy Stylish Shirt Online",
        "seo_description": "Premium cotton",
        "seo_keywords": "shirt, cotton, stylish",
        "handle": "stylish-shirt-zbxf",
        "has_only_default_variant": false,
        "inventory_tracking": true,
        "inventory_policy": "continue",
        "need_variant_image": false,
        "spu": "SS1234",
        "fake_sales": 50,
        "display_fake_sales": true,
        "mixed_wholesale": true,
        "image": {
            "src": "//img.fantaskycdn.com/loading.png",
            "width": 100,
            "height": 100,
            "path": "loading.png",
            "alt": ""
        },
        "images": [
            {
                "id": "1a995f5e-d6e5-48df-bee8-8792a13deab3",
                "product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
                "position": 1,
                "src": "//img.fantaskycdn.com/loading.png",
                "width": 100,
                "height": 100,
                "alt": "",
                "created_at": "2024-12-09T23:39:00Z",
                "updated_at": "2024-12-09T23:39:00Z"
            },
            {
                "id": "dd9d0f98-d610-4d9d-9670-55856573bc2c",
                "product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
                "position": 2,
                "src": "//img.fantaskycdn.com/loading.png",
                "width": 100,
                "height": 100,
                "alt": "",
                "created_at": "2024-12-09T23:39:00Z",
                "updated_at": "2024-12-09T23:39:00Z"
            }
        ],
        "options": [
            {
                "id": "179fa6d5-3b61-4bae-9bb8-1594750a5991",
                "product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
                "position": 1,
                "name": "Size",
                "values": [
                    "Small",
                    "Medium",
                    "Large",
                    "Extra Large"
                ]
            },
            {
                "id": "c4cb286c-2341-4ff3-95eb-9424499bc0c2",
                "product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
                "position": 2,
                "name": "Color",
                "values": [
                    "Red",
                    "Blue",
                    "Black"
                ]
            }
        ],
        "variants": [
            {
                "id": "3fb78d27-0b56-41bc-bf9e-34e52ecd7529",
                "product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
                "image_id": "",
                "created_at": "2024-12-09T23:39:00Z",
                "updated_at": "2024-12-09T23:39:00Z",
                "title": "Small-Red",
                "option1": "Small",
                "option2": "Red",
                "option3": "",
                "image": null,
                "position": 1,
                "compare_at_price": "29.99",
                "price": "19.99",
                "sku": "SS1234-RD-S",
                "barcode": "123456789012",
                "note": "Limited",
                "inventory_quantity": 100,
                "weight": "0.50",
                "weight_unit": "kg",
                "cost_price": "12.99",
                "wholesale_price": [
                    {
                        "price": "19.99",
                        "min_quantity": 1
                    }
                ],
                "extend": null
            },
            {
                "id": "f26b1b77-90b0-436f-9a8b-236a29cd5bfb",
                "product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
                "image_id": "",
                "created_at": "2024-12-09T23:39:00Z",
                "updated_at": "2024-12-09T23:39:00Z",
                "title": "Medium-Blue",
                "option1": "Medium",
                "option2": "Blue",
                "option3": "",
                "image": null,
                "position": 2,
                "compare_at_price": "29.99",
                "price": "19.99",
                "sku": "SS1234-BL-M",
                "barcode": "123456789013",
                "note": "Best-selling",
                "inventory_quantity": 200,
                "weight": "0.60",
                "weight_unit": "kg",
                "cost_price": "13.99",
                "wholesale_price": [
                    {
                        "price": "19.99",
                        "min_quantity": 1
                    }
                ],
                "extend": null
            }
        ],
        "category": null
    }
}

Error Response Example

{
  "errors": [
    "Title is required"
  ]
}
{
  "error": "store is not active"
}

Error Details

ErrorCodeDescriptionPossible ReasonsExample Response
400Bad RequestIncorrect domain name
401UnauthorizedErrorMissing StoreID
422Unprocessable EntityProvided token is malformed or missing required sections{ "errors": [ "idempotent parameter mismatch" ]}
422Unprocessable EntityNon-UUID string passed as unique_token.{ "error": ["unique token must be uuid format"]}
422Unprocessable EntityMissing required field input.{"errors": ["Title is required" ]}
425Too Early- Another request with the same unique_token is still processing.
- Client retries the same request too soon.
{ "error": ["Duplicate requests"] }
500Internal State Error1.Aborted
2.Unimplemented
3.Unauthenticated
4.DeadlineExceeded
5. Response message parsing error
{"error": ["failed to get unique token value"]}
500No contextMissing Context{ "error": ["no Context"] }
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!