Portal
Re-authorize UPI Autopay
Create a fresh UPI mandate and return Razorpay’s hosted authorization URL
POST
/
portal
/
api
/
payment-method
/
mandate
Re-authorize a UPI Autopay mandate
curl --request POST \
--url https://billing.example.com/portal/api/payment-method/mandate \
--header 'Content-Type: application/json' \
--cookie portal_session= \
--data '
{
"vpa": "<string>"
}
'import requests
url = "https://billing.example.com/portal/api/payment-method/mandate"
payload = { "vpa": "<string>" }
headers = {
"cookie": "portal_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'portal_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({vpa: '<string>'})
};
fetch('https://billing.example.com/portal/api/payment-method/mandate', 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://billing.example.com/portal/api/payment-method/mandate",
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([
'vpa' => '<string>'
]),
CURLOPT_COOKIE => "portal_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://billing.example.com/portal/api/payment-method/mandate"
payload := strings.NewReader("{\n \"vpa\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "portal_session=")
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://billing.example.com/portal/api/payment-method/mandate")
.header("cookie", "portal_session=")
.header("Content-Type", "application/json")
.body("{\n \"vpa\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/portal/api/payment-method/mandate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'portal_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"vpa\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"auth_url": "<string>",
"mandate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Requires a portal session. Available only on deployments with real Razorpay keys (
503 otherwise).auth_url) — redirect the customer there to approve. The mandate cap is sized automatically at 2× the largest recent non-void invoice, and activation happens only when Razorpay confirms the token via the token.confirmed webhook; nothing is trusted from the browser.
Razorpay requires a contact number on recurring registration links. A customer without a phone on file gets a
422 with an actionable message — add a phone to the customer record first.Request Body (optional)
| Parameter | Type | Description |
|---|---|---|
vpa | string | Optional UPI id. When omitted, Razorpay’s hosted page collects it. |
Example
curl -X POST https://api.recurso.dev/portal/api/payment-method/mandate \
-H "X-Portal-Session: <session token>" \
-H "Content-Type: application/json" -d '{}'
{
"data": {
"auth_url": "https://rzp.io/rzp/Xo5MA3JR",
"mandate_id": "b17ad1d5-...",
"status": "created"
}
}
Authorizations
Customer-portal session cookie issued by GET /portal/auth/verify.
Body
application/json
Optional UPI id — Razorpay's hosted page collects it when omitted.
Response
Mandate created; redirect the customer to auth_url.
Show child attributes
Show child attributes
⌘I
Re-authorize a UPI Autopay mandate
curl --request POST \
--url https://billing.example.com/portal/api/payment-method/mandate \
--header 'Content-Type: application/json' \
--cookie portal_session= \
--data '
{
"vpa": "<string>"
}
'import requests
url = "https://billing.example.com/portal/api/payment-method/mandate"
payload = { "vpa": "<string>" }
headers = {
"cookie": "portal_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'portal_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({vpa: '<string>'})
};
fetch('https://billing.example.com/portal/api/payment-method/mandate', 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://billing.example.com/portal/api/payment-method/mandate",
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([
'vpa' => '<string>'
]),
CURLOPT_COOKIE => "portal_session=",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://billing.example.com/portal/api/payment-method/mandate"
payload := strings.NewReader("{\n \"vpa\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "portal_session=")
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://billing.example.com/portal/api/payment-method/mandate")
.header("cookie", "portal_session=")
.header("Content-Type", "application/json")
.body("{\n \"vpa\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/portal/api/payment-method/mandate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'portal_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"vpa\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"auth_url": "<string>",
"mandate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}