# Content API for Shopping . returnpolicy

## Instance Methods

Close httplib2 connections.

Batches multiple return policy related calls in a single request.

Deletes a return policy for the given Merchant Center account.

Gets a return policy of the Merchant Center account.

Inserts a return policy for the Merchant Center account.

Lists the return policies of the Merchant Center account.

### Method Details

`close()`

    Close httplib2 connections.

`custombatch(body=None)`

    Batches multiple return policy related calls in a single request.

    Args:
      body: object, The request body.
        The object takes the form of:

    {
        "entries": [ # The request entries to be processed in the batch.
          {
            "batchId": 42, # An entry ID, unique within the batch request.
            "merchantId": "A String", # The Merchant Center account ID.
            "method": "A String", # Method of the batch request entry.
                #
                # Acceptable values are:
                # - "`delete`"
                # - "`get`"
                # - "`insert`"
            "returnPolicy": { # Return policy resource. # The return policy to submit. Set this only if the method is `insert`.
              "country": "A String", # Required. The country of sale where the return policy is applicable.
              "kind": "content#returnPolicy", # Identifies what kind of resource this is. Value: the fixed string "`content#returnPolicy`"
              "label": "A String", # Required. The user-defined label of the return policy. For the default policy, use the label "default".
              "name": "A String", # Required. The name of the policy as shown in Merchant Center.
              "nonFreeReturnReasons": [ # Return reasons that will incur return fees.
                "A String",
              ],
              "policy": { # Required. The policy.
                "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
                "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
                "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                    #
                    # Acceptable values are:
                    # - "`lastReturnDate`"
                    # - "`lifetimeReturns`"
                    # - "`noReturns`"
                    # - "`numberOfDaysAfterDelivery`"
              },
              "returnPolicyId": "A String", # Return policy ID generated by Google.
              "seasonalOverrides": [ # An optional list of seasonal overrides.
                {
                  "endDate": "A String", # Required. Last day on which the override applies. In ISO 8601 format.
                  "name": "A String", # Required. The name of the seasonal override as shown in Merchant Center.
                  "policy": { # Required. The policy which is in effect during that time.
                    "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
                    "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
                    "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                        #
                        # Acceptable values are:
                        # - "`lastReturnDate`"
                        # - "`lifetimeReturns`"
                        # - "`noReturns`"
                        # - "`numberOfDaysAfterDelivery`"
                  },
                  "startDate": "A String", # Required. First day on which the override applies. In ISO 8601 format.
                },
              ],
            },
            "returnPolicyId": "A String", # The return policy ID. Set this only if the method is `delete` or `get`.
          },
        ],
      }

    Returns:
      An object of the form:

        {
        "entries": [ # The result of the execution of the batch requests.
          {
            "batchId": 42, # The ID of the request entry to which this entry responds.
            "errors": { # A list of errors returned by a failed batch entry. # A list of errors defined if, and only if, the request failed.
              "code": 42, # The HTTP status of the first error in `errors`.
              "errors": [ # A list of errors.
                { # An error returned by the API.
                  "domain": "A String", # The domain of the error.
                  "message": "A String", # A description of the error.
                  "reason": "A String", # The error code.
                },
              ],
              "message": "A String", # The message of the first error in `errors`.
            },
            "kind": "content#returnpolicyCustomBatchResponseEntry", # Identifies what kind of resource this is. Value: the fixed string "`content#returnpolicyCustomBatchResponseEntry`"
            "returnPolicy": { # Return policy resource. # The retrieved return policy.
              "country": "A String", # Required. The country of sale where the return policy is applicable.
              "kind": "content#returnPolicy", # Identifies what kind of resource this is. Value: the fixed string "`content#returnPolicy`"
              "label": "A String", # Required. The user-defined label of the return policy. For the default policy, use the label "default".
              "name": "A String", # Required. The name of the policy as shown in Merchant Center.
              "nonFreeReturnReasons": [ # Return reasons that will incur return fees.
                "A String",
              ],
              "policy": { # Required. The policy.
                "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
                "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
                "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                    #
                    # Acceptable values are:
                    # - "`lastReturnDate`"
                    # - "`lifetimeReturns`"
                    # - "`noReturns`"
                    # - "`numberOfDaysAfterDelivery`"
              },
              "returnPolicyId": "A String", # Return policy ID generated by Google.
              "seasonalOverrides": [ # An optional list of seasonal overrides.
                {
                  "endDate": "A String", # Required. Last day on which the override applies. In ISO 8601 format.
                  "name": "A String", # Required. The name of the seasonal override as shown in Merchant Center.
                  "policy": { # Required. The policy which is in effect during that time.
                    "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
                    "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
                    "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                        #
                        # Acceptable values are:
                        # - "`lastReturnDate`"
                        # - "`lifetimeReturns`"
                        # - "`noReturns`"
                        # - "`numberOfDaysAfterDelivery`"
                  },
                  "startDate": "A String", # Required. First day on which the override applies. In ISO 8601 format.
                },
              ],
            },
          },
        ],
        "kind": "content#returnpolicyCustomBatchResponse", # Identifies what kind of resource this is. Value: the fixed string "content#returnpolicyCustomBatchResponse".
      }

