Initiate Refund - COD


This API is used to refund to the customer where the payment transaction is missing in the system. E.g. For payment made through Cash-On-Delivery, the forward payment is made through cash and not on PhonePe. The merchant can initiate a refund through Deferred Credit.

Deferred credit is a two-step process.
First, the merchant initiates the call to /credit/deferred for credit request.
Second, to fulfill the deferred request, the merchant calls Credit Deferred Fulfil

Request Headers

Header Name

Header Values

Content-Type

application/json

X-VERIFY

SHA256(base64 encoded payload + "/v3/credit/deferred" +
salt key) + ### + salt index

X-CALLBACK-URL

Dynamic callback URI for the API request

{
  "merchantId": "DemoMerchant",
  "transactionId": "TX123456789",
  "merchantUserId": "U123456789",
  "amount": 100,
  "merchantOrderId": "OD1234",
  "subMerchant": "DemoMerchant",
  "mobileNumber": "9xxxxxxxxx",
  "message": "refund for cancelled order",
  "email": "[email protected]",
  "shortName": "Amit"
}
{
  "request": "eyJtZXJjaGFudE9yZGVySWQiOiAiT0QxMjM0IiwgInN1Yk1lcmNoYW50IjogIkRlbW9NZXJjaGFudCIsICJhbW91bnQiOiAxMDAsICJtZXNzYWdlIjogInJlZnVuZCBmb3IgY2FuY2VsbGVkIG9yZGVyIiwgIm1vYmlsZU51bWJlciI6ICI5eHh4eHh4eHh4IiwgInNob3J0TmFtZSI6ICJBbWl0IiwgInRyYW5zYWN0aW9uSWQiOiAiVFgxMjM0NTY3ODkiLCAibWVyY2hhbnRVc2VySWQiOiAiVTEyMzQ1Njc4OSIsICJtZXJjaGFudElkIjogIkRlbW9NZXJjaGFudCIsICJlbWFpbCI6ICJhbWl0eHh4NzVAZ21haWwuY29tIn0"
}

Request Parameters

Parameter Name

Type

Description

Mandatory

merchantId

String

Unique Merchant ID assigned to the merchant by PhonePe

Yes

transactionId

String

Unique Transaction ID generated by the merchant to track this request to PhonePe

Yes

merchantUserId

String

Unique ID assigned to the user by the merchant. This is used for linking the user’s PhonePe account.

Yes

amount

Long

Transaction amount in paise

Yes

merchantOrderId

String

Order ID for the merchant transaction

Yes

subMerchant

String

Tag to categorize merchant transaction

No

mobileNumber

String

Mobile number of the user

No

message

String

Short message

No

email

String

Email address of the user

No

shortName

String

User's name pre-filled for registration purpose.

No

Response Parameters

Parameter Name

Type

Description

success

Boolean

Success status of the request

code

ENUM

To see list of response codes go here.

message

String

Short message about code

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