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

Request Headers

Header Name

Header Value

Content-Type

application/json

X-VERIFY

SHA256(base64 encoded payload + "/v3/qr/init" +
salt key) + ### + salt index

X-CALLBACK-URL

URL on which server to server response is required
once payment is done

X-CALL-MODE

HTTP mode to be used for callback. Default Value: POST

X-PROVIDER-ID

Used 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 Name

Type

Description

Mandatory

merchantId

STRING

Unique MerchantID assigned to the merchant by PhonePe

Yes

subMerchantId

STRING

Unique identity of end merchant

No

storeId

STRING

Store Id of store. Should be unique across. Special characters like " ", ",", "@" etc. are not allowed. Length should be lesser than 38 characters

Yes

terminalId

STRING

Unique terminal Id for each POS device. Special characters like " ", ",", "@" etc. are not allowed. Length should be lesser than 38 characters

No

gstBreakup

OBJECT

Refer below for gstBreakup details

No

invoiceDetails

OBJECT

Refer below for invoice details

No

transactionId

STRING

Unique transactionId

Yes

amount

LONG

Amount in Paise

Yes

expiresIn

LONG

Expiry time in seconds

Yes

merchantOrderId

STRING

OrderId. This can be same as transactionId

No

message

STRING

Message for customer

No

Request Parameters - gstBreakup Details

Parameter Name

Type

Mandatory

Comments

gst

LONG

No

In Paise. Cannot be Negative.

cgst

LONG

No

In Paise.Cannot be Negative.

cess

LONG

No

In Paise.Cannot be Negative.

sgst

LONG

No

In Paise.Cannot be Negative.

igst

LONG

No

In Paise.Cannot be Negative.

gstIncentive

LONG

No

In Paise.Cannot be Negative.

gstPercentage

DOUBLE

No

Cannot be Negative.

Request Parameters - invoiceDetails

Parameter Name

Type

Mandatory

Comments

invoiceNumber

String

No

invoiceDate

String

No

Should be of the format 1970-01-01T05:30:00+05:30

invoiceName

String

No

{
  "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

Code

Description

INVALID_TRANSACTION_ID

Duplicate TransactionID

BAD_REQUEST

Invalid request payload

AUTHORIZATION_FAILED

Incorrect X-VERIFY header

INTERNAL_SERVER_ERROR

Something went wrong

SUCCESS

API successful

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