BigCommerce Site Routes API

The Site Routes API from BigCommerce — 2 operation(s) for site routes.

Operations 6

GET /sites/{site_id}/routes BigCommerce Get a Site’s Routes #
POST /sites/{site_id}/routes BigCommerce Create a Site Route #
PUT /sites/{site_id}/routes BigCommerce Update a Site’s Routes #
GET /sites/{site_id}/routes/{route_id} BigCommerce Get a Site Route #
PUT /sites/{site_id}/routes/{route_id} BigCommerce Update a Site Route #
DELETE /sites/{site_id}/routes/{route_id} BigCommerce Delete a Site Route #

Documentation

📖
Documentation
https://developer.bigcommerce.com/
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/abandoned-carts
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/carts
📖
APIReference
https://developer.bigcommerce.com/docs/rest-catalog/brands
📖
APIReference
https://developer.bigcommerce.com/docs/rest-catalog/categories
📖
APIReference
https://developer.bigcommerce.com/docs/rest-catalog/category-trees
📖
APIReference
https://developer.bigcommerce.com/docs/rest-catalog/product-modifiers
📖
APIReference
https://developer.bigcommerce.com/docs/rest-catalog/product-variant-options
📖
APIReference
https://developer.bigcommerce.com/docs/rest-catalog/product-variants
📖
APIReference
https://developer.bigcommerce.com/docs/rest-catalog/products
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/channels
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/checkouts
📖
APIReference
https://developer.bigcommerce.com/docs/rest-content/store-content
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/currencies
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/customers
📖
APIReference
https://developer.bigcommerce.com/docs/rest-content/email-templates
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/geography
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/orders
📖
APIReference
https://developer.bigcommerce.com/docs/rest-content/pages
📖
APIReference
https://developer.bigcommerce.com/docs/rest-payments/tokens
📖
APIReference
https://developer.bigcommerce.com/docs/rest-payments/methods-deprecated
📖
APIReference
https://developer.bigcommerce.com/docs/rest-payments/processing
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/settings
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/shipping-v2
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/channels/site
📖
APIReference
https://developer.bigcommerce.com/docs/rest-management/store-information
📖
APIReference
https://developer.bigcommerce.com/docs/rest-storefront/carts
📖
APIReference
https://developer.bigcommerce.com/docs/rest-storefront/checkouts
📖
APIReference
https://developer.bigcommerce.com/docs/rest-storefront/customers
📖
APIReference
https://developer.bigcommerce.com/docs/rest-storefront/orders
📖
APIReference
https://developer.bigcommerce.com/docs/rest-storefront/subscriptions
📖
APIReference
https://developer.bigcommerce.com/docs/integrations/webhooks
📖
APIReference
https://developer.bigcommerce.com/docs/rest-content/widgets

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/bigcommerce-site-routes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

