Build with Square

Get Started with Square APIs, SDKs, and Plugins

Start building with Square in 6 easy steps.

Step 1: Create a Square account
Permalink Get a link to this section

Square provides collections of APIs that work together to solve a variety of problems, including online payments (eCommerce), in-person payments (point of sale), product management, customer management, and business management.

To work with Square APIs, you must create a Square account or login to an existing account.


Square API support for credit card and card on file processing is currently limited to the United States, Canada, Japan, Australia, and the United Kingdom.

Cash payments and non-payment API functionality (e.g., employee management, timecards, catalog) is supported everywhere Square accounts are available.

Step 2: Create a new application
Permalink Get a link to this section

To create a new application:

  1. Open the Application Dashboard.

  2. Click New Application (or Create Your First Application if your account is brand new).

  3. Enter a name for your application.

  4. Agree to the Square Developer Terms of Service

  5. Click Create Application.


You can test payment processing in the Sandbox right away. To process payments in production, you need to visit to activate payment processing on the target account or Square will return an error.

Step 3: Get to know the application settings pages
Permalink Get a link to this section

Click on the application you created in Step 2 to open the application settings pages. The application settings pages includes multiple pages with different values and settings you may need while developing your application:

  • Credentials — manage application credentials for production and sandbox.

  • OAuth — manage the OAuth workflow for your custom solution.

  • Webhooks — configure and enable webhooks.

  • Reader SDK — configure the Reader SDK for your custom mobile solution.

  • Point of Sale API — configure the Point of Sale API for your custom mobile solution.

  • Apple Pay — configure Apple Pay on the Web for eCommerce solutions using the Square payment form.

  • Locations — display production and sandbox location IDs for the Square account. Location IDs are listed in the application control panel for convenience.


The Application Dashboard is defaulted to the Sandbox Settings mode and provides app credentials for the Sandbox environment. When you are ready to deploy your app to the production environment, set dashboard to Production Settings mode and replace the sandbox credentials in your app configuration code with production credentials.

Step 4: Understand the different application credentials
Permalink Get a link to this section

The application settings pages provide a variety of credentials for accessing Square services. You will need to use different credentials depending on how your application will be used.

Read about Square application credential types to learn about different application credentials.

Step 5: Try it out
Permalink Get a link to this section

Use your sandbox access token and location ID with the tool below to send a Payment request with a test nonce to process a credit card payment.

Get application sandbox credentials
Permalink Get a link to this section

  1. Open the Developer Dashboard and select an application. The Credentials page for the selected app is shown.

  2. Set the dashboard mode to Production Settings for a production application ID or Sandbox Settings for a sandbox application ID (used in testing).

  3. Copy the Sandbox Application ID and the Sandbox Access Token in the Credentials section of the page.

Command Line
Permalink Get a link to this section

If you are using a Mac, open a terminal. If using Windows, open a PowerShell session.

  1. Update the Authorization header by replacing {{ACCESS_TOKEN}} with your Sandbox Personal Access Token.

  2. Update the default JSON block in the payload of the command:

    • Set idempotency_key to any unique string, for example TESTKEY123.

    • Set source_id to cnon:card-nonce-ok.

  3. Copy the command and paste it into the command line

  4. Run the command

Permalink Get a link to this section

curl -X POST \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{ACCESS_TOKEN}}' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
    "idempotency_key": "{{UNIQUE-KEY}}",
    "autocomplete": true,
    "amount_money": {
      "amount": 100,
      "currency": "USD"
    "source_id": "cnon:card-nonce-ok"
}' \

Permalink Get a link to this section

$authHeader = @{ Authorization = 'Bearer  {0}' -f "{{ACCESS_TOKEN}}" }
$body = '{
    "idempotency_key": "{{UNIQUE-KEY}}",
    "autocomplete": true,
    "amount_money": {
      "amount": 100,
      "currency": "USD"
    "source_id": "cnon:card-nonce-ok"

Invoke-RestMethod -Uri |
   -Method Post |
   -ContentType "application/json" |
   -Headers $authHeader |
   -Body $body 

Step 6: Start building!
Permalink Get a link to this section

Square Developer Platform provides a variety of development tools:

  • Square API Suite — supports online payments, order creation for itemized transactions, product catalog management, customer management, and employee time keeping.

  • Webhooks — supports push notifications for Square catalog , inventory, and labor APIs. Future Square API releases will support additional webhooks.

  • Sandbox — supports the Square API suite in an isolated sandbox testing environment. Also supports Webhooks notifications on API operations in the Sandbox environment.

  • Square SDKs — simplify development by encapsulating the Connect v1 and Square API suites. Square SDKs are available for PHP, Node.js, Ruby, Python, Java, and .NET.

  • Connect v1 API Suite — Most of the v1 endpoints are deprecated and replaced with Square API endpoints. Connect v1 is provided primarily for backward compatibility. Existing v1 application developers can use Square API Migration Guides to learn about migrating to the Square API suite.

  • Mobile APIs and SDKs — support in-person payments for mobile web and custom mobile applications:

    • Reader SDK — accepts payments in native Android and iOS apps.

    • Point of Sale API — calls the Square Point of Sale app from native Android and iOS, and mobile web apps.

    • In-App Payments SDK — accepts payments in native Android and iOS apps on buyer's devices.

  • Open Source Plugins — support development in multi-platform application development frameworks. Plugins are available for Reader SDK ( Flutter, React Native) and In-App Payments SDK ( Flutter, React Native).

Did you know?

You can use HTTPS request tools like API Explorer, Postman, Paw or Insomnia to quickly and easily test API requests during development. HTTPS request tools provide customized environments and parameterization of API calls that let you call endpoints without having to write code.

See Testing Square APIs with Postman for more information on using our pre-configured API collections.