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:
  {
    "shared_reference": {
        "code": "shared_reference_1",
        "name": "Shared reference 1",
        "product_class_name": "Season",
        "product_family_code": "family_1",
        "attribute_values": {
            "season": "Winter",
            "family_attr_1": "family1"
        },
        "media_items": [
          {
            "media_item_type": "ImageMediaItem",
            "url": "http://s3.amazonaws.com/cc/image1.jpg",
            "description": "",
            "sort_order": 0,
            "is_primary": false,
            "is_uploaded": null,
            "tag_list": []
          }
        ],
        "price_items": [
          {
            "amount": 45,
            "enabled?": true,
            "price_book_name": "default",
            "from": null,
            "to": null
          }
        ],
        "categories": [
          {
            "path": "Engine Oil",
            "is_primary": true,
            "category_set": "default"
          }
        ],
    }
  }

response:
  {
    "id": 1,
    "code": "shared_reference_1",
    "product_class_id": 7,
    "product_family_id": 1,
    "created_at": "2019-08-30T16:16:05.302+10:00",
    "updated_at": "2019-09-02T15:05:37.613+10:00",
    "name": "Shared reference 1"
  }


Params

Param name Description
shared_reference
required

Validations:

  • Must be a Hash

shared_reference[code]
required

Code of the Shared reference

Validations:

  • Must be a String

shared_reference[name]
required

Name of the Shared reference

Validations:

  • Must be a String

shared_reference[product_class_name]
required

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

Validations:

  • Must be a String

shared_reference[product_family_code]
optional , nil allowed

Product family code

Validations:

  • Must be a String

shared_reference[attribute_values]
optional , nil allowed

Attribute values assigned to the Shared reference.

Validations:

  • Must be a Hash

shared_reference[media_items]
optional , nil allowed

Set media items to the entity (existing media items will be removed).

Validations:

  • Must be an Array of nested elements

shared_reference[media_items][media_item_type]
optional , nil allowed

Validations:

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

shared_reference[media_items][url]
optional , nil allowed

URL that stores the corresponding media item

Validations:

  • Must be a String

shared_reference[media_items][description]
optional , nil allowed

Description for the media item

Validations:

  • Must be a String

shared_reference[media_items][sort_order_position]
optional , nil allowed

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

Validations:

  • Must be a Integer

shared_reference[media_items][is_primary]
optional , nil allowed

Make this media item as primary

Validations:

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

shared_reference[media_items][tag_list]
optional , nil allowed

Tags for this media item

Validations:

  • Must be an array of String

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

shared_reference[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.

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

shared_reference[media_items][processing_options][processed_tags]
optional , nil allowed

The tags for the created media item.

Validations:

  • Must be an array of String

shared_reference[price_items]
optional , nil allowed

Add new prices or update existing prices if they exist.

Validations:

  • Must be an Array of nested elements

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

shared_reference[price_items][from]
optional , nil allowed

Valid from

Validations:

  • Must be a String

shared_reference[price_items][to]
optional , nil allowed

Valid to

Validations:

  • Must be a String

shared_reference[price_items][amount]
optional , nil allowed

Validations:

  • Must be a Numeric

shared_reference[categories]
optional , nil allowed

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

Validations:

  • Must be an Array of nested elements

shared_reference[categories][id]
optional , nil allowed

Category ID

Validations:

  • Must be a Integer