Skip to main content

Documentation Index

Fetch the complete documentation index at: https://payglocal.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Webhook notifications are sent to the webhook URL shared by the merchant. There are no additional integration steps required to implement and receive responses on webhook. To receive webhook responses, share a webhook URL with PayGlocal on which you want to be notified about the status of your transactions. Example webhook URL:
https://www.nameofyourwebsite.com/payment/payglocal/webhook_response
Once the webhook URL is configured on your MID based on your request, you will start receiving the response for all transactions as per the configuration.
To get your webhook URL configured, contact your PayGlocal account manager or write to merchant.support@payglocal.in.

How to Form Your Webhook URL

Your webhook URL is simply a publicly accessible POST endpoint on your own backend server. You build it yourself — PayGlocal will call it whenever a payment event occurs. A typical webhook URL follows this pattern:
https://<your-domain>/<your-path>/webhook
Examples:
https://api.yourstore.com/payments/payglocal/webhook
https://backend.yourapp.in/payglocal/notify
https://yourwebsite.com/payment/payglocal/webhook_response
Rules for a valid webhook URL:
  • Must be HTTPS (HTTP is not accepted)
  • Must be publicly reachable — localhost or private IPs will not work
  • Must accept HTTP POST requests
  • Must return HTTP 200 to acknowledge receipt

Setting Up Your Webhook Endpoint

You need to create a POST endpoint on your backend that PayGlocal can call. The endpoint receives a JSON body and must respond with 200 OK. Here is what your endpoint needs to do:
1. Listen for POST requests at your webhook URL
2. Read the JSON body from the incoming request
3. Return HTTP 200 immediately
4. Process the event (update order, notify user, etc.) after responding
Pseudo-code for any backend (Node, Python, Java, etc.):
POST /payglocal/webhook

  → Read request body (JSON)
  → Validate that merchantId matches your own MID
  → Respond with HTTP 200 OK immediately
  → Trigger your business logic (mark order paid, send receipt, etc.)
Always return HTTP 200 before running any business logic. If your server takes too long to respond, PayGlocal may consider the delivery failed and retry the webhook.

Real-Time Event Notifications

Webhooks enable your application to receive instant notifications when events occur in PayGlocal, eliminating the need for constant polling and enabling real-time, event-driven workflows.

What is a Webhook?

An automated HTTP POST request sent from PayGlocal to your server the moment a payment event occurs — no polling needed.

Why Use Webhooks?

Instant notifications, no polling overhead, reduced server load, and event-driven workflows for faster applications.

When to Use

Payment status updates, order confirmations, transaction monitoring, and any scenario requiring immediate event-based action.

Webhook Flow

1. Event Occurs
   Payment is processed on PayGlocal


2. Webhook Triggered
   PayGlocal sends a POST request to your webhook URL


3. Your Server Receives
   Your endpoint receives the webhook payload


4. Process & Respond
   Handle the event and return HTTP 200


5. Action Taken
   Update your database, fulfil the order, notify the user

Sample Webhook Payload

When an event occurs, PayGlocal sends a POST request to your configured webhook URL. Here is an example of the payload your server receives:
{
  "country": "UNITED KINGDOM",
  "amount": "48",
  "gid": "gl_o-pYA8MLrsnfVpKp1mw",
  "merchantId": "alwyntest1",
  "merchantTxnId": "17083906765",
  "paymentMethod": "CARD",
  "currency": "USD",
  "cardBrand": "VISA",
  "status": "SENT_FOR_CAPTURE"
}

Payload Field Reference

FieldDescription
countryCountry of the card used for payment
amountTransaction amount
gidPayGlocal’s unique transaction identifier
merchantIdYour Merchant ID
merchantTxnIdYour unique transaction reference
paymentMethodPayment method used (e.g. CARD)
currencyCurrency of the transaction
cardBrandCard network used (e.g. VISA, MASTERCARD)
statusFinal transaction status

Payment Status Values

StatusMeaning
SENT_FOR_CAPTUREPayment successful — funds captured
AUTHORIZEDPayment authorized, awaiting capture
ISSUER_DECLINECard declined by the issuing bank
CUSTOMER_CANCELLEDCustomer cancelled the payment
ABANDONEDCustomer left without completing payment
GENERAL_DECLINEDeclined due to risk or fraud check