Skip to main content

Inquiry & Refund

  • Inquiry: We provide capabilities to perform transaction status and refund status inquiry.
  • Refund: We provide capability to refund the transaction so that you can initiate it for your customers.
FieldValue
API NameCreate refund and check transaction/refund status
Path/api/PG/V2
HTTP methodPost
Content typex-www-form-urlencoded

Request parameters

KEYVALUEDETAILSMANDATORY(M)/OPTIONAL(O)
ppc_MerchantIDGreater than zero int32Shared by Pine Labs on merchant registration.M
ppc_AmountString. Greater than zero, in the least currency denominator (e.g. for INR amount is in Paise)It is the amount for which payment transaction is requiredM(optional for inquiry)
ppc_DIA_SECRET_TYPEStringValues: ‘SHA256’ or ‘MD5’M
ppc_DIA_SECRETStringHash of response parameters. Please refer to HashGenerationDocument. Pine PG creates the ppc_DIA_SECRET of the response parameters and sends this information in response as ppc_DIA_SECRET. And you can use this ppc_DIA_SECRET value in Pine PG Response returned from Pine PG API to match with the new SECRET generated at your side using other response parameters. If these two Secrets don’t match then data is not Authentic.M
ppc_UniqueMerchantTxnIDIntegerMerchant transaction idM(Merchant txn id posted during sale for inquiry and for Refund this will be unique txn id other than sale txn id)
ppc_MerchantAccessCodeStringShared by Pine Labs on merchant registration.M
ppc_PinePGTransactionIDInt64 value, it is required for ‘Capture’, ‘Refund’ and ‘Inquiry’ transactions only. So, it must not be supplied in ‘Pre Authorization’ and ‘Purchase’ transactions.This is the Pine_PG_Transaction_ID generated by Pine Labs against the orderID of merchant for ‘PreAuth’ or ‘Purchase’ type. This is sent to the merchant in response of this transaction. This value is used as input parameter for dependent transactions like ‘Capture’, ‘Refund’, ‘Inquiry’. This acts as a parent transactionID(only in case of Purchase type)M(optional for inquiry)
ppc_TransactionTypeIntegerValues: 3 for ‘Inquiry’, 9 for ‘Capture’, 10 for ‘Refund’M
ppc_CurrencyCodeIntegerUse-356 for INRM(optional for inquiry)
ppc_ImeiProductDetailsBase64 StringThis field will be used to pass the product-imei details while doing a refund of brand EMI transaction. Only those imei’s will be unblocked which is present in the field. Value of the field is Base64 of JSON String of product imei details array.O

Sample value of ppc_ImeiProductDetails :

Base64 String

W3sicHJvZHVjdF9jb2RlIjoiNzgwMyIsImltZWlfbm8iOiI5ODQ4NDg4ODQ0In0sIHsicHJvZHVjdF9jb2RlIjoieGl hb21pX3BybyIsImltZWlfbm8iOiI5ODQ4NDg4Mjg0NSJ9XQ==

Decoded Base64 string

[
{
"product_code": "7803",
"imei_no": "9848488844"
},
{
"product_code": "xiaomi_pro", "imei_no": "98484882845"
}
]

Sample Inquiry

ppc_DIA_SECRET=DECF2D9D903BACAF85DA88B5686BC0FB6AB7681673E99191C86B4DC78C27277F&ppc_
DIA_SECRET_TYPE=SHA256&ppc_MerchantAccessCode=58ad283b-7c93-4f19-b072- b17e8ecfb20e&ppc_MerchantID=2415&ppc_TransactionType=3&ppc_UniqueMerchantTxnID=100000000000007687

Sample Refund

