Trinks icon

Trinks

Nó N8N para interagir com a API do Trinks

Actions46

Overview

This node integrates with the Trinks API to retrieve loyalty points information related to customers. Specifically, for the Fidelidade resource and the GET /v1/fidelidade operation, it fetches loyalty data such as points earned, points used, points to be consumed, or points transferred for a given customer within optional date ranges and pagination settings.

Typical use cases include:

  • Retrieving a customer's loyalty points balance or history.
  • Filtering loyalty transactions by type (earned, used, etc.) and date range.
  • Paginating through large sets of loyalty records.

For example, a business could use this node to display a customer's current loyalty points or generate reports on points usage over time.

Properties

Name Meaning
Pessoa Fisica Cliente Id When provided, filters results by the customer's unique ID (id_pessoa).
Tipo Type of points to retrieve: 1 = Points earned, 2 = Points used, 3 = Points to consume, 4 = Points transferred.
Data Inicio Start date filter for the query (string format).
Data Fim End date filter for the query (string format).
Page Page number for paginated results (number).
Page Size Number of items per page in paginated results (number).

Output

The node outputs JSON data representing the response from the Trinks API for the requested loyalty points query. The structure depends on the API but typically includes details about loyalty points transactions matching the query parameters.

No binary data output is produced by this node.

Example output JSON might include fields like:

{
  "points": [
    {
      "transactionId": "12345",
      "type": 1,
      "points": 100,
      "date": "2024-01-01T12:00:00Z"
    }
  ],
  "page": 1,
  "pageSize": 10,
  "totalItems": 50
}

Dependencies

  • Requires an API key credential and an establishment ID credential to authenticate requests to the Trinks API.
  • The base URL for the API is https://api.trinks.com.
  • The node sends requests with headers including Accept: application/json, Content-Type: application/json, and authentication headers.

Troubleshooting

  • Common issues:

    • Missing or invalid API key or establishment ID will cause authentication failures.
    • Providing invalid dates or unsupported tipo values may result in API errors.
    • Pagination parameters (page and pageSize) should be valid numbers; otherwise, the API may return errors or unexpected results.
  • Error messages:

    • "Operation ... not found": This indicates an invalid operation name was specified. Ensure the operation matches exactly GET /v1/fidelidade.
    • HTTP errors from the API (e.g., 401 Unauthorized) usually indicate credential problems.
    • Network errors or timeouts may occur if the API endpoint is unreachable.

To resolve these:

  • Verify credentials are correctly configured.
  • Double-check input parameters for correctness.
  • Use the node's "Continue On Fail" option to handle errors gracefully during execution.

Links and References

Discussion