Square icon

Square

Consume the Square API

Overview

This node integrates with the Square API to manage customer data. Specifically, the Customer - Search operation allows users to search for customers in their Square account based on specific criteria such as email address, phone number, or reference ID. It supports returning either all matching results or a limited subset.

Common scenarios where this node is useful include:

  • Finding customer records by contact details before creating new entries to avoid duplicates.
  • Retrieving customer information for marketing campaigns or customer support.
  • Filtering customers based on identifiers like reference IDs for targeted operations.

For example, a user could search for all customers with a particular email address or phone number and then use that data downstream in their workflow for personalized messaging or order processing.

Properties

Name Meaning
Return All Whether to return all matching customers or limit the number of results returned.
Limit Maximum number of customer records to return if "Return All" is false (minimum 1).
Search Fields Criteria to filter customers by:
- Email Address
- Phone Number
- Reference ID

Output

The node outputs an array of JSON objects representing customer records matching the search criteria. Each object corresponds to a customer entity as returned by the Square API, containing fields such as customer ID, name, contact details, and other metadata.

No binary data output is produced by this operation.

Dependencies

  • Requires a valid Square API authentication token configured in n8n credentials.
  • The node makes HTTP requests to the Square API endpoints, switching between sandbox and production URLs based on credential environment settings.

Troubleshooting

  • Empty Results: If no customers are returned, verify that the search fields are correctly specified and match existing customer data.
  • API Errors: Errors from the Square API (e.g., invalid credentials, rate limits) will be thrown. Ensure the API key is valid and has appropriate permissions.
  • Limit Misconfiguration: Setting "Limit" below 1 will cause validation errors; ensure it is at least 1.
  • Continue On Fail: If enabled, errors for individual items will be captured in the output instead of stopping execution.

Links and References

Discussion