Create Script Tag

Create and inject JavaScript tags into a shop's storefront pages.

🔒

Requires write_script_tag access scope. More access scope

This Create Script Tag API endpoint allows developers to create and inject Script tags into stores' storefront pages.

This API is especially useful for:

  1. Adding custom JavaScript functionality to a shop's pages.
  2. Integrating third-party tracking scripts or widgets.
  3. Managing script tags programmatically for dynamic content.

Request Parameters

Public Request Parameters

📘

Query Parameters

ParameterTypeRequiredDescriptionExample
script_tagobjectYesThe script tag object containing configuration details{...}
script_tag.srcstringYesURL of the JavaScript file to be injected, must be valid and accessiblehttps:// www.shoplazza. com/x.js
script_tag.display_scopestringYesDetermines where the script is displayed (e.g., 'all', 'online_store')'index'
script_tag.event_typestringNoType of event that triggers the script, defaults to 'app''myapp'

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring"200"HTTP status code
messagestring"Success"Operation result message
data.script_tagobject-The updated script tag object

Script Tag Object

ParameterTypeExampleDescription
idstring"script_tag_123456789"Unique identifier for the script tag
display_scopestring"index"Indicates where the script tag is applied
srcstring"https://shoplazza.com/x.js"URL of the script file
event_typestring"myapp"The tag type, as specified during creation
created_atstring"2025-06-15T10:30:00Z"Timestamp when the script tag was created (ISO 8601 format)
updated_atstring"2025-06-15T11:45:00Z"Timestamp when the script tag was last updated (ISO 8601 format)

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!