Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

request:
  {
    "variant": {
      "code": "variant_1",
      "name": "Variant 1 Updated"
    }
  }

response:
  {
    "id": 2,
    "product_type": "product",
    "code": "variant_1",
    "status": "active",
    "product_attributes": {
      "description": {
        "base_type": "html",
        "value": "Variant 1 description"
      },
      "short_description": {
        "base_type": "html",
        "value": ""
      }
    },
    "name": "Variant 1 Updated",
    "is_complete": false,
    "incomplete_fields": {
      "missing_image": true,
      "missing_category": false,
      "missing_price": true,
      "missing_attributes": null
    },
    "discontinued": false,
    "shipping_options": [],
    "attribute_set": {
      "id": 1,
      "name": "Automotive"
    },
    "product_level": {
      "id": 1,
      "name": "Products"
    },
    "brand": {
      "id": 1,
      "name": "MOTUL",
      "description": null,
      "logo_link": ""
    },
    "product_categories": [
      {
        "is_primary": true,
        "category_id": 1,
        "name": "Engine Oil",
        "path": "Engine Oil",
        "category_set": {
          "id": 1,
          "name": "default"
        }
      }
    ],
    "catalogs": [],
    "shipping_zones": [
      {
        "id": 1,
        "name": "AU_FREE"
      }
    ],
    "media_items": []
  }

Params

Param name Description
variant
required

Validations:

  • Must be a Hash

variant[locale]
optional , nil allowed

Locale for this product. Should be one of the language codes defined on CommerceConnect. Defaults to the default language.

Validations:

  • Must be a String

variant[name]
optional , nil allowed

Variant or sku name

Validations:

  • Must be a String

variant[code]
optional

Unique identifier for variant and sku

Validations:

  • Must be a String

variant[status]
optional , nil allowed

Validations:

  • Must be one of: inactive, active.

variant[product_attributes]
optional , nil allowed

Validations:

  • Must be a Hash

variant[product_attributes][_any_attribute_code_]
optional , nil allowed

The key of attribute is attribute code and value is a valid json type that matches the base type of the attribute

Validations:

  • Must be a String

variant[dimension]
optional , nil allowed

Validations:

  • Must be a Hash

variant[dimension][length]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[dimension][width]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[dimension][height]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[dimension][weight]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[packed_dimension]
optional , nil allowed

Validations:

  • Must be a Hash

variant[packed_dimension][length]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[packed_dimension][width]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[packed_dimension][height]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[packed_dimension][weight]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[price_items]
optional , nil allowed

Add new prices or update existing prices if they exist.

Validations:

  • Must be an Array of nested elements

variant[price_items][price_book_name]
optional , nil allowed

Name of an existing price book to which this price item is linked

Validations:

  • Must be a String

variant[price_items][from]
optional , nil allowed

Valid from

Validations:

  • Must be a String

variant[price_items][to]
optional , nil allowed

Valid to

Validations:

  • Must be a String

variant[price_items][amount]
optional , nil allowed

Validations:

  • Must be a Numeric

variant[categories]
optional , nil allowed

Set the product’s categories to these categories (existing categories will be removed)

Validations:

  • Must be an Array of nested elements

variant[categories][id]
optional , nil allowed

Category ID

Validations:

  • Must be a Integer

variant[catalogs]
optional , nil allowed

Link these catalogs with the product.

Validations:

  • Must be an Array of nested elements

variant[catalogs][id]
optional , nil allowed

Catalog ID

Validations:

  • Must be a Integer

variant[catalogs][name]
optional , nil allowed

Catalog name

Validations:

  • Must be a String

variant[media_items]
optional , nil allowed

Set the product’s media items to these (existing media items will be removed).

Validations:

  • Must be an Array of nested elements

variant[media_items][media_item_type]
optional , nil allowed

Validations:

  • Must be one of: ImageMediaItem, VideoMediaItem, FileMediaItem.

variant[media_items][url]
optional , nil allowed

URL that stores the corresponding media item

Validations:

  • Must be a String

variant[media_items][description]
optional , nil allowed

Description for the media item

Validations:

  • Must be a String

variant[media_items][sort_order_position]
optional , nil allowed

The position of the media item. Non negative integer is supported

Validations:

  • Must be a Integer

variant[media_items][is_primary]
optional , nil allowed

Make this media item as primary

Validations:

  • Must be one of: true, false, 1, 0.

variant[media_items][tag_list]
optional , nil allowed

Tags for this media item

Validations:

  • Must be an array of String

variant[media_items][processing_options]
optional , nil allowed

Options to perform extra image processing on the media item. This is applicable only when media_item_type is ‘ImageMediaItem’

Validations:

  • Must be a Hash

variant[media_items][processing_options][apply_background]
optional , nil allowed

Setting this to true would result in a new media item created against the product with background applied. Removes transparency.

Validations:

  • Must be one of: true, false, 1, 0.

variant[media_items][processing_options][background_colour]
optional , nil allowed

The colour name or a hex colour code for the background colour for the created media item. Defaults to white.

Validations:

  • Must be a String

variant[media_items][processing_options][tags]
optional , nil allowed

The tags for the created media item.

Validations:

  • Must be an array of String

variant[inventories]
optional , nil allowed

Add new inventory or update existing inventory data

Validations:

  • Must be an Array of nested elements

variant[inventories][inventory_source]
optional , nil allowed

Inventory source name to which this inventory is applied

Validations:

  • Must be a String

variant[inventories][sku]
optional , nil allowed

Inventory source related SKU

Validations:

  • Must be a String

variant[inventories][qty]
optional , nil allowed

Quantity in the inventory source specified

Validations:

  • Must be a Integer

variant[inventories][stock_availability]
optional , nil allowed

Flag to indicate the stock level

Validations:

  • Must be one of: out_of_stock, in_stock.

variant[inventories][out_of_stock_threshold]
optional , nil allowed

Out of stock threshold

Validations:

  • Must be a Integer

variant[inventories][dispatch_time]
optional , nil allowed

Dispatch time

Validations:

  • Must be a Integer

variant[inventories][dispatch_time_unit]
optional , nil allowed

Dispatch time unit

Validations:

  • Must be one of: day, hour.

variant[inventories][unit_cost]
optional , nil allowed

Unit cost of the product for this inventory source

Validations:

  • Must be a Numeric

variant[inventories][lead_time]
optional , nil allowed

Lead time

Validations:

  • Must be a Integer

variant[inventories][lead_time_unit]
optional , nil allowed

Lead time unit

Validations:

  • Must be one of: months, weeks, days, hours.

variant[inventories][style]
optional , nil allowed

Dynamic means Qty changes and Static means Qty stays the same. This is related to inventory decrement for order download

Validations:

  • Must be one of: dynamic, static, perpetual.