StaticQR Server to Server Callback (v1)

  • Server to server callbacks are initiated from PhonePe server to the url provided by merchant when payment reaches to any terminal state (SUCESS or FAIL)
  • To enable server to server callbacks you need to register your static callback url with PhonePe. This is a one time process. The URL should be HTTPS and running on the secured port 443.
  • NOTE: When a static QR transaction is being performed by the customer either SUCCESS or FAIL, the callback response is being sent from phonepe server on the mapped callback endpoint/URL within 5 seconds of the transaction. Our servers need an acknowledgement as 200 OK success from your end orelse we consider that 1st attempt as FAILED callback and retry for the 2nd attempt. 3 retries are performed from the server side on the merchant’s callback endpoint/URL


The payload that is going to be sent to the merchant on the specified callback url will have a base64 encoded json.

Upon base64 decoding the response, you should get a json with format similar to the response returned by transaction status API.

This is the best case callback that would be sent from PhonePe server to the merchants’ server. In the event of a callback failure, the onus is on the merchants to use the transaction status API and take the transaction to closure.

Callback headers

Following are the response headers sent with a callback.

Header NameHeader Value
X-VERIFYSHA256(MerchantId+TransactionId+Amount+SaltKey) + ### + salt index

Response Parameters

Parameter NameTypeDescription
successBOOLEANtrue/ false
codeENUM(see list of codes below)This parameter is used to decide if payment is success or failed
messageSTRINGDescriptive message
transactionIdSTRINGtransactionId (if this is static QR then this will be generated by PhonePe)
STRINGAssigned merchantId
amountLONGAmount in paisa
updateTimestampLONGPayment timestamp in epoch format
providerReferenceIdSTRINGPhonePe transactionId
payResponseCodeSTRING (Optional parameter to be sent in response)More granular error codes for failure.
paymentModesList(Optional parameter to be sent in response)Please see below for schema
transactionContextObject(Optional parameter to be sent in response)Please see below for schema

Server to Server Callback Response Codes

PAYMENT_SUCCESSPayment is successful for QR scan
PAYMENT_ERRORPayment failed for QR scan
PAYMENT_DECLINEDPayment declined by customer
PAYMENT_CANCELLEDPayment cancelled by merchant

Payment Modes (Optional parameter to be sent in response)

Parameter NameDescription
amountAmount in paisa
utrUTR for UPI payments.

Transaction Context (Optional parameter to be sent in response)

Parameter NameDescription
storeIdStore Id
terminalIdTerminal Id
curl -X POST \ \
  -H 'content-type: application/json' \
  -H 'x-verify: 2abaa82a4810c57dcd6aa52680dd772173b1e40770afe028131f31ddbe5487a8###1' \
  -d '{'success': True, 'code': 'PAYMENT_SUCCESS', 'message': 'Your payment is successful.', 'data': {'merchantId': 'TESTMERCHANT_56677', 'transactionId': '318136388819', 'providerReferenceId': 'T2306301436218684453776', 'amount': 100, 'paymentState': 'COMPLETED', 'payResponseCode': 'SUCCESS', 'transactionContext': {'qrCodeId': 'Q844950455', 'posDeviceId': None, 'storeId': '1', 'terminalId': '1'}, 
  'storeId': '1', 'terminalId': '1'}}'
   "message":"Your payment is successful.",
      "updateTimestamp": 1693904458516,
        "qrCodeId": "Q833950454",
        "posDeviceId": None,
        "storeId": "MS230601",
        "terminalId": "MST230601"
    "storeId": "MS230601",
    "terminalId": "MST230601"
  1. Success/Failure of transaction should be dependent on the code in response parameters
  2. Cross-check the amount which has been passed in forward payment path(Accept payment API) and in the response of Server to Server callback.