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.

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.

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
1POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
2X-Auth-Token: {{ACCESS_TOKEN}}
3Content-Type: application/json
4Accept: application/json
5
6mutation ($input: SetProductUrlPathInput!) {
7 product {
8 setProductUrlPath (input: $input) {
9 product {
10 id
11 urlPath {
12 path
13 }
14 }
15 }
16 }
17}
GraphQL variables
1{
2 "input": {
3 "productId": "bc/store/product/111",
4 "data": {
5 "path": "/global-product-111"
6 }
7 }
8}

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
1POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
2X-Auth-Token: {{ACCESS_TOKEN}}
3Content-Type: application/json
4Accept: application/json
5
6mutation ($input: SetProductUrlPathInput!) {
7 product {
8 setProductUrlPath (input: $input) {
9 product {
10 id
11 overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "uk" }) {
12 urlPath {
13 path
14 }
15 }
16 }
17 }
18 }
19}
GraphQL variables
1{
2 "input": {
3 "productId": "bc/store/product/111",
4 "localeContext": {
5 "channelId": "bc/store/channel/2",
6 "locale": "uk"
7 },
8 "data": {
9 "path": "/overrides-product-111"
10 }
11 }
12}

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
1POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
2X-Auth-Token: {{ACCESS_TOKEN}}
3Content-Type: application/json
4Accept: application/json
5
6mutation ($input: RemoveProductUrlPathOverrideInput!) {
7 product {
8 removeProductUrlPathOverride (input: $input) {
9 product {
10 id
11 urlPath {
12 path
13 }
14 }
15 }
16 }
17}
GraphQL variables
1{
2 "input": {
3 "productId": "b/store/product/111",
4 "localeContext": {
5 "channelId": "bc/store/channel/2",
6 "locale": "uk"
7 }
8 }
9}

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
1POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
2X-Auth-Token: {{ACCESS_TOKEN}}
3Content-Type: application/json
4Accept: application/json
5
6query {
7 store {
8 product (id: "bc/store/product/111") {
9 id
10 urlPath {
11 path
12 }
13 overridesForLocale (localeContext: { channelId: "bc/store/channel/2", locale: "uk" }) {
14 urlPath {
15 path
16 }
17 }
18 }
19 }
20}