Bayarcash icon

Bayarcash

Consume Bayarcash API

Actions6

Overview

This node integrates with the Bayarcash API to create a payment intent, which is a request to initiate a payment transaction through various supported payment channels. It is useful for automating payment processing workflows where you need to generate payment intents programmatically, such as in e-commerce platforms, billing systems, or financial applications.

Typical use cases include:

  • Creating a payment intent for a customer to pay an invoice.
  • Initiating payments via different payment channels like FPX, DuitNow, Boost PayFlex, QRIS, and others.
  • Collecting payer information and redirect URLs for handling payment completion and callbacks.

For example, you can create a payment intent for a customer who wants to pay RM100 using FPX (the default payment channel), providing their name, email, and order number, and then handle the payment status asynchronously via callback URLs.

Properties

Name Meaning
Payment Channel The ID of the payment channel to use. Options include: FPX (Default Payment Channel), FPX Line of Credit, DuitNow Online Banking/Wallets, DuitNow QR, Boost PayFlex (BNPL From Boost), QRIS Indonesia Online Banking, QRIS Indonesia eWallet, NETS Singapore. Default is FPX (1).
Portal Key A portal key string retrieved from the Bayarcash console, used to authenticate and identify the portal initiating the payment intent.
Order Number A unique identifier for the order associated with this payment intent.
Amount The payment amount as an integer (no decimals).
Payer Name The full name of the person making the payment.
Payer Email The email address of the person making the payment.
Payer Telephone Number The telephone number of the payer. Currently only accepts Malaysian phone numbers. Optional.
Callback URL A server-to-server callback URL that will receive POST requests to notify about payment status updates. Optional.
Return URL A server-to-browser redirect URL where the user will be redirected after payment completion. Optional.
Payer Bank Code The bank code of the payer's bank. Optional.
Payer Bank Name The bank name of the payer's bank. Optional.
Metadata Additional metadata as a string to attach to the payment intent. Optional.
Platform ID An optional platform identifier string.
Checksum A checksum string for verification purposes. Optional.

Output

The node outputs JSON data representing the response from the Bayarcash API after creating the payment intent. This typically includes details such as:

  • The unique ID of the created payment intent.
  • Status and other metadata related to the payment intent.
  • URLs or tokens needed to proceed with the payment process.

The output is structured as an array of JSON objects, each corresponding to an input item processed by the node.

No binary data is output by this node.

Dependencies

  • Requires an API authentication token credential (a personal access token) configured in n8n to authorize requests to the Bayarcash API.
  • The node makes HTTP requests to the Bayarcash API endpoints.
  • The user must have a valid portal key from the Bayarcash console.
  • Network connectivity to the Bayarcash API endpoint is required.

Troubleshooting

Common Issues

  • Authentication failures: If the API token is invalid or expired, the node will return an authentication error.
  • Validation errors: Improperly formatted requests or missing required fields will cause validation errors.
  • Permission errors: Using payment channels not enabled for your account or lacking permissions will result in forbidden errors.
  • Resource not found: Incorrect IDs or keys may lead to "not found" errors.
  • Server errors: Temporary issues on the Bayarcash server side may cause 5xx errors.

Error Messages and Resolutions

  • Authentication failed: "Invalid or expired PAT token."
    Resolution: Verify and update the API token credential in n8n.

  • Validation error: "The API could not process your request."
    Resolution: Check all required parameters are provided and correctly formatted.

  • Bad request: "The request was improperly formatted or contained invalid parameters."
    Resolution: Review the input values, especially numeric fields and URLs.

  • Forbidden: "You do not have permission to access this resource or the payment channel is not enabled for your account."
    Resolution: Confirm your account has access to the selected payment channel.

  • Not found: "The requested resource does not exist."
    Resolution: Verify the portal key, order number, or other identifiers.

  • Server error: "The Bayarcash server encountered an error."
    Resolution: Retry later or contact Bayarcash support if persistent.

If the node is set to continue on failure, it will output error details in the JSON output instead of stopping execution.

Links and References

Note: Please refer to the official Bayarcash documentation for detailed API usage and latest updates.

Discussion