Docs
Management API
Scripts

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 /content/scripts

Request

Creates a Script.

Required Fields

  • name

Read Only Fields

  • uuid

Limits

  • 50 scripts per channel.

Notes

  • If the kind is src:
    • Specify the src property.
    • Optionally, you can supply a load_method.
    • Do not specify the html field.
  • If the kind is script_tag:
    • Specify the html property.
    • Do not specify the src field.
  • Each app can have 10 scripts installed.
  • Multiple scripts can be created per call.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

Body

application/json

Script Source URL

HTML Script Tag

Response

Body

object | application/json

For a list of all locations visit Scripts Visibility.

  • data

  • meta
    object

    Response metadata.

example

Get All Scripts

GET /content/scripts

Request

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
    required

Parameters

  • store_hash in path - string
  • page in query - integer

    Specifies the page number in a limited (paginated) list of products.

  • limit in query - integer

    Controls 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 id increments 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 - array

    Filters list of scripts by the associated channel ID.

    Type: array[integer]

example

Response

Body

object | application/json
  • data
    array[object]

  • meta
    object

    Data about the response, including pagination and collection totals.

example

Get a Script

GET /content/scripts/{uuid}

Request

Returns a single Script.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

example

Response

Success

Body

object | application/json

For a list of all locations visit Scripts Visibility.

  • data

  • meta
    object

    Response metadata.

example

Update a Script

PUT /content/scripts/{uuid}

Request

Updates a Script.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

Body

application/json

example

Response

Body

object | application/json

For a list of all locations visit Scripts Visibility.

  • data

  • meta
    object

    Response metadata.

example

Delete a Script

DELETE /content/scripts/{uuid}

Request

Deletes a Script.

Authentication

  • X-Auth-Token in header
    required

Parameters

  • store_hash in path - string

example

Response

Body

object | application/json

No-content response for the BigCommerce API.

  • status
    integer

    204 HTTP status code.

    Example: 204
  • title
    string

    The error title describing the situation.

  • type
    string

  • instance
    string

example

Did you find what you were looking for?