Catalog and inventory
GraphQL Admin API
Product URL

Product URL

International Enhancements for Multi-Storefront

This feature is currently available for Enterprise stores and Partner Sandboxes. If the feature is not working as expected, please contact technical support, as the feature likely needs to be enabled for the individual store. To become an enterprise customer, contact your BigCommerce Customer Service Manager or our support team (opens in a new tab).

Using the Catalog features of the Admin API, you can set and query product URLs for a store or a locale within a storefront channel.

Perform the following:

For a full schema, see the GraphQL Admin API reference (opens in a new tab).

Input fields

Setting or removing information requires that you specify ID fields in the input. For more information on how to specify ID fields, see Input fields.

Set product URL at the global level

The following example sets a product's URL for a store, from which channels inherit by default.

Example mutation: Set product URL at the global level
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json
 
mutation ($input: SetProductUrlPathInput!) {
  product {
    setProductUrlPath (input: $input) {
      product {
        id
        urlPath {
          path
        }
      }
    }
  }
}
GraphQL variables
{
  "input": {
    "productId": "bc/store/product/111",
    "data": {
      "path": "/global-product-111"
    }
  }
}

Set product URL for a locale

The following example sets a product's URL for the locale within a storefront channel. These settings override global store information.

Example mutation: Set product URL for a locale
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json
 
mutation ($input: SetProductUrlPathInput!) {
  product {
    setProductUrlPath (input: $input) {
      product {
        id
        overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "uk" }) {
          urlPath {
            path
          }
        }
      }
    }
  }
}
GraphQL variables
{
  "input": {
    "productId": "bc/store/product/111",
    "localeContext": {
      "channelId": "bc/store/channel/2",
      "locale": "uk"
    },
    "data": {
      "path": "/overrides-product-111"
    }
  }
}

Remove product URL for a locale

The following example removes the overrides for a product's URL. This mutation removes the overrides for the locale within the storefront channel, and the product URL defaults to its global store value.

Example mutation: Remove product URL for a locale
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json
 
mutation ($input: RemoveProductUrlPathOverrideInput!) {
  product {
    removeProductUrlPathOverride (input: $input) {
      product {
        id
        urlPath {
          path
        }
      }
    }
  }
}
GraphQL variables
{
  "input": {
    "productId": "b/store/product/111",
    "localeContext": {
      "channelId": "bc/store/channel/2",
      "locale": "uk"
    }
  }
}

Query product URL

The following example retrieves a product's URL. You can retrieve global information for the store and overrides for a locale within a storefront channel.

Example query: Get product URL for a product
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json
 
query {
  store {
    product (id: "bc/store/product/111") {
      id
      urlPath {
        path
      }
      overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "uk" }) {
        urlPath {
          path
        }
      }
    }
  }
}
Did you find what you were looking for?