Skip to content

Commit ea1e0c1

Browse files
author
Unai Abrisketa
committed
Use put instead of post
1 parent 79bd20f commit ea1e0c1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/beyond_api/resources/products/availability.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ def enable_stock_management(product_id, body)
159159
end
160160

161161
#
162-
# A +POST+ request is used to update the reserve stock by changing the +stockThreshold+ value of a product or variation product (incl. all of its variations). Reserve stock refers to an inventory level that indicates that a product needs to be reordered.
162+
# A +PUT+ request is used to update the reserve stock by changing the +stockThreshold+ value of a product or variation product (incl. all of its variations). Reserve stock refers to an inventory level that indicates that a product needs to be reordered.
163163
#
164-
# $ curl 'https://api-shop.beyondshop.cloud/api/products/f74b5f57-43cc-4176-97aa-c6eb9fdeb37c/availability/update-stock-threshold' -i -X POST \
164+
# $ curl 'https://api-shop.beyondshop.cloud/api/products/f74b5f57-43cc-4176-97aa-c6eb9fdeb37c/availability/update-stock-threshold' -i -X PUT \
165165
# -H 'Content-Type: application/json' \
166166
# -H 'Accept: application/hal+json' \
167167
# -H 'Authorization: Bearer <Access token>' \
@@ -175,12 +175,12 @@ def enable_stock_management(product_id, body)
175175
# @return [OpenStruct]
176176
#
177177
# @example
178-
# session.products.update_reserve_stock("f74b5f57-43cc-4176-97aa-c6eb9fdeb37c", { stock_threshold => 5 })
178+
# session.products.update_reserve_stock("f74b5f57-43cc-4176-97aa-c6eb9fdeb37c", 5)
179179
#
180180
def update_reserve_stock(product_id, stock_threshold)
181-
response, status = BeyondApi::Request.post(@session,
182-
"/products/#{product_id}/availability/update-stock-threshold",
183-
{ stock_threshold: stock_threshold })
181+
response, status = BeyondApi::Request.put(@session,
182+
"/products/#{product_id}/availability/update-stock-threshold",
183+
{ stock_threshold: stock_threshold })
184184

185185
handle_response(response, status)
186186
end

0 commit comments

Comments
 (0)