ppc_Amount=10000&ppc_CurrencyCode=356&ppc_DIA_SECRET=1781AE06CAF31A32B79F31B82B140484 DD9C1B95CC0DD26C1CB4F1AE0D13C066&ppc_DIA_SECRET_TYPE=SHA256&ppc_MerchantAccessCode=58 ad283b-7c93-4f19-b072-
b17e8ecfb20e&ppc_MerchantID=2415&ppc_PinePGTransactionID=87943&ppc_TransactionType=10&ppc_UniqueMerchantTxnID
=100000000000007687&ppc_ImeiProductDetails=W3sicHJvZHVjdF9jb2RlIjoiNzgwMyIsImltZWlfbm8iOiI5ODQ4NDg4ODQ0In0sIH sicHJvZHVjdF9jb2RlIjoieGlhb21pX3BybyIsImltZWlfbm8iOiI5ODQ4NDg4Mjg0NSJ9XQ==

Response parameters for Refund & Inquiry API

Response parameters Key-Valuepair Table Contains a collection of key-value pairs of all parameters which Pine PG will post back in response.

KEYVALUEDETAILS
ppc_MerchantIDGreater than zero int32MID through which transaction has been initiated
ppc_MerchantAccessCodeStringMerchantAccessCode used in API request
ppc_UniqueMerchantTxnIDInt32 valueIn Response you can find the Merchant Unique transaction ID which you have sent as one of the parameter
ppc_PinePGTxnStatusIntegerPlease refer Pine PG Transaction Status Table
ppc_TransactionCompletionDateTimeDateTimeThe date-time of the transaction completion at Pine PG server.
ppc_AmountString Greater than zero, in the least currency denominator (e.g. for INR amount is in Paise)It is the amount for which payment transaction is being done.
ppc_TxnResponseCodeIntegerRepresent the response status of the API call made to PinePG. For the response status of parent transaction refer ppc_ParentTxnResponseCode and ppc_Parent_TxnStatus
ppc_TxnResponseMessageStringIt is the text corresponding to ppc_TxnResponseCode All ppc_TxnResponseCode and their ppc_TxnResponseMessage. Please refer to Transaction Response Codes and their Meanings (Messages) Table
ppc_AcquirerNameStringAcquirer Name
ppc_PinePGTransactionIDIntegerPinePgtransaction ID merchant posted in request.
ppc_DIA_SECRETStringHash of response parameters.
ppc_DIA_SECRET_TYPEString‘SHA256’ or ‘MD5’ and will be the same which is passed in ppc_DIA_SECRET_TYPE parameter of request
ppc_MerchantReturnURLStringReturn Url which you have posted in request
ppc_EMITenureMonthIntegerTenure months of EMI transaction
ppc_EMIInterestRatePercentIntegerInterest rate charged by bank multiplied by 1000
ppc_EMIProcessingFeeLongProcessingFeeofEMIinpaisa
ppc_EMIPrincipalAmountLongPrincipal EMIamount in paisa
ppc_EMIAmountPayableEachMonthLongEMI Montly installment
ppc_ProductCodeLongMerchant product Code in case of Brand EMI transaction.
ppc_ProductDisplayName
ppc_Is_BankEMITransactionBoolFlag to indicate bank EMI transaction
ppc_Is_BrandEMITransactionBoolFlag to indicate brand EMI transaction
ppc_CapturedAmountIntegerTotal amount captured
ppc_RefundedAmountIntegerTotal amount refunded
ppc_EMICashBackTypeIntegerIts value will be 0, 1, 2, and 3. 0-Standard EMI, 1-Pre cash back, 2-Post cash back, 3-Instant Discount
ppc_EMIIssuerDiscCashBackPercentIntegerIssuer Disc or Cash percent applicable in EMI transaction multiplied by 10000
ppc_EMIIssuerDiscCashBackFixedAmtLongIssuer Fixed Disc or Cash Amount applicable in EMI transaction in paisa
ppc_EMIMerchantDiscCashBackPercentIntegerMerchant Disc or Cash percent applicable in EMI transaction multiplied by 10000
ppc_EMIMerchantCashBackFixedAmtLongMerchant Fixed Disc or Cash Amount applicable in EMI
ppc_EMITotalDiscCashBackPercentIntegerTotal Disc or Cash percent applicable in EMI transaction multiplied by 10000
ppc_EMITotalDiscCashBackPercentFixedAmtIntegerTotalFixed Disc or Cashpercent applicable in EMI transaction in paisa
ppc_EMITotalDiscCashBackAmtIntegerTotal Disc or Cash amount applicable in EMI transaction in paisa
ppc_EMIAdditionalCashBackIntegerAdditional cashback applicable in EMI transaction in paisa
ppc_EMIAdditionalRewardPointsIntegerAdditional Reward point applicable in EMI transaction. Please refer Pine PG Transaction Status Table
ppc_PaymentModeIntegerPayment mode selected for doing the purchase transaction. 1:CREDIT/DEBIT CARD, 3:NET BANKING, 4:EMI
ppc_ADDOnInstantDiscAmtIntegerAddon Instant disc amt (Not valid for PG)
ppc_OriginalTxnAmtString. Greater than zero, in the least currency denominator (e.g. for INR amount is in Paise)This is the transaction amount for which the purchase transaction was done
ppc_Parent_TxnStatusIntegerStatus of the Purchase transaction. Please refer to Pine PG Transaction Status Table. This field should be mapped for the response status of the Parent purchase transaction for which API call is made.
Ppc_ParentTxnResponseCodeIntegerResponse code of the Purchase transaction. Represents the response of the API request, and various integer codes are returned based on the transaction result. This field should be mapped for the response status of the Parent purchase transaction for which API call is made.
ppc_ParentTxnResponseMessageStringResponse message of the purchase transaction. It is the text corresponding to ppc_TxnResponseCode. Please refer to Transaction Response Codes and their Meanings (Messages) Table.
ppc_ProgramTypeIntegerValues: 106 for Brand EMI
ppc_MaskedCardNumberStringMasked value of the card used for the purchase transaction

