Refund Flow (Request and Response)

Refund API ??

  • Refunds are reversal transactions in which money is returned to the customer's source account.

  • A refund can only be issued in the case of a successful or settled transaction.

Required headers:

Header Name Header Value
Authorization
required
basic PayGAuthentication
PayGAuthentication = base64encoded(MerchantAuthenticationKey:MerchantAuthenticationToken:M:MerchantKeyId)
OR generate Authorization Header value in PayG Dashboard.
Content-Type
required
application/json

Order Refund Request: ??

OrderKeyId
required
string Id generated based on the create order request from PayG and should be stored in your system for status, verification or any communication with PayG.
Merchantkeyid
required
integer Please get this merchantkeyid from PayG Dashboard
MID
required
string Please get this MID from PayG Dashboard
PaymentType
required
string Identifies the type of the payment., eg: CreditCard/DebitCard/upi,etc
PaymentTransactionId
required
string PaymentTransactionId generated for specific transaction provided by PayG system and it should not be repeated.
RefundAmount
required
decimal(18,2) Refund Amount - This amount will be shown to user for refund payment.

Refund Response: ??

OrderKeyId
string Id generated based on the create order request from PayG and should be stored in your system for status, verification or any communication with PayG.
MerchantKeyId
integer Id which is obtained on MerchantRegistration
UniqueRequestId
string Echo from request
OrderType string Echo from request
OrderAmount
decimal(18,2) Transaction Amount
OrderId string Echo from request
OrderStatus
string Status of the order. Please refer for Order Status Codes
OrderPaymentStatus integer Status of the order., eg: 0,1,2,3,4,5,6,7
OrderPaymentStatusText string Status of the order., eg: Paid
PaymentStatus
integer Status Code of the payment.,
PaymentTransactionId
string Id generated for that transaction
PaymentResponseCode
integer Payment Status of the order. Please refer for Payment Response Codes
PaymentApprovalCode
string Unique number identifying the Approved transaction
PaymentReasonCode
integer Code for transaction failure/approval.
PaymentTransactionRefNo
string Transaction reference number.
PaymentResponseText
string eg: created, completed-approved transaction,cancelled payment by user
PaymentMethod
string Specified Values Transaction processed with eg: CreditCard, DebitCard, UPI etc
PaymentAccount
string Payment processed account detail. Data depending on PaymentMethod. if processed as
UPI - then VPA/UPI ID,
Credit/DebitCard - then Card number first 6 and last 4 digits of card,
Netbanking - then BankName,
Wallet - then Wallet Name like PayTM, Freecharge etc.
OrderRefundTransactionId
integer Transaction ID generated for refund.
RefundPaymentResponseCode
integer Refund Payment Response Code eg: 1,2,4 ..
RefundPaymentResponseText
string Refund payment response text eg: Transaction Successful, Declined/Failed, Pending etc.
RefundDateTime
string Date & Time for refund transaction.
CardType
string Type of card eg: rupay, visa, mastercard etc.
CardLevel
string Level of card eg: Domestic, platinum etc.
OrderNotes string(100) Risk and Security Notes - if you see detail in this, make sure to address with business team as soon as possible
PaymentDateTime datetime Time & Date of the payment
UpdatedDateTime datetime Updated time & date of the payment
PaymentProcessUrl
url PayG payment url for customer to pay, you need to redirect to this url for payment processing.
CustomerData object of CustomerData Customer data passed in oreder creation will be provided in this.
ProductData object of ProductData Product data passed in oreder creation will be provided in this.
OrderPaymentCustomerData object of CustomerData if user have changed their customer data on payG payment page while transaction processing, updated data will be provided in this.
OrderPaymentTransactionDetail object Transaction Details for Order for specific OrderKeyId.
UserDefinedData object of UserDefinedData User Defined Data passed in oreder creation will be provided in this. eg: "UserDefined1": "null", "UserDefined2": null etc.
Id integer Id generated for specific orderkeyid.
Sample
                         
 Authorization: basic YTVhZWNlNT4466tbfb47zM0MWVmNGE6ZTJkYTI2MTYxYjRiNDhmYzk1YjU5ZGFmMjE5MWZiMzM6TTo3Nzcx 
 Content-Type: application/json
   
                         
                        
                        {
                            "OrderKeyId": "18258220120M8792Uf3f5b5a14p",
                            "MID": "Your MID - Provided by PayG",
                            "MerchantKeyId": "8792",
                            "PaymentType": "CreditCard",
                            "PaymentTransactionId":"723333",
                            "RefundAmount":"100"
                        }
                        
                               
                        
        {
            "OrderKeyId":"210923M8340Uf3f5b5c13h",
            "MerchantKeyId":8340,
            "UniqueRequestId":"f3f5b5c13h",
            "OrderType":"PAYMENT",
            "OrderAmount":100.0,
            "OrderId":null,
            "OrderStatus":null,
            "OrderPaymentStatus":0,
            "OrderPaymentStatusText":null,
            "PaymentStatus":0,
            "PaymentTransactionId":null,
            "PaymentResponseCode":0,
            "PaymentApprovalCode":null,
            "PaymentReasonCode": null,
            "PaymentTransactionRefNo":null,
            "PaymentResponseText":null,
            "PaymentMethod":null,
            "PaymentAccount":null,
            "OrderRefundTransactionId": 72260357,
            "RefundPaymentResponseCode": 4,
            "RefundPaymentResponseText": "Pending",
            "RefundDateTime":"2023-12-16T14:16:59.227",
            "CardType": null,
            "CardLevel": null,
            "OrderNotes": null,
            "PaymentDateTime": "12/16/2023 8:40:35 AM",
            "UpdatedDateTime": "12/16/2023 8:42:42 AM",
            "PaymentProcessUrl":null,
            "CustomerData": {
                "CustomerId": "123456",
                "CustomerNotes": "Mens clothing",
                "FirstName": "ravi",
                "LastName": null,
                "MobileNo": "7337327109",
                "Email": "test@gmail.com",
                "EmailReceipt": false,
                "BillingAddress": "1234",
                "BillingCity": "Hyd",
                "BillingState": "Telangana",
                "BillingCountry": "India",
                "BillingZipCode": "223344",
                "ShippingFirstName": "ravi",
                "ShippingLastName": "",
                "ShippingAddress": "1234",
                "ShippingCity": "Hyd",
                "ShippingState": "Telangana",
                "ShippingCountry": "India",
                "ShippingZipCode": "223344",
                "ShippingMobileNo": "7337327109"
            },
            "ProductData": "{'PaymentReason':'OnlineOrder'}",
            "OrderPaymentCustomerData":{
                "FirstName":"ravi",
                "LastName":null,
                "Address":null,
                "City":null,
                "State":null,
                "ZipCode":null,
                "Country":null,
                "MobileNo":"7337327109",
                "Email":"test@gmail.com",
                "UserId":null,
                "IpAddress":null
            },
            "UpiLink":null,
            "OrderPaymentTransactionDetail":null,
            "UserDefinedData":{
                "UserDefined1":"",
                "UserDefined2":null,
                "UserDefined3":null,
                "UserDefined4":null,
                "UserDefined5":null,
                "UserDefined6":null,
                "UserDefined7":null,
                "UserDefined8":null,
                "UserDefined9":null,
                "UserDefined10":null,
                "UserDefined11":null,
                "UserDefined12":null,
                "UserDefined13":null,
                "UserDefined14":null,
                "UserDefined15":null,
                "UserDefined16":null,
                "UserDefined17":null,
                "UserDefined18":null,
                "UserDefined19":null,
                "UserDefined20":null
            }
            "SplitPaymentResponse": null,
            "Id": 112233
        }
   
  

