How to use IBM App Connect with Square

Square is a payments platform that is aimed at small and medium-sized companies that enable them to receive credit card payments and use tablet computers as payment logs for a point-of-sale system.

Availability:
  • App Connect Enterprise as a Service connector
  • A local connector in a Designer instance of IBM App Connect in containers (Continuous Delivery release)Local connector in containers (Continuous Delivery release) 12.0.9.0-r1 or later

Connecting to Square

Complete the connection fields that you see in the App Connect Designer Catalog page or flow editor. If necessary, work with your Square administrator to obtain these values.

Square connection fields:

Authorization method Connection field Description Applicability
API KEY Endpoint URL The URL for authenticating your Square instance. For example, in the sandbox environment, the endpoint URL is connect.squareupsandbox.com, and in the production platform, the endpoint URL is connect.squareup.com.
Note: For more information about Square sandbox and production environments, see Square Sandbox on the Square Developer page.
App Connect Enterprise as a Service and App Connect in containers
Personal access token The production access token or sandbox access token that is generated under the credentials section of your application in Square.
BASIC OAUTH Endpoint URL The URL for authenticating your Square instance. For example, in the sandbox environment, the endpoint URL is connect.squareupsandbox.com, and in the production platform, the endpoint URL is connect.squareup.com.
Note: For more information about Square sandbox and production environments, see Square Sandbox on the Square Developer page.
App Connect Enterprise as a Service and App Connect in containers
Client ID The production application ID or sandbox application ID generated under the OAuth section of your application in Square.
Client secret The production application secret or sandbox application secret that is generated under the OAuth section of your application in Square.
Access token The access token that is generated from the application client ID and client secret.
Refresh token The refresh token that is generated from the application client ID and client secret.
Redirect URI The URI (URL) to which Square will redirect the browser after authentication.
OAUTH 2.0 AUTH CODE
Tip: Authorize connection to Square by signing in to your account.
    App Connect Enterprise as a Service
To obtain the connection values for the Personal access token, Client ID, Client secret, Access token, Refresh token, and Redirect URI to connect to IBM® App Connect, do the following steps:
Note: Choose the applicable steps for the connection values based on the authorization method you selected.
  1. Log in to your Square account.
  2. To generate a personal access token:
    1. On the Square Developer Dashboard page, choose your application. To create a new application, see Create an account and application on the Square Developer page.
    2. On the sidebar, click Credentials.
    3. Copy the Sandbox or Production Access token (personal access token) value based on your requirement and save it somewhere safe.
    4. For more information, see Get a personal access token on the Square Developer page.
  3. To generate client ID, client secret, and redirect URI:
    1. On the Square Developer Dashboard page, choose your application. To create a new application, see Create an account and application on the Square Developer page.
    2. On the sidebar, click OAuth.
    3. Copy the Sandbox or Production Application ID (client ID) value based on your requirement and save it somewhere safe.
    4. Click Show, then copy your Sandbox or Production Application secret value based on your requirement and save it somewhere safe.
    5. On the Redirect URL box, enter the URL (URI) that redirects the seller authorization to your production application.
    6. Click Save.
    7. For more information, see Create the redirect URL on the Square Developer page.
  4. To generate an access token and refresh token from the client ID and client secret, see Create the Redirect URL and Square Authorization Page URL and Connect your Application to a Seller's Account Using OAuth on the Square Developer page.

To connect to a Square endpoint from the App Connect Designer Catalog page for the first time, expand Square, then click Connect. For more information, see Managing accounts.

Tip:

Before you use the account that is created in App Connect in a flow, rename the account to something meaningful that helps you to identify it. To rename the account on the Catalog page, select the account, open its options menu (⋮), then click Rename Account.

General considerations

Before you use App Connect Designer with Square, take note of the following considerations:

  • For more information about Square Idempotency key, see Idempotency on the Square Developer page.
  • (General consideration) You can see lists of the trigger events and actions that are available on the Catalog page of the App Connect Designer.

    For some applications, the events and actions in the catalog depend on the environment and whether the connector supports configurable events and dynamic discovery of actions. If the application supports configurable events, you see a Show more configurable events link under the events list. If the application supports dynamic discovery of actions, you see a Show more link under the actions list.

  • (General consideration) If you are using multiple accounts for an application, the set of fields that is displayed when you select an action for that application can vary for different accounts. In the flow editor, some applications always provide a curated set of static fields for an action. Other applications use dynamic discovery to retrieve the set of fields that are configured on the instance that you are connected to. For example, if you have two accounts for two instances of an application, the first account might use settings that are ready for immediate use. However, the second account might be configured with extra custom fields.

Events and actions

Square events

These events are for changes in this application that trigger a flow to start completing the actions in the flow.

Note: Events are not available for changes in this application. You can trigger a flow in other ways, such as at a scheduled interval or at specific dates and times.

Square actions

Your flow completes these actions on this application.

Object Action Description
Batch-change inventories Create batch-change inventory Applies adjustments and counts to the provided item quantities
Retrieve batch-change inventories Returns historical physical counts and adjustments based on the provided filter criteria
Customers Create customer Creates a new customer for a business
Retrieve customers Returns details for a single or multiple customers
Update customer Updates a customer profile
Update or create customer Updates or creates a customer profile
Delete customer Deletes a customer profile from a business
Invoices Create invoice Creates a draft invoice for an order created by using the Orders API
Retrieve invoices Retrieves an invoice or multiple invoices by using invoice ID
Update invoice Updates an invoice by modifying fields, clearing fields, or both
Update or create invoice Updates or creates an invoice by modifying fields, clearing fields, or both
Delete invoice Deletes the specified invoice
Orders Create order Creates a new order that can include information about products for purchase and settings to apply to the purchase
Retrieve orders Retrieves an order by ID
Update order Updates an open order by adding, replacing, or deleting fields. Orders with a COMPLETED or CANCELED state cannot be updated.
Update or create order Updates or creates an open order by adding, replacing, or deleting fields. Orders with a COMPLETED or CANCELED state cannot be updated.
Search orders Search all orders for one or more locations
Payments Create payment Creates a payment by using the provided source
Retrieve payments Retrieves details for a specific payment or multiple payments
Update payment Updates a payment with the APPROVED status
Update or create payment Update or creates a payment with the APPROVED status
Refunds Create payment refund Creates a refund for the entire payment amount or a portion of it. You can use this option to refund a card payment or record a refund of cash or external payment.
Retrieve payment refunds Retrieves a specific refund by using the refund ID or list of refunds for the account making the request

Examples

Dashboard tile for a template that uses Square

Use templates to quickly create flows for Square

Learn how to use App Connect templates to quickly create flows that complete actions on Square. For example, open the Templates gallery, and then search for Square.

Square flow in detailed view

Use IBM App Connect to build flows that integrate with Square.

Read the blog in the IBM Community to learn how to create a customer in Square when a customer is created in Shopify. Click Read the blog to go to the blog.