# Google Shopping Merchant Accounts V1beta Client - Class OnlineReturnPolicy (1.4.1)

1.4.1 (latest) 1.4.0 1.3.1 1.2.2 1.1.0 1.0.0 0.10.0 0.9.1 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.3 0.2.0 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Shopping Merchant Accounts V1beta Client class OnlineReturnPolicy.

[Online return policy](https://support.google.com/merchants/answer/10220642)
object. This is currently used to represent return policies for ads and free
listings programs.

Generated from protobuf message `google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy`

## Namespace

Google \\ Shopping \\ Merchant \\ Accounts \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. The name of the `OnlineReturnPolicy` resource. Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` |
| `↳ return_policy_id` | `string` Output only. Return policy ID generated by Google. |
| `↳ label` | `string` Required. Immutable. This field represents the unique user-defined label of the return policy. It is important to note that the same label cannot be used in different return policies for the same country. Unless a product specifies a specific label attribute, policies will be automatically labeled as 'default'. To assign a custom return policy to certain product groups, follow the instructions provided in the [Return policy label](https://support.google.com/merchants/answer/9445425). The label can contain up to 50 characters. |
| `↳ countries` | `string[]` Required. Immutable. The countries of sale where the return policy applies. The values must be a valid 2 letter ISO 3166 code. |
| `↳ policy` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.Policy` Optional. The return policy. |
| `↳ seasonal_overrides` | `array<https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.SeasonalOverride>` Optional. Overrides to the general policy for orders placed during a specific set of time intervals. |
| `↳ restocking_fee` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.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. |
| `↳ return_methods` | `int[]` 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. |
| `↳ item_conditions` | `int[]` Optional. The item conditions accepted for returns must not be empty unless the type of return policy is 'noReturns'. |
| `↳ return_shipping_fee` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.ReturnShippingFee` Optional. The return shipping fee. Should be set only when customer need to download and print the return label. |
| `↳ return_policy_uri` | `string` Required. The return policy uri. This can used by Google to do a sanity check for the policy. It must be a valid URL. |
| `↳ accept_defective_only` | `bool` Optional. This field specifies if merchant only accepts defective products for returns. |
| `↳ process_refund_days` | `int` Optional. The field specifies the number of days it takes for merchants to process refunds. |
| `↳ accept_exchange` | `bool` Optional. This field specifies if merchant allows customers to exchange products. |
| `↳ return_label_source` | `int` Optional. The field specifies the return label source. |

### getName

Identifier. The name of the `OnlineReturnPolicy` resource.

Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Identifier. The name of the `OnlineReturnPolicy` resource.

Format: `accounts/{account}/onlineReturnPolicies/{return_policy}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReturnPolicyId

Output only. Return policy ID generated by Google.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setReturnPolicyId

Output only. Return policy ID generated by Google.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabel

Required. Immutable. This field represents the unique user-defined label of
the return policy. It is important to note that the same label cannot be
used in different return policies for the same country. Unless a product
specifies a specific label attribute, policies will be automatically
labeled as 'default'. To assign a custom return policy to certain product
groups, follow the instructions provided in the [Return policy label](https://support.google.com/merchants/answer/9445425).

The label can contain up to 50 characters.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setLabel

Required. Immutable. This field represents the unique user-defined label of
the return policy. It is important to note that the same label cannot be
used in different return policies for the same country. Unless a product
specifies a specific label attribute, policies will be automatically
labeled as 'default'. To assign a custom return policy to certain product
groups, follow the instructions provided in the [Return policy label](https://support.google.com/merchants/answer/9445425).

The label can contain up to 50 characters.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCountries

Required. Immutable. The countries of sale where the return policy applies.

The values must be a valid 2 letter ISO 3166 code.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setCountries

Required. Immutable. The countries of sale where the return policy applies.

The values must be a valid 2 letter ISO 3166 code.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPolicy

Optional. The return policy.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.Policy|null` |   |

### hasPolicy

### clearPolicy

### setPolicy

Optional. The return policy.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.Policy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSeasonalOverrides

Optional. Overrides to the general policy for orders placed during a
specific set of time intervals.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.SeasonalOverride>` |   |

### setSeasonalOverrides

Optional. Overrides to the general policy for orders placed during a
specific set of time intervals.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.SeasonalOverride>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRestockingFee

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.RestockingFee|null` |   |

### hasRestockingFee

### clearRestockingFee

### setRestockingFee

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.RestockingFee` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReturnMethods

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setReturnMethods

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getItemConditions

Optional. The item conditions accepted for returns must not be empty unless
the type of return policy is 'noReturns'.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setItemConditions

Optional. The item conditions accepted for returns must not be empty unless
the type of return policy is 'noReturns'.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReturnShippingFee

Optional. The return shipping fee. Should be set only when customer need to
download and print the return label.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.ReturnShippingFee|null` |   |

### hasReturnShippingFee

### clearReturnShippingFee

### setReturnShippingFee

Optional. The return shipping fee. Should be set only when customer need to
download and print the return label.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1beta.OnlineReturnPolicy.ReturnShippingFee` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReturnPolicyUri

Required. The return policy uri. This can used by Google to do a sanity
check for the policy. It must be a valid URL.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setReturnPolicyUri

Required. The return policy uri. This can used by Google to do a sanity
check for the policy. It must be a valid URL.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAcceptDefectiveOnly

Optional. This field specifies if merchant
only accepts defective products for returns.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasAcceptDefectiveOnly

### clearAcceptDefectiveOnly

### setAcceptDefectiveOnly

Optional. This field specifies if merchant
only accepts defective products for returns.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProcessRefundDays

Optional. The field specifies the number of
days it takes for merchants to process refunds.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### hasProcessRefundDays

### clearProcessRefundDays

### setProcessRefundDays

Optional. The field specifies the number of
days it takes for merchants to process refunds.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAcceptExchange

Optional. This field specifies if merchant
allows customers to exchange products.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasAcceptExchange

### clearAcceptExchange

### setAcceptExchange

Optional. This field specifies if merchant
allows customers to exchange products.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReturnLabelSource

Optional. The field specifies the return
label source.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### hasReturnLabelSource

### clearReturnLabelSource

### setReturnLabelSource

Optional. The field specifies the return
label source.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |