HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Update Product Price

📘

Notice 提醒

Do not allow to update price of products containing multiple variations which have different price with the main products.
不允許更新價格不同於主商品的規格商品。

*若要更新價格不同於主商品之規格商品,請使用Update Product Variation Price

Function

To update product's price with open API
透過open API 更新商品價格

URL

PUT <<api_domain>>/v1/products/:id/update_price

Request Parameters

ParameterTypeDescriptionExample
idStringProduct's ID
商品ID
priceFloatPrice
原價格
can be 0
可以為 0
ruby "price": 90
price_saleFloatPrice on sale
特價
can be 0
可以為 0
ruby "price_sale": 78
costFloatCost
成本
can be 0
可以為 0
ruby "cost": 30
member_priceFloatMember Price
會員價格
can be 0
可以為 0
ruby "member_price": 30
retail_priceFloatRetail Price
實體店價格
can be 0
可以為 0
ruby "retail_price": 30
product_price_tiersObjectProduct Price Tiers
會員價格分級
can be 0
可以為 0
Object Key為Membership Tier ID
ruby "retail_price": { "5b2b66599a76f0196a000a54": 30 }

Request example

curl --location --request PUT '<<api_domain>>/v1/products/5fbb1f0cc74ff9003e02c68d/update_price' \
--header 'Authorization: Bearer 87d8e74272aadc43d600b72da14b1eb535b0d2da7541e4f508577eec644df046' \
--header 'Content-Type: application/json' \
--data-raw '{
    "price": 300,
    "price_sale": 250,
    "cost": 150
}'

Response Field

The same as Get Product

Response Example

The same as Get Product