edahab

n8n community node for the eDahab payment API (Issueinvoice, CheckInvoiceStatus, agentPayment).

Documentation

eDahab logo

edahab (n8n Node Package)

Complete n8n community node for eDahab payment APIs.

Python SDK DocseDahab DocsStatus Codes


Table of Contents


1) Package identity and separation

This folder is a standalone npm package for n8n:

  • package file: n8n-nodes-edahab/package.json
  • package name: n8n-nodes-edahab
  • node runtime file: dist/nodes/Edahab/Edahab.node.js
  • credential file: dist/credentials/EdahabApi.credentials.js

It is separate from the Python package (edahab on PyPI).


2) Features

  • Implements all core eDahab endpoints required for workflows:
    • Issueinvoice
    • agentPayment
    • CheckInvoiceStatus
  • usableAsTool: true for n8n AI Agent tool chains.
  • Enforces currency in payment operations through constrained options (USD, SLSH).
  • Uses official signing algorithm (SHA256(body + secret)) with stable serialized body.

3) Requirements

  • n8n instance with community nodes enabled.
  • Node.js/npm environment compatible with your n8n deployment.
  • n8n credentials for eDahab API key and secret.

4) Install and build

From this folder:

npm install
npm run build

Build output includes:

  • dist/nodes/Edahab/Edahab.node.js
  • dist/credentials/EdahabApi.credentials.js
  • dist/transport/edahabRequest.js
  • dist/nodes/Edahab/eDahab.png

5) Install into n8n

Local path install (recommended for development)

mkdir -p ~/.n8n/nodes
cd ~/.n8n/nodes
npm install /absolute/path/to/edahab/n8n-nodes-edahab

Restart n8n after install.

Install from npm registry

npm install n8n-nodes-edahab

Then restart n8n.


6) AI Agent tool usage

The node is usable as an n8n AI tool because:

  • node definition sets usableAsTool: true
  • operations are explicit and deterministic
  • currency values are constrained to avoid invalid API calls

In AI agent workflows, choose the eDahab node as a tool and map inputs from the agent context.


7) Credentials reference

Credential type: eDahab API

Field Required Description
API Key Yes Sent as apiKey in request body
API Secret Yes Used to compute hash query param
API Base URL No Defaults to https://edahab.net/api/api/

Security note: API secret is not sent directly, only used to derive hash.


8) Node operations reference

Resource: Payment

Operation: Collect from Customer (Issueinvoice)

Parameters:

  • edahabNumber (string, required)
  • amount (number, required)
  • agentCode (string, required)
  • currency (options, required): USD or SLSH
  • failOnInvoiceError (boolean)

Behavior:

  • Calls POST Issueinvoice?hash=...
  • If failOnInvoiceError=true, non-zero StatusCode fails node

Operation: Send Credit (agentPayment)

Parameters:

  • phoneNumber (string, required)
  • transactionAmount (number, required)
  • transactionId (string, required)
  • currencyAgent (options, required): USD or SLSH

Behavior:

  • Calls POST agentPayment?hash=...
  • Returns parsed response JSON
  • Does not apply invoice-style StatusCode failure logic by default

Resource: Invoice

Operation: Verify Status (CheckInvoiceStatus)

Parameters:

  • invoiceId (string, required)
  • failOnInvoiceErrorVerify (boolean)

Behavior:

  • Calls POST CheckInvoiceStatus?hash=...
  • Can fail node on non-zero StatusCode when toggle enabled

9) Request signing behavior

The node performs these steps before each API request:

  1. Build sorted compact JSON body
  2. Compute hash = SHA256(body + apiSecret)
  3. Send POST to baseUrl + endpoint + ?hash=...

This matches eDahab docs and the companion Python SDK behavior.


10) Error handling behavior

  • Network/HTTP issues are raised as node operation errors.
  • Invalid JSON responses fail execution.
  • Invoice operations can be strict or permissive based on fail toggles.
  • continueOnFail behavior is respected and returns item-level error payload.

11) Publish to npm

npm run build
npm publish --access public

If your npm account has 2FA enabled for publish:

npm publish --access public --otp=123456

12) Troubleshooting

  • Node not visible in n8n: restart n8n and verify package installed under .n8n/nodes.
  • Icon missing: confirm dist/nodes/Edahab/eDahab.png exists after npm run build.
  • Credential/status errors: verify API key/secret and base URL.
  • StatusCode failures: check status docs and disable strict toggle if you want soft handling.

14) Official docs links

Discussion