HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Update Product Variation Price

Function

To update product variation's price with open API
透過open API 更新規格價格

URL

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

Request Parameters

ParameterTypeDescriptionExample
product_idStringProduct's ID
主商品ID
idStringProduct Variation's Key
商品規格ID
priceFloatProduct Variation's Price
要更新商品規格之價格
ruby "price": 123
price_saleFloatProduct Variation's Price Sale
要更新商品規格之特價
costFloatProduct Variation's Cost
要更新商品規格之成本
member_priceFloatProduct Variation's Member Price
要更新商品規格之會員價格
retail_priceFloatProduct Variation's Retail Price
要更新商品規格之實體店價格
product_price_tiersFloatProduct Variation's Product Price Tiers
要更新商品規格之會員價格分級
(Object Key 為 Membership Tier ID)
"product_price_tiers": {"5b2b66599a76f0196a000a54": 30}

Response Fields

The same as ProductVariation

Response Example

{
    "id": "5df30b52f6186100245563d2",
    "fields_translations": {
        "en": [
            "Yellow",
            "Taiwan"
        ],
        "zh-hant": [
            "黃",
            "台灣產"
        ]
    },
    "price": {
        "cents": 123,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$123",
        "dollars": 123.0
    },
    "price_sale": {
        "cents": 123,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$123",
        "dollars": 123.0
    },
    "member_price": {
        "cents": 0,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "",
        "dollars": 0.0
    },
    "quantity": 42,
    "unlimited_quantity": null,
    "media": {},
    "sku": "yellow_TW",
    "location_id": null,
    "variant_option_ids": [
        "5df30b5245986b001b61d404",
        "5df30b5245986b001b61d402"
    ],
    "barcode": null
}