Pay Credit

Headers

Field NameMandatoryDescription
Content-TypeYesapplication/json
X-VerifyYesSHA256(base64 encoded payload + '/v3/merchant/credit/pay' + salt key) + '###' + salt index
{
  "userAuthToken": "USER_TOKEN568909123",
  "merchantId": "PPE_MRCH_123",
  "transactionId": "TRX_MRCH_123",
  "amount": 2500,
  "merchantOrderId": "MRC_ORD_123",
  "creditType": "CREDIT",
  "paymentInstrument": {
    "instrumentType": "ACCOUNT",
    "instrumentId": "instrumentUniqueId"
  },
  "message": "transaction remarks"
}
{ 
  "request" : "ewogICJ1c2VyQXV0aFRva2VuIjogIlVTRVJfVE9LRU41Njg5MDkxMjMiLAogICJtZXJjaGFudElkIjogIlBQRV9NUkNIXzEyMyIsCiAgInRyYW5zYWN0aW9uSWQiOiAiVFJYX01SQ0hfMTIzIiwKICAiYW1vdW50IjogMjUwMCwKICAibWVyY2hhbnRPcmRlcklkIjogIk1SQ19PUkRfMTIzIiwKICAiY3JlZGl0VHlwZSI6ICJDUkVESVQiLAogICJwYXltZW50SW5zdHJ1bWVudCI6IHsKICAgICJpbnN0cnVtZW50VHlwZSI6ICJBQ0NPVU5UIiwKICAgICJpbnN0cnVtZW50SWQiOiAiaW5zdHJ1bWVudFVuaXF1ZUlkIgogIH0sCiAgIm1lc3NhZ2UiOiAidHJhbnNhY3Rpb24gcmVtYXJrcyIKfQ=="
}
{
  "mobileNumber": "9988776655",
  "merchantId": "PPE_MRCH_123",
  "transactionId": "TRX_MRCH_123",
  "amount": 2500,
  "merchantOrderId": "MRC_ORD_123",
  "creditType": "CREDIT",
  "paymentInstrument": {
    "instrumentType": "VPA_TOKEN",
    "instrumentId": "instrumentUniqueId"
  },
  "message": "transaction remarks"
}
{ 
  "request" : "ewogICJtb2JpbGVOdW1iZXIiOiAiOTk4ODc3NjY1NSIsCiAgIm1lcmNoYW50SWQiOiAiUFBFX01SQ0hfMTIzIiwKICAidHJhbnNhY3Rpb25JZCI6ICJUUlhfTVJDSF8xMjMiLAogICJhbW91bnQiOiAyNTAwLAogICJtZXJjaGFudE9yZGVySWQiOiAiTVJDX09SRF8xMjMiLAogICJjcmVkaXRUeXBlIjogIkNSRURJVCIsCiAgInBheW1lbnRJbnN0cnVtZW50IjogewogICAgImluc3RydW1lbnRUeXBlIjogIlZQQV9UT0tFTiIsCiAgICAiaW5zdHJ1bWVudElkIjogImluc3RydW1lbnRVbmlxdWVJZCIKICB9LAogICJtZXNzYWdlIjogInRyYW5zYWN0aW9uIHJlbWFya3MiCn0="
}
{
  "mobileNumber": "9988776655",
  "merchantId": "PPE_MRCH_123",
  "transactionId": "TRX_MRCH_123",
  "amount": 2500,
  "merchantOrderId": "MRC_ORD_123",
  "creditType": "CREDIT",
  "paymentInstrument": {
    "instrumentType": "VPA",
    "instrumentId": "[email protected]"
  },
  "message": "transaction remarks"
}
{ 
  "request" : "ewogICJtb2JpbGVOdW1iZXIiOiAiOTk4ODc3NjY1NSIsCiAgIm1lcmNoYW50SWQiOiAiUFBFX01SQ0hfMTIzIiwKICAidHJhbnNhY3Rpb25JZCI6ICJUUlhfTVJDSF8xMjMiLAogICJhbW91bnQiOiAyNTAwLAogICJtZXJjaGFudE9yZGVySWQiOiAiTVJDX09SRF8xMjMiLAogICJjcmVkaXRUeXBlIjogIkNSRURJVCIsCiAgInBheW1lbnRJbnN0cnVtZW50IjogewogICAgImluc3RydW1lbnRUeXBlIjogIlZQQSIsCiAgICAiaW5zdHJ1bWVudElkIjogImNsZWFydnBhQHlibCIKICB9LAogICJtZXNzYWdlIjogInRyYW5zYWN0aW9uIHJlbWFya3MiCn0="
}

