Resource Representation

Example:

{

"id": 1,
"name": "SKU",
"class_type": "sku"

}

Supported Formats

json

GET /api/v2/product_classes
List product classes

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": 2,
    "entries": [
      {
          "id": 1,
          "name": "SKU",
          "class_type": "sku"
          "include_media": false,
          "include_price": true,
          "include_category": true,
          "include_inventory": true,
          "include_dimension": true,
          "lower_class_id": null,
          "attribute_definitions": [
              {
                  "id": 1,
                  "base_type": "html",
                  "name": "Description",
                  "code": "description"
              },
              {
                  "id": 2,
                  "base_type": "html",
                  "name": "Short Description",
                  "code": "short_description"
              },
          ]
      },
      {
          "id": 2,
          "name": "Product",
          "class_type": "variation"
          "include_media": false,
          "include_price": true,
          "include_category": true,
          "include_inventory": true,
          "include_dimension": true,
          "lower_class_id": 3,
          "attribute_definitions": [
              {
                  "id": 1,
                  "base_type": "html",
                  "name": "Description",
                  "code": "description"
              },
              {
                  "id": 2,
                  "base_type": "html",
                  "name": "Short Description",
                  "code": "short_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 Class ID

Validations:

  • Must be a String


POST /api/v2/product_classes
Create product class

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:
  {
    "product_class": {
        "name": "Shoe Colour",
        "class_type": "variation",
        "include_media": true,
        "include_price": true,
        "include_category": true,
        "include_inventory": false,
        "include_dimension": false,
        "lower_class_id": 12,
        "attribute_definition_ids": [2, 12, 25]
    }
  }

response:
  {
      "id": 10,
      "name": "Shoe Colour",
      "class_type": "variation",
      "include_media": true,
      "include_price": true,
      "include_category": true,
      "include_inventory": false,
      "include_dimension": false,
      "created_at": "2017-09-08T16:08:59.144+10:00",
      "updated_at": "2017-09-08T16:08:59.144+10:00",
      "lower_class_id": 12
  }

Params

Param name Description
product_class
required

Validations:

  • Must be a Hash

product_class[name]
required

Name of the product class

Validations:

  • Must be a String

product_class[class_type]
optional , nil allowed

Validations:

  • Must be one of: sku, grouped, variation, product_kit, npc.

product_class[include_media]
optional , nil allowed

Allow images to be included in this class, not supported in NPC.

Validations:

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

product_class[include_price]
optional , nil allowed

Allow prices to be included in this class, not supported in NPC.

Validations:

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

product_class[include_category]
optional , nil allowed

Allow categories to be included in this class, not supported in NPC.

Validations:

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

product_class[include_inventory]
optional , nil allowed

Allow inventories to be included in this class, not supported in NPC.

Validations:

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

product_class[include_dimension]
optional , nil allowed

Allow dimensions to be included in this class, not supported in NPC.

Validations:

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

product_class[lower_class_id]
optional , nil allowed

Only applies to class_type variation. It sets the next level product class.

Validations:

  • Must be a Integer

product_class[lower_class_name]
optional , nil allowed

Only applies to class_type variation. It sets the next level product class.

Validations:

  • Must be a String

product_class[attribute_definition_ids]
optional , nil allowed

List of Attribute Definition IDs to link to this product class

Validations:

  • Must be an array of Integer

product_class[attribute_definition_codes]
optional , nil allowed

List of Attribute Definition codes to link to this product class

Validations:

  • Must be an array of String

product_class[attribute_definition_mode]
optional , nil allowed

Update mode for Attribute Definition. Default is reset

Validations:

  • Must be one of: add, reset, merge.


PUT /api/v2/product_classes/:id
Update a product class

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:
  {
    "product_class": {
      "name": "Shoe Colour",
      "class_type": "variation",
      "include_media": true,
      "include_price": true,
      "include_category": true,
      "include_inventory": false,
      "include_dimension": false,
      "lower_class_id": 12,
      "attribute_definition_ids": [2, 12, 25]
    }
  }

response:
  {
      "id": 10,
      "name": "Shoe Colour",
      "class_type": "variation",
      "include_media": true,
      "include_price": true,
      "include_category": true,
      "include_inventory": false,
      "include_dimension": false,
      "created_at": "2017-09-08T16:08:59.144+10:00",
      "updated_at": "2017-09-08T16:08:59.144+10:00",
      "lower_class_id": 12
  }

Params

Param name Description
product_class
required

Validations:

  • Must be a Hash

product_class[name]
optional

Name of the product class

Validations:

  • Must be a String

product_class[class_type]
optional , nil allowed

Validations:

  • Must be one of: sku, grouped, variation, product_kit, npc.

product_class[include_media]
optional , nil allowed

Allow images to be included in this class, not supported in NPC.

Validations:

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

product_class[include_price]
optional , nil allowed

Allow prices to be included in this class, not supported in NPC.

Validations:

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

product_class[include_category]
optional , nil allowed

Allow categories to be included in this class, not supported in NPC.

Validations:

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

product_class[include_inventory]
optional , nil allowed

Allow inventories to be included in this class, not supported in NPC.

Validations:

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

product_class[include_dimension]
optional , nil allowed

Allow dimensions to be included in this class, not supported in NPC.

Validations:

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

product_class[lower_class_id]
optional , nil allowed

Only applies to class_type variation. It sets the next level product class.

Validations:

  • Must be a Integer

product_class[lower_class_name]
optional , nil allowed

Only applies to class_type variation. It sets the next level product class.

Validations:

  • Must be a String

product_class[attribute_definition_ids]
optional , nil allowed

List of Attribute Definition IDs to link to this product class

Validations:

  • Must be an array of Integer

product_class[attribute_definition_codes]
optional , nil allowed

List of Attribute Definition codes to link to this product class

Validations:

  • Must be an array of String

product_class[attribute_definition_mode]
optional , nil allowed

Update mode for Attribute Definition. Default is reset

Validations:

  • Must be one of: add, reset, merge.


DELETE /api/v2/product_classes/:id
Delete a product class

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": 2
  }