迁移在线退货政策管理
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Content API 资源 OnlineReturnPolicy
和相关字段(包括 ReturnPolicyPolicy
和 ReturnPolicySeasonalOverride
)已发生变化。
Merchant API 中 returnpolicy
资源在 Content 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
Content API ReturnPolicyPolicy
在 Merchant API 中变为 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
。
方法
与 Content API 方法相比,Merchant API 也发生了一些变化。
Content API |
Merchant API |
customBatch
|
使用 Merchant API 时,方法有所不同。请参阅
重构代码以支持并发请求。 |
delete
|
delete
|
get
|
get
|
insert
|
create
|
list
|
list
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[null,null,["最后更新时间 (UTC):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 ` |"]]