Nuvem Solution icon

Nuvem Solution

Interact with Nuvem Solution API

Actions120

Cliente → Get Compras Por Ano

AI-generated

Overview

This node integrates with the Nuvem Solution API to retrieve customer purchase data filtered by year. Specifically, the "Cliente" resource with the "Get Compras Por Ano" operation fetches paginated purchase records for a given customer ID and year. This is useful for businesses that want to analyze or report on customer purchasing behavior over specific years.

Common scenarios:

  • Generating annual purchase reports for customers.
  • Analyzing customer buying trends year-over-year.
  • Feeding purchase data into dashboards or CRM systems for better customer insights.

Example use case:
A sales analyst wants to extract all purchases made by a particular customer in 2023, paginated 20 items per page, to identify seasonal buying patterns.

Properties

Name Meaning
Cliente ID The unique identifier (number) of the customer whose purchase data is being queried.
Ano The year (number) for which the customer's purchases are requested.
Page The page number (number) for paginating through the results; defaults to 1.
Page Size The number of items (number) to return per page; defaults to 20.

Output

The output is a JSON array containing the purchase records for the specified customer and year. Each item in the array represents a purchase entry with details as returned by the Nuvem Solution API endpoint /erp/crm/clientes/{clienteId}/comprasPorAno/{ano}.

The structure typically includes fields such as purchase identifiers, dates, amounts, and possibly product or service details, depending on the API's response schema.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to the Nuvem Solution API.
  • Requires credentials including:
    • Base URL of the API.
    • Software key.
    • Secret.
    • User ID.
    • User key.
  • These credentials must be configured in n8n under the appropriate credential type for authentication.
  • The node uses bearer token authentication obtained via an internal authentication request before making API calls.

Troubleshooting

  • Authentication failures:
    If the node throws errors related to authentication, verify that the software key, secret, user ID, and user key are correctly set and valid. Also, ensure the API base URL is correct and accessible.

  • Invalid customer ID or year:
    Errors may occur if the Cliente ID does not exist or the Ano is out of range. Confirm these inputs are valid and correspond to existing data in the system.

  • Pagination issues:
    If no data is returned, check that the Page and Page Size parameters are within valid ranges and that there is data available for those pages.

  • API connectivity problems:
    Network issues or incorrect base URL can cause request failures. Ensure network access to the API endpoint and correct configuration.

  • Error messages from API:
    The node surfaces error messages from the API. Review these messages for clues, such as rate limits, missing permissions, or malformed requests.

Links and References

Discussion