Scripts
Add client-side code to a BigCommerce storefront page or associate a script with a channel. To learn more about scripts, see the Scripts API article.
Create a Script
POST https://api.bigcommerce.com/stores/{store_hash}/v3/content/scriptsRequest
Creates a Script.
Required Fields
- name
Read Only Fields
- uuid
Limits
- 50 scripts per channel.
Notes
- If the
kindissrc:- Specify the
srcproperty. - Optionally, you can supply a
load_method. - Do not specify the
htmlfield.
- Specify the
- If the
kindisscript_tag:- Specify the
htmlproperty. - Do not specify the
srcfield.
- Specify the
- Each app can have 10 scripts installed.
- Multiple scripts can be created per call.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
application/json
Script Source URL
HTML Script Tag
Response
example
Get All Scripts
GET https://api.bigcommerce.com/stores/{store_hash}/v3/content/scriptsRequest
Returns a list of Scripts. Optional parameters can be passed in.
This operation will only return scripts generated by the API key and password used to create the script originally.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- page in query - integerSpecifies the page number in a limited (paginated) list of products.
- limit in query - integerControls the number of items per page in a limited (paginated) list of products.
- sort in query - string
Field name to sort the scripts by. Note: Since
idincrements when new scripts are added, you can use that field to sort by script create date.Allowed: name | description | date_created | date_modified
- direction in query - string
Sort direction. Acceptable values are:
asc,desc.Allowed: asc | desc
- channel_id:in in query - arrayFilters list of scripts by the associated channel ID.Type: array[integer]
example
Response
Body
object | application/json
dataarray[object]
example
Get a Script
GET https://api.bigcommerce.com/stores/{store_hash}/v3/content/scripts/{uuid}Request
Returns a single Script.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- uuid in path - stringrequiredThe identifier for a specific script.Example: 03805148-a592-4803-9482-e91fe5c1be12
example
Response
example
Update a Script
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/content/scripts/{uuid}Request
Updates a Script.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- uuid in path - stringrequiredThe identifier for a specific script.Example: 03805148-a592-4803-9482-e91fe5c1be12
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
Body
application/json
example
Response
example
Delete a Script
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/content/scripts/{uuid}Request
Deletes a Script.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- uuid in path - stringrequiredThe identifier for a specific script.Example: 03805148-a592-4803-9482-e91fe5c1be12
example
Response
Body
object | application/json
No-content response for the BigCommerce API.
statusinteger
204 HTTP status code.
Example: 204titlestring
The error title describing the situation.typestring
instancestring
example
See something you can improve? Edit this file on GitHub
Did you find what you were looking for?