Refund
Initiate a full or partial refund for a successfully captured transaction.
curl --request POST \
--url https://api.payglocal.in/gl/v1/payments/{gid}/refund \
--header 'Content-Type: application/json' \
--header 'x-gl-token-external: <api-key>' \
--data '
{
"refundType": "P",
"paymentData": {
"totalAmount": "25.00",
"txnCurrency": "INR"
}
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/{gid}/refund"
payload = {
"refundType": "P",
"paymentData": {
"totalAmount": "25.00",
"txnCurrency": "INR"
}
}
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/{gid}/refund")
.header("x-gl-token-external", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"refundType\": \"P\",\n \"paymentData\": {\n \"totalAmount\": \"25.00\",\n \"txnCurrency\": \"INR\"\n }\n}")
.asString();const url = 'https://api.payglocal.in/gl/v1/payments/{gid}/refund';
const options = {
method: 'POST',
headers: {'x-gl-token-external': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({refundType: 'P', paymentData: {totalAmount: '25.00', txnCurrency: 'INR'}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"gid": "gl_refund_abcdef123",
"status": "SENT_FOR_REFUND",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "",
"data": {
"gid": "gl_refund_abcdef123",
"originalGid": "gl_9c2645ed09edb22e",
"status": "SENT_FOR_REFUND",
"refundAmount": "25.00"
}
}{
"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"
}
]
}{
"gid": "gl_9c2645ed09edb22e",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "VALIDATION_ERROR",
"data": {},
"errors": {},
"errorDetails": [
{
"field": "panNumber",
"message": "Required field is missing"
}
]
}When to Use
Refund all or part of a captured transaction. If the transaction is still inAUTHORIZED state (not yet captured), use Auth Reversal instead.
Full vs Partial
refundType=F— full refund. OmitpaymentData.totalAmount.refundType=P— partial refund.paymentData.totalAmountis required and must be ≤ the captured amount.
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.
Path Parameters
PayGlocal gid of the original transaction.
Body
Unified request body for payment initiation, capture, refund, reversal, and SI operations.
Most fields are optional — which fields are required depends on the operation. See each
endpoint's required: list for operation-specific rules.
Note: required: lists are best-effort and derived from current integration examples —
validate against your integration spec or contact your PayGlocal implementation lead.
Full or partial refund indicator (used on refund calls).
F, P "F"
Merchant's unique transaction identifier. Required for /initiate and SI sale.
"order_1712345678"
Merchant's secondary unique reference.
Refund lifecycle action.
Full or partial capture indicator (used on capture calls).
F, P "F"
If true on /initiate, the transaction is auto-captured post-auth.
Payment instrument + amount details for a transaction.
Show child attributes
Show child attributes
Risk & analytics payload forwarded to fraud engines.
Show child attributes
Show child attributes
Mandatory when registering a standing instruction on initiate. Omit for GPI-only sales without a mandate.
Show child attributes
Show child attributes
URL PayGlocal redirects to after payment completion.
Opaque merchant metadata echoed back in callbacks.
Show child attributes
Show child attributes
Set true to enable Dynamic Currency Conversion.
PayGlocal DCC quote reference (when dcc_indicator=true).
Response
Refund accepted.
Standard PayGlocal response envelope (GlocalApiResponse).
PayGlocal global transaction ID.
"gl_9c2645ed09edb22e"
High-level status of this API response.
"SUCCESS"
Human-readable message.
Response timestamp (DD/MM/YYYY HH:MM:SS).
"10/01/2026 15:00:00"
Empty on success; populated on failure.
""
Operation-specific payload. Shape varies by endpoint.
Field-level validation errors (populated on 4xx).
Show child attributes
Show child attributes
curl --request POST \
--url https://api.payglocal.in/gl/v1/payments/{gid}/refund \
--header 'Content-Type: application/json' \
--header 'x-gl-token-external: <api-key>' \
--data '
{
"refundType": "P",
"paymentData": {
"totalAmount": "25.00",
"txnCurrency": "INR"
}
}
'import requests
url = "https://api.payglocal.in/gl/v1/payments/{gid}/refund"
payload = {
"refundType": "P",
"paymentData": {
"totalAmount": "25.00",
"txnCurrency": "INR"
}
}
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/{gid}/refund")
.header("x-gl-token-external", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"refundType\": \"P\",\n \"paymentData\": {\n \"totalAmount\": \"25.00\",\n \"txnCurrency\": \"INR\"\n }\n}")
.asString();const url = 'https://api.payglocal.in/gl/v1/payments/{gid}/refund';
const options = {
method: 'POST',
headers: {'x-gl-token-external': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({refundType: 'P', paymentData: {totalAmount: '25.00', txnCurrency: 'INR'}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"gid": "gl_refund_abcdef123",
"status": "SENT_FOR_REFUND",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "",
"data": {
"gid": "gl_refund_abcdef123",
"originalGid": "gl_9c2645ed09edb22e",
"status": "SENT_FOR_REFUND",
"refundAmount": "25.00"
}
}{
"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"
}
]
}{
"gid": "gl_9c2645ed09edb22e",
"timestamp": "10/01/2026 15:00:00",
"reasonCode": "VALIDATION_ERROR",
"data": {},
"errors": {},
"errorDetails": [
{
"field": "panNumber",
"message": "Required field is missing"
}
]
}
