Revoke Mandate API

Use this API to revoke/cancel an ACTIVE mandate.

API Endpoints
Sandbox Link
POST
https://sandbox.juspay.in/mandates/{mandate_id}
Production Link
POST
https://api.juspay.in/mandates/{mandate_id}
Authorization Header
Headers
Path Params
Body
200 : Success
400 : Invalid Input data
401 : Authentication Failed

Error Codes

Scroll inside to view more
Scenario
Error Code
Description
Sample Response
Invalid Mandate ID
400
Bad Request
{"error_message":"Mandate not found","status":"invalid_request_error","error_code":"Mandate not found","error_info":{"user_message":"Cannot process your request as mandate not found.","developer_message":"Mandate not found for customer.","code":"RESOURCE_NOT_FOUND","category":"USER_ERROR"}}
Performing revoke on revoked mandate
400
Bad Request
{"error_message":"Mandate Not in Active State","status":"Invalid Request","error_code":"BAD_REQUEST","error_info":{"user_message":"You are not allowed to perform this action since mandate is not active.","developer_message":"Action not allowed since mandate is not active for given mandate id.","code":"INVALID_ACTION","category":"USER_ERROR"}}
Invalid API Key
401
Unauthorized
{"status":"error","error_code":"access_denied","error_info":{"user_message":"Unauthorized.","developer_message":"Invalid API Key. Please pass a valid and active api key.","code":"UNAUTHORIZED","category":"USER_ERROR"}}
Passing an invalid URL
404
Not Found
Not passing 'command' field
400
Bad Request
{"error_message":"Mandate Not in Active State","status":"Invalid Request","error_code":"BAD_REQUEST","error_info":{"user_message":"You are not allowed to perform this action since mandate is not active.","developer_message":"Action not allowed since mandate is not active for given mandate id.","code":"INVALID_ACTION","category":"USER_ERROR"}}
Performing revoke on pending mandate transaction
400
Bad Request
{"error_message":"Mandate Not in Active State","status":"Invalid Request","error_code":"BAD_REQUEST","error_info":{"user_message":"You are not allowed to perform this action since mandate is not active.","developer_message":"Action not allowed since mandate is not active for given mandate id.","code":"INVALID_ACTION","category":"USER_ERROR"}}
Passing Invalid 'command' value
400
Bad Request
{"error_message":"Invalid command","status":"Invalid Request","error_code":"bad_request","error_info":{"user_message":"Invalid command. Please check your request.","fields":[{"field_name":"command","reason":"Invalid value."}],"developer_message":"Invalid command. Please pass valid command in request.","code":"INVALID_INPUT","category":"USER_ERROR"}}
Performing revoke on paused mandate
200
Success
{"mandate_id":"s9SS9SzZqzbrN8A4mU7ikx","gateway_response_code":"REVOKE_MANDATE","mandate_status":"REVOKED","gateway_response_message":"Revoked the mandate based on gateway's response"}
Last updated 9 months ago