QR Init is used when the merchant wants to generate a new dynamic QR code.

Request Headers

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(base64 encoded payload + "/v3/qr/init" +
salt key) + ### + salt index
X-CALLBACK-URLURL on which server to server response is required
once payment is done
X-CALL-MODEHTTP mode to be used for callback. Default Value: POST
{
  "request": "ewoJIm1lcmNoYW50SWQiOiJNMjMwNjE2MDQ4MzIyMDY3NTU3OTE0MCIsCgkidHJhbnNhY3Rpb25JZCI6IlRYMzIzMjE4NDk2NDQyMzQiLAoJImFtb3VudCI6MTAwMCwKCSJzdG9yZUlkIjoiMjM0NTU1IiwKCSJ0ZXJtaW5hbElkIjoiODk0MjM3Igp9"
}

Request Parameters

Parameter NameTypeDescriptionMandatory
merchantIdSTRINGUnique MerchantID assigned to the merchant by PhonePeYes
subMerchantIdSTRINGUnique identity of end merchantNo
storeIdSTRINGSame as subMerchantIdNo
terminalIdSTRINGUnique terminal Id for each POS deviceNo
transactionId STRINGUnique transactionIdYes
amountLONGAmount in PaiseYes
expiresInLONGExpiry time in secondsYes
merchantOrderIdSTRINGOrderId. This can be same as transactionIdNo
messageSTRINGMessage for customerNo
{
    "success": true,
    "code": "SUCCESS",
    "message": "Your request has been successfully completed.",
    "data": {
        "merchantId": "M2306160483220675579140",
        "transactionId": "TX32321849644234",
        "amount": 1000,
        "qrString": "upi://pay?pn=MERCHANT&pa=M2306160483220675579140@ybl&tid=YBL60c7891e33cb42daaf86b0aeb992a8b9&tr=P1806151323093900554957&am=10.00&cu=INR&url=https://phonepe.com&mc=5311&tn=Payment%20for%20P1806151323093900554957"
    }
}

Response Codes

CodeDescription
INVALID_TRANSACTION_IDDuplicate TransactionID
BAD_REQUESTInvalid request payload
AUTHORIZATION_FAILEDIncorrect X-VERIFY header
INTERNAL_SERVER_ERRORSomething went wrong
SUCCESSAPI successful

Sample Codes##

Sample code can be downloaded from the link mentioned below:-

URL: https://phon.pe/uh822h5f,
Password: OQ9qgKB9jp

Language
Click Try It! to start a request and see the response here!