bigcommerce-site-routes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: BigCommerce Sites Site Routes API
  version: ''
  description: "Create and manage [sites](#sites) and [routes](#routes) for [headless storefront](https://support.bigcommerce.com/s/article/The-Headless-Approach#what-mean) sales [channels](/docs/rest-management/channels).\n\n## [Sites](/docs/rest-management/sites)\n\nSites link [headless storefronts](/docs/storefront/headless) to sales [channels](/docs/rest-management/channels). To [create a site](/docs/rest-management/sites#create-a-site), send a `POST` request to `/stores/{{STORE_HASH}}/v3/sites`.\n\n```http\nPOST https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/sites\nX-Auth-Token: {{ACCESS_TOKEN}}\nContent-Type: application/json\nAccept: application/json\n\n{\n  \"url\": \"http://store.example.com/\",\n  \"channel_id\": 5\n}\n```\n\n**Response**\n\n```json\n{\n  \"id\": 1,\n  \"url\": \"http://store.example.com/\",\n  \"channel_id\": 5,\n  \"created_at\": \"2022-01-04T04:15:50.000Z\",\n  \"updated_at\": \"2022-01-04T04:15:50.000Z\"\n}\n```\n\nTo [get a list of sites](/docs/rest-management/sites#get-sites), send a `GET` request to `/stores/{{STORE_HASH}}/v3/sites`.\n\n```http\nGET https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/sites\nX-Auth-Token: {{ACCESS_TOKEN}}\nAccept: application/json\n```\n\n## Site routes\n\n[Site routes](/docs/rest-management/sites/site-routes) tell BigCommerce how to link to pages on a [headless storefront](/docs/storefront/headless). To [create a route](/docs/rest-management/sites/site-routes#create-a-site-route) for a [site](#sites), send a `POST` request to `/stores/{{STORE_HASH}}/v3/sites/{site_id}/routes`.\n\n```http\nPOST https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/sites/{site_id}/routes\nX-Auth-Token: {{ACCESS_TOKEN}}\nContent-Type: application/json\nAccept: application/json\n\n{\n  \"type\": \"product\",\n  \"matching\": \"12\",\n  \"route\": \"/en/product?id=12\"\n}\n```\n\n## Route types\n\nThe following route types are supported.\n\n| Type | Description |\n|-|-|\n|`product`|Route for product details pages |\n|`brand`|Route to brand pages |\n|`category`|Route to category pages |    \n|`blog`|Route to blog page|    \n|`home`|Route to storefront homepage|\n|`cart`|Route to shopper’s cart|\n|`checkout`|Route to checkout page|\n|`search`|Route to store search page|\n|`account`|Route to account profile page|\n|`login`|Route to account login page|\n|`returns`|Route for return policy page|\n|`static`|Route to a static page|    \n|`create_account`|Route to create new shopper account page|\n|`forgot_password`|Route to shopper forgot password page|\n|`account_order_status`|Route for order status page|\n|`account_new_return`|Route for product returns page|\n|`recover_abandoned_cart`|Route for URL in emails for a shopper to recover their abandoned cart|\n\n## Route variables\n\nThe following route variables are supported.\n\n|Variable|Description|\n|-|-|\n|`{id}`|The **ID** of the requested item|\n|`{slug}`|The **slug** for the requested item (if available). Note: the `slug` value may contain `/` slash|\n|`{lang}`|The **language** string that the client is using|\n\n**Example:**\n\n```http\nPOST https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/sites/{site_id}/routes\nX-Auth-Token: {{ACCESS_TOKEN}}\nContent-Type: application/json\nAccept: application/json\n\n{\n  \"type\": \"product\",\n  \"matching\": \"*\",\n  \"route\": \"/{lang}/{slug}?id={id}\"\n}\n```\n\n## Additional Information\n\n### Related resources\n* [Channels and Listings Reference](/docs/rest-management/channels)\n* [Channels Overview](/docs/integrations/channels)\n* [Building Headless Storefronts Guide](/docs/storefront/headless)"
  termsOfService: https://www.bigcommerce.com/terms
  contact:
    name: BigCommerce
    url: https://www.bigcommerce.com
    email: support@bigcommerce.com
servers:
- url: https://api.bigcommerce.com/stores/{store_hash}/v3
  variables:
    store_hash:
      default: store_hash
      description: Permanent ID of the BigCommerce store.
  description: BigCommerce API Gateway
