Update Script Tag

🔒

Requires write_script_tags access scope.More access scope

The Update Script Tag API allows updating an existing script tag in a shop's storefront. This is useful for modifying the behavior, appearance, or scope of the existing script.

This API is especially useful for:

  1. Modifying script tags after deployment for improved functionality.
  2. Correcting or updating script configurations without creating new tags.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

ParameterTypeRequiredDescriptionExample
idstringYesUnique identifier of the script tag.f50950fa-40ec-441f-b98d-e1869050bdf2

Body Parameters

ParameterTypeRequiredDescriptionExample
srcstringYesScript file URLhttps://www.shoplazza.com/x.js
display_scopestringOptionalDisplay scope.index
event_typestringOptionalTag type. Defaults to app.myapp

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Success Response

FieldTypeDescriptionExample
idstringScript's unique IDf50950fa-40ec-441f-b98d-e186905dbf2
display_scopestringUpdated display scopeindex
event_typestringUpdated tag typeapp
srcstringUpdated script file URLhttps://www.shoplazza.com/x.js
created_atstringCreation timestamp2024-04-29T03:22:50Z
updated_atstringLast updated timestamp2024-04-29T05:59:40Z

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.

FieldTypeExampleDescription
errorString "page not found"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
404Not foundScript's ID is empty or not provided"record not found"
422Unprocessable Entitythe src url provided is not valid"src not is file url"

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!