Reputation: 8941
I'm looking for a minimal set of directions that allow me to do this. Unfortunately, Shopify app documentation is not great.
Upvotes: 0
Views: 113
Reputation: 4096
You can create a ScriptTag by making a POST request to the /admin/script_tags.json
endpoint. Your app would need the write_script_tags
scope. Here is an example using curl:
curl -H "Content-Type: application/json" -H "X-Shopify-Access-Token: youraccesstokengoeshere" -X POST "https://yourstore.myshopify.com/admin/script_tags.json" -d '{
"script_tag": {
"event": "onload",
"src": "https://yoursite.com/yourscript.js"
}
}'
https://docs.shopify.com/api/uiintegrations/scripttag#create
Upvotes: 3