curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/ \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--header 'X-Merchant-ID: <api-key>' \
--data '
{
"amount": "1000.00",
"collection_mode": "s2s",
"currency": "INR",
"reference_id": "SUBGB37NP",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "+919876543210",
"address": {
"line_1": "123 Main Street",
"line_2": "Apt 4B",
"city": "Mumbai",
"state": "Maharashtra",
"postal_code": "400001"
},
"ip_address": "192.168.1.100",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
},
"product": {
"name": "Monthly Subscription Plan",
"description": "Monthly subscription for premium services",
"hs_code": "98051000",
"hs_code_description": "Subscription services",
"type_of_goods": "service"
},
"invoice": {
"number": "INVPUZWBY",
"date": "2025-12-15"
},
"standing_instruction": {
"billing_amount": "1000.00",
"billing_currency": "INR",
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2026-01-15",
"payment_end_date": "2027-01-15",
"remarks": "Monthly subscription for premium services",
"auto_refund_mandate": false
},
"mop_type": "UPI",
"upi_flow_type": "intent"
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/"
payload = {
"amount": "1000.00",
"collection_mode": "s2s",
"currency": "INR",
"reference_id": "SUBGB37NP",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "+919876543210",
"address": {
"line_1": "123 Main Street",
"line_2": "Apt 4B",
"city": "Mumbai",
"state": "Maharashtra",
"postal_code": "400001"
},
"ip_address": "192.168.1.100",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
},
"product": {
"name": "Monthly Subscription Plan",
"description": "Monthly subscription for premium services",
"hs_code": "98051000",
"hs_code_description": "Subscription services",
"type_of_goods": "service"
},
"invoice": {
"number": "INVPUZWBY",
"date": "2025-12-15"
},
"standing_instruction": {
"billing_amount": "1000.00",
"billing_currency": "INR",
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2026-01-15",
"payment_end_date": "2027-01-15",
"remarks": "Monthly subscription for premium services",
"auto_refund_mandate": False
},
"mop_type": "UPI",
"upi_flow_type": "intent"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-Merchant-ID": "<api-key>",
"X-API-Version": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-Merchant-ID': '<api-key>',
'X-API-Version': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '1000.00',
collection_mode: 's2s',
currency: 'INR',
reference_id: 'SUBGB37NP',
buyer: {
name: 'John Doe',
email: '[email protected]',
phone: '+919876543210',
address: {
line_1: '123 Main Street',
line_2: 'Apt 4B',
city: 'Mumbai',
state: 'Maharashtra',
postal_code: '400001'
},
ip_address: '192.168.1.100',
user_agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
},
product: {
name: 'Monthly Subscription Plan',
description: 'Monthly subscription for premium services',
hs_code: '98051000',
hs_code_description: 'Subscription services',
type_of_goods: 'service'
},
invoice: {number: 'INVPUZWBY', date: '2025-12-15'},
standing_instruction: {
billing_amount: '1000.00',
billing_currency: 'INR',
billing_cycle: 'MONTHLY',
billing_interval: 1,
payment_start_date: '2026-01-15',
payment_end_date: '2027-01-15',
remarks: 'Monthly subscription for premium services',
auto_refund_mandate: false
},
mop_type: 'UPI',
upi_flow_type: 'intent'
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/', 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://api-pacb-uat.eximpe.com/pg/subscriptions/intent/",
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([
'amount' => '1000.00',
'collection_mode' => 's2s',
'currency' => 'INR',
'reference_id' => 'SUBGB37NP',
'buyer' => [
'name' => 'John Doe',
'email' => '[email protected]',
'phone' => '+919876543210',
'address' => [
'line_1' => '123 Main Street',
'line_2' => 'Apt 4B',
'city' => 'Mumbai',
'state' => 'Maharashtra',
'postal_code' => '400001'
],
'ip_address' => '192.168.1.100',
'user_agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
],
'product' => [
'name' => 'Monthly Subscription Plan',
'description' => 'Monthly subscription for premium services',
'hs_code' => '98051000',
'hs_code_description' => 'Subscription services',
'type_of_goods' => 'service'
],
'invoice' => [
'number' => 'INVPUZWBY',
'date' => '2025-12-15'
],
'standing_instruction' => [
'billing_amount' => '1000.00',
'billing_currency' => 'INR',
'billing_cycle' => 'MONTHLY',
'billing_interval' => 1,
'payment_start_date' => '2026-01-15',
'payment_end_date' => '2027-01-15',
'remarks' => 'Monthly subscription for premium services',
'auto_refund_mandate' => false
],
'mop_type' => 'UPI',
'upi_flow_type' => 'intent'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>",
"X-Merchant-ID: <api-key>"
],
]);
$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://api-pacb-uat.eximpe.com/pg/subscriptions/intent/"
payload := strings.NewReader("{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBGB37NP\",\n \"buyer\": {\n \"name\": \"John Doe\",\n \"email\": \"[email protected]\",\n \"phone\": \"+919876543210\",\n \"address\": {\n \"line_1\": \"123 Main Street\",\n \"line_2\": \"Apt 4B\",\n \"city\": \"Mumbai\",\n \"state\": \"Maharashtra\",\n \"postal_code\": \"400001\"\n },\n \"ip_address\": \"192.168.1.100\",\n \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n },\n \"product\": {\n \"name\": \"Monthly Subscription Plan\",\n \"description\": \"Monthly subscription for premium services\",\n \"hs_code\": \"98051000\",\n \"hs_code_description\": \"Subscription services\",\n \"type_of_goods\": \"service\"\n },\n \"invoice\": {\n \"number\": \"INVPUZWBY\",\n \"date\": \"2025-12-15\"\n },\n \"standing_instruction\": {\n \"billing_amount\": \"1000.00\",\n \"billing_currency\": \"INR\",\n \"billing_cycle\": \"MONTHLY\",\n \"billing_interval\": 1,\n \"payment_start_date\": \"2026-01-15\",\n \"payment_end_date\": \"2027-01-15\",\n \"remarks\": \"Monthly subscription for premium services\",\n \"auto_refund_mandate\": false\n },\n \"mop_type\": \"UPI\",\n \"upi_flow_type\": \"intent\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-Merchant-ID", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
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://api-pacb-uat.eximpe.com/pg/subscriptions/intent/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-Merchant-ID", "<api-key>")
.header("X-API-Version", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBGB37NP\",\n \"buyer\": {\n \"name\": \"John Doe\",\n \"email\": \"[email protected]\",\n \"phone\": \"+919876543210\",\n \"address\": {\n \"line_1\": \"123 Main Street\",\n \"line_2\": \"Apt 4B\",\n \"city\": \"Mumbai\",\n \"state\": \"Maharashtra\",\n \"postal_code\": \"400001\"\n },\n \"ip_address\": \"192.168.1.100\",\n \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n },\n \"product\": {\n \"name\": \"Monthly Subscription Plan\",\n \"description\": \"Monthly subscription for premium services\",\n \"hs_code\": \"98051000\",\n \"hs_code_description\": \"Subscription services\",\n \"type_of_goods\": \"service\"\n },\n \"invoice\": {\n \"number\": \"INVPUZWBY\",\n \"date\": \"2025-12-15\"\n },\n \"standing_instruction\": {\n \"billing_amount\": \"1000.00\",\n \"billing_currency\": \"INR\",\n \"billing_cycle\": \"MONTHLY\",\n \"billing_interval\": 1,\n \"payment_start_date\": \"2026-01-15\",\n \"payment_end_date\": \"2027-01-15\",\n \"remarks\": \"Monthly subscription for premium services\",\n \"auto_refund_mandate\": false\n },\n \"mop_type\": \"UPI\",\n \"upi_flow_type\": \"intent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-Merchant-ID"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBGB37NP\",\n \"buyer\": {\n \"name\": \"John Doe\",\n \"email\": \"[email protected]\",\n \"phone\": \"+919876543210\",\n \"address\": {\n \"line_1\": \"123 Main Street\",\n \"line_2\": \"Apt 4B\",\n \"city\": \"Mumbai\",\n \"state\": \"Maharashtra\",\n \"postal_code\": \"400001\"\n },\n \"ip_address\": \"192.168.1.100\",\n \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n },\n \"product\": {\n \"name\": \"Monthly Subscription Plan\",\n \"description\": \"Monthly subscription for premium services\",\n \"hs_code\": \"98051000\",\n \"hs_code_description\": \"Subscription services\",\n \"type_of_goods\": \"service\"\n },\n \"invoice\": {\n \"number\": \"INVPUZWBY\",\n \"date\": \"2025-12-15\"\n },\n \"standing_instruction\": {\n \"billing_amount\": \"1000.00\",\n \"billing_currency\": \"INR\",\n \"billing_cycle\": \"MONTHLY\",\n \"billing_interval\": 1,\n \"payment_start_date\": \"2026-01-15\",\n \"payment_end_date\": \"2027-01-15\",\n \"remarks\": \"Monthly subscription for premium services\",\n \"auto_refund_mandate\": false\n },\n \"mop_type\": \"UPI\",\n \"upi_flow_type\": \"intent\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "UPI Subscription created successfully",
"data": {
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"subscription_id": "660e8400-e29b-41d4-a716-446655440001",
"subscription_type": "UPI_RECURRING",
"intent_uri": "pa=merchant@payu&pn=Merchant%20Name&am=1000.00&cu=INR&tn=Order%20Description&tr=ORD-2024-001",
"qr_code": {
"url": "upi://pay?pa=merchant@payu&pn=Merchant%20Name&am=1000.00&cu=INR&tn=Order%20Description&tr=ORD-2024-001",
"base64": "iVBORw0KGgoAAAANSUhEUgAA..."
},
"subscription": {
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2024-01-01",
"payment_end_date": "2024-12-31"
}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "ERR_SERVICE_ERROR_000",
"message": "Payment gateway error",
"details": {
"error": "An unexpected error occurred. Please try again later"
}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Create UPI Subscription (Intent Flow)
Create a new UPI subscription order with standing instructions (SI) using Intent flow via QR code or payment link.
curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/ \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--header 'X-Merchant-ID: <api-key>' \
--data '
{
"amount": "1000.00",
"collection_mode": "s2s",
"currency": "INR",
"reference_id": "SUBGB37NP",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "+919876543210",
"address": {
"line_1": "123 Main Street",
"line_2": "Apt 4B",
"city": "Mumbai",
"state": "Maharashtra",
"postal_code": "400001"
},
"ip_address": "192.168.1.100",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
},
"product": {
"name": "Monthly Subscription Plan",
"description": "Monthly subscription for premium services",
"hs_code": "98051000",
"hs_code_description": "Subscription services",
"type_of_goods": "service"
},
"invoice": {
"number": "INVPUZWBY",
"date": "2025-12-15"
},
"standing_instruction": {
"billing_amount": "1000.00",
"billing_currency": "INR",
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2026-01-15",
"payment_end_date": "2027-01-15",
"remarks": "Monthly subscription for premium services",
"auto_refund_mandate": false
},
"mop_type": "UPI",
"upi_flow_type": "intent"
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/"
payload = {
"amount": "1000.00",
"collection_mode": "s2s",
"currency": "INR",
"reference_id": "SUBGB37NP",
"buyer": {
"name": "John Doe",
"email": "[email protected]",
"phone": "+919876543210",
"address": {
"line_1": "123 Main Street",
"line_2": "Apt 4B",
"city": "Mumbai",
"state": "Maharashtra",
"postal_code": "400001"
},
"ip_address": "192.168.1.100",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
},
"product": {
"name": "Monthly Subscription Plan",
"description": "Monthly subscription for premium services",
"hs_code": "98051000",
"hs_code_description": "Subscription services",
"type_of_goods": "service"
},
"invoice": {
"number": "INVPUZWBY",
"date": "2025-12-15"
},
"standing_instruction": {
"billing_amount": "1000.00",
"billing_currency": "INR",
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2026-01-15",
"payment_end_date": "2027-01-15",
"remarks": "Monthly subscription for premium services",
"auto_refund_mandate": False
},
"mop_type": "UPI",
"upi_flow_type": "intent"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-Merchant-ID": "<api-key>",
"X-API-Version": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-Merchant-ID': '<api-key>',
'X-API-Version': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '1000.00',
collection_mode: 's2s',
currency: 'INR',
reference_id: 'SUBGB37NP',
buyer: {
name: 'John Doe',
email: '[email protected]',
phone: '+919876543210',
address: {
line_1: '123 Main Street',
line_2: 'Apt 4B',
city: 'Mumbai',
state: 'Maharashtra',
postal_code: '400001'
},
ip_address: '192.168.1.100',
user_agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
},
product: {
name: 'Monthly Subscription Plan',
description: 'Monthly subscription for premium services',
hs_code: '98051000',
hs_code_description: 'Subscription services',
type_of_goods: 'service'
},
invoice: {number: 'INVPUZWBY', date: '2025-12-15'},
standing_instruction: {
billing_amount: '1000.00',
billing_currency: 'INR',
billing_cycle: 'MONTHLY',
billing_interval: 1,
payment_start_date: '2026-01-15',
payment_end_date: '2027-01-15',
remarks: 'Monthly subscription for premium services',
auto_refund_mandate: false
},
mop_type: 'UPI',
upi_flow_type: 'intent'
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/', 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://api-pacb-uat.eximpe.com/pg/subscriptions/intent/",
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([
'amount' => '1000.00',
'collection_mode' => 's2s',
'currency' => 'INR',
'reference_id' => 'SUBGB37NP',
'buyer' => [
'name' => 'John Doe',
'email' => '[email protected]',
'phone' => '+919876543210',
'address' => [
'line_1' => '123 Main Street',
'line_2' => 'Apt 4B',
'city' => 'Mumbai',
'state' => 'Maharashtra',
'postal_code' => '400001'
],
'ip_address' => '192.168.1.100',
'user_agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
],
'product' => [
'name' => 'Monthly Subscription Plan',
'description' => 'Monthly subscription for premium services',
'hs_code' => '98051000',
'hs_code_description' => 'Subscription services',
'type_of_goods' => 'service'
],
'invoice' => [
'number' => 'INVPUZWBY',
'date' => '2025-12-15'
],
'standing_instruction' => [
'billing_amount' => '1000.00',
'billing_currency' => 'INR',
'billing_cycle' => 'MONTHLY',
'billing_interval' => 1,
'payment_start_date' => '2026-01-15',
'payment_end_date' => '2027-01-15',
'remarks' => 'Monthly subscription for premium services',
'auto_refund_mandate' => false
],
'mop_type' => 'UPI',
'upi_flow_type' => 'intent'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>",
"X-Merchant-ID: <api-key>"
],
]);
$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://api-pacb-uat.eximpe.com/pg/subscriptions/intent/"
payload := strings.NewReader("{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBGB37NP\",\n \"buyer\": {\n \"name\": \"John Doe\",\n \"email\": \"[email protected]\",\n \"phone\": \"+919876543210\",\n \"address\": {\n \"line_1\": \"123 Main Street\",\n \"line_2\": \"Apt 4B\",\n \"city\": \"Mumbai\",\n \"state\": \"Maharashtra\",\n \"postal_code\": \"400001\"\n },\n \"ip_address\": \"192.168.1.100\",\n \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n },\n \"product\": {\n \"name\": \"Monthly Subscription Plan\",\n \"description\": \"Monthly subscription for premium services\",\n \"hs_code\": \"98051000\",\n \"hs_code_description\": \"Subscription services\",\n \"type_of_goods\": \"service\"\n },\n \"invoice\": {\n \"number\": \"INVPUZWBY\",\n \"date\": \"2025-12-15\"\n },\n \"standing_instruction\": {\n \"billing_amount\": \"1000.00\",\n \"billing_currency\": \"INR\",\n \"billing_cycle\": \"MONTHLY\",\n \"billing_interval\": 1,\n \"payment_start_date\": \"2026-01-15\",\n \"payment_end_date\": \"2027-01-15\",\n \"remarks\": \"Monthly subscription for premium services\",\n \"auto_refund_mandate\": false\n },\n \"mop_type\": \"UPI\",\n \"upi_flow_type\": \"intent\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-Merchant-ID", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
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://api-pacb-uat.eximpe.com/pg/subscriptions/intent/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-Merchant-ID", "<api-key>")
.header("X-API-Version", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBGB37NP\",\n \"buyer\": {\n \"name\": \"John Doe\",\n \"email\": \"[email protected]\",\n \"phone\": \"+919876543210\",\n \"address\": {\n \"line_1\": \"123 Main Street\",\n \"line_2\": \"Apt 4B\",\n \"city\": \"Mumbai\",\n \"state\": \"Maharashtra\",\n \"postal_code\": \"400001\"\n },\n \"ip_address\": \"192.168.1.100\",\n \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n },\n \"product\": {\n \"name\": \"Monthly Subscription Plan\",\n \"description\": \"Monthly subscription for premium services\",\n \"hs_code\": \"98051000\",\n \"hs_code_description\": \"Subscription services\",\n \"type_of_goods\": \"service\"\n },\n \"invoice\": {\n \"number\": \"INVPUZWBY\",\n \"date\": \"2025-12-15\"\n },\n \"standing_instruction\": {\n \"billing_amount\": \"1000.00\",\n \"billing_currency\": \"INR\",\n \"billing_cycle\": \"MONTHLY\",\n \"billing_interval\": 1,\n \"payment_start_date\": \"2026-01-15\",\n \"payment_end_date\": \"2027-01-15\",\n \"remarks\": \"Monthly subscription for premium services\",\n \"auto_refund_mandate\": false\n },\n \"mop_type\": \"UPI\",\n \"upi_flow_type\": \"intent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/subscriptions/intent/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-Merchant-ID"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBGB37NP\",\n \"buyer\": {\n \"name\": \"John Doe\",\n \"email\": \"[email protected]\",\n \"phone\": \"+919876543210\",\n \"address\": {\n \"line_1\": \"123 Main Street\",\n \"line_2\": \"Apt 4B\",\n \"city\": \"Mumbai\",\n \"state\": \"Maharashtra\",\n \"postal_code\": \"400001\"\n },\n \"ip_address\": \"192.168.1.100\",\n \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n },\n \"product\": {\n \"name\": \"Monthly Subscription Plan\",\n \"description\": \"Monthly subscription for premium services\",\n \"hs_code\": \"98051000\",\n \"hs_code_description\": \"Subscription services\",\n \"type_of_goods\": \"service\"\n },\n \"invoice\": {\n \"number\": \"INVPUZWBY\",\n \"date\": \"2025-12-15\"\n },\n \"standing_instruction\": {\n \"billing_amount\": \"1000.00\",\n \"billing_currency\": \"INR\",\n \"billing_cycle\": \"MONTHLY\",\n \"billing_interval\": 1,\n \"payment_start_date\": \"2026-01-15\",\n \"payment_end_date\": \"2027-01-15\",\n \"remarks\": \"Monthly subscription for premium services\",\n \"auto_refund_mandate\": false\n },\n \"mop_type\": \"UPI\",\n \"upi_flow_type\": \"intent\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "UPI Subscription created successfully",
"data": {
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"subscription_id": "660e8400-e29b-41d4-a716-446655440001",
"subscription_type": "UPI_RECURRING",
"intent_uri": "pa=merchant@payu&pn=Merchant%20Name&am=1000.00&cu=INR&tn=Order%20Description&tr=ORD-2024-001",
"qr_code": {
"url": "upi://pay?pa=merchant@payu&pn=Merchant%20Name&am=1000.00&cu=INR&tn=Order%20Description&tr=ORD-2024-001",
"base64": "iVBORw0KGgoAAAANSUhEUgAA..."
},
"subscription": {
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2024-01-01",
"payment_end_date": "2024-12-31"
}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "ERR_SERVICE_ERROR_000",
"message": "Payment gateway error",
"details": {
"error": "An unexpected error occurred. Please try again later"
}
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Client Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.
Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.
Merchant Identifier - The unique ID for the merchant account. This is required for PSP (Payment Service Provider) merchants who manage multiple merchant accounts. You can find merchant IDs in the Merchant Management section of the dashboard.
API Version - Specifies which version of the API to use (e.g., '2.X.X'). This header allows you to control which API version your integration uses.
Body
Subscription creation request with INTENT flow. Requires preferred_upi_flow_type to be 'INTENT'.
Order amount
Currency code (e.g. INR)
Unique merchant reference ID
Buyer details
Show child attributes
Show child attributes
Product details
Show child attributes
Show child attributes
Invoice details
Show child attributes
Show child attributes
Standing instruction configuration for a subscription
Show child attributes
Show child attributes
Payment collection mode (must be 's2s' for subscriptions)
s2s Method of payment
UPI UPI flow type (must be 'intent')
intent