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
X-PROVIDER-IDUsed for the cases where the merchant has multiple merchant IDs
{
  "merchantId": "MERCHANTUAT",
  "transactionId": "TX32321849644234",
  "merchantOrderId": "TX32321849644234",
  "amount": 1000,
  "storeId": "234555",
  "terminalId": "894237",
  "expiresIn": 1800,
  "gstBreakup": {
    "gst": 100,
    "cgst": 25,
    "cess": 25,
    "sgst": 25,
    "igst": 25,
    "gstIncentive": 100,
    "gstPercentage": 10
  },
  "invoiceDetails": {
    "invoiceNumber": "123456fffff##_##",
    "invoiceDate": "2021-06-29T10:13:54.022Z",
    "invoiceName": "bccbd_cjdcdjc******"
  }
}
{
  "request": "ewogICJtZXJjaGFudElkIjogIk1FUkNIQU5UVUFUIiwKICAidHJhbnNhY3Rpb25JZCI6ICJUWDMyMzIxODQ5NjQ0MjM0IiwKICAibWVyY2hhbnRPcmRlcklkIjogIlRYMzIzMjE4NDk2NDQyMzQiLAogICJhbW91bnQiOiAxMDAwLAogICJzdG9yZUlkIjogIjIzNDU1NSIsCiAgInRlcm1pbmFsSWQiOiAiODk0MjM3IiwKICAiZXhwaXJlc0luIjogMTgwMCwKICAiZ3N0QnJlYWt1cCI6IHsKICAgICJnc3QiOiAxMDAsCiAgICAiY2dzdCI6IDI1LAogICAgImNlc3MiOiAyNSwKICAgICJzZ3N0IjogMjUsCiAgICAiaWdzdCI6IDI1LAogICAgImdzdEluY2VudGl2ZSI6IDEwMCwKICAgICJnc3RQZXJjZW50YWdlIjogMTAKICB9LAogICJpbnZvaWNlRGV0YWlscyI6IHsKICAgICJpbnZvaWNlTnVtYmVyIjogIjEyMzQ1NmZmZmZmIyNfIyMiLAogICAgImludm9pY2VEYXRlIjogIjIwMjEtMDYtMjlUMTA6MTM6NTQuMDIyWiIsCiAgICAiaW52b2ljZU5hbWUiOiAiYmNjYmRfY2pkY2RqYyoqKioqKiIKICB9Cn0="
}

Request Parameters

Parameter NameTypeDescriptionMandatory
merchantIdSTRINGUnique MerchantID assigned to the merchant by PhonePeYes
subMerchantIdSTRINGUnique identity of end merchantNo
storeIdSTRINGStore Id of store. Should be unique across. Special characters like " ", ",", "@" etc. are not allowed. Length should be lesser than 38 charactersYes
terminalIdSTRINGUnique terminal Id for each POS device. Special characters like " ", ",", "@" etc. are not allowed. Length should be lesser than 38 charactersNo
gstBreakupOBJECTRefer below for gstBreakup detailsNo
invoiceDetailsOBJECTRefer below for invoice detailsNo
transactionId STRINGUnique transactionIdYes
amountLONGAmount in PaiseYes
expiresInLONGExpiry time in secondsYes
merchantOrderIdSTRINGOrderId. This can be same as transactionIdNo
messageSTRINGMessage for customerNo

Request Parameters - gstBreakup Details

Parameter NameTypeMandatoryComments
gstLONGNoIn Paise. Cannot be Negative.
cgstLONGNoIn Paise.Cannot be Negative.
cessLONGNoIn Paise.Cannot be Negative.
sgstLONGNoIn Paise.Cannot be Negative.
igstLONGNoIn Paise.Cannot be Negative.
gstIncentiveLONGNoIn Paise.Cannot be Negative.
gstPercentageDOUBLENoCannot be Negative.

Request Parameters - invoiceDetails

Parameter NameTypeMandatoryComments
invoiceNumberStringNo
invoiceDateStringNoShould be of the format 1970-01-01T05:30:00+05:30
invoiceNameStringNo
{
  "success": true,
  "code": "SUCCESS",
  "message": "Your request has been successfully completed.",
  "data": {
    "merchantId": "MERCHANTUAT",
    "transactionId": "TX32321849644234",
    "amount": 1000,
    "qrString": "upi://[email protected]&pn=Test%20MerchantTT&am=10.00&mam=10.00&tr=TX32321849644234&tn=Payment%20for%20TX32321849644234&mc=5311&mode=04&purpose=00&gstBrkUp=GST:1.0|CGST:0.25|SGST:0.25|IGST:0.25|CESS:0.25|GSTIncentive:1.0|GSTPCT:10.0&invoiceNo=123456fffff##_##&invoiceDate=2021-06-29T15:43:54+05:30&invoiceName=bccbd_cjdcdjc******"
  }
}

Response Codes

CodeDescription
INVALID_TRANSACTION_IDDuplicate TransactionID
BAD_REQUESTInvalid request payload
AUTHORIZATION_FAILEDIncorrect X-VERIFY header
INTERNAL_SERVER_ERRORSomething went wrong
SUCCESSAPI successful
Language
Click Try It! to start a request and see the response here!