<- Snippets API

Snippets API

All versions ->

Upsert snippet

POST

 /v2/sites/{site_id}/snippet

Adds a snippet to a Square Online site or updates the existing snippet on the site.

The snippet code is appended to the end of the head element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site.

You can call ListSites to get the IDs of the sites that belong to a seller.

Note: Square Online APIs are publicly available as part of an early access program. For more information, see Early access program for Square Online APIs.

Permissions:ONLINE_STORE_SNIPPETS_WRITE
Try in API Explorer
Link to section

Path parameters

Example code

Link to section

site_id

string

Required

The ID of the site where you want to add or update the snippet.

Link to section

Request body

Link to section

snippet

Required

The snippet for the site.

Link to section

Response fields

Link to section

errors

Any errors that occurred during the request.

Link to section

snippet

The new or updated snippet.