What type of API does Squarespace provide?
Squarespace uses a REST API architecture. The key points about Squarespace's API are:
Type of API
Squarespace uses a REST API.
Key Features of Squarespace's REST API
- It provides APIs for different functionalities like Forms, Orders, Inventory, Transactions, etc.
- It requires API keys for authentication and access.
- Different APIs are available based on the Squarespace plan:
- Forms API is available on Business and higher plans
- Orders, Inventory and Transactions APIs are available on Commerce Advanced and Premium plans
- It allows syncing store data like orders, inventory and transactions with third-party services.
- There are APIs for inventory management, order management and syncing, product management, transaction syncing, and webhook subscriptions.
API Documentation
Squarespace provides detailed API documentation for developers on their Developer Site.
Security
- API keys are used for authentication and need to be kept secure.
- API keys can be revoked if needed.
Best Practices
- Treat API keys like passwords and keep them secure.
- Save API keys securely as they cannot be retrieved later.
Does the Squarespace API have webhooks?
Yes, the official Squarespace API does have webhooks. Here are the key points about Squarespace webhooks:
Webhook Support
Squarespace offers webhook functionality through their Webhook Subscriptions API.
Event Types
You can subscribe to the following types of events:
-
Extension events:
extension.uninstall
- Triggered when an extension is uninstalled
-
Commerce order events:
order.create
- Triggered when a new order is created
order.update
- Triggered when an existing order is updated
Key Points
- To receive notifications, you need to create a webhook subscription using the Webhook Subscriptions API.
- Each webhook subscription requires an HTTPS endpoint URL to receive notifications.
- You can have up to 25 webhook subscriptions per Squarespace website.
- Webhook notifications include a signature header for verification purposes.
- Some event subscriptions (like order events) require specific OAuth access permissions.
Webhook Payload
The webhook notification payload includes:
- A unique notification ID
- The Squarespace website ID that triggered the notification
- The subscription ID
- The event topic (e.g., "extension.uninstall")
- A timestamp of when the notification was created
- Event-specific data
Best Practices
- Store the webhook secret securely to verify incoming notifications.
- Implement proper error handling and retries for your webhook endpoint.
- Use the test notification endpoint provided by Squarespace to validate your webhook setup.
In summary, Squarespace's webhook system allows developers to subscribe to various events related to extensions and commerce orders, providing real-time notifications for integration purposes.
Rate Limits and other limitations
The Squarespace API has the following rate limits:
General Rate Limit
- 300 requests per minute (equivalent to 5 requests per second) [1]
Create Order Endpoint Specific Limit
- 100 requests per hour, per website when using an API Key for authentication [1][4]
Key Points to Consider
- Requests exceeding the rate limit receive a 429 Too Many Requests response [1]
- There's a cool down period of one minute after exceeding the rate limit [1]
- The stricter rate limit for the Create Order endpoint does not apply when using OAuth for authentication [1]
Best Practices
- Space out your requests to avoid hitting the rate limits [4]
- Use OAuth authentication for the Create Order endpoint if you need to make more than 100 requests per hour [1]
- Implement proper error handling for 429 responses in your application
- Consider caching frequently accessed data to reduce the number of API calls
Additional Information
- The rate limits are in place to ensure fair usage of the API and maintain system stability
- If you consistently need higher rate limits, you may need to contact Squarespace Customer Care for assistance [1]
- Always include proper headers in your requests, such as Authorization and User-Agent, as specified in the Squarespace API documentation
By adhering to these rate limits and following best practices, you can effectively integrate with the Squarespace API while ensuring smooth operation of your application.
Latest API Version
Based on the search results provided, here is the most up-to-date information about the Squarespace API versions:
Current API Versions
The Squarespace API does not have a single overall version number. Instead, each individual API within the Squarespace ecosystem has its own version number [1]. The current versions for some of the key APIs are:
- Products API: Version 1.0 (as of October 31, 2023, which introduced read-only access to download products) [2]
- Inventory API: No specific version mentioned, but it was introduced on June 6, 2019 [2]
- Orders API: No specific version mentioned, but it allows importing orders as of July 13, 2020 [2]
- Transactions API: No specific version mentioned [4]
- Webhook Subscriptions API: No specific version mentioned [4]
API Structure and Versioning
Squarespace uses the following format for API requests [1]:
https://api.squarespace.com/{api-version}/{resource-path}
For example:
https://api.squarespace.com/1.0/commerce/orders
Key Points to Consider
-
Backward-compatible changes are embedded in existing API versions [1].
-
New resource fields may be added to Commerce APIs to expose additional data, so developers should design their applications to handle new fields without breaking [1].
-
Squarespace supports legacy API versions for an extended period, and documentation for supported legacy versions is provided per API [1].
-
The most recent significant update was on October 31, 2023, when a new version of the Products API was released to enable read-only access to download products [2].
-
API keys are required to authenticate and access the Squarespace APIs. These keys can be generated with specific permissions for different APIs (Orders, Forms, Inventory, Transactions) [5].
Best Practices
-
Always check the specific API documentation for the most up-to-date version information and features.
-
Keep your applications flexible to handle new fields that may be added in future updates.
-
Use the appropriate API key with the correct permissions for the API you're accessing.
-
Regularly check the Squarespace Developer documentation and changelog for updates and new features.
In conclusion, while there isn't a single "most recent version" of the Squarespace API, developers should refer to the individual API documentation for the most current version information and features for each specific API they intend to use.
How to get a Squarespace developer account and API Keys?
Here are the key steps to get a developer account for Squarespace to create an API integration:
-
Sign up for a Squarespace account with a Commerce Advanced or Premium plan, as the Commerce APIs are only available on those plans.
-
Once you have an account, go to Settings > Advanced in your Squarespace admin panel.
-
In the Advanced settings, you'll find a section to generate API keys. Add a key name and select which Commerce APIs you want to access (e.g. Orders, Inventory, Transactions).
-
Generate the API key. Make sure to copy and save it securely, as it will only be shown once.
-
Use the generated API key to authenticate your requests to the Squarespace Commerce APIs.
Key points to consider:
- API keys are specific to a single Squarespace site, so you'll need to generate a new key for each site you want to integrate with.
- Treat your API key like a password - keep it secure and don't share it publicly.
- For more advanced integrations or to build a public Squarespace Extension, you'll need to use OAuth instead of API keys. This requires applying to become an official Squarespace developer partner.
- Review the Squarespace developer documentation for details on how to use the APIs and best practices for integration.
What can you do with the Squarespace API?
Here are the key data models you can interact with using the Squarespace API, along with what is possible for each:
Inventory API
- Read and adjust stock information for product variants
- Sync Squarespace inventory with external inventory management systems
Orders API
- Access order history for one-time purchases and subscription orders
- Import orders from third-party sales channels
- Sync Squarespace orders with shipping and fulfillment services
Products API
- Create, edit, and remove physical products
- Manage product variants and images
Profiles API
- Retrieve customer data
- Access mailing list subscribers
- Get donor information
Transactions API
- Access financial transactions for orders and donations
- Sync transactions with accounting services
Webhook Subscriptions API
- Subscribe to notifications from a Squarespace site
- Get notified of events like when an order is created
Forms API (for Zapier integration)
- Connect form submissions to Zapier automations
- Trigger workflows based on form submissions
Some key points to note:
- These APIs allow syncing Squarespace data with external systems and services
- They are designed for merchants to build custom integrations
- API access requires appropriate Squarespace plan levels (e.g. Commerce Advanced for Orders/Inventory APIs)
- Authentication and permissions are used to keep merchant data secure
- The APIs follow REST principles and use standard HTTPS features
So in summary, the Squarespace API provides programmatic access to core commerce and customer data, enabling integrations with external business systems and workflows.