Swan icon

Swan

Consume Swan.io API

Overview

This node integrates with the Swan.io API to perform various operations related to financial accounts and transactions. It is useful for automating workflows that involve querying account details, updating account information, initiating credit transfers, managing consents, and retrieving transaction data.

Common scenarios include:

  • Retrieving detailed information about a specific account.
  • Updating an account's name.
  • Initiating multiple credit transfers from an account.
  • Granting consent using server-side signatures for secure authorization.
  • Querying transaction details by ID.

For example, a user can automate payment processing by initiating credit transfers programmatically or fetch account status updates as part of a reporting workflow.

Properties

Name Meaning
Authentication Selects the type of access token used: "User Access Token" or "Project Access Token".
Account ID The unique identifier of the account to query, update, or initiate transfers on. Required for operations: Query - Account, Initiate Credit Transfers, Update Account.
Operation The action to perform. Options include: Custom GraphQL query, Grant Consent with Server Signature, Initiate Credit Transfers, Update Account, Query Account, Query Transaction.
Consent Redirect URL URL to redirect after consent is granted. Required for initiating credit transfers.
Transaction ID Identifier of the transaction to query. Required for Query - Transaction operation.
Consent ID Identifier of the consent to grant. Required for Grant Consent with Server Signature.
Consent Challenge Challenge string used in consent granting. Required for Grant Consent with Server Signature.
Credit Transfers Collection of credit transfer details including amount, currency, beneficiary IBAN and name, label, and reference. Required for initiating credit transfers.
Name New name for the account when updating it. Required for Update Account operation.
Query Custom GraphQL query string. Required for Custom operation.
Variables JSON object containing variables for the custom GraphQL query. Required for Custom operation.

Output

The node outputs JSON data corresponding to the result of the selected operation:

  • Query - Account: Outputs the account details as returned by the Swan API.
  • Query - Transaction: Outputs transaction details.
  • Update Account: Outputs the updated account information.
  • Initiate Credit Transfers: Outputs the response from initiating credit transfers, typically including confirmation and status.
  • Grant Consent With Server Signature: Outputs the result of the consent granting process.
  • Custom: Outputs the raw JSON response from the custom GraphQL query.

No binary data output is produced by this node.

Dependencies

  • Requires valid API authentication tokens: either a user access token or a project access token depending on the operation.
  • For some operations (e.g., Grant Consent With Server Signature), a server consent private key must be configured in credentials.
  • Uses internal helper functions to make authenticated requests to the Swan API.
  • No additional external dependencies beyond the Swan API and n8n credential configuration.

Troubleshooting

  • Authentication Errors: Using the wrong token type for an operation will throw errors. For example, querying transactions requires a project token, while initiating credit transfers requires a user token.
  • Missing Required Parameters: Operations require specific parameters like Account ID, Transaction ID, or Consent Challenge. Omitting these will cause errors.
  • Server Consent Private Key Missing: Granting consent with server signature requires a configured private key; absence leads to an error.
  • Unsupported Operation: Selecting an operation not implemented by the node will throw an error.
  • API Request Failures: Network issues or invalid API credentials may cause request failures; ensure credentials are valid and network connectivity is stable.

To resolve errors:

  • Verify correct authentication method is selected.
  • Ensure all required fields for the chosen operation are filled.
  • Configure necessary credentials properly in n8n.
  • Check API limits and permissions on the Swan platform.

Links and References

Discussion