Property Resource

Property Resource

Get Product Properties

GET /api/products/1/properties.json

  • GET /api/products/1/properties.json will return the first 150 (default limit) product properties. You can increase the limit to a maximum of 250 product properties.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X GET \
http://shop_subdomain.versacommerce.de/api/products/1/properties.json

Status: 200 OK

[
  {
    "property": {
      "adjustable_id": 1,
      "adjustable_type": "Product",
      "handle": "color",
      "id": 100,
      "is_visible": true,
      "key": "Color",
      "position": 0,
      "value": "black"
    }
  },
  {
    "property": {
      "adjustable_id": 1,
      "adjustable_type": "Product",
      "handle": "length",
      "id": 101,
      "is_visible": true,
      "key": "Length",
      "position": 1,
      "value": "686 mm"
    }
  },
  {
    "property": {
      "adjustable_id": 1,
      "adjustable_type": "Product",
      "handle": "height",
      "id": 102,
      "is_visible": true,
      "key": "Height",
      "position": 2,
      "value": "128 mm"
    }
  },
  {
    "property": {
      "adjustable_id": 1,
      "adjustable_type": "Product",
      "handle": "css-class",
      "id": 103,
      "is_visible": false,
      "key": "css-class",
      "position": null,
      "value": "awesome"
    }
  }
]


Get Product Property

GET /api/products/1/properties/100.json

  • GET /api/products/1/properties/100.json will return the specified product property.

Example:

$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X GET \
http://shop_subdomain.versacommerce.de/api/products/1/properties/100.json

Status: 200 OK

{
  "property": {
    "adjustable_id": 1,
    "adjustable_type": "Product",
    "handle": "color",
    "id": 100,
    "is_visible": true,
    "key": "Color",
    "position": 0,
    "value": "black"
  }
}


Create Product Property

POST /api/products/1/properties.json

  • POST /api/products/1/properties.json will create a new product property from the parameters passed.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X POST \
-d \
'{
"property": {
"key": "Color",
"value": "black"
}
}' \
http://shop_subdomain.versacommerce.de/api/products/1/properties.json

Status: 201 Created

{
  "property": {
    "key": "Color",
    "value": "black"
  }
}

See the Get Product Property endpoint for more info about the output.



Update Product Property

PUT /api/products/1/properties/100.json

  • PUT /api/products/1/properties/100.json will update the product property from the parameters passed.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X PUT \
-d \
'{
"property": {
"key": "Color",
"value": "White"
}
}' \
http://shop_subdomain.versacommerce.de/api/products/1/properties/100.json

Status: 200 OK

{
  "property": {
    "key": "Color",
    "value": "white"
  }
}


Bulk Create or Update Product Properties

PUT /api/products/1.json

  • PUT /api/products/1.json will add or update the product properties from the parameters passed.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X PUT \
-d \
'{
"product": {
"properties": [{
"key": "Color",
"value": "black"
},
{
"key": "Length",
"value": "686 mm"
},
{
"key": "Height",
"value": "128 mm"
},
{
"key": "css-class",
"value": "awesome",
"is_visible": false
}
]
}
}' \
http://shop_subdomain.versacommerce.de/api/products/1.json

Status: 200 OK

{
  "product": {
    "properties": [{
        "key": "Color",
        "value": "black"
      },
      {
        "key": "Length",
        "value": "686 mm"
      },
      {
        "key": "Height",
        "value": "128 mm"
      },
      {
        "key": "css-class",
        "value": "awesome",
        "is_visible": false
      }
    ]
  }
}

See the Get Product endpoint for more info about the output.



Delete Product Properties

DELETE /api/products/1/properties/100.json

  • DELETE /api/products/1/properties/100.json will delete the property specified and return 200 OK if that was successful.
Example:
$ curl -s \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-u APP_API_KEY:APP_API_PASSWORD \
-X DELETE \
http://shop_subdomain.versacommerce.de/api/products/1/properties/100.json

Status: 200 OK


    • Related Articles

    • Property

      Diese Attribute werden Sie i.d.R Ihren Besuchern zeigen, aber Sie können Attribute auch benutzen, um besondere Einstellungen für das Template product.html vorzunehmen, die nur für bestimmte Produkte gelten sollen. ​ Beispiel: Die Attribute eines ...
    • Metafield Resource

      Metafield Resource Get Metafields Get Metafield Create Metafield Update Metafield Delete Metafield Get Metafield Count Filter Metafields Get Metfields GET /api/metafields.json GET /api/metafields.json will return all Metafields. See the Filter ...
    • Product Image Resource

      Product Image Resource Bulk Create Or Update Delete Product Images Bulk Create or Update PUT /api/products/1/.json PUT /api/products/1.json will create or update the product images from the parameters passed. Example: $ curl -s \ -H 'Accept: ...
    • Product Resource

      Product Associations Product Properties Product Recommendations Create Product POST /api/products.json POST /api/products.json will create a new product from the parameters passed. Example: $ curl -s \ -H 'Accept: application/json' \ -H ...
    • Order Resource

      Attention Order resources are read-only by default. Please contact us for access. ​ Order Statuses Order Status English German open new order Neue Bestellung in_progress in progress, started processing Bearbeitung begonnen cancelled order was ...