How to connect Squarespace to API2Cart?
The first method, using the squarespace_api_key parameter, does the following:
-
To get squarespace_api_key:
It would be best if you went to the Squarespace administrator panel. Click on 'Settings,' select the 'Advanced' option from the menu, click 'Developer API Keys,' and then 'Create Key.'
- You need to navigate to the Squarespace administrator panel. Click on 'Settings', select the 'Advanced' option from the menu, click on 'Developer API Keys' and then 'Create Key'. You can find and manage your keys at https://{your-squarespace-site}.squarespace.com/config/settings/developer-tools/developer-api-keys.
If you plan to use webhooks on Squarespace, please connect using the second method. To connect Squarespace to API2Cart using the second method, utilizing squarespace_client_id, squarespace_secret, squarespace_access_token, squarespace_refresh_token parameters, follow these steps:
- Obtain your client_id and client_secret:
- Fill out the form at https://partner.squarespace.com/oauth-form to get your_client_id and your_client_secret.
- The application processing is manual and may take up to 7 days. After approval, Squarespace support will send your client_id and client_secret to the provided email.
- Authorize your application:
- Go to the following link in your browser: https://login.squarespace.com/api/1/login/oauth/provider/authorize
- Set the parameters:
client_id
- obtained in step 1redirect_uri
- callback URL for receiving POST requests with datascope
-required scopes (e.g., website.orders, website.orders.read, website.transactions.read, website.inventory, website.inventory.read, website.products, website.products.read)
state
- any value for CSRF protection, to be used in step 3access_type
- set as "offline"After clicking "Allow," you will be redirected to the specified callback URL with a parameter
code
, which is needed for the next step.- Make a POST request to the URL https://login.squarespace.com/api/1/login/oauth/provider/tokens with the following parameters:
grant_type
- set to "authorization_code" for the first request and "refresh_token" for token refreshcode
- the value obtained in step 2redirect_uri
- the URL to which the request with parameters will be sentrefresh_token
- specify the refresh_token in case of token refresh andgrant_type=refresh_token
- After step 3, you will receive a POST request to the callback URL specified in step 2 with the necessary parameters, including
access_token
andrefresh_token
. - Fill out the form in your application using the parameters:
squarespace_client_id
- client_id from step 1squarespace_client_secret
- client_secret from step 1squarespace_access_token
- access_token from step 3squarespace_refresh_token
- refresh_token from step 3
Exchange the code for tokens:
Use the obtained tokens in your application: