REST over HTTPS, versioned per API
All Commerce APIs are REST over HTTPS, with the version of each API in the path, after api.squarespace.com. The Products API is on v2. Every request needs a User-Agent header; requests without one are rejected.
Extensions, OAuth and API keys
A third-party app is a Squarespace Extension, and extensions must use OAuth. A refresh token works once: each refresh returns a new pair, and the old refresh token stops working as soon as the new access token is used. A site owner on the Commerce Advanced plan can instead create an API key.
| Credential | Who it is for | Lifetime |
|---|---|---|
| Access token | An extension, through OAuth | 30 minutes |
| Refresh token | An extension, through OAuth | 7 days, single use |
| API key | A site owner on Commerce Advanced | Never expires while the site is active |
Scroll sideways to see every column.
Rate limits
The Commerce APIs allow 300 requests a minute, five a second. A request over the limit gets a 429 Too Many Requests and a cool-down of one minute. Creating orders with an API key has a stricter limit of its own: 100 requests an hour per website. The docs do not say whether the 300 is counted per key, per site or per extension.
Products and variants
A product has variants, each with its own SKU, pricing and stock. A physical product’s variant attributes are at most six key-value pairs, and Squarespace’s help center sets the limits at six options and 250 variants per product.
Writing prices, one variant at a time
The Products API has no batch or bulk endpoint. A price changes through the update of one variant, which accepts partial updates, so a large price update is one request per variant, inside the limit of 300 a minute.
POST /v2/commerce/products/{productId}/variants/{variantId} Authorization: Bearer … User-Agent: your-extension/1.0 Content-Type: application/json { "pricing": { "present": true, "value": { "basePrice": { "present": true, "value": { "currency": "USD", "value": 45.00 } } } } }
Pagination and webhooks
Product lists page with a cursor, up to 50 products a page, ordered by when they were last modified. Squarespace’s webhooks cover extension uninstall, orders, contacts and addresses, and none of them is about products or stock; subscribing needs an OAuth token.