Site Routes
Get a Site’s Routes
GET https://api.bigcommerce.com/stores/{store_hash}/v3/sites/{site_id}/routesRequest
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- site_id in path - integerrequired
- type in query - stringFilter routes by a specified resource type.
- page in query - integerSpecifies the page number in a limited (paginated) list of items.
- limit in query - integerControls the number of items per page in a limited (paginated) list of items.
example
Response
Body
dataarray[object]
response
Create a Site Route
POST https://api.bigcommerce.com/stores/{store_hash}/v3/sites/{site_id}/routesRequest
Create routes that tell BigCommerce how to link to pages on a headless storefront.
Usage Notes
- For a list of supported route types, see Route types.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- site_id in path - integerrequired
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
typestring
The type of resource being routed to; supported types.Allowed: product | brand | category | page | blog | home | cart | checkout | search | account | login | returns | static
matchingstring
Depending on the resource type, this can be an ID (matching a specific item), or a "*" wildcard (matching all items of that type).
For example, a route with a type: "product" and matching: "5" will be used for the product with the ID of 5.
Example: 5routestring
The route template that will be used to generate the URL for the requested resource.
Supports several tokens:
{id}
The ID of the requested item.{slug}
The slug for the requested item (if available). Note: theslug
value may contain/
slash.{language}
The language string that the client is using.
Example: /my-amazing-product
example
Response
Body
dataobject
Route object used in responses.
response
Update a Site’s Routes
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/sites/{site_id}/routesRequest
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- site_id in path - integerrequired
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
idinteger
Unique ID for this route. Required when updating an existing route.typestring
The type of resource being routed to; supported types.Allowed: product | brand | category | page | blog | home | cart | checkout | search | account | login | returns | static
matchingstring
Depending on the resource type, this can be an ID (matching a specific item), or a "*" wildcard (matching all items of that type).
For example, a route with a type: "product" and matching: "5" will be used for the product with the ID of 5.
Example: 5routestring
The route template that will be used to generate the URL for the requested resource.
Supports several tokens:
{id}
The ID of the requested item.{slug}
The slug for the requested item (if available). Note: theslug
value may contain/
slash.{language}
The language string that the client is using.
Example: /my-amazing-product
example
Response
Body
dataarray[object]
response
Get a Site Route
GET https://api.bigcommerce.com/stores/{store_hash}/v3/sites/{site_id}/routes/{route_id}Request
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- site_id in path - stringrequired
- route_id in path - stringrequired
example
Response
Body
dataobject
Route object used in responses.
response
Update a Site Route
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/sites/{site_id}/routes/{route_id}Request
Update a site’s route.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- site_id in path - stringrequired
- route_id in path - stringrequired
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
typestring
requiredThe type of resource being routed to; supported types.Allowed: product | brand | category | page | blog | home | cart | checkout | search | account | login | returns | static
matchingstring
requiredDepending on the resource type, this can be an ID (matching a specific item), or a "*" wildcard (matching all items of that type).
For example, a route with a type: "product" and matching: "5" will be used for the product with the ID of 5.
Example: 5routestring
requiredThe route template that will be used to generate the URL for the requested resource.
Supports several tokens:
{id}
The ID of the requested item.{slug}
The slug for the requested item (if available). Note: theslug
value may contain/
slash.{language}
The language string that the client is using.
Example: /my-amazing-product
example
Response
Body
dataobject
Route object used in responses.
response
Delete a Site Route
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/sites/{site_id}/routes/{route_id}Request
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- site_id in path - stringrequired
- route_id in path - stringrequired