Refund Status Flow (Request and Response)

Refund Status API ??

  • Refunds are reversal transactions in which money is returned to the customer's source account.

  • A refund can only be issued in the case of a successful or settled transaction.

  • Once refund initiated, you can check the status if refund transaction.

Required headers:

Header Name Header Value
Authorization
required
basic PayGAuthentication
PayGAuthentication = base64encoded(MerchantAuthenticationKey:MerchantAuthenticationToken:M:MerchantKeyId)
OR generate Authorization Header value in PayG Dashboard.
Content-Type
required
application/json

Refund Status Request: ??

OrderKeyId
required
integer Id generated based on the create order request from PayG and should be stored in your system for status, verification or any communication with PayG.
MID
required
string Please get this MID from PayG Dashboard.
Merchantkeyid
required
integer Please get this merchantkeyid from PayG Dashboard.
TransactionId
required
integer original PayG TransactionID

Refund Status Response: ??

OrderKeyId
string(30) Id generated based on the create order request from PayG and should be stored in your system for status, verification or any communication with PayG.
MerchantKeyId
integer Id which is obtained on MerchantRegistration
UniqueRequestId
string(20) Echo from request
OrderType string(20) Echo from request
OrderAmount
decimal(18,2) Transaction Amount
OrderId string(20) Echo from request
OrderStatus
string(10) Status of the order. Please refer for Order Status Codes
OrderPaymentStatus integer Status of the order., eg: 0,1,2,3,4,5,6,7
OrderPaymentStatusText string Status of the order., eg: Paid
PaymentStatus
integer Status Code of the payment.,
PaymentTransactionId
string(50) Id generated for that transaction
PaymentResponseCode
integer Payment Status of the order. Please refer for Payment Response Codes
PaymentApprovalCode
string(20) Unique number identifying the Approved transaction
PaymentReasonCode
integer Code for transaction failure/approval.
PaymentTransactionRefNo
string Transaction reference number.
PaymentResponseText
string(50) eg: created, completed-approved transaction,cancelled payment by user
PaymentMethod
string Specified Values Transaction processed as
PaymentAccount
string(50) Payment processed account detail. Data depending on PaymentMethod. if processed as
UPI - then VPA /UPI ID,
Credit/DebitCard - then Card number first 6 and last 4 of card ,
Netbanking - then BankName,
Wallet - then Wallet Name like PayTM, PhonePe etc
OrderRefundTransactionId
integer Transaction ID generated for refund.
RefundPaymentResponseCode
integer Refund Payment Response Code eg: 1,2,4 ..
RefundPaymentResponseText
string Refund payment response text eg: Transaction Successful, Declined/Failed, Pending etc.
RefundDateTime
string Date & Time for refund transaction.
CardType
string Type of card eg: rupay, visa, mastercard etc.
CardLevel
string Level of card eg: Domestic, platinum etc.
OrderNotes string(100) Risk and Security Notes - if you see detail in this, make sure to address with business team as soon as possible
PaymentDateTime datetime Time & Date of the payment
UpdatedDateTime datetime Updated time & date of the payment
PaymentProcessUrl*
url PayG payment url for customer to pay, you need to redirect to this url for payment processing.
CustomerData object of CustomerData Customer data passed in oreder creation will be provided in this.
ProductData object of ProductData Product data passed in oreder creation will be provided in this.
OrderPaymentCustomerData object of CustomerData if user have changed their customer data on payG payment page while transaction processing, updated data will be provided in this.
OrderPaymentTransactionDetail object Transaction Details for Order for specific OrderKeyId.
UserDefinedData object of UserDefinedData User Defined Data passed in oreder creation will be provided in this. eg: "UserDefined1": "null", "UserDefined2": null etc.
Id integer Id generated for specific orderkeyid.

