The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide.
Script Tag
script_tags
access scope.If your app integrates with a Shopify theme and you plan to submit it to the Shopify App Store, you must use theme app extensions instead of Script tags. Script tags can only be used with vintage themes. Learn more.
The ScriptTag resource represents remote JavaScript code that is loaded into the pages of a shop's storefront or the order status page of checkout. This lets you add functionality to those pages without using theme templates.
Script tags are scoped to the app that created them. When an app is uninstalled from a shop, all of the script tags that it created are automatically removed along with it.
Endpoints
- post/admin/api/latest/script_
tags. json Creates a new script tag - get/admin/api/latest/script_
tags. json Retrieves a list of all script tags - get/admin/api/latest/script_
tags/{script_ tag_ id}. json Retrieves a single script tag - get/admin/api/latest/script_
tags/count. json Retrieves a count of all script tagsdeprecated - put/admin/api/latest/script_
tags/{script_ tag_ id}. json Updates a script tag - del/admin/api/latest/script_
tags/{script_ tag_ id}. json Deletes a script tag
The ScriptTag resource
Properties
The DOM event that triggers the loading of the script. Valid values: onload
.
The ID for the script tag.
The URL of the remote script.
The page or pages on the online store where the script should be included. Valid values:
Show display_scope properties
online_store
: Include the script only on the web storefront.order_status
: Include the script only on the order status page.all
: Include the script on both the web storefront and the order status page.
Whether the Shopify CDN can cache and serve the script tag. Valid values:
Show cache properties
true
: The script will be cached and served by the CDN. The cache expires 15 minutes after the script tag is successfully returned.false
: The script will be served as is.
false
.The ScriptTag resource
Create a new script tag
Create a new script tag
Show script_tag properties
The DOM event that triggers the loading of the script. Valid values: onload
.
The URL of the remote script.
Creating a script tag without a src and event will return an error
Creating a script tag without a src and event will return an error
/admin/api/2025-07/script_ tags. json
Response
Retrieves a list of all script tags. Note: This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to Make paginated requests to the REST Admin API.
Show script tags created before this date. (format: 2014-04-25T16:15:47-04:00)
Show script tags created after this date. (format: 2014-04-25T16:15:47-04:00)
A comma-separated list of fields to include in the response.
The number of results to return.
Restrict results to after the specified ID.
Show script tags with this URL.
Show script tags last updated before this date. (format: 2014-04-25T16:15:47-04:00)
Show script tags last updated after this date. (format: 2014-04-25T16:15:47-04:00)
/admin/api/2025-07/script_ tags. json
Response
Retrieves a single script tag
A comma-separated list of fields to include in the response.
Retrieve a single script tag by its ID
Retrieve a single script tag by its ID
/admin/api/2025-07/script_ tags/596726825. json
Response
Retrieves a count of all script tags
Count only script tags with a given URL.
/admin/api/2025-07/script_ tags/count. json
Response
Update a script tag's URL
Update a script tag's URL
Show script_tag properties
The ID for the script tag.
The URL of the remote script.
/admin/api/2025-07/script_ tags/596726825. json
Response
Delete an existing script tag
Delete an existing script tag