Recommendation Resource

Recommendation Resource

Create or Update Product Recommendations

PUT /api/products/1.json
  • PUT /api/products/1.json will create or update the product recommendations 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": {
"recommended_product_code_1": "product-code-1",
"recommended_product_description_1": "Lorem ipsum dolor sit amet.",
"recommended_product_code_2": "product-code-2",
"recommended_product_description_2": "Consectetur adipisicing elit.",
"recommended_product_code_3": "product-code-3",
"recommended_product_description_3": "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"recommended_product_code_30": "product-code-30",
"recommended_product_description_30 ": "Ut enim ad minim veniam, quis nostrud exercitation."
}
}' \
http://shop_subdomain.versacommerce.de/api/products/1.json

Status: 201 Created

{
  "product": {
    "recommended_product_code_1": "product-code-1",
    "recommended_product_description_1": "Lorem ipsum dolor sit amet.",
    "recommended_product_code_2": "product-code-2",
    "recommended_product_description_2": "Consectetur adipisicing elit.",
    "recommended_product_code_3": "product-code-3",
    "recommended_product_description_3": "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
    "recommended_product_code_30": "product-code-30",
    "recommended_product_description_30 ": "Ut enim ad minim veniam, quis nostrud exercitation."
  }
}

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



Delete Product Recommendations

PUT /api/products/1.json

  • PUT /api/products/1.json will delete the product recommendations 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": {
"recommended_product_code_1": "",
"recommended_product_code_2": "",
"recommended_product_code_3": "",
"recommended_product_code_30": "",
}
}' \
http://shop_subdomain.versacommerce.de/api/products/1.json

Status: 200 OK

{
  "product": {
    "recommended_product_code_1": null,
    "recommended_product_code_2": null,
    "recommended_product_code_3": null,
    "recommended_product_code_30": null
  }
}

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


    • Related Articles

    • Recommendation

      Die Empfehlungen eines Produktes können Sie abrufen und in einer Schleife durcharbeiten: {% for recommendation in product.recommendations %} <p> {{ recommendation.product.title | link_to: recommendation.product.url }} {{ recommendation.description }} ...
    • 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 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 ...
    • 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: ...
    • Shipment Resource

      Attention Shipment resources are read-only by default. Please contact us at support@versacommerce.de if you need write permissions. Get Shipments GET /api/shipments.json GET /api/shipments.json will return the first 150 (default limit) items. You can ...