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

ParamaterTypeDescriptionExample
product_idStringProduct's ID
主商品ID
idStringProduct Variation's Key
商品規格ID
priceFloatProduct Variation's Price
要更新商品規格之價格
ruby "price": 123

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
}