/

to search

Introducing Setu Changelog Check it out ↗

#Execute mandate

PREREQUISITES 

🌟 Pre-debit notification ↗

A merchant needs to manually execute the mandate, only if autoExecute and autoPreNotify are set to false while creating a mandate.


Once the pre-debit notification against the manadate is successful, the merchant can execute the mandate on the specified executionDate while sending the pre-debit notification.

The process for mandate execution is described in the below diagram:

The merchant will have to call the execute mandate API with the correct set of parameters.

Staging hosthttps://umap.setu.co/api
MethodPOST
Path/v1/merchants/mandates/{mandateId}/execute
HeadermerchantId
Authorization: Bearer <insert_token_here>. Generate this token using OAuth.

Content-Type—will be application/json
Sample request
{
"amount": 1000,
"merchantReferenceId": "ABC1234789",
"remark": "Transaction for car loan emi",
"sequenceNumber": 1,
"umn": "setumandate1234789@ybl"
}

Request body parameter values for executing a recurring mandate

parametervalue
amountmust be equal to the amount mentioned while sending mandate pre debit notification
umncan be derived from the notifications received by the merchant during mandate creation flow or via check mandate status API
Sample response
{
"amount": 1000,
"createdAt": "2023-09-04T12:08:20+0530",
"id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"mandateId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"merchantId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"merchantReferenceId": "ABC1234789",
"remark": "Transaction for car loan emi",
"sequenceNumber": 1,
"status": "pending",
"txnId": "BTTZrc5gDFkuCr3n3I0ey4aNtzLOLR7K7aR",
"umn": "c27f5fc30d344e9594fce0afa34f8859@mypsp"
}

In the above response:

  • id is a unique ID that is associated with this mandate execution and can be used to track it later.

To know more about all the API params, please refer to the API documentation here.

UPI Setu will send notifications to the merchant for the following events:

  • mandate_operation.execute.success (if mandate execution is successful)
  • mandate_operation.execute.failed (if mandate execution fails)

Read more about mandate execute operation notifications here

In addition to the notifications, the merchant can also use check mandate execution status API to check if execution is successful

If autoExecute and autoPreNotify are set to true while creating a mandate, UPI Setu will schedule executions and send notifications to the merchant for execution confirmation and mandate status in every recurrence cycle

Please refer to the Document Reference section for checking the API reference and the notifications.


#Check mandate execution status

In addition to the notifications sent by UPI Setu, Merchant can use this API to check the status of a mandate execution.

Staging hosthttps://umap.setu.co/api
MethodGET
Path/v1/merchants/mandate-executions/{id}
HeadermerchantId
Authorization: Bearer <insert_token_here>. Generate this token using OAuth.

Content-Type—will be application/json
Sample response
{
"amount": 1000,
"createdAt": "2023-09-04T12:08:20+0530",
"id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"mandateId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"merchantId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"merchantReferenceId": "ABC1234789",
"remark": "Transaction for car loan emi",
"sequenceNumber": 1,
"status": "success",
"txnId": "BTTZrc5gDFkuCr3n3I0ey4aNtzLOLR7K7aR",
"umn": "c27f5fc30d344e9594fce0afa34f8859@mypsp"
}
In the above response:
  • id is a unique ID that is associated with this mandate execution and can be used to track it later.

To know more about all the API params, please refer to the API documentation here.