Note: The status of the Purchase transaction for which an Inquiry API call is made should be incurred from parameters ppc_Parent_TxnStatus and

Transactionppc_Parent_TxnStatusppc_ParentTxnResponseCode
Successful Parent Purchase Transaction41

For any Inquiry transaction of purchase or refund, ppc_PinePGTxnStatus will always be 7 whether parent transaction is success or failure.

{
"ppc_MerchantID": "2415",
"ppc_MerchantAccessCode": "4e919e33-e940-49a7-a2ba- ece896b9800a",
"ppc_PinePGTxnStatus": "7",
"ppc_TransactionCompletionDateTime": "31/08/2017 05:27:20 PM",
"ppc_UniqueMerchantTxnID": "107028531080501543",
"ppc_Amount": "9000000",
"ppc_Txn ResponseCode": "1",
"ppc_TxnResponseMessage": "SUCCESS",
"ppc_PinePGTransactionID": "1024 80",
"ppc_CapturedAmount": "9000000",
"ppc_RefundedAmount": "0",
"ppc_ParentTxnResponse C ode": "1",
"ppc_Parent_TxnStatus": "4",
"ppc_ParentTxnResponseMessage": "SUCCESS",
"ppc_A cquirerName": "AMEX",
"ppc_DIA_SECRET": "72FA164057D4C6E6D0754C16C964566686E63E 3BEB3E64BCFB022D41158F777C",
"ppc_DIA_SECRET_TYPE": "SHA256",
"ppc_EMITenureMo nth": "3",
"ppc_EMIInterestRatePercent": "12.00",
"ppc_EMIPrincipalAmount": "9000000",
"ppc_EMI AmountPayableEachMonth": "3060199",
"ppc_ProductCode": "24",
"ppc_Is_BrandEMITransaction": "1",
"ppc_EMICashBackType": "2",
"ppc_EMIIssuerDiscCashBackPercent": "0.00",
"ppc_EMIIssuer DiscCashBackFixedAmt": "0",
"ppc_EMIMerchantDiscCashBackPercent": "0.00",
"ppc_EMIMercha ntCashBackFixedAmt": "0",
"ppc_EMITotalDiscCashBackPercent": "4.00",
"ppc_EMITotalDiscCash BackAmt": "360000",
"ppc_PaymentMode": "1",
"ppc_IssuerName": "AMEX"
}

