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_relationship": {
      "status": "active",
      "sort_order": 1,
      "relationship_id": 2,
      "parent_product_id": 21,
      "child_product_id": 19
    }
  }

  or

  {
    "product_relationship": {
      "status": "active",
      "sort_order": 2,
      "relationship_code": "relationship_1",
      "parent_product_code": "product_code_1",
      "child_product_code": "product_code_2"
    }
  }


response:
  {
    "id": 2,
    "sort_order": 20,
    "status": "active",
    "relationship": {
        "id": 2,
        "name": "My Relationship 1",
        "code": "my_relationship_1"
    },
    "parent_product": {
        "id": 20,
        "code": "product_code_1",
        "name": "Product 1"
    },
    "child_product": {
        "id": 19,
        "code": "product_code_1",
        "name": "Product 2"
    }
  }

Params

Param name Description
product_relationship
required

Validations:

  • Must be a Hash

product_relationship[relationship_id]
optional , nil allowed

ID of the relationship

Validations:

  • Must be a Integer

product_relationship[relationship_code]
optional , nil allowed

Code of the relationship

Validations:

  • Must be a String

product_relationship[parent_product_id]
optional , nil allowed

ID of the parent product

Validations:

  • Must be a Integer

product_relationship[parent_product_code]
optional , nil allowed

Code of the parent product

Validations:

  • Must be a String

product_relationship[child_product_id]
optional , nil allowed

ID of the child product

Validations:

  • Must be a Integer

product_relationship[child_product_code]
optional , nil allowed

Code of the child product

Validations:

  • Must be a String

product_relationship[status]
optional , nil allowed

Validations:

  • Must be one of: inactive, active.

product_relationship[sort_order]
optional , nil allowed

Product Relationship ordering

Validations:

  • Must be a Integer