# Migrate online return policy management

The Content API resource `OnlineReturnPolicy` and associated fields including
`ReturnPolicyPolicy` and `ReturnPolicySeasonalOverride` have changed.

The Merchant API equivalent of the
[`returnpolicy`](https://developers.google.com/shopping-content/reference/rest/v2.1/returnpolicy) resource in
Content API is
[`accounts.onlineReturnPolicies`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.onlineReturnPolicies).

This table explains what changes in `OnlineReturnPolicy`.

| Content API | Merchant API |
|---|---|
| ` "country": string ` | ` "countries": [ string ] ` |
| ` "policy": { object (ReturnPolicyPolicy) } ` | ` "policy": { object (Policy) } ` |
| ` "seasonalOverrides": [ { object (ReturnPolicySeasonalOverride) } ] ` | ` "seasonalOverrides": [ { object (SeasonalOverride) } ], ` |
| ` nonFreeReturnReasons": [ string ] ` | This field goes away.` ` |
| `kind ` | This field goes away.` ` |
| ` "returnShippingFee": { object (Price) } ` | ` "returnShippingFee": { object (ReturnShippingFee) } ` |

In addition, a number of fields are new with Merchant API.

| Merchant API field | Description |
|---|---|
| ` "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. ` ` |
| ` "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. ` ` |
| ` "itemConditions": [ enum (ItemCondition) ], ` | Optional. The item conditions accepted for returns must not be empty unless the type of return policy is `noReturns.` |
| ` "returnShippingFee": { object (ReturnShippingFee) } ` | Optional. The return shipping fee. Should be set only when customer need to download and print the return label. ` ` |
| ` "returnPolicyUri": string ` | Required. The return policy URI. Google uses this to validate the policy. It must be a valid URL. ` ` |
| ` "acceptDefectiveOnly": boolean ` | Required. Specifies that a merchant accepts only defective products for returns. ` ` |
| ` "processRefundDays": integer ` | Optional. Specifies the number of days it takes for merchants to process refunds. ` ` |
| ` "acceptExchange": boolean ` | Optional. Specifies whether the merchant allows customers to exchange products. |
| ` "returnLabelSource": enum (ReturnLabelSource) ` | Specifies the return label source. Required when return method is BY_MAIL. ` ` |

## ReturnPolicyPolicy

The Content API `ReturnPolicyPolicy` becomes `Policy` in Merchant API. Here's
how the fields have changed.

| Content API | Merchant API |
|---|---|
| ` "type": string, ` | ` "type": enum (Type) ` Possible values include ` NUMBER_OF_DAYS_AFTER_DELIVERY, NO_RETURNS or LIFETIME_RETURNS. ` |
| ` "numberOfDays": string ` | ` "days": string ` |
| ` "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. |

## ReturnPolicySeasonalOverride

The Content API `ReturnPolicySeasonalOverride` becomes `SeasonalOverride` in
Merchant API. In addition to the changes in fields, the additional field
`return_window` is a union that can be either `returnDays` or `returnUntilDate`:

      "returnDays": integer,
      "returnUntilDate": {
        object (Date)

They have the following meanings:

- `returnDays`: Number of days (from the delivery date) that the product can still be returned.
- `returnUntilDate`: Fixed end date until which the product can be returned.

Here's how the fields have changed.

| Content API | Merchant API |
|---|---|
| ` "name": string ` | ` "label": string ` |
| ` "startDate": string ` | ` "startDate": { object (Date) } ` |
| ` "endDate": string ` | ` "endDate": { object (Date) } ` |
| ` "policy": { object (ReturnPolicyPolicy) } ` | Use `policy` instead. |

## Definitions of other objects

For definitions of the new Merchant API objects

- `RestockingFee`
- `ReturnMethod`
- `ItemCondition`
- `ReturnShippingFee`
- `Type`
- `ReturnLabelSource`

see
[`accounts.onlineReturnPolicies`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.onlineReturnPolicies).

## Methods

With Merchant API, there are some changes from the Content API methods as well.

| Content API | Merchant API |
|---|---|
| ` customBatch ` | With Mechant API, there is a different approach. See [Refactor code for concurrent requests.](https://developers.google.com/merchant/api/guides/compatibility/refactor-concurrent-requests) |
| ` delete ` | ` delete ` |
| ` get ` | ` get ` |
| ` insert ` | `create` |
| ` list ` | ` list ` |