Port Mandate
curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>' \
--data '
{
"customerDetails": {
"customerEmail": "john.doe@gmail.com",
"customerPhone": "9999999999",
"debitAccountNumber": "1234567890",
"debitAccountHolderName": "John Doe",
"debitBankId": "SBIN",
"debitAccountType": "SAVINGS"
},
"subscriptionDetails": {
"umrn": "SBIN0000000000000000",
"paymentType": "E_MANDATE",
"fixedAmount": 10,
"maxAmount": 100,
"portingFrequency": "MNTH",
"startDate": "2025-03-28",
"endDate": "2025-08-04",
"maxCycles": 10,
"subscriptionId": "subs-import-mandate",
"firstChargeDate": "2025-04-03"
}
}
'import requests
url = "https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port"
payload = {
"customerDetails": {
"customerEmail": "john.doe@gmail.com",
"customerPhone": "9999999999",
"debitAccountNumber": "1234567890",
"debitAccountHolderName": "John Doe",
"debitBankId": "SBIN",
"debitAccountType": "SAVINGS"
},
"subscriptionDetails": {
"umrn": "SBIN0000000000000000",
"paymentType": "E_MANDATE",
"fixedAmount": 10,
"maxAmount": 100,
"portingFrequency": "MNTH",
"startDate": "2025-03-28",
"endDate": "2025-08-04",
"maxCycles": 10,
"subscriptionId": "subs-import-mandate",
"firstChargeDate": "2025-04-03"
}
}
headers = {
"X-Client-Id": "<x-client-id>",
"X-Client-Secret": "<x-client-secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-Id': '<x-client-id>',
'X-Client-Secret': '<x-client-secret>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerDetails: {
customerEmail: 'john.doe@gmail.com',
customerPhone: '9999999999',
debitAccountNumber: '1234567890',
debitAccountHolderName: 'John Doe',
debitBankId: 'SBIN',
debitAccountType: 'SAVINGS'
},
subscriptionDetails: {
umrn: 'SBIN0000000000000000',
paymentType: 'E_MANDATE',
fixedAmount: 10,
maxAmount: 100,
portingFrequency: 'MNTH',
startDate: '2025-03-28',
endDate: '2025-08-04',
maxCycles: 10,
subscriptionId: 'subs-import-mandate',
firstChargeDate: '2025-04-03'
}
})
};
fetch('https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerDetails' => [
'customerEmail' => 'john.doe@gmail.com',
'customerPhone' => '9999999999',
'debitAccountNumber' => '1234567890',
'debitAccountHolderName' => 'John Doe',
'debitBankId' => 'SBIN',
'debitAccountType' => 'SAVINGS'
],
'subscriptionDetails' => [
'umrn' => 'SBIN0000000000000000',
'paymentType' => 'E_MANDATE',
'fixedAmount' => 10,
'maxAmount' => 100,
'portingFrequency' => 'MNTH',
'startDate' => '2025-03-28',
'endDate' => '2025-08-04',
'maxCycles' => 10,
'subscriptionId' => 'subs-import-mandate',
'firstChargeDate' => '2025-04-03'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port"
payload := strings.NewReader("{\n \"customerDetails\": {\n \"customerEmail\": \"john.doe@gmail.com\",\n \"customerPhone\": \"9999999999\",\n \"debitAccountNumber\": \"1234567890\",\n \"debitAccountHolderName\": \"John Doe\",\n \"debitBankId\": \"SBIN\",\n \"debitAccountType\": \"SAVINGS\"\n },\n \"subscriptionDetails\": {\n \"umrn\": \"SBIN0000000000000000\",\n \"paymentType\": \"E_MANDATE\",\n \"fixedAmount\": 10,\n \"maxAmount\": 100,\n \"portingFrequency\": \"MNTH\",\n \"startDate\": \"2025-03-28\",\n \"endDate\": \"2025-08-04\",\n \"maxCycles\": 10,\n \"subscriptionId\": \"subs-import-mandate\",\n \"firstChargeDate\": \"2025-04-03\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<x-client-id>")
req.Header.Add("X-Client-Secret", "<x-client-secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port")
.header("X-Client-Id", "<x-client-id>")
.header("X-Client-Secret", "<x-client-secret>")
.header("Content-Type", "application/json")
.body("{\n \"customerDetails\": {\n \"customerEmail\": \"john.doe@gmail.com\",\n \"customerPhone\": \"9999999999\",\n \"debitAccountNumber\": \"1234567890\",\n \"debitAccountHolderName\": \"John Doe\",\n \"debitBankId\": \"SBIN\",\n \"debitAccountType\": \"SAVINGS\"\n },\n \"subscriptionDetails\": {\n \"umrn\": \"SBIN0000000000000000\",\n \"paymentType\": \"E_MANDATE\",\n \"fixedAmount\": 10,\n \"maxAmount\": 100,\n \"portingFrequency\": \"MNTH\",\n \"startDate\": \"2025-03-28\",\n \"endDate\": \"2025-08-04\",\n \"maxCycles\": 10,\n \"subscriptionId\": \"subs-import-mandate\",\n \"firstChargeDate\": \"2025-04-03\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<x-client-id>'
request["X-Client-Secret"] = '<x-client-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerDetails\": {\n \"customerEmail\": \"john.doe@gmail.com\",\n \"customerPhone\": \"9999999999\",\n \"debitAccountNumber\": \"1234567890\",\n \"debitAccountHolderName\": \"John Doe\",\n \"debitBankId\": \"SBIN\",\n \"debitAccountType\": \"SAVINGS\"\n },\n \"subscriptionDetails\": {\n \"umrn\": \"SBIN0000000000000000\",\n \"paymentType\": \"E_MANDATE\",\n \"fixedAmount\": 10,\n \"maxAmount\": 100,\n \"portingFrequency\": \"MNTH\",\n \"startDate\": \"2025-03-28\",\n \"endDate\": \"2025-08-04\",\n \"maxCycles\": 10,\n \"subscriptionId\": \"subs-import-mandate\",\n \"firstChargeDate\": \"2025-04-03\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "OK",
"message": "Mandate Porting Successful",
"data": {
"subReferenceId": 12345,
"subscriptionId": "subs-import-mandate",
"status": "ACTIVE"
}
}{
"status": "ERROR",
"subCode": "400",
"message": "Invalid or missing parameters in the request."
}{
"status": "ERROR",
"message": "Server encountered an unexpected condition."
}Subscription
Port Mandate
Use this API to import an existing mandate into the Cashfree subscription system. This is applicable where mandates are already created with another provider or system. By porting the mandate, you can manage the subscription within Cashfreeās ecosystem.
POST
/
api
/
v2
/
subscriptions
/
mandate
/
port
Port Mandate
curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>' \
--data '
{
"customerDetails": {
"customerEmail": "john.doe@gmail.com",
"customerPhone": "9999999999",
"debitAccountNumber": "1234567890",
"debitAccountHolderName": "John Doe",
"debitBankId": "SBIN",
"debitAccountType": "SAVINGS"
},
"subscriptionDetails": {
"umrn": "SBIN0000000000000000",
"paymentType": "E_MANDATE",
"fixedAmount": 10,
"maxAmount": 100,
"portingFrequency": "MNTH",
"startDate": "2025-03-28",
"endDate": "2025-08-04",
"maxCycles": 10,
"subscriptionId": "subs-import-mandate",
"firstChargeDate": "2025-04-03"
}
}
'import requests
url = "https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port"
payload = {
"customerDetails": {
"customerEmail": "john.doe@gmail.com",
"customerPhone": "9999999999",
"debitAccountNumber": "1234567890",
"debitAccountHolderName": "John Doe",
"debitBankId": "SBIN",
"debitAccountType": "SAVINGS"
},
"subscriptionDetails": {
"umrn": "SBIN0000000000000000",
"paymentType": "E_MANDATE",
"fixedAmount": 10,
"maxAmount": 100,
"portingFrequency": "MNTH",
"startDate": "2025-03-28",
"endDate": "2025-08-04",
"maxCycles": 10,
"subscriptionId": "subs-import-mandate",
"firstChargeDate": "2025-04-03"
}
}
headers = {
"X-Client-Id": "<x-client-id>",
"X-Client-Secret": "<x-client-secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-Id': '<x-client-id>',
'X-Client-Secret': '<x-client-secret>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customerDetails: {
customerEmail: 'john.doe@gmail.com',
customerPhone: '9999999999',
debitAccountNumber: '1234567890',
debitAccountHolderName: 'John Doe',
debitBankId: 'SBIN',
debitAccountType: 'SAVINGS'
},
subscriptionDetails: {
umrn: 'SBIN0000000000000000',
paymentType: 'E_MANDATE',
fixedAmount: 10,
maxAmount: 100,
portingFrequency: 'MNTH',
startDate: '2025-03-28',
endDate: '2025-08-04',
maxCycles: 10,
subscriptionId: 'subs-import-mandate',
firstChargeDate: '2025-04-03'
}
})
};
fetch('https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerDetails' => [
'customerEmail' => 'john.doe@gmail.com',
'customerPhone' => '9999999999',
'debitAccountNumber' => '1234567890',
'debitAccountHolderName' => 'John Doe',
'debitBankId' => 'SBIN',
'debitAccountType' => 'SAVINGS'
],
'subscriptionDetails' => [
'umrn' => 'SBIN0000000000000000',
'paymentType' => 'E_MANDATE',
'fixedAmount' => 10,
'maxAmount' => 100,
'portingFrequency' => 'MNTH',
'startDate' => '2025-03-28',
'endDate' => '2025-08-04',
'maxCycles' => 10,
'subscriptionId' => 'subs-import-mandate',
'firstChargeDate' => '2025-04-03'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port"
payload := strings.NewReader("{\n \"customerDetails\": {\n \"customerEmail\": \"john.doe@gmail.com\",\n \"customerPhone\": \"9999999999\",\n \"debitAccountNumber\": \"1234567890\",\n \"debitAccountHolderName\": \"John Doe\",\n \"debitBankId\": \"SBIN\",\n \"debitAccountType\": \"SAVINGS\"\n },\n \"subscriptionDetails\": {\n \"umrn\": \"SBIN0000000000000000\",\n \"paymentType\": \"E_MANDATE\",\n \"fixedAmount\": 10,\n \"maxAmount\": 100,\n \"portingFrequency\": \"MNTH\",\n \"startDate\": \"2025-03-28\",\n \"endDate\": \"2025-08-04\",\n \"maxCycles\": 10,\n \"subscriptionId\": \"subs-import-mandate\",\n \"firstChargeDate\": \"2025-04-03\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-Id", "<x-client-id>")
req.Header.Add("X-Client-Secret", "<x-client-secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port")
.header("X-Client-Id", "<x-client-id>")
.header("X-Client-Secret", "<x-client-secret>")
.header("Content-Type", "application/json")
.body("{\n \"customerDetails\": {\n \"customerEmail\": \"john.doe@gmail.com\",\n \"customerPhone\": \"9999999999\",\n \"debitAccountNumber\": \"1234567890\",\n \"debitAccountHolderName\": \"John Doe\",\n \"debitBankId\": \"SBIN\",\n \"debitAccountType\": \"SAVINGS\"\n },\n \"subscriptionDetails\": {\n \"umrn\": \"SBIN0000000000000000\",\n \"paymentType\": \"E_MANDATE\",\n \"fixedAmount\": 10,\n \"maxAmount\": 100,\n \"portingFrequency\": \"MNTH\",\n \"startDate\": \"2025-03-28\",\n \"endDate\": \"2025-08-04\",\n \"maxCycles\": 10,\n \"subscriptionId\": \"subs-import-mandate\",\n \"firstChargeDate\": \"2025-04-03\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/api/v2/subscriptions/mandate/port")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Id"] = '<x-client-id>'
request["X-Client-Secret"] = '<x-client-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerDetails\": {\n \"customerEmail\": \"john.doe@gmail.com\",\n \"customerPhone\": \"9999999999\",\n \"debitAccountNumber\": \"1234567890\",\n \"debitAccountHolderName\": \"John Doe\",\n \"debitBankId\": \"SBIN\",\n \"debitAccountType\": \"SAVINGS\"\n },\n \"subscriptionDetails\": {\n \"umrn\": \"SBIN0000000000000000\",\n \"paymentType\": \"E_MANDATE\",\n \"fixedAmount\": 10,\n \"maxAmount\": 100,\n \"portingFrequency\": \"MNTH\",\n \"startDate\": \"2025-03-28\",\n \"endDate\": \"2025-08-04\",\n \"maxCycles\": 10,\n \"subscriptionId\": \"subs-import-mandate\",\n \"firstChargeDate\": \"2025-04-03\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "OK",
"message": "Mandate Porting Successful",
"data": {
"subReferenceId": 12345,
"subscriptionId": "subs-import-mandate",
"status": "ACTIVE"
}
}{
"status": "ERROR",
"subCode": "400",
"message": "Invalid or missing parameters in the request."
}{
"status": "ERROR",
"message": "Server encountered an unexpected condition."
}Headers
Client ID provided by Cashfree.
Example:
"asdf1234"
Client Secret provided by Cashfree.
Example:
"qwer9876"
Body
application/json
Response
Mandate ported successfully.
Was this page helpful?
āI