post https://{shopdomain}.myshoplaza.com/openapi/2022-01/redirects
Requires
write_shop_navigationaccess 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:
- Managing outdated URLs after updating your store's structure.
- Preventing broken links by redirecting users to active pages.
- Improving SEO by maintaining URL integrity.
Request Parameters
Public Request Parameters
Body Parameters
| Parameter | Type | Description | Required | Example | 
|---|---|---|---|---|
| from_url | string | Original URL to be redirected. | Yes | /collections/hot-selling | 
| redirect_url | string | Target URL where the original URL will redirect users. | Yes | /collections/test1567 | 
| status | string | Status of the redirect: open(available) orclose(unavailable). | Yes | open | 
Response Explanation
Public Response Parameters
Successful Response
| Field | Type | Example | Description | 
|---|---|---|---|
| id | string | 373043233132924740 | Unique identifier for the redirect. | 
| store_id | integer | 633130 | ID of the store where the redirect is created. | 
| status | string | open | Status of the redirect. | 
| from_url | string | /collections/hot-selling | The original URL specified for redirection. | 
| redirect_url | string | /collections/test1567 | The 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.
| Field | Type | Example | Description | 
|---|---|---|---|
| errors | Array | [ "file number error"] | A list of errors encountered during the request processing. | 
| Field | Type | Example | Description | 
|---|---|---|---|
| error | String |  "store is not active" | Indicates an error encountered during the process | 
Error Detail
| Status Code | Message | Possible Reason | Example Response | 
|---|---|---|---|
| 400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request | 
| Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized | |
| 422 | Unprocessable Entity | from_url is already existed | "Path has already been take" | 
