Sunday, 19 April 2026

n8n Xendit GCash Tutorial: Automate Payments in the Philippines

n8n + Xendit + GCash Tutorial

How to Use n8n with Xendit GCash for Payment Automation

Learn how to automate GCash payment flows using n8n, Xendit API, webhooks, and notifications.

If you want to build a modern payment automation workflow in the Philippines, combining n8n with Xendit GCash is a strong setup. Xendit handles the payment collection, while n8n automates what happens before and after the payment.

💡 Example: customer clicks pay → Xendit creates a GCash payment request → customer completes payment in GCash → webhook hits n8n → Google Sheets, Telegram, email, or CRM updates automatically.

What You’ll Learn

  • How Xendit GCash works
  • How to connect Xendit to n8n
  • How to create a payment request
  • How to receive webhook events in n8n
  • How to build a full payment automation workflow

What Is Xendit GCash?

Xendit allows merchants to collect payments through supported payment channels. For GCash, the channel is documented as an e-wallet payment method for the Philippines using PHP.

In practice, the usual user flow is simple: you create a payment request, Xendit returns the next action for the customer, and the customer completes the payment through a redirect or deep link.

Important: GCash uses a redirect approval flow, so your workflow should expect a checkout URL or app handoff for the user to complete payment.

Key GCash Details for Integration

  • Channel Code: GCASH
  • Type: EWALLET
  • Currency: PHP
  • Country: PH
  • Min Amount: 1
  • Max Amount: 100,000.00
  • User Approval Flow: REDIRECT
  • Desktop Support: Web URL
  • Mobile Support: Deeplink URL

Step 1: Get Your Xendit API Key

In Xendit, generate your secret API key from the dashboard. Xendit’s docs say their API uses Basic Auth, with your secret API key as the username and an empty password.

⚠️ Keep your secret key private. Do not expose it in frontend code or public pages.

Step 2: Build the n8n Workflow

A practical starter workflow looks like this:

Webhook / Manual Trigger
   ↓
Set / Edit Fields
   ↓
HTTP Request (Create Xendit Payment Request)
   ↓
Respond to Webhook or Store Checkout URL
   ↓
Webhook (Xendit Event)
   ↓
IF
   ↓
Google Sheets / Telegram / Gmail / CRM

In n8n, the HTTP Request node is the easiest way to call Xendit’s REST API, while the Webhook node is how you receive payment updates from Xendit.

Step 3: Create the Payment Request

Xendit’s current Payments API uses /payment_requests for collecting one-off payments. For e-wallet flows like GCash, this is the endpoint you’ll typically use for a standard pay flow.

Endpoint:

POST https://api.xendit.co/payment_requests

Example n8n HTTP Request settings:

  • Method: POST
  • Authentication: Basic Auth
  • Username: YOUR_XENDIT_SECRET_KEY
  • Password: leave blank
  • Headers: Content-Type: application/json

Example body:

{
  "reference_id": "ORDER-1001",
  "type": "PAY",
  "country": "PH",
  "currency": "PHP",
  "amount": 500,
  "payment_method": {
    "type": "EWALLET",
    "reusability": "ONE_TIME_USE",
    "ewallet": {
      "channel_code": "GCASH",
      "channel_properties": {
        "success_return_url": "https://yourdomain.com/payment-success",
        "failure_return_url": "https://yourdomain.com/payment-failed"
      }
    }
  }
}
💡 After creating the request, Xendit returns a payment object and next-step data. For redirect-based methods, your app should send the user to the provided checkout or action URL.

Step 4: Send the Customer to GCash

Since GCash uses a redirect flow, the customer needs to complete payment outside your backend flow. On desktop, this may be a web URL. On mobile, this may be a deep link into the GCash app.

In n8n, if your workflow starts from a Webhook node, you can either:

  • Return the checkout URL directly to your frontend, or
  • Use Respond to Webhook to send a clean JSON response containing the payment link.

Step 5: Receive Xendit Webhook Events

After the customer completes or abandons the payment, Xendit sends a webhook event to your server. In n8n, the Webhook node can receive this event and start the status-handling workflow.

n8n provides both Test URL and Production URL for Webhook nodes, so make sure you register the production URL in your Xendit dashboard when you go live.

Typical webhook workflow:

Webhook
   ↓
IF payment status = succeeded
   ├── Google Sheets update
   ├── Telegram notification
   ├── Send receipt email
   └── Update CRM
else
   └── Mark payment as failed / pending

Step 6: Log the Payment in Google Sheets

A common pattern is to store payment records in Google Sheets for simple reporting. You can save fields like:

  • reference_id
  • payment_request_id
  • amount
  • currency
  • status
  • customer name
  • paid_at

Step 7: Notify via Telegram or Email

Once a successful GCash payment comes in, n8n can instantly notify you or your team via Telegram, Gmail, Slack, or SMS.

Example message:

✅ New GCash payment received
Order: ORDER-1001
Amount: ₱500
Status: SUCCEEDED

Real Use Cases

Online order checkout
Invoice payment links
Reservation or booking deposits
Auto-updated payment dashboards

Common Errors and Fixes

1. Authentication failed
Make sure your HTTP Request node is using Basic Auth correctly with the secret key as username and blank password.

2. Customer cannot complete payment
Check your success and failure return URLs and confirm you are using the correct redirect URL returned by Xendit.

3. Webhook not triggering in n8n
Verify that Xendit is pointed to your production webhook URL, not your test URL.

4. Payment record not updating
Use an IF node to branch by payment status and log the raw webhook payload while testing.

5. Invalid amount or channel data
Check that your request matches GCash requirements such as PHP currency and valid amount range.

Best Practices

  • Test in Xendit test mode first
  • Log full API responses during setup
  • Use reference_id values you can trace easily
  • Separate create-payment and webhook-processing workflows
  • Keep your Xendit key only in n8n credentials or secure variables

Watch My Automation Videos on YouTube

I share real n8n builds, automation ideas, and AI workflow content on my YouTube channel.

▶ Visit My YouTube Channel

FAQ

Can I use n8n with Xendit GCash even without a dedicated Xendit node?
Yes. The n8n HTTP Request node can call Xendit’s REST API directly.

Does GCash require redirect handling?
Yes. Xendit documents GCash as using a redirect approval flow.

Can I automate payment notifications?
Yes. Once Xendit sends a webhook to n8n, you can update Sheets, send Telegram alerts, email receipts, or update your CRM automatically.


SEO Title

n8n Xendit GCash Tutorial: Automate Payments in the Philippines

No comments:

Post a Comment

n8n Xendit GCash Tutorial: Automate Payments in the Philippines

n8n + Xendit + GCash Tutorial How to Use n8n with Xendit GCash for Payment Automation Learn how to a...