Printcart icon

Printcart

Consume Prinrcart API

Actions83

Overview

This node integrates with the Printcart API to manage various resources related to print-on-demand products and designs. Specifically, for the Template resource with the Get List of Template operation, it fetches a list of templates from the Printcart platform.

Use cases include:

  • Retrieving available design templates to display or process in workflows.
  • Automating template management by fetching templates programmatically.
  • Filtering and sorting templates based on criteria like limit, sort order, and sort field.

Example scenario: You want to get the latest 10 templates sorted by their ID in descending order to update your product catalog or trigger further processing.

Properties

Name Meaning
Authentication Method of authentication; currently supports "API Token"
Limit Maximum number of template results to return (minimum 10)
Sort Sorting direction for the results; options are "Desc" (descending) or "Asc" (ascending)
Sort By Field by which to sort the templates; default is "id"

Output

The node outputs an array of JSON objects representing the templates retrieved from the Printcart API. Each object corresponds to a template and includes all data fields returned by the API for that template.

No binary data output is involved in this operation.

Dependencies

  • Requires an API token credential for authenticating requests to the Printcart API.
  • The node makes HTTP GET requests to the endpoint:
    https://{sid}:{secret}@api.printcart.com/v1/templates with query parameters for limit, sort, and sortBy.
  • The sid and secret values are obtained from the API token credentials configured in n8n.

Troubleshooting

  • Authentication errors: Ensure the API token credential is correctly set up and has valid permissions.
  • Invalid parameter values:
    • The Limit must be at least 10. Values below this may cause errors or unexpected behavior.
    • The Sort option must be either "Asc" or "Desc".
    • The Sort By field should correspond to a valid sortable field in the Printcart API.
  • Network issues: Verify network connectivity to api.printcart.com.
  • API rate limits: If many requests are made rapidly, the API might throttle requests. Implement retry logic or reduce request frequency.
  • Empty results: If no templates are returned, check if the account has any templates or adjust filter parameters.

Links and References

Discussion