Mandate Execution API
After the successful Mandate registration, Merchant will receive a mandate_id, mandate_token from Juspay that should be stored against a customer at their end. For the subsequent charge transactions, the merchant is supposed to pass a combination of customer_id and mandate_id to do a debit without a 2FA. This API will create an order and perform a transaction with PG based on the mandate_id passed in the request.
Consists of two parts.
Username: API Key obtained from Juspay dashboard
Password: Empty string
Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
application/x-www-form-urlencoded
Unique identifier for the merchant. This is the Merchant ID provided by Juspay. The value is case sensitive.
Passing this value will help us route efficiently at network level.
Example:- x-merchantid: testaccount
Unique Identifier for the order.
This is the amount that a customer will be charged in this transaction.
Customer Identifier against which the mandate was created.
ISO string of the currency. Use INR for Indian Rupee. Among other accepted values are EUR, USD, GBP. Default value: INR
Email address of the customer. This field is mandatory if gateway requires it.
Mobile number or fixed line number of the customer. This field is mandatory if gateway requires it.
Short description for the order. We send this information to the backend gateways whenever there is a provision for this.
A fully qualified URL such as http://shop.merchant.com/ to which the customer will be redirected after payment completion.
This URL shouldn’t contain any query parameters.
This URL takes higher precedence over the common return URL configured in your account settings.
An identifier for the product on the Lender side for which the payment is being done. This field is just echoed back in the response so that Lender can differentiate on their side.
First name in the billing address
Last name in the billing address
Line 1 in the billing address
Line 2 in the billing address
Line 3 in the billing address
Billing address city
Billing address state
Billing address country
Billing address postal code or zip code
Mobile or phone number in the billing address
ISO Country code. Default value: IND
First name in the shipping address
Last name in the shipping address
Line 1 in the shipping address
Line 2 in the shipping address
Line 3 in the shipping address
Shipping address city
Shipping address state
Shipping address country
Shipping address postal code or zip code
Mobile or phone number in the shipping address
ISO Country code. Default value: IND
Specify your preferred gateway for this order. Complete mapping for gateway_id can be found here: Gateway mapping
The username you hold at Juspay
Mandate ID sent by Juspay after successful mandate registration.
[CONDITIONAL] The object_reference_id which was sent in notification API call. Applicable only for merchants calling Notification and Execution APIs separately.
Applicable only for cards SI. If merchant wants to generate invoice display number, but wants Juspay to handle pre-debit notification, this needs to be sent.
Applicable only for merchants enabled for mandate workflow (notification + execution flow).UNIX EPOCH timestamp format. Default execution happens at 25th hour of successful notification. If a merchant wants to execute mandate at custom time anytime after 25th hour, send execution_date.
The format of the response. Should be passed as json.
Transaction UUID for the payment
Transaction Id for the payment
Status of the transaction. See Appendix for status mapping.
URL to which the user has to be taken to for completing the authentication
HTTP Method for authentication. Can be one of GET or POST
Present only when the method is POST. Parameter map that has to be sent along with the URL for authentication.
Order ID of the transaction
Provides the reason for the error
Example:- Sample value: Mandate not found
Error status
Example:- invalid_request_error
Specifies the Error code
Example:- Sample value: Mandate not found
Additional information on the error message
Error message can be displayed to the user
Example:- Sample value: Cannot process your request as mandate not found.
Detailed info on the error
Example:- Sample value: Mandate not found for customer.
category of the error
Example:- Sample value: USER_ERROR
Error Codes
|
Error Codes
|
Description
|
Sample Error Message
|
|---|---|---|
401
| Invalid Authentication
| { "status": "error", "error_code": "access_denied" }
|
400
| Duplicate order id
| { "status": "DUPLICATE_ORDER_ID", "error_message": "Order already exists with the given order_id" }
|
400
| Invalid order amount
| {"status":"Invalid Request","error_message":Invalid order amount","error_code":"Invalid"}
|
400
| Mandate max amount not found
| {"status":"Invalid Request","error_message":"Mandate max amount not found.","error_code":"Invalid"}
|
400
| Amount not found in request.
| {"status":"ERROR","error_message":"Bad request.","error_code":"Bad request."}
|
400
| Order amount greater than mandate max amount
| {"status":"Bad Request","error_message":"Order amount greater than mandate max amount (<="" style="user-select: text;">max amount>)","error_code":"Invalid"}
|
400
| Currency not valid for mandate transaction
| {"status":"Bad Request","error_message":"currency not valid for mandate transaction.","error_code":"Invalid"}
|
400
| Mandate not found
| {"status":"invalid_request_error","error_message":"Mandate not found","error_code":"Mandate not found"}
|
400
| Mandate not in active state
| {"status":"invalid_request_error","error_message":"Mandate is in PAUSED state. Recurring cannot be executed","error_code":"invalid_request"}
|
404
| Passing Invalid URL
| -
|
400
| Not passing merchant_id field
| {"error_message":"Bad request.","status":"ERROR","error_code":"Bad request.","error_info":{"user_message":"Bad request.","fields":[{"field_name":"merchant_id","reason":"Field required but not passed."}],"developer_message":"Failed while parsing your request.","code":"MISSING_MANDATORY_PARAMETER","category":"USER_ERROR"}}
|
400
| Invalid Merchant ID
| {"user_message":"Invalid merchant id. Cannot process your request.","error_message":"Invalid Request","error":true,"error_info":{"user_message":"Please pass valid merchant_id in request.","fields":[{"field_name":"merchant_id","reason":"Invalid merchant_id."}],"developer_message":"merchant_id is invalid.","code":"RESOURCE_NOT_FOUND","category":"USER_ERROR"}}
|
400
| Perfroming a transaction by providing a different currency than the create mandate
| {"error_message":"currency not valid for mandate transaction","status":"Bad Request","error_code":"Invalid","error_info":{"user_message":"Invalid request params. Please verify your input.","developer_message":"currency not valid for mandate transaction","code":"INVALID_INPUT","category":"USER_ERROR"}}
|
200
| Passing invalid customer_id
| {"payment":{"authentication":{"method":"GET","url":"https://sandbox.juspay.in/v2/pay/finish/Merchant/mozsgdGv78wAz8dpfz/1738237998"}},"status":"AUTHENTICATION_FAILED","txn_uuid":"mozsdGvg78wAz8dpfz","resp_message":"{\"status\":422,\"errorCode\":\"800\",\"message\":\"Contract not found\",\"errorType\":\"validation\",\"pspReference\":\"QV5HW3RDKLSMC375\"}","resp_code":"FAILURE_RESPONSE","offer_details":{"offers":[]},"order_id":"1738237998","txn_id":"Merchant-1738237998-1"}
|

