HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Update Gifts

Function

To update information about existing gift with open API
透過open API 更新贈品

URL

PUT <<api_domain>>/v1/gifts/:id

Request Parameters

FieldTypeDescriptionExample
title_translationsHashGifts Title
贈品名稱
{ "en": "create by open api}"
media_idsArrayArray of Media ID
一組圖片ID
["603f06f7f6ba0c00451d0f12"]
unlimited_quantityBooleanGifts unlimited quantity or not
贈品是否無限數量
true
skuString贈品SKUSKU-456344881
costHashCost
成本
{ "dollars": 12}
weightFloatWeigth
重量
12.1
quantityFloatGift Quantity
贈品數量
200

JSON Response Sample

{
    "_id": "5d8b0a6552910502640e8a76",
    "cost": {
        "cents": 13,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$13",
        "dollars": 13.0
    },
    "title_translations": {
        "en": "create by open api!!!"
    },
    "description_translations": {},
    "media_ids": [
        "603f06f7f6ba0c00451d0f12"
    ],
    "owner_id": "5d8aecb7f21e4e00014d5ae7",
    "sku": "GIFT-SKU-0002",
    "status": "active",
    "unlimited_quantity": false,
    "weight": 42.18,
    "created_at": "2019-09-25T06:34:13.048Z",
    "updated_at": "2021-06-25T10:46:51.209Z",
    "stock_ids": null,
    "root_product_id": null,
    "media": [],
    "quantity": 3
}

Sample CURL Example

curl --location --request PUT '<<api_domain>>/v1/gifts/5d8b0a6552910502640e8a76' \
--header 'Authorization: Bearer ${token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title_translations": { "en": "create by open api"},
    "media_ids": ["603f06f7f6ba0c00451d0f12"],
    "unlimited_quantity": false,
    "sku": "GIFT-SKU-0002",
    "cost": { "dollars": 13},
    "weight": 42.18
}'