Square icon

Square

Consume the Square API

Overview

This node interacts with the Square API to manage invoices. Specifically, the "Get Many" operation under the "Invoice" resource retrieves multiple invoice records from a Square account. It supports fetching either all invoices or a limited number of them.

Common scenarios where this node is useful include:

  • Synchronizing invoice data from Square into another system or database.
  • Generating reports based on recent or all invoices.
  • Automating workflows that require batch processing of invoices, such as sending reminders or updating statuses.

For example, you could use this node to fetch the latest 50 invoices for review or to retrieve all invoices for a given period to export them to a spreadsheet.

Properties

Name Meaning
Return All Boolean option to decide whether to return all invoices or limit the number of results.
Limit Maximum number of invoices to return when "Return All" is false. Minimum value is 1.

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 /invoices endpoint.

If binary data were involved (e.g., PDF versions of invoices), it would be included in the output's binary property, but this node only returns JSON data related to invoices.

Dependencies

  • Requires an API authentication token credential for Square API access.
  • The node uses the Square API base URL, switching between sandbox and production environments based on the credential environment setting.
  • No additional external dependencies are required beyond the configured Square API credentials.

Troubleshooting

  • Common issues:

    • Exceeding API rate limits may cause errors; ensure your usage complies with Square's API policies.
    • Providing invalid or expired API credentials will result in authentication errors.
    • Setting "Limit" to zero or a negative number will likely cause validation errors.
  • Error messages:

    • Errors returned from the Square API (e.g., invalid parameters, unauthorized access) are propagated and can be caught if "Continue On Fail" is enabled.
    • If no invoices are found, the output will simply be an empty array without error.

To resolve errors:

  • Verify API credentials and permissions.
  • Check parameter values, especially "Limit".
  • Enable "Continue On Fail" to handle partial failures gracefully.

Links and References

Discussion