Checkout Flow (PayCollect)
PayCollect GPI
PayGlocal Payment Initiate (GPI) — one-step hosted sale via POST /gl/v1/payments/initiate/paycollect. No card data in your request.
POST
/
gl
/
v1
/
payments
/
initiate
/
paycollect
PayCollect GPI (request body)
curl --request POST \
--url https://api.payglocal.in/gl/v1/payments/initiate/paycollect \
--header 'Content-Type: application/json' \
--header 'x-gl-token-external: <api-key>' \
--data '
{
"merchantTxnId": "order_1712345678",
"paymentData": {
"totalAmount": "100.00",
"txnCurrency": "INR",
"billingData": {
"firstName": "John",
"lastName": "Doe",
"emailId": "john.doe@example.com",
"addressCountry": "IND"
}
},
"merchantCallbackURL": "https://merchant.example.com/callback"
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/initiate/paycollect"
payload = {
"merchantTxnId": "order_1712345678",
"paymentData": {
"totalAmount": "100.00",
"txnCurrency": "INR",
"billingData": {
"firstName": "John",
"lastName": "Doe",
"emailId": "john.doe@example.com",
"addressCountry": "IND"
}
},
"merchantCallbackURL": "https://merchant.example.com/callback"
}
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/paycollect")
.header("x-gl-token-external", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantTxnId\": \"order_1712345678\",\n \"paymentData\": {\n \"totalAmount\": \"100.00\",\n \"txnCurrency\": \"INR\",\n \"billingData\": {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"emailId\": \"john.doe@example.com\",\n \"addressCountry\": \"IND\"\n }\n },\n \"merchantCallbackURL\": \"https://merchant.example.com/callback\"\n}")
.asString();const url = 'https://api.payglocal.in/gl/v1/payments/initiate/paycollect';
const options = {
method: 'POST',
headers: {'x-gl-token-external': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantTxnId: 'order_1712345678',
paymentData: {
totalAmount: '100.00',
txnCurrency: 'INR',
billingData: {
firstName: 'John',
lastName: 'Doe',
emailId: 'john.doe@example.com',
addressCountry: 'IND'
}
},
merchantCallbackURL: 'https://merchant.example.com/callback'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"gid": "gl_9c2645ed09edb22e",
"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_9c2645ed09edb22e/status?x-gl-token=example",
"merchantTxnId": "order_1712345678"
},
"errors": null
}{
"gid": "gl_9c2645ed09edb22e",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "VALIDATION_ERROR",
"data": {},
"errors": null,
"errorDetails": [
{
"fieldName": "paymentData.totalAmount",
"message": "This field is required"
}
]
}{
"gid": "gl_9c2645ed09edb22e",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "UNAUTHORIZED",
"data": {},
"errors": null,
"errorDetails": [
{
"fieldName": "authorization",
"message": "Invalid x-gl-token-external"
}
]
}What is GPI?
GPI (PayGlocal Payment Initiate) starts a PayCollect payment. You initiate from your server with transaction and billing data; PayGlocal returns agid and a redirectUrl. Send the customer to that URL to pay on the hosted checkout, then read the outcome from your callback or the status API.
Supported payment methods
The customer chooses on the hosted page:| Method | Domestic | International |
|---|---|---|
| Cards | ✓ | ✓ |
| UPI Intent | ✓ | — |
| Net banking | ✓ | — |
| Apple Pay | — | ✓ |
| Global alternative payments | — | ✓ |
For global alternative payments, include
riskData.shippingData.addressCountry and emailId in the request body.API
| Method | POST |
| Path | /gl/v1/payments/initiate/paycollect |
| Production | https://api.payglocal.in/gl/v1/payments/initiate/paycollect |
| Sandbox | https://api.uat.payglocal.in/gl/v1/payments/initiate/paycollect |
GPI, on-demand SI, auto-debit, and authorize all call this path. Only the JSON request body differs.
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.
Used by all
/gl/v1/payments/*endpoints.
Body
application/json
PayCollect GPI (no mandate, no captureTxn).
Response
Returned immediately from initiate. Redirect the customer to data.redirectUrl, then poll data.statusUrl or Get Transaction Status. A successful GPI sale usually reaches SENT_FOR_CAPTURE. No mandateId in data.
Response envelope for PayCollect initiate (200).
PayCollect GPI (request body)
curl --request POST \
--url https://api.payglocal.in/gl/v1/payments/initiate/paycollect \
--header 'Content-Type: application/json' \
--header 'x-gl-token-external: <api-key>' \
--data '
{
"merchantTxnId": "order_1712345678",
"paymentData": {
"totalAmount": "100.00",
"txnCurrency": "INR",
"billingData": {
"firstName": "John",
"lastName": "Doe",
"emailId": "john.doe@example.com",
"addressCountry": "IND"
}
},
"merchantCallbackURL": "https://merchant.example.com/callback"
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/initiate/paycollect"
payload = {
"merchantTxnId": "order_1712345678",
"paymentData": {
"totalAmount": "100.00",
"txnCurrency": "INR",
"billingData": {
"firstName": "John",
"lastName": "Doe",
"emailId": "john.doe@example.com",
"addressCountry": "IND"
}
},
"merchantCallbackURL": "https://merchant.example.com/callback"
}
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/paycollect")
.header("x-gl-token-external", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantTxnId\": \"order_1712345678\",\n \"paymentData\": {\n \"totalAmount\": \"100.00\",\n \"txnCurrency\": \"INR\",\n \"billingData\": {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"emailId\": \"john.doe@example.com\",\n \"addressCountry\": \"IND\"\n }\n },\n \"merchantCallbackURL\": \"https://merchant.example.com/callback\"\n}")
.asString();const url = 'https://api.payglocal.in/gl/v1/payments/initiate/paycollect';
const options = {
method: 'POST',
headers: {'x-gl-token-external': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantTxnId: 'order_1712345678',
paymentData: {
totalAmount: '100.00',
txnCurrency: 'INR',
billingData: {
firstName: 'John',
lastName: 'Doe',
emailId: 'john.doe@example.com',
addressCountry: 'IND'
}
},
merchantCallbackURL: 'https://merchant.example.com/callback'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"gid": "gl_9c2645ed09edb22e",
"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_9c2645ed09edb22e/status?x-gl-token=example",
"merchantTxnId": "order_1712345678"
},
"errors": null
}{
"gid": "gl_9c2645ed09edb22e",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "VALIDATION_ERROR",
"data": {},
"errors": null,
"errorDetails": [
{
"fieldName": "paymentData.totalAmount",
"message": "This field is required"
}
]
}{
"gid": "gl_9c2645ed09edb22e",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "UNAUTHORIZED",
"data": {},
"errors": null,
"errorDetails": [
{
"fieldName": "authorization",
"message": "Invalid x-gl-token-external"
}
]
}
