post
https://{subdomain}.myshoplaza.com/openapi/2025-06/script_tags
Create and inject JavaScript tags into a shop's storefront pages.
Requireswrite_script_tagaccess 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:
- Adding custom JavaScript functionality to a shop's pages.
- Integrating third-party tracking scripts or widgets.
- Managing script tags programmatically for dynamic content.
Request Parameters
Public Request Parameters
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
script_tag | object | Yes | The script tag object containing configuration details | {...} |
script_tag.src | string | Yes | URL of the JavaScript file to be injected, must be valid and accessible | https:// www.shoplazza. com/x.js |
script_tag.display_scope | string | Yes | Determines where the script is displayed (e.g., 'all', 'online_store') | 'index' |
script_tag.event_type | string | No | Type of event that triggers the script, defaults to 'app' | 'myapp' |
Response Explanation
Public Response Parameters
Successful Response
| Parameter | Type | Example | Description |
|---|---|---|---|
code | string | "200" | HTTP status code |
message | string | "Success" | Operation result message |
data.script_tag | object | - | The updated script tag object |
Script Tag Object
| Parameter | Type | Example | Description |
|---|---|---|---|
id | string | "script_tag_123456789" | Unique identifier for the script tag |
display_scope | string | "index" | Indicates where the script tag is applied |
src | string | "https://shoplazza.com/x.js" | URL of the script file |
event_type | string | "myapp" | The tag type, as specified during creation |
created_at | string | "2025-06-15T10:30:00Z" | Timestamp when the script tag was created (ISO 8601 format) |
updated_at | string | "2025-06-15T11:45:00Z" | Timestamp when the script tag was last updated (ISO 8601 format) |
Error Response
| Field | Type | Example | Description |
|---|---|---|---|
code | string | InvalidParameter | Error http message |
message | string | `` | Error message |
