Resource Representation

{
  "en": {
    "id": 1,
    "product_type": "product",
    "code": "12345",
    "status": "active",
    "product_attributes": {
      "description": {
        "base_type": "html",
        "value": "<p style="line-height: 18.5714px;">This is a description.</p>"
      },
      "short_description": {
        "base_type": "html",
        "value": "<span style="line-height: 18.5714px;">This is a short description.</span>"
      }
    },
    "name": "Product 12345",
    "is_complete": true,
    "incomplete_fields": {
      "missing_image": false,
      "missing_category": false,
      "missing_price": false,
      "missing_attributes": []
    },
    "discontinued": false,
    "catalogs": [
      {
        "id": 1,
        "name": "Catalog Name"
      }
    ]
  },
  "created_at": "2016-04-15T14:25:38.489+10:00",
  "updated_at": "2016-04-27T16:10:51.655+10:00"
}

Supported Formats

json

GET /api/v2/alias_products
List alias products

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

Response: 

{
    "page": 1,
    "per_page": 50,
    "total_pages": 1,
    "total_entries": 1,
    "entries": [
        {
            "id": 1775,
            "product_type": null,
            "code": "shirt-a",
            "status": "active",
            "product_attributes": null,
            "name": "Shirt A",
            "class_type": "sku",
            "discontinued": false,
            "product_class": {
                "id": 17,
                "name": "Style"
            },
            "attribute_values": [
                {
                    "attribute_definition_id": 7,
                    "attribute_definition_code": "country_of_origin",
                    "data": "Germany"
                },
                {
                    "attribute_definition_id": 2,
                    "attribute_definition_code": "short_description",
                    "data": "test short description"
                },
                {
                    "attribute_definition_id": 14,
                    "attribute_definition_code": "season",
                    "data": "Spring"
                },
                {
                    "attribute_definition_id": 1,
                    "attribute_definition_code": "description",
                    "data": "test description"
                }
            ]
        }
    ]
}  

Params

Param name Description
per_page
optional

Number of objects in one response. Default is 50

Validations:

  • Must be a number.

page
optional

Page number. Default is 1

Validations:

  • Must be a number.

created_time_from
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

created_time_to
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

updated_time_from
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

updated_time_to
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

id
optional

Product ID

Validations:

  • Must be a String

code
optional

Product code

Validations:

  • Must be a String

name
optional

Product name

Validations:

  • Must be a String

status
optional

Product status

Validations:

  • Must be one of: active, inactive.

response_product_fields
optional

Version 5 only. One of ‘name’, ‘status’, ‘class_type’. The product information to be included in the product data response. Use comma to join multiple fields.

Validations:

  • Must be a String

response_associated_fields
optional

Version 5 only. One of ‘product_class’, ‘brand’, ‘attribute_values’, ‘dimension’, ‘packed_dimension’, ‘product_categories’, ‘catalogs’, ‘shipping_zones’, ‘price_items’, ‘inventories’, ‘media_items’, ‘entity_identifiers’. The information related to the product to be included in the product data response. Use comma to join multiple fields.

Validations:

  • Must be a String

root_products_only
optional

Return products only at the root level. Defaults to true. Only applicable to CC V3 tenants

Validations:

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


POST /api/v2/alias_products
Create or update an alias product

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:
  {
    "alias_product": {
      "code": "product_1",
      "name": "Product 1",
      "master_product_code": "the parent product code of alias product",
      "product_class_name": "product class name for alias product",
      "status": "active",
      "product_attributes": {
        "description": "Product 1 description"
      }
    }
  }
  
  Sample: create an alias product in a one level attribute set with minimal data required
  
  {
    "alias_product": {
      "code": "alias_product_code",
      "name": "alias_product_name",
      "master_product_code": "the parent product code of alias product",
      "product_class_name": "product class name for alias product",
      "product_attributes": {
        "description": "content test here",
        "gender": "Male"
      }
    }
  }
  
  Sample: update some fields of an existing alias product 
  
  {
    "alias_product": {
      "code": "alias_product_code-001",
      "product_attributes": {
        "description": "content test here",
        "gender": "Male"
      }
    }
  }
  
  Single option, multi option values:
  
  {
    "alias_product": {
      "code": "sku-12"
      "product_attributes": {
        "option1": 2,
        "option2": [ { "code": "blue" } ],
        "option3": [4, 5],
        "option4": [ { "code": "A" }, { "code": "B" } ]
      }
    }
  }
        

  Response:
  
  
  { 
    "id": 2712,
    "product_type": null,
    "code": "csv-group-1",
    "master_product_code": "the parent product code of alias product",
    "status": "active",
    "product_attributes": null,
    "name": "csv-group-1",
    "class_type": "sku",
    "discontinued": false,
    "attribute_values": [
        {
            "attribute_definition_id": 25,
            "attribute_definition_code": "multi_option_attributes",
            "data": []
        },
        {
            "attribute_definition_id": 2,
            "attribute_definition_code": "short_description",
            "data": ""
        }
      ]
   }
    

Params

Param name Description
alias_product
required

Validations:

  • Must be a Hash

alias_product[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

alias_product[name]
optional , nil allowed

Product or sku name

Validations:

  • Must be a String

alias_product[code]
optional , nil allowed

Unique identifier for product and sku

Validations:

  • Must be a String

alias_product[product_class_name]
optional , nil allowed

Class name that this product is assigned to. This must be created beforehand

Validations:

  • Must be a String

alias_product[status]
optional , nil allowed

Validations:

  • Must be one of: inactive, active.

alias_product[product_attributes]
optional , nil allowed

Validations:

  • Must be a Hash

alias_product[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

alias_product[catalogs]
optional , nil allowed

Link these catalogs with the product.

Validations:

  • Must be an Array of nested elements

alias_product[catalogs][id]
optional , nil allowed

Catalog ID

Validations:

  • Must be a Integer

alias_product[catalogs][name]
optional , nil allowed

Catalog name

Validations:

  • Must be a String


PUT /api/v2/alias_products/:id
Update an alias product

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:
  Same as product create

response: 
  Same as product create

Params

Param name Description
alias_product
required

Validations:

  • Must be a Hash

alias_product[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

alias_product[name]
optional , nil allowed

Product or sku name

Validations:

  • Must be a String

alias_product[code]
optional , nil allowed

Unique identifier for product and sku

Validations:

  • Must be a String

alias_product[product_class_name]
optional , nil allowed

Class name that this product is assigned to. This must be created beforehand

Validations:

  • Must be a String

alias_product[status]
optional , nil allowed

Validations:

  • Must be one of: inactive, active.

alias_product[product_attributes]
optional , nil allowed

Validations:

  • Must be a Hash

alias_product[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

alias_product[catalogs]
optional , nil allowed

Link these catalogs with the product.

Validations:

  • Must be an Array of nested elements

alias_product[catalogs][id]
optional , nil allowed

Catalog ID

Validations:

  • Must be a Integer

alias_product[catalogs][name]
optional , nil allowed

Catalog name

Validations:

  • Must be a String


DELETE /api/v2/alias_product/:id
Delete an alias product

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

response:
  {
    "id": 8
  }