Request Parameters

Field NameData TypeMandatoryDescription
userAuthTokenStringConditionaluserAuthToken generated from user linking. Not mandatory if mobile number is passed
mobileNumberStringConditionalToken to identify the user generated during otp verify call. Not mandatory if userAuthToken is passed.
merchantIdStringYesUnique Id assigned to the merchant in the PhonePe system. Assigned during merchant onboarding
transactionIdStringYesUnique Id generated by merchant for this transaction
amountLongYesAmount to be credited to the user. (in paise). Min: 1, Max: 1,00,000.00
merchantOrderIdStringNoOrder Id for this transaction at merchant’s end (if any)
creditTypeEnumYesIdentifier for type of credit. Possible Values = REFUND, CREDIT.
paymentInstrumentObjectYesObject containing details of destination instrument
messageStringNoMessage to identify what the credit was for
subMerchantIdStringNoTag to categorize merchant transactions.

Request Data Description: paymentInstrument fields

Field NameData TypeMandatoryDescription
instrumentTypeStringYesType of payment instrument payment. Possible values = VPA_TOKEN, VPA, ACCOUNT.
instrumentIdStringYesUnique identifier with instrumentType as VPA_TOKEN or ACCOUNT from /credit/options response .
VPA with instrumentType as VPA when not fetched from /credit/options call.
{
  "success": true,
  "code": "PAYMENT_PENDING",
  "message": "Your request is in pending state.",
  "data": {
    "merchantId": "PPE_MRCH_123",
    "transactionId": "TRX_MRCH_123",
    "providerReferenceId": "TTX_123_45",
    "amount": 2500,
    "paymentState": "PENDING",
    "payResponseCode": "CREATED"
  }
}

Response Parameters

Field NameData TypeDescription
successBooleanRedundant field. To be ignored by merchants.
codeStringSee "PAY CREDIT : Response Codes" table for a list of possible values and their meanings
messageStringShort message describing the code
dataObjectObject containing details of actual response data

Response Data Description: data level fields

Field NameData TypeDescription
merchantIdStringUnique Id assigned to the merchant in PhonePe system. Assigned during merchant onboarding
merchantTransactionIdStringUnique Id generated by merchant for this transaction
providerReferenceIdStringPhonePe transactionId generated for the credit request
payResponseCodeStringPhonePe payment status code. Please note, this is a string and new values can be added as and when needed. Don’t use this field for making decisions
paymentStateStringPhonePe internal payment state. This is an informative field. Don’t use this field for making decisions, since new values can be added to it

PAY CREDIT : Response Codes

Code ValueDescription
BAD_REQUESTInvalid request payload
INTERNAL_SERVER_ERRORSome went wrong at the server side. Merchant needs to call the transaction status API to verify transaction status
INVALID_TRANSACTION_IDThe transaction Id provided by the merchant is duplicated
INVALID_USER_AUTH_TOKENThe user auth token provided for this token is either expired or not mapped to the merchant. Please regenerate the token & try again.
USER_NOT_FOUNDNo user found for the given mobile number or userAuthToken.
INSTRUMENT_NOT_FOUNDThe instrument Id entered is invalid. Make another call to /credit/options, select a valid instrumentId & try again.
ACCOUNT_NOT_FOUNDInvalid instrument Id. Handling should be the same as INSTRUMENT_NOT_FOUND.
VPA_NOT_FOUNDInvalid instrument Id. Handling should be the same as INSTRUMENT_NOT_FOUND.
BLOCKED_FRAUDBusiness rule violation. Either the total amount to be credited exceeds the maximum amount allowed for a merchant OR to a user on a given day OR the maximum amount allowed for a given transaction.
PAYMENT_SUCCESSAmount has been successfully credited to the user
PAYMENT_ERRORPayment has failed
PAYMENT_PENDINGPayment is submitted for crediting the amount. Merchant needs to verify payment status by calling the transaction status API
Language
Click Try It! to start a request and see the response here!