BigCommerce
Management API
Site Routes

Sites

Get a Site’s Routes

GET /sites/{site_id}/routes

Request

Get a site’s routes.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required

    The MIME type of the response body.

  • site_id in path - integer
    required
  • 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

object | application/json
  • data
    array[object]

  • meta
    object

    Meta data relating to pagination.

response

Create a Site Route

POST /sites/{site_id}/routes

Request

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
    required

Parameters

  • store_hash in path - string
  • site_id in path - integer
    required
  • Content-Type in header with default of application/json - string
    required

    The MIME type of the request body.

Body

object | application/json
  • type
    string

    The type of resource being routed to; supported types.

    Allowed: product | brand | category | page | blog | home | cart | checkout | search | account | login | returns | static

  • matching
    string

    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

  • route
    string

    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: the slug value may contain / slash.
    • {language} The language string that the client is using.

    Example: /my-amazing-product

example

Response

Body

object | application/json
  • data

    Route object used in responses.

  • meta
    object

    Response metadata.

response

Update a Site’s Routes

PUT /sites/{site_id}/routes

Request

Upsert routes for site with ID {site_id}.

Usage Notes

  • id is required when updating an existing route.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string
  • site_id in path - integer
    required
  • Content-Type in header with default of application/json - string
    required

    The MIME type of the request body.

Body

application/json

Route object used in responses.

  • id
    integer

    Unique ID for this route. Required when updating an existing route.

  • type
    string

    The type of resource being routed to; supported types.

    Allowed: product | brand | category | page | blog | home | cart | checkout | search | account | login | returns | static

  • matching
    string

    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

  • route
    string

    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: the slug value may contain / slash.
    • {language} The language string that the client is using.

    Example: /my-amazing-product

    example

    Response

    Body

    object | application/json
    • data
      array[object]

    • meta
      object

      Meta data relating to pagination.

    response

    Get a Site Route

    GET /sites/{site_id}/routes/{route_id}

    Request

    Get a site’s route.

    Authentication

    • X-Auth-Token in header
      required

    Parameters

    • store_hash in path - string
    • Accept in header with default of application/json - string
      required

      The MIME type of the response body.

    • site_id in path - string
      required
    • route_id in path - string
      required

    example

    Response

    Body

    object | application/json
    • data

      Route object used in responses.

    • meta
      object

      Response metadata.

    response

    Update a Site Route

    PUT /sites/{site_id}/routes/{route_id}

    Request

    Update a site’s route.

    Authentication

    • X-Auth-Token in header
      required

    Parameters

    • store_hash in path - string
    • site_id in path - string
      required
    • route_id in path - string
      required
    • Content-Type in header with default of application/json - string
      required

      The MIME type of the request body.

    Body

    object | application/json
    • type
      string
      required

      The type of resource being routed to; supported types.

      Allowed: product | brand | category | page | blog | home | cart | checkout | search | account | login | returns | static

    • matching
      string
      required

      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

    • route
      string
      required

      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: the slug value may contain / slash.
      • {language} The language string that the client is using.

      Example: /my-amazing-product

    example

    Response

    Body

    object | application/json
    • data

      Route object used in responses.

    • meta
      object

      Response metadata.

    response

    Delete a Site Route

    DELETE /sites/{site_id}/routes/{route_id}

    Request

    Delete a site’s route.

    Authentication

    • X-Auth-Token in header
      required

    Parameters

    • store_hash in path - string
    • Accept in header with default of application/json - string
      required

      The MIME type of the response body.

    • site_id in path - string
      required
    • route_id in path - string
      required

    example

    Response

    Did you find what you were looking for?