Skip to main content
POST
/
gl
/
v1
/
payments
/
initiate
PayDirect GPI (request body)
curl --request POST \
  --url https://api.payglocal.in/gl/v1/payments/initiate \
  --header 'Content-Type: application/json' \
  --header 'x-gl-token-external: <api-key>' \
  --data '
{
  "merchantTxnId": "23AEE8CB6B62EE2AF07",
  "merchantUniqueId": "IFNN939494NJFJ",
  "paymentData": {
    "totalAmount": "10.00",
    "txnCurrency": "INR",
    "cardData": {
      "number": "4111111111111111",
      "expiryMonth": "05",
      "expiryYear": "2026",
      "securityCode": "111"
    },
    "billingData": {
      "firstName": "John",
      "lastName": "Doe",
      "addressStreet1": "221B Baker Street",
      "addressCity": "Bengaluru",
      "addressCountry": "IND",
      "emailId": "john.doe@example.com",
      "callingCode": "+91",
      "phoneNumber": "9999999999"
    }
  },
  "merchantCallbackURL": "https://api.prod.payglocal.in/gl/v1/payments/merchantCallback"
}
'
{
  "gid": "gl_o-a057c4d6b6c620741apzp0ZX2",
  "status": "INPROGRESS",
  "message": "Transaction Created Successfully",
  "timestamp": "02/06/2026 21:47:33",
  "reasonCode": "200",
  "data": {
    "redirectUrl": "https://api.uat.payglocal.in/gl/payflow-ui/?x-gl-token=example",
    "statusUrl": "https://api.uat.payglocal.in/gl/v1/payments/gl_o-a057c4d6b6c620741apzp0ZX2/status?x-gl-token=example",
    "merchantTxnId": "23AEE8CB6B62EE2AF07"
  },
  "errors": null
}

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.

What is GPI?

GPI (PayGlocal Payment Initiate) is the API call that starts a PayDirect payment. You send transaction and card (or token) data in one request; PayGlocal returns a gid and a redirectUrl. Send the customer to that URL to complete 3DS, then read the outcome from your callback or the status API.

Supported payment methods

MethodDomesticInternational
Cards
Apple Pay
PayDirect GPI does not support UPI, net banking, or global alternative payments — use GPI for those.

Notes

  • In Request bodypaymentData, send cardData or tokenData (exactly one is mandatory).

API

MethodPOST
Path/gl/v1/payments/initiate
Productionhttps://api.payglocal.in/gl/v1/payments/initiate
Sandboxhttps://api.uat.payglocal.in/gl/v1/payments/initiate
GPI, on-demand SI, auto-debit, and authorize all call this path. Only the JSON request body differs.

Headers

HeaderMandatoryDescription
Content-TypeYesapplication/json
x-gl-token-externalYesRSA-signed JWS of the request body (see Key Management)
x-gl-merchantidYesYour PayGlocal merchant ID (MID)
x-gl-kidYesKey ID of the private key used to sign the JWS
Sign the JSON from Request body below as the JWS in x-gl-token-external, then POST to the URL above.

Next steps

StepAPI
Confirm outcomeGet transaction status
Refund (after capture)Refund

Authorizations

x-gl-token-external
string
header
required

RSA-signed JWS (JSON Web Signature) token carrying the request payload.

  • Header: { "alg": "RS256", "kid": "<merchant-key-id>", "iss": "<merchant-id>", "x-gl-enc": "false", "is-digested": "true" }
  • Payload: the exact JSON body sent in the request (or its SHA-256 digest when is-digested=true).
  • Signed with the merchant's RSA private key; PayGlocal verifies with the matching public key.

Body

application/json

GPI one-step sale (no mandate, no auth-only flag).

merchantTxnId
string
required

Merchant's unique transaction identifier. Alphanumeric only.

Required string length: 4 - 50
Example:

"23AEE8CB6B62EE2AF07"

merchantCallbackURL
string<uri>
required

Customers are redirected here post payment completion.

Example:

"https://api.prod.payglocal.in/gl/v1/payments/merchantCallback"

paymentData
Card data · object
required

Payment instrument and amount for PayDirect initiate. Either option 1 (cardData) or option 2 (tokenData) — not both.

merchantUniqueId
string

Optional stable merchant-side ID for idempotency and reconciliation. Alphanumeric only.

Required string length: 15 - 40
Example:

"IFNN939494NJFJ"

riskData
object

Recommended for fraud checks and processor compliance.

Response

Returned immediately from initiate. Redirect the customer to data.redirectUrl, then poll data.statusUrl or Get Transaction Status. A successful GPI card sale usually reaches SENT_FOR_CAPTURE. No mandateId in data.

Response envelope for PayDirect initiate (200). GPI and auth-onlydata does not include mandateId. No fields in this envelope are marked required.

gid
string

PayGlocal transaction ID. Use for status, capture, and refund APIs.

Example:

"gl_o-a057c4d6b6c620741apzp0ZX2"

status
string

High-level status. Typically INPROGRESS immediately after initiate.

Example:

"INPROGRESS"

message
string

Human-readable status message.

Example:

"Transaction Created Successfully"

timestamp
string

Response timestamp (DD/MM/YYYY HH:MM:SS).

Example:

"02/06/2026 21:47:33"

reasonCode
string

Success code on initiate (e.g. 200). See 4xx responses for error codes.

Example:

"200"

data
object

data on a successful PayDirect initiate (200). GPI and auth-only responses use this shape (no mandateId). No response fields are marked required — typical GPI payloads include redirectUrl, statusUrl, and merchantTxnId.

errors
object

null on success.