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.
Servers
- https://connect.squareup.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
site_id |
String | Yes |
The ID of the site where you want to add or update the snippet. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
snippet |
Object | Yes |
Represents the snippet that is added to a Square Online site. The snippet code is injected into the |
snippet.id |
String | No |
The Square-assigned ID for the snippet. |
snippet.site_id |
String | No |
The ID of the site that contains the snippet. |
snippet.content |
String | Yes |
The snippet code, which can contain valid HTML, JavaScript, or both. |
snippet.created_at |
String | No |
The timestamp of when the snippet was initially added to the site, in RFC 3339 format. |
snippet.updated_at |
String | No |
The timestamp of when the snippet was last updated on the site, in RFC 3339 format. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.