In Merchant API you can use geographic regions as targets for services related
to the
[`accounts.products.regionalInventories`](https://developers.google.com/merchant/api/reference/rest/inventories_v1/accounts.products.regionalInventories)
resource. You can define regions as collections of either postal codes or, in
some countries, using predefined geotargets. For more information, see
[Set up regions](https://support.google.com/merchants/answer/7410946#zippy=%2Ccreate-a-new-regionS).

To create and update regions, you can use the following methods:

- [`Get`](https://developers.google.com/merchant/api/guides/accounts/regions#get)
- [`List`](https://developers.google.com/merchant/api/guides/accounts/regions#list)
- [`Create`](https://developers.google.com/merchant/api/guides/accounts/regions#create)
- [`Patch`](https://developers.google.com/merchant/api/guides/accounts/regions#patch)
- [`Delete`](https://developers.google.com/merchant/api/guides/accounts/regions#delete)

## Retrieve a region

To retrieve a region defined in your Merchant Center account, use the
[`accounts.regions.get`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.regions/get)
method.

Here's a sample request:

    GET https://merchantapi.googleapis.com/accounts/v1/accounts/125222396/regions/234567

Here's a sample response from a successful call:

    HTTP/1.1 200

    {
      "name": "accounts/125222396/regions/234567",
      "displayName": "Canada",
      "postalCodeArea": {
        "regionCode": "CA",
        "postalCodes": [
          {
            "begin": "L6A"
          }
        ]
      }

## List all regions

To list the regions in your Merchant Center account, use the
[`accounts.regions.list`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.regions/list)
method.

Here's a sample request:

    GET https://merchantapi.googleapis.com/accounts/v1/accounts/125222396/regions?pageSize=100

Here's a sample response from a successful call:

    HTTP/1.1 200

    {
      "regions": [
        {
          "name": "accounts/125222396/regions/234567",
          "displayName": "Canada",
          "postalCodeArea": {
            "regionCode": "CA",
            "postalCodes": [
              {
                "begin": "L6A"
              }
            ]
          },
          "regionalInventoryEligible": true,
          "shippingEligible": true
        },
        {
          "name": "accounts/125222396/regions/Inline region",
          "displayName": "Inline region",
          "postalCodeArea": {
            "regionCode": "CA",
            "postalCodes": [
              {
                "begin": "M7B"
              }
            ]
          },
          "regionalInventoryEligible": false,
          "shippingEligible": true
        },
      ]
    }

## Insert a region

To insert a region definition in your Merchant Center account, use the
[`accounts.regions.create`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.regions/create)
method. Executing this method requires administrator access.

Here's a sample request:

    POST https://merchantapi.googleapis.com/accounts/v1/accounts/102959835/regions?regionId=987654

    {
      "displayName": "TestRegion",
      "name": "987654",
      "postalCodeArea": {
        "postalCodes": [
          {
            "begin": "98109"
          }
        ],
        "regionCode": "US"
      }
    }

Here's a sample response from a successful call:

    {
         "name": "accounts/102959835/regions/987654",
      "displayName": "TestRegion",
      "postalCodeArea": {
        "regionCode": "US",
        "postalCodes": [
          {
            "begin": "98109"
          }
        ]
      },
      "regionalInventoryEligible": true,
      "shippingEligible": true
    }

To create a new region with `AreaCode`:

Here's a sample request:

    POST https://merchantapi.googleapis.com/accounts/v1/accounts/102959835/regions?regionId=168888 HTTP/1.1

    {
      "displayName": "WA_test",
      "name": "168888",
      "geotargetArea": {
        "geotargetCriteriaIds": [
          20101
        ]
      }
    }

Here's a sample response from a successful call:

    {
      "name": "accounts/102959835/regions/168888",
      "displayName": "WA_test",
      "geotargetArea": {
        "geotargetCriteriaIds": [
          "20101"
        ]
      },
      "regionalInventoryEligible": true,
      "shippingEligible": false
    }

To update the `displayName` and `GeoTargetCriteriaIds` for the region created:

Here's a sample request:

    PATCH https://merchantapi.googleapis.com/accounts/v1/accounts/102959835/regions/168888?updateMask=displayName%2CgeotargetArea HTTP/1.1

    {
      "displayName": "BR_test",
      "geotargetArea": {
        "geotargetCriteriaIds": [
          20100
        ]
      }
    }

Here's a sample response from a successful call:

    HTTP/1.1 200

    {
      "name": "accounts/102959835/regions/168888",
      "displayName": "BR_test",
      "geotargetArea": {
        "geotargetCriteriaIds": [
          "20100"
        ]
      },
      "regionalInventoryEligible": true,
      "shippingEligible": false
    }

## Update a region

To update a region definition in your Merchant Center account, use the
[`accounts.regions.patch`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.regions/patch)
method. Executing this method requires administrator access.

Here's a sample request:

    PATCH https://merchantapi.googleapis.com/accounts/v1/accounts/102959835/regions/987654?updateMask=displayName%2CpostalCodeArea HTTP/1.1

    Authorization: Bearer [YOUR_ACCESS_TOKEN]
    Accept: application/json
    Content-Type: application/json

    {
      "displayName": "Test",
      "postalCodeArea": {
        "postalCodes": [
          {
            "begin": "98108"
          }
        ],
        "regionCode": "US"
      }
    }

Here's a sample response from a successful call:

    {
      "name": "accounts/102959835/regions/987654",
      "displayName": "Test",
      "postalCodeArea": {
        "regionCode": "US",
        "postalCodes": [
          {
            "begin": "98108"
          }
        ]
      },
      "regionalInventoryEligible": true,
      "shippingEligible": true
    }

## Delete a region

To delete a region definition from your Merchant Center account, use the
[`accounts.regions.delete`](https://developers.google.com/merchant/api/reference/rest/accounts_v1/accounts.regions/delete)
method. Executing this method requires administrator access.

Here's a sample request:

    DELETE https://merchantapi.googleapis.com/accounts/v1/accounts/102959835/regions/987654 HTTP/1.1

Here's a sample response from a successful call:

    HTTP/1.1 200
    {}

## Batch operations

If you are managing multiple regions, Merchant API provides batch endpoints that
let you create, update, and delete up to 100 regions in a single call. For more
information, see [Manage region
batching](https://developers.google.com/merchant/api/guides/accounts/manage-region-batching).