`delete(merchantId, returnPolicyId)`

    Deletes a return policy for the given Merchant Center account.

    Args:
      merchantId: string, The Merchant Center account from which to delete the given return policy. (required)
      returnPolicyId: string, Return policy ID generated by Google. (required)

`get(merchantId, returnPolicyId)`

    Gets a return policy of the Merchant Center account.

    Args:
      merchantId: string, The Merchant Center account to get a return policy for. (required)
      returnPolicyId: string, Return policy ID generated by Google. (required)

    Returns:
      An object of the form:

        { # Return policy resource.
        "country": "A String", # Required. The country of sale where the return policy is applicable.
        "kind": "content#returnPolicy", # Identifies what kind of resource this is. Value: the fixed string "`content#returnPolicy`"
        "label": "A String", # Required. The user-defined label of the return policy. For the default policy, use the label "default".
        "name": "A String", # Required. The name of the policy as shown in Merchant Center.
        "nonFreeReturnReasons": [ # Return reasons that will incur return fees.
          "A String",
        ],
        "policy": { # Required. The policy.
          "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
          "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
          "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
              #
              # Acceptable values are:
              # - "`lastReturnDate`"
              # - "`lifetimeReturns`"
              # - "`noReturns`"
              # - "`numberOfDaysAfterDelivery`"
        },
        "returnPolicyId": "A String", # Return policy ID generated by Google.
        "seasonalOverrides": [ # An optional list of seasonal overrides.
          {
            "endDate": "A String", # Required. Last day on which the override applies. In ISO 8601 format.
            "name": "A String", # Required. The name of the seasonal override as shown in Merchant Center.
            "policy": { # Required. The policy which is in effect during that time.
              "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
              "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
              "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                  #
                  # Acceptable values are:
                  # - "`lastReturnDate`"
                  # - "`lifetimeReturns`"
                  # - "`noReturns`"
                  # - "`numberOfDaysAfterDelivery`"
            },
            "startDate": "A String", # Required. First day on which the override applies. In ISO 8601 format.
          },
        ],
      }