Other possible response combinations for an Inquiry call are mentioned below:

ppc_Parent_TxnStatusppc_ParentTxnResponseCodeTransaction StateTransaction type
61Full Refund successFull RefundSuccess
91Partial Refund successPartial RefundSuccess
1-1FailurePurchase
11InitiatedPurchase-
-7Any codeFailure - Payment / Full Refund / Partial Refund failedPayment / Full Refund / Partial Refund

Transactionppc_PinePGTxnStatusppc_TxnResponse Code
Successful Refund initiated for Parent Purchase Transaction12

{
"ppc_MerchantID": "4651",
"ppc_MerchantAccessCode": "2b13fc39-cf42-4f9e-bf7b-3458a97f9ca4",
"ppc_PinePGTxnStatus": "1",
"ppc_TransactionCompletionDateTime": "12/01/2021 03:12:46 PM",
"ppc_UniqueMerchantTxnID": "4651_1201202115124604102",
"ppc_Amount": "100",
"ppc_TxnResponseCode": "2",
"ppc_TxnResponseMessage": "REFUND PROCESS INITIATED",
"ppc_PinePGTransactionID": "0",
"ppc_CapturedAmount": "0",
"ppc_RefundedAmount": "0",
"ppc_DIA_SECRET":"9F629518EF305D5A423922A9E99E2B6F46C890BBF7FED39FBCEA49B8F6D15F2C",
"ppc_DIA_SECRET_TYPE": "SHA256",
"ppc_Parent_TxnStatus": "4",
"ppc_ParentTxnResponseCode": "1",
"ppc_ParentTxnResponseMessage": "SUCCESS"
}

If Refund is for an Non-Aggregator Purchase Refund can be fully refund or partial refund

Transactionppc_Parent_TxnStatusppc_ParentTxnResponseCodeRemark
Successful Inquiry of an Initiated Refund for fully Refund61
Successful Inquiry of an Initiated Refund for partial Refund91After doing multiple partial refund ppc_ PinePGTxnStatus will change from 9 to 6 when total sum of partial refund is equal to the captured amount. In case of response of last transaction, ppc_Parent_TxnStatus =6

Fully Refunded Sample Response

{
"ppc_MerchantID": "4651",
"ppc_MerchantAccessCode": "2b13fc39-cf42-4f9e-bf7b-3458a97f9ca4",
"ppc_PinePGTxnStatus": "6",
"ppc_TransactionCompletionDateTime": "12/01/2021 03:12:46 PM",
"ppc_UniqueMerchantTxnID": "4651_1201202115124604102",
"ppc_Amount": "100",
"ppc_TxnResponseCode": "1",
"ppc_TxnResponseMessage": "SUCCESS",
"ppc_PinePGTransactionID": "78612345",
"ppc_CapturedAmount": "0", "ppc_RefundedAmount":"100”,
"ppc_DIA_SECRET":"9F629518EF305D5A423922A9E99E2B6F46C890BBF7FED39FBCEA49B8F6D15F2C",
"ppc_DIA_SECRET_TYPE": "SHA256",
"ppc_Parent_TxnStatus": "6",
"ppc_ParentTxnResponseCode": "1", "ppc_ParentTxnResponseMessage": "SUCCESS"
}

Partial Refunded Sample Response

