Seamless Flow (PayDirect)
PayDirect Standing Instruction: On Demand
On-demand SI — register a mandate on PayDirect initiate when PayGlocal has enabled on-demand SI on your MID.
POST
/
gl
/
v1
/
payments
/
initiate
PayDirect on-demand SI — register mandate (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",
"merchantCallbackURL": "https://api.prod.payglocal.in/gl/v1/payments/merchantCallback",
"standingInstruction": {
"data": {
"maxAmount": "15000",
"amount": "15000",
"numberOfPayments": "N",
"frequency": "ONDEMAND",
"type": "VARIABLE"
}
},
"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"
}
}
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/initiate"
payload = {
"merchantTxnId": "23AEE8CB6B62EE2AF07",
"merchantUniqueId": "IFNN939494NJFJ",
"merchantCallbackURL": "https://api.prod.payglocal.in/gl/v1/payments/merchantCallback",
"standingInstruction": { "data": {
"maxAmount": "15000",
"amount": "15000",
"numberOfPayments": "N",
"frequency": "ONDEMAND",
"type": "VARIABLE"
} },
"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"
}
}
}
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 \"merchantCallbackURL\": \"https://api.prod.payglocal.in/gl/v1/payments/merchantCallback\",\n \"standingInstruction\": {\n \"data\": {\n \"maxAmount\": \"15000\",\n \"amount\": \"15000\",\n \"numberOfPayments\": \"N\",\n \"frequency\": \"ONDEMAND\",\n \"type\": \"VARIABLE\"\n }\n },\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}")
.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',
merchantCallbackURL: 'https://api.prod.payglocal.in/gl/v1/payments/merchantCallback',
standingInstruction: {
data: {
maxAmount: '15000',
amount: '15000',
numberOfPayments: 'N',
frequency: 'ONDEMAND',
type: 'VARIABLE'
}
},
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'
}
}
})
};
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",
"mandateId": "md_925996a0-9da6-42df-b968-8a14729885fd"
},
"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": {}
}On-demand standing instructions
On-demand SI is a PayGlocal MID configuration — not a restriction thatstandingInstruction.data.frequency must be ONDEMAND. You can set any supported frequency in the request body.
Use this flow when on-demand SI is enabled for your account. Registration uses the same PayDirect initiate endpoint as GPI with a standingInstruction block.
Key points
- Register the mandate using the Initiate API with
standingInstruction.data(see Request body). frequency(ONDEMAND,WEEKLY,MONTHLY, etc.) is a mandate field only — PayGlocal does not auto-debit on that schedule for on-demand SI. You trigger every subsequent debit by calling the SI sale API (billing cadence is up to you).- Subsequent debit amounts:
FIXED— sameamounteach time.VARIABLE— up tomaxAmountper debit.
mandateIdis returned in the Initiate API response (data.mandateId) and must be stored for future mandate operations. It is not returned again in later transactions.
Supported payment methods
| Method | Domestic | International |
|---|---|---|
| Cards | — | ✓ |
paymentData, send cardData only (tokenData is not supported). UPI, net banking, and domestic-only methods are not supported.
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 |
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 actions
Storedata.mandateId from the initiate response — it is not returned on later calls.| Action | API |
|---|---|
| Subsequent debit | SI subsequent payment |
| Mandate status | Check mandate status |
| Cancel mandate | Cancel standing instruction |
| Registration / payment outcome | Get transaction status |
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
application/json
Standing instruction registration when on-demand SI is enabled on the MID.
International cards only (paymentData.cardData).
Response
Returned immediately from initiate. Redirect the customer to data.redirectUrl, then poll data.statusUrl or Get Transaction Status. When mandate registration succeeds, data.mandateId may be present in data.
Response envelope for PayDirect standing instruction initiate (200). data may include mandateId.
No fields in this envelope are marked required.
PayDirect on-demand SI — register mandate (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",
"merchantCallbackURL": "https://api.prod.payglocal.in/gl/v1/payments/merchantCallback",
"standingInstruction": {
"data": {
"maxAmount": "15000",
"amount": "15000",
"numberOfPayments": "N",
"frequency": "ONDEMAND",
"type": "VARIABLE"
}
},
"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"
}
}
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/initiate"
payload = {
"merchantTxnId": "23AEE8CB6B62EE2AF07",
"merchantUniqueId": "IFNN939494NJFJ",
"merchantCallbackURL": "https://api.prod.payglocal.in/gl/v1/payments/merchantCallback",
"standingInstruction": { "data": {
"maxAmount": "15000",
"amount": "15000",
"numberOfPayments": "N",
"frequency": "ONDEMAND",
"type": "VARIABLE"
} },
"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"
}
}
}
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 \"merchantCallbackURL\": \"https://api.prod.payglocal.in/gl/v1/payments/merchantCallback\",\n \"standingInstruction\": {\n \"data\": {\n \"maxAmount\": \"15000\",\n \"amount\": \"15000\",\n \"numberOfPayments\": \"N\",\n \"frequency\": \"ONDEMAND\",\n \"type\": \"VARIABLE\"\n }\n },\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}")
.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',
merchantCallbackURL: 'https://api.prod.payglocal.in/gl/v1/payments/merchantCallback',
standingInstruction: {
data: {
maxAmount: '15000',
amount: '15000',
numberOfPayments: 'N',
frequency: 'ONDEMAND',
type: 'VARIABLE'
}
},
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'
}
}
})
};
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",
"mandateId": "md_925996a0-9da6-42df-b968-8a14729885fd"
},
"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": {}
}
