Redirect
A redirect causes a visitor on a specific path on the shop's site to be automatically sent to a different location, called the target. The target can be a new path on the shop's site or a full URL. The new URL can even be on a completely different domain. Redirect paths are unique, so a shop can't have more than one redirect with the same path.
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2019-04/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2019-04/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2019-04/redirects/#{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2019-04/redirects.json Creates a redirect
- PUT /admin/api/2019-04/redirects/#{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2019-04/redirects/#{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
page
deprecated |
The page of results to show. (default:1 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2019-04/redirects.json
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 304339089,
"path": "/products.php",
"target": "/products"
},
{
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
},
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2019-04/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2019-04/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2019-04/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2019-04/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034148,
"path": "/ipod",
"target": "/pages/itunes"
}
}
Create a redirect using a full URL for the path, which will be saved as an absolute path without a domain
POST /admin/api/2019-04/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034149,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2019-04/redirects/#{redirect_id}.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2019-04/redirects/#{redirect_id}.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2019-04/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
}
A redirect causes a visitor on a specific path on the shop's site to be automatically sent to a different location, called the target. The target can be a new path on the shop's site or a full URL. The new URL can even be on a completely different domain. Redirect paths are unique, so a shop can't have more than one redirect with the same path.
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2019-07/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2019-07/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2019-07/redirects/#{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2019-07/redirects.json Creates a redirect
- PUT /admin/api/2019-07/redirects/#{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2019-07/redirects/#{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
page
deprecated |
The page of results to show. (default:1 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2019-07/redirects.json
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 304339089,
"path": "/products.php",
"target": "/products"
},
{
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
},
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2019-07/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2019-07/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2019-07/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2019-07/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034148,
"path": "/ipod",
"target": "/pages/itunes"
}
}
Create a redirect using a full URL for the path, which will be saved as an absolute path without a domain
POST /admin/api/2019-07/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034149,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2019-07/redirects/#{redirect_id}.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2019-07/redirects/#{redirect_id}.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2019-07/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
}
A redirect causes a visitor on a specific path on the shop's site to be automatically sent to a different location, called the target. The target can be a new path on the shop's site or a full URL. The new URL can even be on a completely different domain. Redirect paths are unique, so a shop can't have more than one redirect with the same path.
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2019-10/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2019-10/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2019-10/redirects/#{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2019-10/redirects.json Creates a redirect
- PUT /admin/api/2019-10/redirects/#{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2019-10/redirects/#{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2019-10/redirects.json
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 304339089,
"path": "/products.php",
"target": "/products"
},
{
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
},
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2019-10/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2019-10/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2019-10/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2019-10/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034148,
"path": "/ipod",
"target": "/pages/itunes"
}
}
Create a redirect using a full URL for the path, which will be saved as an absolute path without a domain
POST /admin/api/2019-10/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034149,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2019-10/redirects/#{redirect_id}.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2019-10/redirects/#{redirect_id}.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2019-10/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
}
A redirect causes a visitor on a specific path on the shop's site to be automatically sent to a different location, called the target. The target can be a new path on the shop's site or a full URL. The new URL can even be on a completely different domain. Redirect paths are unique, so a shop can't have more than one redirect with the same path.
What you can do with Redirect
The Shopify API lets you do the following with the Redirect resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-01/redirects.json Retrieves a list of URL redirects
- GET /admin/api/2020-01/redirects/count.json Retrieves a count of URL redirects
- GET /admin/api/2020-01/redirects/#{redirect_id}.json Retrieves a single redirect
- POST /admin/api/2020-01/redirects.json Creates a redirect
- PUT /admin/api/2020-01/redirects/#{redirect_id}.json Updates an existing redirect
- DELETE /admin/api/2020-01/redirects/#{redirect_id}.json Deletes a redirect
Redirect properties
id
read-only |
The ID for the redirect. |
path |
The old path to be redirected. When the user visits this path, they will be redirected to the target. (maximum: 1024 characters) |
target |
The target location where the user will be redirected. When the user visits the old path specified by the |
Endpoints
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
path
|
Show redirects with a given path. |
target
|
Show redirects with a given target. |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a list of all redirects
GET /admin/api/2020-01/redirects.json
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 304339089,
"path": "/products.php",
"target": "/products"
},
{
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
},
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
Retrieve a list of URL redirects after a specified ID
GET /admin/api/2020-01/redirects.json?since_id=668809255
View Response
HTTP/1.1 200 OK
{
"redirects": [
{
"id": 950115854,
"path": "/ibook",
"target": "/products/macbook"
}
]
}
path
|
Count redirects with given path. |
target
|
Count redirects with given target. |
Count all redirects
GET /admin/api/2020-01/redirects/count.json
View Response
HTTP/1.1 200 OK
{
"count": 3
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single redirect by its ID
GET /admin/api/2020-01/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/leopard",
"target": "/pages/macosx"
}
}
path
property, it will be saved as an absolute path without the domain.
For example, "path": "http://www.johns-apparel.com/springwear"
will be saved as "path": "springwear"
.
Create a redirect
POST /admin/api/2020-01/redirects.json
{
"redirect": {
"path": "/ipod",
"target": "/pages/itunes"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034148,
"path": "/ipod",
"target": "/pages/itunes"
}
}
Create a redirect using a full URL for the path, which will be saved as an absolute path without a domain
POST /admin/api/2020-01/redirects.json
{
"redirect": {
"path": "http://www.apple.com/forums",
"target": "http://forums.apple.com"
}
}
View Response
HTTP/1.1 201 Created
{
"redirect": {
"id": 979034149,
"path": "/forums",
"target": "http://forums.apple.com/"
}
}
Creating a redirect without a path or target fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"path": [
"can't be blank"
],
"target": [
"can't be blank",
"can't be the same as path"
]
}
}
Update the path URI of a redirect
PUT /admin/api/2020-01/redirects/#{redirect_id}.json
{
"redirect": {
"id": 668809255,
"path": "/tiger"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 668809255,
"path": "/tiger",
"target": "/pages/macosx"
}
}
Update both the path and target URIs of a redirect
PUT /admin/api/2020-01/redirects/#{redirect_id}.json
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
View Response
HTTP/1.1 200 OK
{
"redirect": {
"id": 950115854,
"path": "/powermac",
"target": "/pages/macpro"
}
}
Delete an existing redirect
DELETE /admin/api/2020-01/redirects/#{redirect_id}.json
View Response
HTTP/1.1 200 OK
{
}