curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/subscriptions/card/ \
--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": "SUBCARD001",
"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": "INVCARD001",
"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",
"billing_date": 1,
"billing_limit": "AFTER",
"billing_rule": "MAX",
"remarks": "Monthly subscription for premium services"
},
"mop_type": "credit_card",
"card_details": {
"number": "4111111111111111",
"cardholder_name": "John Doe",
"expiry_month": 12,
"expiry_year": 2027,
"cvv": "123",
"network": "VISA",
"nickname": "My Credit Card"
}
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/subscriptions/card/"
payload = {
"amount": "1000.00",
"collection_mode": "s2s",
"currency": "INR",
"reference_id": "SUBCARD001",
"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": "INVCARD001",
"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",
"billing_date": 1,
"billing_limit": "AFTER",
"billing_rule": "MAX",
"remarks": "Monthly subscription for premium services"
},
"mop_type": "credit_card",
"card_details": {
"number": "4111111111111111",
"cardholder_name": "John Doe",
"expiry_month": 12,
"expiry_year": 2027,
"cvv": "123",
"network": "VISA",
"nickname": "My Credit Card"
}
}
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: 'SUBCARD001',
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: 'INVCARD001', 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',
billing_date: 1,
billing_limit: 'AFTER',
billing_rule: 'MAX',
remarks: 'Monthly subscription for premium services'
},
mop_type: 'credit_card',
card_details: {
number: '4111111111111111',
cardholder_name: 'John Doe',
expiry_month: 12,
expiry_year: 2027,
cvv: '123',
network: 'VISA',
nickname: 'My Credit Card'
}
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/subscriptions/card/', 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/card/",
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' => 'SUBCARD001',
'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' => 'INVCARD001',
'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',
'billing_date' => 1,
'billing_limit' => 'AFTER',
'billing_rule' => 'MAX',
'remarks' => 'Monthly subscription for premium services'
],
'mop_type' => 'credit_card',
'card_details' => [
'number' => '4111111111111111',
'cardholder_name' => 'John Doe',
'expiry_month' => 12,
'expiry_year' => 2027,
'cvv' => '123',
'network' => 'VISA',
'nickname' => 'My Credit Card'
]
]),
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/card/"
payload := strings.NewReader("{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBCARD001\",\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\": \"INVCARD001\",\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 \"billing_date\": 1,\n \"billing_limit\": \"AFTER\",\n \"billing_rule\": \"MAX\",\n \"remarks\": \"Monthly subscription for premium services\"\n },\n \"mop_type\": \"credit_card\",\n \"card_details\": {\n \"number\": \"4111111111111111\",\n \"cardholder_name\": \"John Doe\",\n \"expiry_month\": 12,\n \"expiry_year\": 2027,\n \"cvv\": \"123\",\n \"network\": \"VISA\",\n \"nickname\": \"My Credit Card\"\n }\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/card/")
.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\": \"SUBCARD001\",\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\": \"INVCARD001\",\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 \"billing_date\": 1,\n \"billing_limit\": \"AFTER\",\n \"billing_rule\": \"MAX\",\n \"remarks\": \"Monthly subscription for premium services\"\n },\n \"mop_type\": \"credit_card\",\n \"card_details\": {\n \"number\": \"4111111111111111\",\n \"cardholder_name\": \"John Doe\",\n \"expiry_month\": 12,\n \"expiry_year\": 2027,\n \"cvv\": \"123\",\n \"network\": \"VISA\",\n \"nickname\": \"My Credit Card\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/subscriptions/card/")
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\": \"SUBCARD001\",\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\": \"INVCARD001\",\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 \"billing_date\": 1,\n \"billing_limit\": \"AFTER\",\n \"billing_rule\": \"MAX\",\n \"remarks\": \"Monthly subscription for premium services\"\n },\n \"mop_type\": \"credit_card\",\n \"card_details\": {\n \"number\": \"4111111111111111\",\n \"cardholder_name\": \"John Doe\",\n \"expiry_month\": 12,\n \"expiry_year\": 2027,\n \"cvv\": \"123\",\n \"network\": \"VISA\",\n \"nickname\": \"My Credit Card\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Card Subscription created successfully",
"data": {
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"subscription_type": "CARD_RECURRING",
"subscription_id": "660e8400-e29b-41d4-a716-446655440001",
"acstemplate": "<html>...</html>",
"subscription": {
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2024-01-01",
"payment_end_date": "2024-12-31",
"status": "PENDING"
}
}
}{
"success": false,
"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": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Create Card Subscription
Create a new card-based subscription order with standing instructions (SI).
curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/subscriptions/card/ \
--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": "SUBCARD001",
"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": "INVCARD001",
"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",
"billing_date": 1,
"billing_limit": "AFTER",
"billing_rule": "MAX",
"remarks": "Monthly subscription for premium services"
},
"mop_type": "credit_card",
"card_details": {
"number": "4111111111111111",
"cardholder_name": "John Doe",
"expiry_month": 12,
"expiry_year": 2027,
"cvv": "123",
"network": "VISA",
"nickname": "My Credit Card"
}
}
'import requests
url = "https://api-pacb-uat.eximpe.com/pg/subscriptions/card/"
payload = {
"amount": "1000.00",
"collection_mode": "s2s",
"currency": "INR",
"reference_id": "SUBCARD001",
"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": "INVCARD001",
"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",
"billing_date": 1,
"billing_limit": "AFTER",
"billing_rule": "MAX",
"remarks": "Monthly subscription for premium services"
},
"mop_type": "credit_card",
"card_details": {
"number": "4111111111111111",
"cardholder_name": "John Doe",
"expiry_month": 12,
"expiry_year": 2027,
"cvv": "123",
"network": "VISA",
"nickname": "My Credit Card"
}
}
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: 'SUBCARD001',
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: 'INVCARD001', 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',
billing_date: 1,
billing_limit: 'AFTER',
billing_rule: 'MAX',
remarks: 'Monthly subscription for premium services'
},
mop_type: 'credit_card',
card_details: {
number: '4111111111111111',
cardholder_name: 'John Doe',
expiry_month: 12,
expiry_year: 2027,
cvv: '123',
network: 'VISA',
nickname: 'My Credit Card'
}
})
};
fetch('https://api-pacb-uat.eximpe.com/pg/subscriptions/card/', 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/card/",
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' => 'SUBCARD001',
'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' => 'INVCARD001',
'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',
'billing_date' => 1,
'billing_limit' => 'AFTER',
'billing_rule' => 'MAX',
'remarks' => 'Monthly subscription for premium services'
],
'mop_type' => 'credit_card',
'card_details' => [
'number' => '4111111111111111',
'cardholder_name' => 'John Doe',
'expiry_month' => 12,
'expiry_year' => 2027,
'cvv' => '123',
'network' => 'VISA',
'nickname' => 'My Credit Card'
]
]),
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/card/"
payload := strings.NewReader("{\n \"amount\": \"1000.00\",\n \"collection_mode\": \"s2s\",\n \"currency\": \"INR\",\n \"reference_id\": \"SUBCARD001\",\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\": \"INVCARD001\",\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 \"billing_date\": 1,\n \"billing_limit\": \"AFTER\",\n \"billing_rule\": \"MAX\",\n \"remarks\": \"Monthly subscription for premium services\"\n },\n \"mop_type\": \"credit_card\",\n \"card_details\": {\n \"number\": \"4111111111111111\",\n \"cardholder_name\": \"John Doe\",\n \"expiry_month\": 12,\n \"expiry_year\": 2027,\n \"cvv\": \"123\",\n \"network\": \"VISA\",\n \"nickname\": \"My Credit Card\"\n }\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/card/")
.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\": \"SUBCARD001\",\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\": \"INVCARD001\",\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 \"billing_date\": 1,\n \"billing_limit\": \"AFTER\",\n \"billing_rule\": \"MAX\",\n \"remarks\": \"Monthly subscription for premium services\"\n },\n \"mop_type\": \"credit_card\",\n \"card_details\": {\n \"number\": \"4111111111111111\",\n \"cardholder_name\": \"John Doe\",\n \"expiry_month\": 12,\n \"expiry_year\": 2027,\n \"cvv\": \"123\",\n \"network\": \"VISA\",\n \"nickname\": \"My Credit Card\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/subscriptions/card/")
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\": \"SUBCARD001\",\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\": \"INVCARD001\",\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 \"billing_date\": 1,\n \"billing_limit\": \"AFTER\",\n \"billing_rule\": \"MAX\",\n \"remarks\": \"Monthly subscription for premium services\"\n },\n \"mop_type\": \"credit_card\",\n \"card_details\": {\n \"number\": \"4111111111111111\",\n \"cardholder_name\": \"John Doe\",\n \"expiry_month\": 12,\n \"expiry_year\": 2027,\n \"cvv\": \"123\",\n \"network\": \"VISA\",\n \"nickname\": \"My Credit Card\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Card Subscription created successfully",
"data": {
"order_id": "550e8400-e29b-41d4-a716-446655440000",
"subscription_type": "CARD_RECURRING",
"subscription_id": "660e8400-e29b-41d4-a716-446655440001",
"acstemplate": "<html>...</html>",
"subscription": {
"billing_cycle": "MONTHLY",
"billing_interval": 1,
"payment_start_date": "2024-01-01",
"payment_end_date": "2024-12-31",
"status": "PENDING"
}
}
}{
"success": false,
"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": false,
"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., '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which API version your integration uses. Default version information is available in the Developer Settings.
Body
Card subscription creation request. Accepts the same fields as Create Order (S2S Card) plus a standing_instruction block.
Amount in decimal format (e.g., "100.00")
^\d+\.\d{2}$3-letter ISO currency code (e.g., INR, USD)
^[A-Z]{3}$Unique identifier for the order
Show child attributes
Show child attributes
Show child attributes
Show child attributes
URL to redirect after payment
Payment collection mode (must be 's2s' for subscriptions)
s2s Method of payment
UPI flow type (required when collection_mode is s2s and mop_type is UPI)
intent, collection Show child attributes
Show child attributes
Show child attributes
Show child attributes
Standing instruction configuration for a subscription
Show child attributes
Show child attributes