Got questions? Leave your message here or Schedule a quick call with our manager now

How to connect Squarespace to API2Cart?

There are two ways to connect Squarespace to API2Cart. To connect Squarespace to API2Cart using the first method, utilizing the squarespace_api_key parameter, follow these steps:

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.'


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:
  1. 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.

  2. 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 1
      • redirect_uri - callback URL for receiving POST requests with data
      • scope - 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 3
      • access_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.
  3. Exchange the code for tokens:

    • 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 refresh
      • code - the value obtained in step 2
      • redirect_uri - the URL to which the request with parameters will be sent
      • refresh_token - specify the refresh_token in case of token refresh and grant_type=refresh_token

  4. Use the obtained tokens in your application:

    • After step 3, you will receive a POST request to the callback URL specified in step 2 with the necessary parameters, including access_token and refresh_token.
    • Fill out the form in your application using the parameters:

      • squarespace_client_id - client_id from step 1
      • squarespace_client_secret - client_secret from step 1
      • squarespace_access_token - access_token from step 3
      • squarespace_refresh_token - refresh_token from step 3

Posted in: Getting Started