security:
- X-Auth-Token: []
tags:
- name: Site Routes
paths:
  /sites/{site_id}/routes:
    parameters:
    - $ref: '#/components/parameters/Accept'
    - name: site_id
      in: path
      required: true
      schema:
        type: integer
    get:
      summary: BigCommerce Get a Site’s Routes
      operationId: getSiteRoutes
      parameters:
      - name: type
        in: query
        description: Filter routes by a specified resource type.
        schema:
          type: string
      - in: query
        name: page
        description: Specifies the page number in a limited (paginated) list of items.
        schema:
          type: integer
      - in: query
        name: limit
        description: Controls the number of items per page in a limited (paginated) list of items.
        schema:
          type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/siteRoute_Full'
                  meta:
                    $ref: '#/components/schemas/_metaCollection'
              examples:
                response:
                  value:
                    data:
                    - id: 1
                      type: product
                      matching: '5'
                      route: /products?id={id}
                    - id: 2
                      type: category
                      matching: '44'
                      route: /category/{slug}
                    meta:
                      pagination:
                        total: 1
                        count: 1
                        per_page: 50
                        current_page: 1
                        total_pages: 1
      tags:
      - Site Routes
      description: Get a site’s routes.
    post:
      summary: BigCommerce Create a Site Route
      operationId: createSiteRoute
      parameters:
      - $ref: '#/components/parameters/ContentType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/siteRoute_Base'
        required: true
        x-examples:
          application/json:
            type: returns
            matching: '5'
            route: /my-amazing-product
      responses:
        '201':
          $ref: '#/components/responses/siteRoute_Resp'
        '422':
          $ref: '#/components/responses/ErrorResponse'
        '502':
          $ref: '#/components/responses/502_GatewayError'
      tags:
      - Site Routes
      description: 'Create routes that tell BigCommerce how to link to pages on a [headless storefront](/docs/storefront/headless).


        ## Usage Notes

        * For a list of supported route types, see [Route types](/docs/rest-management/sites#route-types).'
    put:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/siteRoute_Full'
                  meta:
                    $ref: '#/components/schemas/_metaCollection'
              examples:
                response:
                  value:
                    data:
                    - id: 123
                      type: brand
                      matching: '5'
                      route: /my-amazing-product
                    - id: 345
                      type: blog
                      matching: '5'
                      route: /my-amazing-product
                    - id: 234
                      type: returns
                      matching: '5'
                      route: /my-amazing-product
                    meta:
                      pagination:
                        total: 80
                        count: 50
                        per_page: 50
                        current_page: 50
                        total_pages: 2
                        links:
                          current: ?page=1&limit=50
                          next: ?page=2&limit=50
        '422':
          $ref: '#/components/responses/BulkErrorResponse'
      description: 'Upsert routes for site with ID `{site_id}`.


        ## Usage Notes

        * `id` is required when updating an existing route.'
      summary: BigCommerce Update a Site’s Routes
      operationId: updateSiteRoutes
      parameters:
      - $ref: '#/components/parameters/ContentType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/siteRoute_Full'
        x-examples:
          application/json:
          - id: 1
            type: product
            matching: '*'
            route: /products/{id}
          - id: 2
            type: product
            matching: '10'
            route: /products?id={id}
      tags:
      - Site Routes
  /sites/{site_id}/routes/{route_id}:
    parameters:
    - $ref: '#/components/parameters/Accept'
    - name: site_id
      in: path
      required: true
      schema:
        type: string
    - name: route_id
      in: path
      required: true
      schema:
        type: string
    get:
      summary: BigCommerce Get a Site Route
      operationId: getSiteRoute
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/siteRoute_Full'
                  meta:
                    $ref: '#/components/schemas/MetaOpen'
              examples:
                response:
                  value:
                    data:
                      id: 60474753
                      type: checkout
                      matching: '5'
                      route: /my-amazing-product
                    meta: {}
      tags:
      - Site Routes
      description: Get a site’s route.
    put:
      summary: BigCommerce Update a Site Route
      operationId: updateSiteRoute
      parameters:
      - $ref: '#/components/parameters/ContentType'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/siteRoutes_Route_Base'
        required: true
        x-examples:
          application/json:
            type: product
            matching: '*'
            route: /products/{id}
      responses:
        '201':
          $ref: '#/components/responses/siteRoute_Resp'
      tags:
      - Site Routes
      description: 'Update a site’s route.

        '
    delete:
      summary: BigCommerce Delete a Site Route
      operationId: deleteSiteRoute
      responses:
        '204':
          description: ''
      tags:
      - Site Routes
      description: Delete a site’s route.
components:
  schemas:
    error_Full:
      type: object
      title: error_Full
      properties:
        status:
          description: 'The HTTP status code.

            '
          type: integer
        title:
          description: 'The error title describing the particular error.

            '
          type: string
        type:
          type: string
      x-internal: false
    MetaOpen:
      title: Response meta
      type: object
      properties: {}
      additionalProperties: true
      description: Response metadata.
    siteRoute_Full:
      title: siteRoute_Full
      description: Route object used in responses.
      allOf:
      - type: object
        properties:
          id:
            type: integer
            description: Unique ID for this route. Required when updating an existing route.
      - $ref: '#/components/schemas/siteRoute_Base'
      x-internal: false
    _metaCollection:
      title: metaCollection
      description: Meta data relating to pagination.
      type: object
      properties:
        pagination:
          type: object
          properties:
            total:
              type: integer
              description: Total number of items returned.
              example: 3
            count:
              type: integer
              description: Number of items returned on per page.
              example: 1
            per_page:
              type: integer
              description: Number of items to be displayed per page.
              example: 1
            current_page:
              type: integer
              description: Current page number.
              example: 2
            total_page:
              type: integer
              description: Total number of pages.
              example: 3
            links:
              type: object
              properties:
                previous:
                  type: string
                  description: Query string appended to the resource to return to the previous page.
                  example: ?limit=1&page=1
                next:
                  type: string
                  description: Query string appended to the resource to proceed to the next page.
                  example: ?limit=1&page=3
                current:
                  type: string
                  description: Query string appended to the resource to show the current page.
                  example: ?limit=1&page=2
      x-internal: false
    siteRoutes_Route_Base:
      title: siteRoutes_Route_Base
      type: object
      properties:
        type:
          type: string
          description: The type of resource being routed to; [supported types](/docs/rest-management/sites#route-types).
          enum:
          - product
          - brand
          - category
          - page
          - blog
          - home
          - cart
          - checkout
          - search
          - account
          - login
          - returns
          - static
        matching:
          type: string
          example: '5'
          description: '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.'
        route:
          type: string
          example: /my-amazing-product
          description: '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.'
      required:
      - type
      - matching
      - route
      x-internal: false
    _errors:
      type: object
      description: The keys and values in an errors object will vary depending on the error received.
      title: _errors
      x-internal: false
    _metaEmpty:
      type: object
      properties: {}
      description: Empty meta object; may be used later.
      title: _metaEmpty
      x-internal: false
    siteRoute_Base:
      type: object
      title: siteRoute_Base
      properties:
        type:
          type: string
          description: The type of resource being routed to; [supported types](/docs/rest-management/sites#route-types).
          enum:
          - product
          - brand
          - category
          - page
          - blog
          - home
          - cart
          - checkout
          - search
          - account
          - login
          - returns
          - static
        matching:
          type: string
          description: '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:
          type: string
          description: '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
      x-internal: false
  parameters:
    Accept:
      name: Accept
      in: header
      required: true
      description: The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.
      schema:
        type: string
        default: application/json
    ContentType:
      name: Content-Type
      in: header
      required: true
      description: The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the request body.
      schema:
        type: string
        default: application/json
  responses:
    ErrorResponse:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              title:
                type: string
                description: General error message
              status:
                type: string
                description: HTTP status code
              errors:
                $ref: '#/components/schemas/_errors'
              type:
                type: string
    502_GatewayError:
      description: If something happens during the request that causes it to fail, a 502 response will be returned. A new request should be made; however, it could fail.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_Full'
    siteRoute_Resp:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/siteRoute_Full'
              meta:
                $ref: '#/components/schemas/MetaOpen'
          examples:
            response:
              value:
                data:
                  id: 123
                  type: checkout
                  matching: '5'
                  route: /my-amazing-product
                meta: {}
    BulkErrorResponse:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                description: The HTTP status code.
              title:
                type: string
              errors:
                $ref: '#/components/schemas/_errors'
              meta:
                $ref: '#/components/schemas/_metaEmpty'
              type:
                type: string
          examples:
            response:
              value:
                meta:
                  saved_records: 0
                title: Bulk operation has failed
                type: /api-docs/getting-started/api-status-codes
                errors:
                  0.matching.type: Route already exists for site 1 matching 5 for type product
                  1.matching.type: Route already exists for site 1 matching * for type home
                status: 422
  securitySchemes:
    X-Auth-Token:
      name: X-Auth-Token
      description: '### OAuth scopes


        | UI Name | Permission | Parameter |

        |:--|:--|:-|

        |  Channel Listings | modify | `store_channel_listings` |

        |  Channel Listings | read-only | `store_channel_listings_read_only` |

        |  Channel Settings | modify | `store_channel_settings` |

        |  Channel Settings | read-only | `store_channel_settings_read_only` |

        |  Sites & Routes | modify | `store_sites` |

        |  Sites & Routes | read-only | `store_sites_read_only` |


        ### Authentication header


        | Header | Argument | Description |

        |:-|:|:|

        | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/docs/start/authentication/api-accounts). |


        ### Further reading


        For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/docs/start/authentication#x-auth-token-header-example-requests).


        For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/docs/start/authentication/api-accounts#oauth-scopes).


        For a list of API status codes, see [API Status Codes](/docs/start/about/status-codes).'
      type: apiKey
      in: header