Take Payments

Samples and SDKs

Use Square SDKs and sample applications to simplify development with Square APIs.

Connect Samples and SDKs

eCommerce Samples Product Management Samples OAuth Samples Other Samples
PHP, Node.js, Ruby, Python, Java, C# Catalog tool (Java) PHP, Ruby, Python, Java Connect v1 Samples

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

Generate Connect SDKs with Swagger

Connect v1 and Connect v2 SDKs are generated from an OAS (Open API Specification). The Connect OAS specification is available on Github.

You can use the Connect OAS definition to:

  • Generate SDKs for unsupported languages with the Swagger Code Generator.
  • Import the definition into a REST tool like Postman to simplify manual testing.

Mobile SDKs

Square offers the following SDKs for mobile development.

Prev
< Getting Started Guide
Next
Square Data Model >

Ask for help on Stack Overflow or join our Slack channel