Use Bayarcash in n8n
The Bayarcash node for n8n lets a workflow create payment intents, check them, and read your portals and transactions without code. It is a community node, published on npm as n8n-nodes-bayarcash, and uses Bayarcash API v3.
Install the node
Section titled “Install the node”Community nodes can be installed on self-hosted n8n. To install it:
- In n8n, open Settings → Community Nodes.
- Install the npm package
n8n-nodes-bayarcash. - Search for Bayarcash when you add a node to a workflow.
The n8n guide to installing community nodes has the full steps and other ways to install.
Connect your Bayarcash account
Section titled “Connect your Bayarcash account”The node signs in with a credential called Bayarcash API. To create it:
-
Add a Bayarcash node, and under the credential choose to create a new one.
-
Fill in the fields:
Field What to enter Personal Access Token (PAT) Your Personal Access Token from the merchant dashboard. Environment Sandbox - api.console.bayarcash-sandbox.com/v3 while you test, or Production - api.console.bayar.cash/v3 for real payments. It is set to Production until you change it. -
Save. n8n tests the credential by listing your portals.
Use a sandbox token with Sandbox and a production token with Production. They do not work across environments.
What the node can do
Section titled “What the node can do”Choose a Resource, then an Operation:
| Resource | Operation | What it does |
|---|---|---|
| Payment Intent | Create | Creates a payment and returns the url to send your customer to. |
| Payment Intent | Get Status | Gets a payment intent by its Payment Intent ID. |
| Payment Intent | Delete | Cancels a payment intent by its Payment Intent ID. |
| Portal | List All Portals | Lists your portals. |
| Portal | Get Portal Channels | Gets one portal, with its payment channels, by Portal ID. |
| Transaction | Get Transaction by ID | Gets one transaction by its Transaction ID. |
| Transaction | List Transactions | Lists transactions. Add Filters for Order Number, Status, Payment Channel, Exchange Reference Number or Payer Email. |
Create a payment intent
Section titled “Create a payment intent”To create a payment from a workflow:
- Add a Bayarcash node and choose Payment Intent → Create.
- Choose the portal in Portal Name or ID. The list comes from your account.
- Fill in Order Number, Amount, Payer Name and Payer Email. These are required.
- Optionally choose one or more Payment Channel values. Leave it empty to let the customer choose on the Bayarcash page.
- Optionally fill in Payer Telephone Number, Callback URL and Return URL.
- Run the node. Send the
urlfrom its output to your customer, for example by email or WhatsApp.
Receive the result in n8n
Section titled “Receive the result in n8n”The Bayarcash node does not start workflows by itself. To act when a payment finishes:
- Start a second workflow with n8n’s Webhook node, set to receive a POST.
- Put that webhook’s URL in Callback URL when you create the payment intent.
- In the callback workflow, verify the
checksumwith your API Secret Key before you trust the data. See Verify callbacks and checksums. - Use Get Transaction by ID with the callback’s
transaction_idto read the full, current record.
Make the webhook answer with HTTP 200, or Bayarcash sends the callback again.
- Build the workflow on the sandbox first. Switch the credential’s Environment to Production, with a production token, only once a test payment runs end to end.
- Keep the order number unique for each payment. It is how you match a callback or transaction back to the row, deal or invoice that started the workflow.
Common issues
The node fails with "Authentication failed: Invalid or expired PAT token. Please check your credentials." What should I check?
Check that you pasted the whole Personal Access Token, and that Environment matches where the token came from. A sandbox token only works with Sandbox, and a production token only with Production.
Creating a payment intent fails with "Forbidden" and mentions the payment channel. Why?
The channel you chose in Payment Channel is not enabled on your account. New accounts only have FPX. Choose another channel, leave the field empty, or ask Bayarcash to enable the channel.
Why does Get Portal Channels say the resource does not exist?
Portal ID needs the portal's ID, not its portal key. Run List All Portals first and copy the ID from its output.
Was this article helpful?
Thanks for your feedback.
Sorry this didn't help. WhatsApp us and we'll sort it out with you.