{
"ppc_MerchantID": "4651",
"ppc_MerchantAccessCode": "2b13fc39-cf42-4f9e-bf7b-3458a97f9ca4",
"ppc_PinePGTxnStatus": "6",
"ppc_TransactionCompletionDateTime": "12/01/2021 03:12:46 PM",
"ppc_UniqueMerchantTxnID": "4651_1201202115124604102",
"ppc_Amount": "100",
"ppc_TxnResponseCode": "1",
"ppc_TxnResponseMessage": "SUCCESS",
"ppc_PinePGTransactionID": "78612345",
"ppc_CapturedAmount": "0",
"ppc_RefundedAmount":"100”,
"ppc_DIA_SECRET":"9F629518EF305D5A423922A9E99E2B6F46C890BBF7FED39FBCEA49B8F6D15F2C",
"ppc_DIA_SECRET_TYPE": "SHA256",
"ppc_Parent_TxnStatus": "9",
"ppc_ParentTxnResponseCode": "1",
"ppc_ParentTxnResponseMessage": "SUCCESS"
}

Inquiry needs to be performed for the Refund Initiated

Here's the provided information formatted into a markdown table:

Transactionppc_Parent_TxnStatusppc_ParentTxnResponseCodeRemark
Successful Inquiry of an Initiated Refund for fully Refund61
Successful Inquiry of an Initiated Refund for partial Refund91After doing multiple partial refund ppc_ PinePGTxnStatus will change from 9 to 6 when total sum of partial refund is equal to the captured amount. In case of response of last transaction, ppc_Parent_TxnStatus =6

Inquiry of Refunded transaction (Transaction can be aggregator or non-Aggregator)

Fully Refunded

{
"ppc_MerchantID": "4651",
"ppc_MerchantAccessCode": "2b13fc39-cf42-4f9e-bf7b- 3458a97f9ca4",
"ppc_PinePGTxnStatus": "7",
"ppc_TransactionCompletionDateTime": "12/01/2021 03:15:03 PM",
"ppc_UniqueMerchantTxnID": "4651_1201202115124604102",
"ppc_Amount": "100",
"ppc_TxnResponse Code": "1",
"ppc_TxnResponseMessage": "SUCCESS",
"ppc_PinePGTransactionID": "321410",
"ppc_Captured Amount": "0",
"ppc_RefundedAmount": "100",
"ppc_AcquirerName": "HDFC",
"ppc_DIA_SECRET": "0EED21AF 99DF2C1C48EC923FE64E7177A5CCA2B022D901E4BBE72FE55E18D470",
"ppc_DIA_SECRET_TYPE": "SHA256",
"ppc_PaymentMode": "1",
"ppc_Parent_TxnStatus": "6",
"ppc_ParentTxnResponseCode": "1",
"ppc_ParentTxnResponseMessage": "SUCCESS",
"ppc_RRN": "100110000464"
}

Note: In case of amount is fully refunded (it can be done via one transaction or multiple transaction) then ppc_Parent_TxnStatus=6

Partial Refunded

{
"ppc_MerchantID": "4651",
"ppc_MerchantAccessCode": "2b13fc39-cf42-4f9e-bf7b- 3458a97f9ca4",
"ppc_PinePGTxnStatus": "7",
"ppc_TransactionCompletionDateTime": "12/01/2021 03:15:03 PM",
"ppc_UniqueMerchantTxnID": "4651_1201202115124604102",
"ppc_Amount": "100",
"ppc_TxnResponse Code": "1",
"ppc_TxnResponseMessage": "SUCCESS",
"ppc_PinePGTransactionID": "321410",
"ppc_Captured Amount": "0",
"ppc_RefundedAmount": "100",
"ppc_AcquirerName": "HDFC",
"ppc_DIA_SECRET": "0EED21AF 99DF2C1C48EC923FE64E7177A5CCA2B022D901E4BBE72FE55E18D470",
"ppc_DIA_SECRET_TYPE": "SHA256",
"ppc_PaymentMode": "1",
"ppc_Parent_TxnStatus": "9",
"ppc_ParentTxnResponseCode": "1",
"p pc_ParentTxnResponseMessage": "SUCCESS",
"ppc_RRN": "100110000464"
}

Note: In case of amount is partial refunded (it can be one transaction or multiple transaction) then ppc_Parent_TxnStatus=9