Module: BeyondApi::ProductVariationProperties
- Included in:
- Products
- Defined in:
- lib/beyond_api/resources/products/variation_properties.rb
Instance Method Summary collapse
-
#update_variation_properties(product_id, body) ⇒ OpenStruct
A
PATCH
request is used to update the variation properties of a variation product. -
#variation_properties(product_id) ⇒ OpenStruct
A
GET
request is used to retrieve the variation properties of a variation product.
Instance Method Details
#update_variation_properties(product_id, body) ⇒ OpenStruct
A PATCH
request is used to update the variation properties of a variation product.
$ curl 'https://api-shop.beyondshop.cloud/api/products/51953b86-7ccc-4e80-acbd-1a2fc921fc2e/variation-properties' -i -X PATCH \
-H 'Content-Type: application/hal+json' \
-H 'Accept: application/hal+json' \
-H 'Authorization: Bearer <Access token>' \
-d '[ {
"property" : "salesPrice",
"enabled" : true
}, {
"property" : "listPrice",
"enabled" : true
}, {
"property" : "refPrice",
"enabled" : true
}, {
"property" : "manufacturerPrice",
"enabled" : true
}, {
"property" : "productIdentifiers",
"enabled" : true
} ]'
58 59 60 61 62 |
# File 'lib/beyond_api/resources/products/variation_properties.rb', line 58 def update_variation_properties(product_id, body) response, status = BeyondApi::Request.patch(@session, "/products/#{product_id}/variation-properties", body) handle_response(response, status) end |
#variation_properties(product_id) ⇒ OpenStruct
A GET
request is used to retrieve the variation properties of a variation product.
$ curl 'https://api-shop.beyondshop.cloud/api/products/ea81446c-8fec-418c-8b3c-6e43fdee713a/variation-properties' -i -X GET \
-H 'Accept: application/hal+json' \
-H 'Authorization: Bearer <Access token>'
80 81 82 83 84 |
# File 'lib/beyond_api/resources/products/variation_properties.rb', line 80 def variation_properties(product_id) response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/variation-properties") handle_response(response, status) end |