Status Sample

                         
 Authorization: basic YTVhZWNlNTg3NWEwNDA0NGJmZjQ5MWRlNzM0MWVmNGE6ZTJkYTI2MTYxYjRiNDhmYzk1YjU5ZGFmMjE5MWZiMzM6TTo3Nzcx 
 Content-Type: application/json
   
                         
                        
                                {
                                "OrderKeyId": "73304848231216M21764UTEST600021",
                                "MID": "Your MID - Provided by PayG",
                                "MerchantKeyId": 21764,
                                "TransactionId": 72200157
                                }
                         
                        
        
        {
            "OrderKeyId":"73304848231216M21764UTEST500021",
            "MerchantKeyId":21764,
            "UniqueRequestId":"TEST500021",
            "OrderType":"PAYMENT",
            "OrderAmount":100.0,
            "OrderId":null,
            "OrderStatus":null,
            "OrderPaymentStatus":0,
            "OrderPaymentStatusText": "Paid",
            "PaymentStatus":1,
            "PaymentTransactionId":"72260277",
            "PaymentResponseCode":1,
            "PaymentApprovalCode":"",
            "PaymentReasonCode": null,
            "PaymentTransactionRefNo": "335045432763",
            "PaymentResponseText":"Approved",
            "PaymentMethod":"Upi",
            "PaymentAccount":"8889991111@ybl",
            "OrderRefundTransactionId": 72260357,
            "RefundPaymentResponseCode": 1,
            "RefundPaymentResponseText": "Transaction Successful",
            "RefundDateTime":"2023-12-16T14:16:59.227",
            "CardType": null,
            "CardLevel": null,
            "OrderNotes": null,
            "PaymentDateTime": "12/16/2023 2:07:53 PM",
            "UpdatedDateTime": "12/16/2023 2:16:59 PM",
            "PaymentProcessUrl": null,
            "CustomerData": {
            "CustomerId": null,
            "CustomerNotes": null,
            "FirstName": "",
            "LastName": "",
            "MobileNo": "8889991111",
            "Email": "abce@gmail.com",
            "EmailReceipt": false,
            "BillingAddress": "",
            "BillingCity": "",
            "BillingState": "",
            "BillingCountry": null,
            "BillingZipCode": "",
            "ShippingFirstName": null,
            "ShippingLastName": null,
            "ShippingAddress": null,
            "ShippingCity": null,
            "ShippingState": null,
            "ShippingCountry": null,
            "ShippingZipCode": null,
            "ShippingMobileNo": null
            },
            "ProductData": "Testings",
            "OrderPaymentCustomerData": null,
            "UpiLink": null,
            "OrderPaymentTransactionDetail": [
            {
            "Id": 71507213,
            "OrderId": 73304848,
            "OrderKeyId": "73304848231216M21764UTEST500021",
            "MerchantKeyId": 21764,
            "TransactionId": 72260277,
            "ResponseCode": 1,
            "ResponseText": "Approved",
            "ProcessorRequestId": "T72260277M21764D231216",
            "IPAddress": null,
            "UpdatedDateTime": "2023-12-16T14:07:52.143",
            "TransactionAmount": 1.00
            },
            {
            "Id": 71507293,
            "OrderId": 73304848,
            "OrderKeyId": "73304848231216M21764UTEST500021",
            "MerchantKeyId": 21764,
            "TransactionId": 72260357,
            "ResponseCode": 1,
            "ResponseText": "Approved",
            "ProcessorRequestId": "72260277D20231216T02PM56",
            "IPAddress": "183.82.97.220:55414",
            "UpdatedDateTime": "2023-12-16T14:30:34.7",
            "TransactionAmount": 1.00
            }
            ],
            "UserDefinedData": {
            "UserDefined1":"",
            "UserDefined2": "",
            "UserDefined3": "",
            "UserDefined4": "",
            "UserDefined5": "",
            "UserDefined6": "",
            "UserDefined7": "",
            "UserDefined8": "",
            "UserDefined9": null,
            "UserDefined10": null,
            "UserDefined11": null,
            "UserDefined12": null,
            "UserDefined13": null,
            "UserDefined14": null,
            "UserDefined15": null,
            "UserDefined16": null,
            "UserDefined17": null,
            "UserDefined18": null,
            "UserDefined19": null,
            "UserDefined20": null
            },
            "SplitPaymentResponse": null,
            "Id": 73304848
        }