Samples and SDKs

Square SDKs

Use Square SDKs to simplify development with Square APIs.

Install Connect SDKs

Manual installation

If you prefer to install the Connect SDK manually, download the SDK for your preferred language directly from GitHub:

Composer (PHP)

The PHP SDK is hosted on Packagist and can be installed with Composer. To install the Connect SDK:

  1. Add the Connect library to your dependencies:
php composer.phar require square/connect
  1. Download and install the new dependency:
php composer.phar install
  1. Add the SDK as a requirement in your code:
require 'vendor/autoload.php';

NPM (Node.js)

The Node.js SDK can be installed as an NPM package. To install the Connect SDK:

  1. Download the package:
npm install --save square-connect
  1. Add the SDK as a requirement in your code:
const SquareConnect = require('square-connect');

Gems (Ruby)

The Ruby SDK can be installed as a gem. To install the Connect SDK:

  1. Download the gem:
gem install square_connect
  1. Add the SDK as a requirement in your code:
require 'square_connect'

PyPI (Python)

The Python SDK can be installed as a PyPI package. To install the Connect SDK:

  1. Download the package:
pip install squareconnect
  1. Import the SDK in your code:
import squareconnect

Maven and Gradle (Java)

The Java SDK can be installed with Maven or Gradle.

Maven

To install the Connect SDK with Maven, add the connect artifact as a dependency in your pom.xml file:

<dependency>
    <groupId>com.squareup</groupId>
    <artifactId>connect</artifactId>
    <version>[2.0.0,)</version>
    <scope>compile</scope>
</dependency>

Gradle

To install the Connect SDK with Gradle, add the library as a build dependency in build.gradle:

compile "com.squareup:connect:2.+"

Nuget (C#)

The C# SDK can be installed as a nuget package on Windows, MacOS, and Linux.

Windows

  1. Install the SDK from the Nuget Package Manager Console:
Install-Package Square.Connect
  1. Add Square.Connect.dll as a requirement for your project.
  2. Add the SDK as a requirement in your code with the following namespaces:
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;

MacOS and Linux

  1. Install the SDK from the command line:
nuget install Square.Connect
  1. Add Square.Connect.dll as a requirement for your project.
  2. Add the SDK as a requirement in your code with the following namespaces:
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;

Connect Postman Collection

Postman is an app for easy RESTful API exploration. Use the Connect Postman Collection to quickly and easily test API requests during development.

Click the button below to explore Connect API collection:

Button

Mobile Solutions

Square offers the following solutions for mobile development.

Contact Developer Support, join our Slack channel, or ask for help on Stack Overflow