`insert(merchantId, body=None)`

    Inserts a return policy for the Merchant Center account.

    Args:
      merchantId: string, The Merchant Center account to insert a return policy for. (required)
      body: object, The request body.
        The object takes the form of:

    { # Return policy resource.
      "country": "A String", # Required. The country of sale where the return policy is applicable.
      "kind": "content#returnPolicy", # Identifies what kind of resource this is. Value: the fixed string "`content#returnPolicy`"
      "label": "A String", # Required. The user-defined label of the return policy. For the default policy, use the label "default".
      "name": "A String", # Required. The name of the policy as shown in Merchant Center.
      "nonFreeReturnReasons": [ # Return reasons that will incur return fees.
        "A String",
      ],
      "policy": { # Required. The policy.
        "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
        "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
        "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
            #
            # Acceptable values are:
            # - "`lastReturnDate`"
            # - "`lifetimeReturns`"
            # - "`noReturns`"
            # - "`numberOfDaysAfterDelivery`"
      },
      "returnPolicyId": "A String", # Return policy ID generated by Google.
      "seasonalOverrides": [ # An optional list of seasonal overrides.
        {
          "endDate": "A String", # Required. Last day on which the override applies. In ISO 8601 format.
          "name": "A String", # Required. The name of the seasonal override as shown in Merchant Center.
          "policy": { # Required. The policy which is in effect during that time.
            "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
            "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
            "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                #
                # Acceptable values are:
                # - "`lastReturnDate`"
                # - "`lifetimeReturns`"
                # - "`noReturns`"
                # - "`numberOfDaysAfterDelivery`"
          },
          "startDate": "A String", # Required. First day on which the override applies. In ISO 8601 format.
        },
      ],
    }

    Returns:
      An object of the form:

        { # Return policy resource.
        "country": "A String", # Required. The country of sale where the return policy is applicable.
        "kind": "content#returnPolicy", # Identifies what kind of resource this is. Value: the fixed string "`content#returnPolicy`"
        "label": "A String", # Required. The user-defined label of the return policy. For the default policy, use the label "default".
        "name": "A String", # Required. The name of the policy as shown in Merchant Center.
        "nonFreeReturnReasons": [ # Return reasons that will incur return fees.
          "A String",
        ],
        "policy": { # Required. The policy.
          "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
          "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
          "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
              #
              # Acceptable values are:
              # - "`lastReturnDate`"
              # - "`lifetimeReturns`"
              # - "`noReturns`"
              # - "`numberOfDaysAfterDelivery`"
        },
        "returnPolicyId": "A String", # Return policy ID generated by Google.
        "seasonalOverrides": [ # An optional list of seasonal overrides.
          {
            "endDate": "A String", # Required. Last day on which the override applies. In ISO 8601 format.
            "name": "A String", # Required. The name of the seasonal override as shown in Merchant Center.
            "policy": { # Required. The policy which is in effect during that time.
              "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
              "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
              "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                  #
                  # Acceptable values are:
                  # - "`lastReturnDate`"
                  # - "`lifetimeReturns`"
                  # - "`noReturns`"
                  # - "`numberOfDaysAfterDelivery`"
            },
            "startDate": "A String", # Required. First day on which the override applies. In ISO 8601 format.
          },
        ],
      }

`list(merchantId)`

    Lists the return policies of the Merchant Center account.

    Args:
      merchantId: string, The Merchant Center account to list return policies for. (required)

    Returns:
      An object of the form:

        {
        "kind": "content#returnpolicyListResponse", # Identifies what kind of resource this is. Value: the fixed string "content#returnpolicyListResponse".
        "resources": [
          { # Return policy resource.
            "country": "A String", # Required. The country of sale where the return policy is applicable.
            "kind": "content#returnPolicy", # Identifies what kind of resource this is. Value: the fixed string "`content#returnPolicy`"
            "label": "A String", # Required. The user-defined label of the return policy. For the default policy, use the label "default".
            "name": "A String", # Required. The name of the policy as shown in Merchant Center.
            "nonFreeReturnReasons": [ # Return reasons that will incur return fees.
              "A String",
            ],
            "policy": { # Required. The policy.
              "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
              "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
              "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                  #
                  # Acceptable values are:
                  # - "`lastReturnDate`"
                  # - "`lifetimeReturns`"
                  # - "`noReturns`"
                  # - "`numberOfDaysAfterDelivery`"
            },
            "returnPolicyId": "A String", # Return policy ID generated by Google.
            "seasonalOverrides": [ # An optional list of seasonal overrides.
              {
                "endDate": "A String", # Required. Last day on which the override applies. In ISO 8601 format.
                "name": "A String", # Required. The name of the seasonal override as shown in Merchant Center.
                "policy": { # Required. The policy which is in effect during that time.
                  "lastReturnDate": "A String", # Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
                  "numberOfDays": "A String", # The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
                  "type": "A String", # Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items.
                      #
                      # Acceptable values are:
                      # - "`lastReturnDate`"
                      # - "`lifetimeReturns`"
                      # - "`noReturns`"
                      # - "`numberOfDaysAfterDelivery`"
                },
                "startDate": "A String", # Required. First day on which the override applies. In ISO 8601 format.
              },
            ],
          },
        ],
      }