Applies to: Sites API | Snippets API
Learn how to use the Sites API to list the sites for a Square seller account.
You can use the Sites API to retrieve metadata about Square Online sites. The Sites API is used with the Snippets API to add and manage snippets on a Square Online site. For more information, see Snippets API.
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.
The ListSites endpoint retrieves the Square Online sites for a seller account. The following is an example request:
List sites
If successful, this endpoint returns a 200 OK
status code and a JSON response.
If the associated account has one or more sites, the response contains the sites. Sites are listed in descending order by the
created_at
date:{ "sites": [ { "id": "site_27807527648example", "site_title": "My Second Site", "domain": "mysite2.square.site", "is_published": false, "created_at": "2020-10-28T13:22:51.000000Z", "updated_at": "2021-01-13T09:58:32.000000Z" }, { "id": "site_10272534583example", "site_title": "My First Site", "domain": "mysite1.square.site", "is_published": true, "created_at": "2020-06-18T17:45:13.000000Z", "updated_at": "2020-11-23T02:19:10.000000Z" } ] }If the associated account has no sites, the response contains an empty object:
{}