PayDirect GPI
PayGlocal Payment Initiate (GPI) — one-step PayDirect sale via POST /gl/v1/payments/initiate.
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"
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/initiate"
payload = {
"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"
}
headers = {
"x-gl-token-external": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.payglocal.in/gl/v1/payments/initiate")
.header("x-gl-token-external", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantTxnId\": \"23AEE8CB6B62EE2AF07\",\n \"merchantUniqueId\": \"IFNN939494NJFJ\",\n \"paymentData\": {\n \"totalAmount\": \"10.00\",\n \"txnCurrency\": \"INR\",\n \"cardData\": {\n \"number\": \"4111111111111111\",\n \"expiryMonth\": \"05\",\n \"expiryYear\": \"2026\",\n \"securityCode\": \"111\"\n },\n \"billingData\": {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"addressStreet1\": \"221B Baker Street\",\n \"addressCity\": \"Bengaluru\",\n \"addressCountry\": \"IND\",\n \"emailId\": \"john.doe@example.com\",\n \"callingCode\": \"+91\",\n \"phoneNumber\": \"9999999999\"\n }\n },\n \"merchantCallbackURL\": \"https://api.prod.payglocal.in/gl/v1/payments/merchantCallback\"\n}")
.asString();const url = 'https://api.payglocal.in/gl/v1/payments/initiate';
const options = {
method: 'POST',
headers: {'x-gl-token-external': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"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
}{
"gid": "gl_9c2645ed09edb22e",
"status": "REQUEST_ERROR",
"message": "Authentication failed, please contact support.",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "GL-400-001",
"data": {},
"errors": {
"detailedMessage": "Authentication failed, please contact support.",
"displayMessage": "Something went wrong. We'll take you back to checkout so that you can try again."
},
"errorDetails": {}
}{
"gid": "gl_9c2645ed09edb22e",
"status": "BLACKLIST_MATCH",
"message": "You are not allowed to onboard on this platform. Please contact support.",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "GL-403-001",
"data": {},
"errors": {
"detailedMessage": "You are not allowed to onboard on this platform, please contact support.",
"displayMessage": "Something went wrong. We'll take you back to checkout so that you can try again."
},
"errorDetails": {}
}{
"gid": "gl_9c2645ed09edb22e",
"status": "REQUEST_ERROR",
"message": "Authentication failed, please contact support.",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "GL-400-001",
"data": {},
"errors": {
"detailedMessage": "Authentication failed, please contact support.",
"displayMessage": "Something went wrong. We'll take you back to checkout so that you can try again."
},
"errorDetails": {}
}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 agid 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
| Method | Domestic | International |
|---|---|---|
| Cards | ✓ | ✓ |
| Apple Pay | — | ✓ |
Notes
- In Request body →
paymentData, sendcardDataortokenData(exactly one is mandatory).
API
| Method | POST |
| Path | /gl/v1/payments/initiate |
| Production | https://api.payglocal.in/gl/v1/payments/initiate |
| Sandbox | https://api.uat.payglocal.in/gl/v1/payments/initiate |
Headers
| Header | Mandatory | Description |
|---|---|---|
Content-Type | Yes | application/json |
x-gl-token-external | Yes | RSA-signed JWS of the request body (see Key Management) |
x-gl-merchantid | Yes | Your PayGlocal merchant ID (MID) |
x-gl-kid | Yes | Key ID of the private key used to sign the JWS |
x-gl-token-external, then POST to the URL above.
Next steps
| Step | API |
|---|---|
| Confirm outcome | Get transaction status |
| Refund (after capture) | Refund |
Authorizations
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
GPI one-step sale (no mandate, no auth-only flag).
Merchant's unique transaction identifier. Alphanumeric only.
4 - 50"23AEE8CB6B62EE2AF07"
Customers are redirected here post payment completion.
"https://api.prod.payglocal.in/gl/v1/payments/merchantCallback"
Payment instrument and amount for PayDirect initiate. Either option 1 (cardData) or option 2 (tokenData) — not both.
- Card data
- Token data
Show child attributes
Show child attributes
Optional stable merchant-side ID for idempotency and reconciliation. Alphanumeric only.
15 - 40"IFNN939494NJFJ"
Recommended for fraud checks and processor compliance.
Show child attributes
Show child attributes
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-only — data does not include mandateId.
No fields in this envelope are marked required.
PayGlocal transaction ID. Use for status, capture, and refund APIs.
"gl_o-a057c4d6b6c620741apzp0ZX2"
High-level status. Typically INPROGRESS immediately after initiate.
"INPROGRESS"
Human-readable status message.
"Transaction Created Successfully"
Response timestamp (DD/MM/YYYY HH:MM:SS).
"02/06/2026 21:47:33"
Success code on initiate (e.g. 200). See 4xx responses for error codes.
"200"
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.
Show child attributes
Show child attributes
null on success.
Show child attributes
Show child attributes
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"
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/initiate"
payload = {
"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"
}
headers = {
"x-gl-token-external": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.payglocal.in/gl/v1/payments/initiate")
.header("x-gl-token-external", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantTxnId\": \"23AEE8CB6B62EE2AF07\",\n \"merchantUniqueId\": \"IFNN939494NJFJ\",\n \"paymentData\": {\n \"totalAmount\": \"10.00\",\n \"txnCurrency\": \"INR\",\n \"cardData\": {\n \"number\": \"4111111111111111\",\n \"expiryMonth\": \"05\",\n \"expiryYear\": \"2026\",\n \"securityCode\": \"111\"\n },\n \"billingData\": {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"addressStreet1\": \"221B Baker Street\",\n \"addressCity\": \"Bengaluru\",\n \"addressCountry\": \"IND\",\n \"emailId\": \"john.doe@example.com\",\n \"callingCode\": \"+91\",\n \"phoneNumber\": \"9999999999\"\n }\n },\n \"merchantCallbackURL\": \"https://api.prod.payglocal.in/gl/v1/payments/merchantCallback\"\n}")
.asString();const url = 'https://api.payglocal.in/gl/v1/payments/initiate';
const options = {
method: 'POST',
headers: {'x-gl-token-external': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"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
}{
"gid": "gl_9c2645ed09edb22e",
"status": "REQUEST_ERROR",
"message": "Authentication failed, please contact support.",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "GL-400-001",
"data": {},
"errors": {
"detailedMessage": "Authentication failed, please contact support.",
"displayMessage": "Something went wrong. We'll take you back to checkout so that you can try again."
},
"errorDetails": {}
}{
"gid": "gl_9c2645ed09edb22e",
"status": "BLACKLIST_MATCH",
"message": "You are not allowed to onboard on this platform. Please contact support.",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "GL-403-001",
"data": {},
"errors": {
"detailedMessage": "You are not allowed to onboard on this platform, please contact support.",
"displayMessage": "Something went wrong. We'll take you back to checkout so that you can try again."
},
"errorDetails": {}
}{
"gid": "gl_9c2645ed09edb22e",
"status": "REQUEST_ERROR",
"message": "Authentication failed, please contact support.",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "GL-400-001",
"data": {},
"errors": {
"detailedMessage": "Authentication failed, please contact support.",
"displayMessage": "Something went wrong. We'll take you back to checkout so that you can try again."
},
"errorDetails": {}
}
