HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Update Affiliate Campaign

Function

To update some information of an affiliate campaign
更新單個推薦活動資訊

URL

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

Request Parameters

ParameterTypeDescriptionExample
id
*Required
StringAffiliate campaign ID
欲更新的推薦活動 ID
6049d431709478001d7c496b
nameStringAffiliate campaign name
推薦活動名稱
Affiliate Campaign Name
promotion_idStringPromotion id
套用優惠折扣 ID

-

null : 不套用折扣
promotion_id : 只能填入設定 "僅適用於推薦活動的" 優惠
5ce0d084e388096bdb229a59
partner_infoObjectPartner info
合作夥伴資訊
{
"partner_info": {
"name": "Sam Chen",
"email": "[email protected]"
}
}
campaign_productsArray[Object]指定分潤商品

Add item without id param to array to create new campaign product.
Remove item from array to delete campaign product.
Update item is not allowed.

藉由新增不含 id 的物件到陣列中,即可新增新的 Campaign Product。
從陣列中移除物件即可刪除該 Campaign Product。
不可更新任何已存在的 Campaign Product 其資料。
{
"id": "5ce0d084e388096bdb229a59",
"product_id": "5ce0d084e388096bdb229a59",
"affiliate_percentage": 30
}
start_atDateTimeAffiliate campaign start time
推薦活動開始時間
2018-01-10T06:33:45.231+00:00
end_atDateTimeAffiliate campaign end time
推薦活動結束時間

-
null = no end date 永不過期
2018-01-10T06:33:45.231+00:00
remarks_translationsTranslationRemarks translations
顯示於KOL Hub 的條款說明
feature key: affiliate_kol_report
{}

Request Example

curl --location --request PUT 'https://open.shopline.com/v1/affiliate_campaigns/:id' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer your token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Update Campaign Name 1670829482",
    "promotion_id": null,
    "start_at": "2022-12-12T07:18:01.846Z",
    "end_at": null
}'

Response Field

Same as Get Affiliate Campaign