RedStage icon

RedStage

Consume Red Stage API

Overview

The RedStage node for n8n enables integration with the Red Stage API, specifically allowing users to search for shipments using flexible filters and options. The "Shipment: Search" operation is designed to retrieve a list of shipment records based on user-defined criteria such as fields to include, filtering conditions, sorting, and pagination.

Common scenarios:

  • Fetching shipments that match specific statuses or attributes.
  • Retrieving only selected fields (e.g., shipping address) for efficiency.
  • Paginating through large sets of shipment data.
  • Sorting shipments by a particular field in ascending or descending order.

Practical example:
A logistics manager wants to find all shipments with status "in transit", display only their IDs and shipping addresses, sorted by creation date, and limited to 20 results per page.


Properties

Name Type Meaning
Additional Fields collection A group of optional parameters to refine the search. See below for details.
└ Field to Show string Specify which fields should be included in the response (e.g., "*" for all, or "shipping_address").
└ JSON Search Filter json JSON object specifying filter conditions (e.g., { "status": { "eq": 1 } }).
└ Sort Field string The field name to sort the results by.
└ Sort Direction options Choose between "Ascending" (asc) or "Descending" (desc) sort order.
└ Page number The page number to retrieve (minimum: 1).
└ Limit number Maximum number of results to return (min: 1, max: 100).

Output

  • The output is an array of JSON objects, each representing a shipment record matching the search criteria.
  • The structure of each object depends on the "Field to Show" selection; it may include all fields or only those specified.
  • If an error occurs and "Continue On Fail" is enabled, the output will include an object with an error property containing the error message.

Example output:

[
  {
    "id": "12345",
    "shipping_address": "123 Main St, City, Country",
    "status": "in_transit"
  },
  {
    "id": "12346",
    "shipping_address": "456 Elm St, City, Country",
    "status": "in_transit"
  }
]

Or, in case of error (with Continue On Fail):

[
  {
    "error": "Invalid filter syntax"
  }
]

Dependencies

  • External Service: Requires access to the Red Stage API.
  • Credentials: Needs a configured redStageApi credential in n8n.
  • Environment: No special environment variables are required beyond standard n8n setup.

Troubleshooting

Common issues:

  • Invalid filter syntax: If the "JSON Search Filter" is not valid JSON or uses unsupported operators, the API may return an error.
  • Missing credentials: If the redStageApi credential is not set up, the node will fail to authenticate.
  • Unknown resource/operation: If the resource or operation names are incorrect, the node will throw an error indicating the resource is not known.

Error messages and resolutions:

  • "The resource \"shipment\" is not known!"
    Ensure you have selected the correct resource and operation.
  • "Invalid filter syntax"
    Double-check your JSON in the "JSON Search Filter" field for proper formatting.
  • "Authentication failed"
    Verify that your Red Stage API credentials are correctly configured in n8n.

Links and References

Discussion