Create Redirect

🔒

Requires write_shop_navigation access scope. More access scope

The Create Redirect API allows you to set up a URL redirect in your store, ensuring that users navigating to an outdated or unavailable URL are redirected to the correct location.

This API is especially useful for:

  1. Managing outdated URLs after updating your store's structure.
  2. Preventing broken links by redirecting users to active pages.
  3. Improving SEO by maintaining URL integrity.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Body Parameters

ParameterTypeDescriptionRequiredExample
from_urlstringOriginal URL to be redirected.Yes/collections/hot-selling
redirect_urlstringTarget URL where the original URL will redirect users.Yes/collections/test1567
statusstringStatus of the redirect: open (available) or close (unavailable).Yesopen

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeExampleDescription
idstring373043233132924740Unique identifier for the redirect.
store_idinteger633130ID of the store where the redirect is created.
statusstringopenStatus of the redirect.
from_urlstring/collections/hot-sellingThe original URL specified for redirection.
redirect_urlstring/collections/test1567The target URL specified for the redirection.

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "file number error"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422Unprocessable Entityfrom_url is already existed"Path has already been take"

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!