Site Routes
Get a Site’s Routes
GET /stores/{store_hash}/v3/sites/{site_id}/routesRequest
Get a site’s routes.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequired
The MIME type of the response body.
- site_id in path - integerrequired
- type in query - string
Filter routes by a specified resource type.
- page in query - integer
Specifies the page number in a limited (paginated) list of items.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of items.
example
Response
Body
dataarray[object]
metaobject
Meta data relating to pagination.
response
Create a Site Route
POST /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 headerrequired
Parameters
- store_hash in path - string
- site_id in path - integerrequired
- Content-Type in header with default of application/json - stringrequired
The 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: 5
routestring
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
data
Route object used in responses.
metaobject
Response metadata.
response
Update a Site’s Routes
PUT /stores/{store_hash}/v3/sites/{site_id}/routesRequest
Upsert routes for site with ID {site_id}
.
Usage Notes
id
is required when updating an existing route.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- site_id in path - integerrequired
- Content-Type in header with default of application/json - stringrequired
The 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: 5
routestring
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]
metaobject
Meta data relating to pagination.
response
Get a Site Route
GET /stores/{store_hash}/v3/sites/{site_id}/routes/{route_id}Request
Get a site’s route.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequired
The MIME type of the response body.
- site_id in path - stringrequired
- route_id in path - stringrequired
example
Response
Body
data
Route object used in responses.
metaobject
Response metadata.
response
Update a Site Route
PUT /stores/{store_hash}/v3/sites/{site_id}/routes/{route_id}Request
Update a site’s route.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- site_id in path - stringrequired
- route_id in path - stringrequired
- Content-Type in header with default of application/json - stringrequired
The 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: 5
routestring
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
data
Route object used in responses.
metaobject
Response metadata.
response
Delete a Site Route
DELETE /stores/{store_hash}/v3/sites/{site_id}/routes/{route_id}Request
Delete a site’s route.
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequired
The MIME type of the response body.
- site_id in path - stringrequired
- route_id in path - stringrequired