predebit
The Pre-Debit Notification API allows the merchants to send a pre-debit notification to the customer regarding an upcoming payment which will be deducted from the customer’s account as part of the registration. There is a mandate to send this notification to the customer at least 48 hours before the actual debit, that is, 48 hours before calling the Recurring API.
Reminder
- Check the mandate status before calling the Pre-Debit Notification API.
- Unless the Pre-Debit notification API is implemented, the Recurring Payment Transaction API will not work, and you will not be able to charge the customer for the given billing cycle.
- Pre-Debit notification is necessary only for Cards and UPI and works for only these two payment modes
Environment
Production Environment | <https://info.payu.in/merchant/> |
Test Environment | <https://test.payu.in/merchant/> |
Sample request
curl --location --request POST 'https://test.info.payu.in/merchant/postservice.php?form=2' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data
'key=JF****g&hash=9f5faabedb7f5d41f519db3a223cf5318ecc0b7e669f49e0a699d4c4879e1ccaed5b99f5cd
8be4f2cbddefe5272ec983abd8f38480d9c2609a29447f750a3158&command=check_action_status_txnid&var
1=7043873219"
Sample response
Successful sceanario
{
"status": 1,
"action": "MANDATE_PRE_DEBIT",
"message": "Request Processed Successfully",
“invoiceId”:” ADDA049409”
}
Failure Scenarios
- Mandate is active in PayU DB and Pre-Debit gets declined from Bank/NPCI
{
"status": “QC” ----- >> Bank/NPCI Error Code
"action": "MANDATE_PRE_DEBIT",
"message": “MANDATE HAS BEEN REVOKED”. ---- >> Description against error code
}
Where, the message parameter in the response will display error code according to the scenario
- Mandate is already Paused/ Revoked in PayU DB
{
"status": 0,
"action": "MANDATE_PRE_DEBIT",
"message": "Mandate is not active” --- >> Description will change based on Scenario
}
Where, the message parameter in the response will display according to the scenario.
Response parameters
Parameter Name | Description |
---|---|
status |
Status defines acknowledgment from PayU. Possible values are : · 0 – This value indicates pre-debit notification failed to get triggered and merchant should retry after some time to trigger the same or failed to get deleted in case of action delete. |
action |
Always returned as “MANDATE_PRE_DEBIT” to highlight the type of action. |
message |
Description of the pre-debit notification process |
invoiceId |
This is an acknowledgment ID that a pre debit notification has been sent for processing. |
invoiceStatus |
This is the status of the invoice whether it has been charged for recurring or not. Values can be:
|
approvedStatus |
This is for cases where the transaction is above 15000 as RBI guideline says approval is required through AFA (Additional Factor authentication). Values can be:
|
Request parameters
Reference information
Response Parameters var1 JSON fields description
Additional information
Parameter Name | Description |
---|---|
status |
Status defines acknowledgment from PayU. Possible values are : |
action |
Always returned as “MANDATE_PRE_DEBIT” to highlight the type of action. |
message |
Description of the pre-debit notification process |
invoiceId |
This is an acknowledgment ID that a pre debit notification has been sent for processing. |
invoiceStatus |
This is the status of the invoice whether it has been charged for recurring or not. Values can be:
|
approvedStatus |
This is for cases where the transaction is above 15000 as RBI guideline says approval is required through AFA (Additional Factor authentication) Values can be.:
|
var1 JSON fields description
The var1 variable is in JSON format and comprises of the following parameters:
JSON Field | Description |
---|---|
authpayuid |
The value of mihpayid returned in the payment response of Registration transaction when transaction is successfully completed. As explained earlier in the document, you need to map this value against customer profile at his end so that correct authPayuid will be passed in the request. |
requestId |
Unique request value generated at merchant’s end to distinguish independent request call. |
debitDate |
This parameter contains the date of debit when the recurring would be charged by merchant.
|
invoiceDisplayNumber |
A unique display number by merchant for every subsequent invoice/recurring charge. This can be displayed on the merchant’s panel to the customer. This same value needs to be sent in the recurring api also. |
amount |
The transaction amount which will be deducted from the customer’s payment instrument.
|
action |
Any of the following actions can be performed: |
Use the following sample values while trying out the API:
Example values for fields in var1:
authPayuId
: 10731087875requestId
: 23123abut12123osd14debitDate
: 2020-03-20amount
: 100