Square icon

Square

Consume Square API

Overview

This node integrates with the Square API to manage invoices among other resources. Specifically, the "Invoice" resource with the "Get Many" operation allows users to retrieve multiple invoice records from their Square account. It supports fetching either all invoices or a limited number of them based on user preference.

Common scenarios where this node is beneficial include:

  • Synchronizing invoice data from Square into another system for reporting or analytics.
  • Automating workflows that require batch processing of invoices.
  • Monitoring recent invoices or retrieving historical invoice data for customer management.

For example, a user might configure this node to fetch the latest 50 invoices to generate a sales report or to trigger follow-up actions on unpaid invoices.

Properties

Name Meaning
Return All Whether to return all invoice results or only up to a specified limit.
Limit The maximum number of invoice results to return when "Return All" is set to false.

Output

The node outputs an array of JSON objects representing invoices retrieved from the Square API. Each object corresponds to one invoice and contains all the invoice details as provided by Square's API response.

If binary data were involved (e.g., PDF versions of invoices), it would be included in a separate binary property, but this operation focuses solely on JSON invoice data.

Dependencies

  • Requires an API key credential for authenticating with the Square API.
  • The node dynamically selects the base URL depending on whether the environment is set to sandbox or production.
  • No additional external dependencies are required beyond the configured Square API credentials.

Troubleshooting

  • Common Issues:

    • Exceeding API rate limits may cause errors; consider enabling retry logic or limiting request frequency.
    • Providing an invalid or expired API key will result in authentication errors.
    • Setting "Return All" to true on accounts with very large numbers of invoices may lead to long execution times or timeouts.
  • Error Messages:

    • Errors returned from the Square API are propagated. For example, if the API returns an error message about invalid parameters, verify the input properties.
    • If no invoices are found, the output will simply be an empty array without error.
    • If the "Limit" property is set below 1, the node will throw a validation error before making the API call.

Links and References

Discussion