For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
        • Abandoned Carts
        • Carts
              • POSTCreate Cart Redirect URL
        • Channels
        • Checkouts
        • Currencies
        • Customer Segmentation
        • Geography
        • Infrastructure Hosting
        • Inventory
        • Orders
        • Order Operations
        • Pickup
        • Pickup Methods
        • Pickup Options
        • Pricing
        • Price Lists
        • Promotions
        • Promotion Settings
        • Redirects
        • Scripts
        • Settings
        • Shipping
        • Sites
        • Subscribers
        • System Logs
        • Tax
        • Wishlists
      • Payments
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTAdminManagementCartsRedirects

Create Cart Redirect URL

POST
https://api.bigcommerce.com/stores/:store_hash/v3/carts/:cartId/redirect_urls
POST
/stores/:store_hash/v3/carts/:cartId/redirect_urls
$curl -X POST https://api.bigcommerce.com/stores/store_hash/v3/carts/cartId/redirect_urls \
> -H "Accept: application/json" \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "query_params": {
> "key_1": "value_1",
> "key_2": "value_2"
> }
>}'
201Create a cart redirect URL
1{
2 "data": {
3 "cart_url": "https://store.mybigcommerce.com/cart.php?action=load&id=0aa00afa-a000-00a0-00aae-aa0000f000a0&token=00aaaaa0aa0000000000a000a000f0aa0000afa00aa00afa0a000000000aa0a0",
4 "checkout_url": "https://store.mybigcommerce.com/cart.php?action=loadInCheckout&id=1ea11efe-b111-11d1-11ee-cd1110f111b1&token=00aaaaa0aa0000000000a000a000f0aa0000afa00aa00afa0a000000000aa0a0",
5 "embedded_checkout_url": "https://store.mybigcommerce.com/cart.php?embedded=1&action=loadInCheckout&id=0aa00afa-a000-00a0-00aae-aa0000f000a0&token=00aaaaa0aa0000000000a000a000f0aa0000afa00aa00afa0a000000000aa0a0"
6 },
7 "meta": {
8 "$ref": "#/components/schemas/metaCollection_open"
9 }
10}
Creates a **Cart** redirect URL for redirecting a shopper to an already created cart using the `cartId`. **Usage Notes** * To use redirect URLs, first create the cart using the REST Management API or GraphQL Storefront API. * Redirect URLs can also be created with **Create a Cart** requests by appending `include=redirect_urls`. * A **Carts** redirect URL is valid for 30 days and may only be used once. * Redirect URLs point to either a shared checkout domain or a channel-specific domain, depending on the storefront configuration. * Once a redirect URL has been visited, it will be invalidated and cannot be used again. * If your application requires URLs to be visited more than once, consider generating a fresh one each time you need to restore a cart, and redirecting to the URL from your own application. * To restore a cart that was created on the storefront, either by a shopper or a Storefront API, first recreate the cart using the **REST Management API**. * When redirecting the shopper, you can add a set of `query_params` to the URL. The `query_params` feature allows passing additional information to the redirect URL.
Was this page helpful?
Previous

Delete Metafield

Next

Get Global Cart Settings

Built with

Creates a Cart redirect URL for redirecting a shopper to an already created cart using the cartId.

Usage Notes

  • To use redirect URLs, first create the cart using the REST Management API or GraphQL Storefront API.
  • Redirect URLs can also be created with Create a Cart requests by appending include=redirect_urls.
  • A Carts redirect URL is valid for 30 days and may only be used once.
  • Redirect URLs point to either a shared checkout domain or a channel-specific domain, depending on the storefront configuration.
  • Once a redirect URL has been visited, it will be invalidated and cannot be used again.
  • If your application requires URLs to be visited more than once, consider generating a fresh one each time you need to restore a cart, and redirecting to the URL from your own application.
  • To restore a cart that was created on the storefront, either by a shopper or a Storefront API, first recreate the cart using the REST Management API.
  • When redirecting the shopper, you can add a set of query_params to the URL. The query_params feature allows passing additional information to the redirect URL.

Authentication

X-Auth-Tokenstring

OAuth scopes

UI NamePermissionParameter
Cartsmodifystore_cart
Cartsread-onlystore_cart_read_only
Information & Settingsmodifystore_v2_information
Information & Settingsread-onlystore_v2_information

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.

Path parameters

cartIdstringRequiredformat: "UUID"
The identifier of a specific cart.
store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json
The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

Request

This endpoint expects an object.
query_paramsobjectOptional

Response

dataobject
metaobject
Response metadata.

The MIME type of the response body.