Square icon

Square

Consume Square API

Overview

This node integrates with the Square API to perform various operations related to invoices, customers, and bookings. Specifically for the Invoice - Search operation, it allows users to search for invoices based on filters such as location IDs and customer IDs. This is useful in scenarios where you want to retrieve a list of invoices matching certain criteria, for example, all invoices for specific customers or locations.

Practical examples:

  • Retrieve all invoices for a particular store location.
  • Find invoices associated with specific customers.
  • Limit the number of returned invoices or fetch all matching invoices.

Properties

Name Meaning
Return All Whether to return all matching invoices or limit the results to a specified number.
Limit Maximum number of invoices to return (only applicable if "Return All" is false).
Search Fields Filters to narrow down the search:
- Location IDs: Comma-separated list of location IDs.
- Customer IDs: Comma-separated list of customer IDs.

Output

The output is an array of JSON objects representing the invoices that match the search criteria. Each object contains invoice details as returned by the Square API. The structure corresponds directly to the API response for invoice search results.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the Square API via an API key credential.
  • The node uses the Square API base URL, switching between sandbox and production environments based on the configured environment setting.
  • No additional external dependencies are required beyond the Square API access.

Troubleshooting

  • Common issues:

    • Providing invalid or empty filter values may result in no results or errors.
    • Exceeding API rate limits can cause request failures.
    • Not setting the correct environment (sandbox vs production) might lead to unexpected results.
  • Error messages:

    • Errors from the Square API will be propagated. For example, if authentication fails, an error indicating invalid credentials will appear.
    • If the "Limit" property is set below 1, the node may throw an error due to invalid input.
    • If the API returns an error, enabling "Continue On Fail" allows processing to continue with error details included in the output.

To resolve errors:

  • Verify API credentials and environment settings.
  • Ensure filter fields are correctly formatted (e.g., comma-separated strings).
  • Adjust limits and retry after some time if rate-limited.

Links and References

Discussion