遷移線上退貨政策管理
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Content API 資源 OnlineReturnPolicy
和相關聯的欄位 (包括 ReturnPolicyPolicy
和 ReturnPolicySeasonalOverride
) 已變更。
Content API 中 returnpolicy
資源的 Merchant API 對應項目為 accounts.onlineReturnPolicies
。
下表說明 OnlineReturnPolicy
的變更內容。
Content API |
Merchant API |
"country": string
|
"countries": [ string ]
|
"policy": {
object (ReturnPolicyPolicy)
}
|
"policy": {
object (Policy)
}
|
"seasonalOverrides": [
{
object (ReturnPolicySeasonalOverride)
}
]
|
"seasonalOverrides": [
{
object (SeasonalOverride)
}
],
|
nonFreeReturnReasons": [ string ]
|
這個欄位會消失。
|
kind
|
這個欄位會消失。
|
"returnShippingFee": {
object (Price)
}
|
"returnShippingFee": {
object (ReturnShippingFee)
}
|
此外,Merchant API 也新增了許多欄位。
Merchant API 欄位 |
說明 |
"restockingFee": {
object (RestockingFee)
},
|
(選用步驟) 適用於所有退貨原因類別的重新進貨費用。
如果未設定值,系統會將此視為免收補貨費用。
|
"returnMethods": [
enum (ReturnMethod)
]
|
(選用步驟) 消費者退貨的方式。除非退貨政策類型為 noReturns,否則此值不得為空值。
|
"itemConditions": [ enum (ItemCondition) ],
|
(選用步驟) 除非退貨政策類型為 noReturns. ,否則接受退貨的商品狀況不得為空白
|
"returnShippingFee": {
object (ReturnShippingFee)
}
|
(選用步驟) 退貨運費。只有在顧客需要下載及列印退貨標籤時,才應設定此值。
|
"returnPolicyUri": string
|
必要欄位。退貨政策 URI。Google 會使用這項資訊驗證政策。
必須是有效網址。
|
"acceptDefectiveOnly": boolean
|
必要欄位。指定商家僅接受瑕疵產品退貨。
|
"processRefundDays": integer
|
(選用步驟) 指定商家處理退款所需的天數。
|
"acceptExchange": boolean
|
(選用步驟) 指定商家是否允許消費者換貨。
|
"returnLabelSource": enum (ReturnLabelSource)
|
指定退貨單來源。退貨方式為 BY_MAIL 時為必填。
|
ReturnPolicyPolicy
在 Merchant API 中,Content API ReturnPolicyPolicy
會變成 Policy
。以下說明欄位異動情形。
Content API |
Merchant API |
"type": string,
|
"type": enum (Type)
可能的值包括
NUMBER_OF_DAYS_AFTER_DELIVERY, NO_RETURNS or LIFETIME_RETURNS.
|
"numberOfDays": string
|
"days": string
|
"lastReturnDate": string
|
請改用 days 。這代表商品送達後可退貨的天數,一天是指送達時間戳記後的 24 小時。NUMBER_OF_DAYS_AFTER_DELIVERY 退貨時必須提供。
|
ReturnPolicySeasonalOverride
Content API ReturnPolicySeasonalOverride
會變成 Merchant API SeasonalOverride
。除了欄位變更外,額外欄位 return_window
是聯集,可以是 returnDays
或 returnUntilDate
:
"returnDays": integer,
"returnUntilDate": {
object (Date)
意義如下:
returnDays
:產品可退貨的天數 (從送達日期起算)。
returnUntilDate
:產品退貨的固定截止日期。
以下是欄位異動內容。
Content API |
Merchant API |
"name": string
|
"label": string
|
"startDate": string
|
"startDate": {
object (Date)
}
|
"endDate": string
|
"endDate": {
object (Date)
}
|
"policy": {
object (ReturnPolicyPolicy)
}
|
請改用 policy 。 |
其他物件的定義
如需新版 Merchant API 物件的定義
RestockingFee
ReturnMethod
ItemCondition
ReturnShippingFee
Type
ReturnLabelSource
請參閱accounts.onlineReturnPolicies
。
方法
Merchant API 也會進行一些變更,與 Content API 方法不同。
Content API |
Merchant API |
customBatch
|
使用 Merchant API 時,做法有所不同。請參閱「
重構程式碼以處理並行要求」。 |
delete
|
delete
|
get
|
get
|
insert
|
create
|
list
|
list
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[null,null,["上次更新時間:2025-08-08 (世界標準時間)。"],[],[],null,["# Migrate online return policy management\n\nThe Content API resource `OnlineReturnPolicy` and associated fields including\n`ReturnPolicyPolicy` and `ReturnPolicySeasonalOverride` have changed.\n\nThe Merchant API equivalent of the\n[`returnpolicy`](/shopping-content/reference/rest/v2.1/returnpolicy) resource in\nContent API is\n[`accounts.onlineReturnPolicies`](/merchant/api/reference/rest/accounts_v1/accounts.onlineReturnPolicies).\n\nThis table explains what changes in `OnlineReturnPolicy`.\n\n| Content API | Merchant API |\n|------------------------------------------------------------------------|-------------------------------------------------------------|\n| ` \"country\": string ` | ` \"countries\": [ string ] ` |\n| ` \"policy\": { object (ReturnPolicyPolicy) } ` | ` \"policy\": { object (Policy) } ` |\n| ` \"seasonalOverrides\": [ { object (ReturnPolicySeasonalOverride) } ] ` | ` \"seasonalOverrides\": [ { object (SeasonalOverride) } ], ` |\n| ` nonFreeReturnReasons\": [ string ] ` | This field goes away.` ` |\n| `kind ` | This field goes away.` ` |\n| ` \"returnShippingFee\": { object (Price) } ` | ` \"returnShippingFee\": { object (ReturnShippingFee) } ` |\n\nIn addition, a number of fields are new with Merchant API.\n\n| Merchant API field | Description |\n|---------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` \"restockingFee\": { object (RestockingFee) }, ` | Optional. The restocking fee that applies to all return reason categories. This would be treated as a free restocking fee if the value is not set. ` ` |\n| ` \"returnMethods\": [ enum (ReturnMethod) ] ` | Optional. The return methods of how customers can return an item. This value is required to not be empty unless the type of return policy is noReturns. ` ` |\n| ` \"itemConditions\": [ enum (ItemCondition) ], ` | Optional. The item conditions accepted for returns must not be empty unless the type of return policy is `noReturns.` |\n| ` \"returnShippingFee\": { object (ReturnShippingFee) } ` | Optional. The return shipping fee. Should be set only when customer need to download and print the return label. ` ` |\n| ` \"returnPolicyUri\": string ` | Required. The return policy URI. Google uses this to validate the policy. It must be a valid URL. ` ` |\n| ` \"acceptDefectiveOnly\": boolean ` | Required. Specifies that a merchant accepts only defective products for returns. ` ` |\n| ` \"processRefundDays\": integer ` | Optional. Specifies the number of days it takes for merchants to process refunds. ` ` |\n| ` \"acceptExchange\": boolean ` | Optional. Specifies whether the merchant allows customers to exchange products. |\n| ` \"returnLabelSource\": enum (ReturnLabelSource) ` | Specifies the return label source. Required when return method is BY_MAIL. ` ` |\n\nReturnPolicyPolicy\n------------------\n\nThe Content API `ReturnPolicyPolicy` becomes `Policy` in Merchant API. Here's\nhow the fields have changed.\n\n| Content API | Merchant API |\n|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` \"type\": string, ` | ` \"type\": enum (Type) ` Possible values include ` NUMBER_OF_DAYS_AFTER_DELIVERY, NO_RETURNS or LIFETIME_RETURNS. ` |\n| ` \"numberOfDays\": string ` | ` \"days\": string ` |\n| ` \"lastReturnDate\": string ` | Use `days` instead. It represents the number of days items can be returned after delivery, where one day is defined as 24 hours after the delivery timestamp. Required for `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. |\n\nReturnPolicySeasonalOverride\n----------------------------\n\nThe Content API `ReturnPolicySeasonalOverride` becomes `SeasonalOverride` in\nMerchant API. In addition to the changes in fields, the additional field\n`return_window` is a union that can be either `returnDays` or `returnUntilDate`: \n\n \"returnDays\": integer,\n \"returnUntilDate\": {\n object (Date)\n\nThey have the following meanings:\n\n- `returnDays`: Number of days (from the delivery date) that the product can still be returned.\n- `returnUntilDate`: Fixed end date until which the product can be returned.\n\nHere's how the fields have changed.\n\n| Content API | Merchant API |\n|-----------------------------------------------|------------------------------------|\n| ` \"name\": string ` | ` \"label\": string ` |\n| ` \"startDate\": string ` | ` \"startDate\": { object (Date) } ` |\n| ` \"endDate\": string ` | ` \"endDate\": { object (Date) } ` |\n| ` \"policy\": { object (ReturnPolicyPolicy) } ` | Use `policy` instead. |\n\nDefinitions of other objects\n----------------------------\n\nFor definitions of the new Merchant API objects\n\n- `RestockingFee`\n- `ReturnMethod`\n- `ItemCondition`\n- `ReturnShippingFee`\n- `Type`\n- `ReturnLabelSource`\n\nsee\n[`accounts.onlineReturnPolicies`](/merchant/api/reference/rest/accounts_v1/accounts.onlineReturnPolicies).\n\nMethods\n-------\n\nWith Merchant API, there are some changes from the Content API methods as well.\n\n| Content API | Merchant API |\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` customBatch ` | With Mechant API, there is a different approach. See [Refactor code for concurrent requests.](/merchant/api/guides/compatibility/refactor-concurrent-requests) |\n| ` delete ` | ` delete ` |\n| ` get ` | ` get ` |\n| ` insert ` | `create` |\n| ` list ` | ` list ` |"]]