Get Started with Square APIs
Start building with Square in 7 easy steps.
Step 1: Create a Square account
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.
Step 2: Create a new application
When you create a new application, Square generates credentials (linked to that application) that you can use to work with Square APIs.
To create a new application:
- Open the Application Dashboard.
- Click New Application (or Create Your First Application if your account is brand new).
- Enter a name for your application.
- Agree to Square's Developer Terms of Service and click Create Application.
Step 3: Get to know the application control panel
Click on the application you created in Step 2 to open the application control panel. The control panel includes multiple tabs 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.
- Point of Sale API — configure the Point of Sale API for your mobile custom solution.
- Apple Pay — configure Apple Pay for 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.
Step 4: Understand the different application credentials
The application control panel provides a variety of credentials for accessing Square services. You will need to use different credentials depending on how your application will be used.
|Personal access token||Full-access (unscoped) authorization credential.||Grants full production access to the corresponding Square account.||Found on the Credentials tab of the application control panel.|
|Sandbox token||Full access (unscoped) authorization credential.||Grants full sandbox access to the corresponding Square account.||Found on the Credentials tab of the application control panel.|
|Application ID||Random, unique ID assigned by Square.||Identifies your application in mobile API calls, OAuth requests, and in the Square Payment form.||Found on the Credentials tab of the application control panel.|
|Application Secret||OAuth authentication credential.||Authenticates your application identity in OAuth requests.||Found on the OAuth tab of the application control panel.|
|OAuth token||Scoped authorization credential.||Grants limited access to a Square account by asking the account owner for explicit permissions.||Requested programmatically using the OAuth API.|
Step 5: Try it out!
Now we will use your sandbox token and sandbox location ID to process a test credit card payment.
To find your sandbox token and sandbox location ID:
- Go to the Application Dashboard.
- Click on your application to open the application control panel.
- Click on the Credentials tab to find your sandbox token.
- Click on the Locations tab to find the Sandbox location ID for "Coffee & Toffee SF".
Now use the tool below to send a Charge request with a test credit card nonce:
- Paste your sandbox token in the Sandbox Token field.
- Paste a sandbox location ID in the location_id field.
- Select "Transactions" from the API dropdown and "Charge" from the Endpoint dropdown.
- Update the default JSON block in the Request text area:
idempotency_keyto any unique string, for example
- Click Send Request. The response body will appear as JSON under Response.
Step 6: Get to know Square's APIs and SDKs
Square's Developer Platform provides a variety of development tools:
- Connect v1 API Suite — supports webhooks and employee, role, and timecard management. Payment and item management functionality in the v1 suite is still fully supported but provided primarily for backward compatibility. New applications should use the Connect v2 API Suite for payments and item management.
- Connect v2 API Suite — supports online payments, order creation for itemized transactions, product catalog management, and customer management.
- Connect SDKs — simplify development by encapsulating the Connect v1 and Connect v2 API suites. Available for PHP, Node.js, Ruby, Python, Java, and C#.
- Mobile APIs and SDKs — support in-person payments for mobile web and custom mobile (iOS and Android) applications.
The Connect v2 API Suite also has a Swagger specification available on Github. If your preferred language is not supported by the official Connect SDKs, you can use the Swagger specification to generate custom client libraries. See Generating client libraries and other tools with Swagger for more information.
Step 7: Start building with Square
Take payments securely on your website with full control of the checkout process using the Transactions API and Square Payment Form.