Sorry, your browser does not support JavaScript! Plural XT APIs - Pine Labs Developer

Plural XT API

Introduction

Pine Labs' Plural XT APIs conform to the REST architectural style. APIs follow HTTP protocol of communication. You can use one of test or live environments. APIs in test environment do not have any impact on your production data.

API endpoints for test and production environments are provided below:

Environment URL
Test https://paymentoptimizertest.pinepg.in/
Production https://paymentoptimizer.pinepg.in

Authentication

Most APIs follow the standard authentication process. For any such request you need to provide the Client ID for the authentication process. Once you are onboarding on Pine Labs' Plural XT you can get Client ID from the Pine Labs' Plural XT merchant dashboard.


MERCHANT_ID=3413&MERCHANT_ACCESS_CODE=1c295f88-4477-4cd3-b5ac-
e76148545a3e&PRODUCT_CODE=40&AMOUNT=55000
&REFERENCE_NO=EQWEWEE&
CUSTOMER_MOBILE_NO=7303963669&
CUSTOMER_EMAIL_ID=dummy.email@pinelabs.com
&PRODUCT_DESCRIPTION=abc	

Customer

A customer is an individual who registers on the merchant's platform to buy goods or services. The customer object enables the merchant to create, fetch, update and delete customers.

Create Customer

Merchant can create customer. The merchant can call the create customer API at the time of registration of the customer. Pine Labs' Plural XT will assign a unique ID corresponding to the customer. Merchant can save this unique ID in his database. For subsequent transactions this unique identifier is used to identify the customer's related orders and payments.

This API requires authentication information in the request payload header. Authentication details can be found from here.

POST : create/customer

Request Parameters:

post create/customer

Form Data

Varchar(100)

Unique reference number of Customer at Merchant's end

Varchar(20)

Mobile Number of Customer

Varchar(100)

Email Id of Customer

Varchar(200)

First Name of Customer

Varchar(200)

Last Name of Cusomer

Varchar(10)

Country Code

Name Description Data Type
customer_ref_no (required) Unique reference number of Customer at Merchant's end Varchar(100)
mobile_number (required) Mobile Number of Customer Varchar(20)
email_id (required) Email Id of Customer Varchar(100)
first_name (required) First Name of Customer Varchar(200)
last_name (required) Last Name of Cusomer Varchar(200)
country_code (required) Country Code Varchar(10)

curl --location --request POST 'https://dummy.base.url/create/customer' \
--header 'Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ' \
--header 'Content-Type: application/json' \
--data-raw '{
"country_code": "91",
"mobile_number": "7303963669",
"email_id": "dummy.email@pinelabs.com",
"first_name": "fname",
"last_name": "lname",
"customer_ref_no": "123012216"
}

import requests

url = "https://dummy.base.url/create/customer"

payload = "{\n  \"country_code\": \"91\",\n  \"mobile_number\": \"7303963669\",\n  \"email_id\": \"dummy.email@pinelabs.com\",\n  \"first_name\": \"fname\",\n  \"last_name\": \"lname\",\n  \"customer_ref_no\": \"123012216\"\n}\n"
headers = {
  'Authorization': 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

																

require "uri"
require "net/http"

url = URI("https://dummy.base.url/create/customer")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
request["Content-Type"] = "application/json"
request.body = "{\n  \"country_code\": \"91\",\n  \"mobile_number\": \"7303963669\",\n  \"email_id\": \"dummy.email@pinelabs.com\",\n  \"first_name\": \"fname\",\n  \"last_name\": \"lname\",\n  \"customer_ref_no\": \"123012216\"\n}\n"

response = https.request(request)
puts response.read_body

setUrl('https://dummy.base.url/create/customer');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ',
  'Content-Type' => 'application/json'
));
$request->setBody('{\n  "country_code": "91",\n  "mobile_number": "7303963669",\n  "email_id": "dummy.email@pinelabs.com",\n  "first_name": "fname",\n  "last_name": "lname",\n  "customer_ref_no": "123012216"\n}\n');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"country_code\": \"91\",\n  \"mobile_number\": \"7303963669\",\n  \"email_id\": \"dummy.email@pinelabs.com\",\n  \"first_name\": \"fname\",\n  \"last_name\": \"lname\",\n  \"customer_ref_no\": \"123012216\"\n}\n");
Request request = new Request.Builder()
  .url("https://dummy.base.url/create/customer")
  .method("POST", body)
  .addHeader("Authorization", "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

{
	"customer_id": 1164,
	"customer_ref_no": "poiuytrwqq8762711",
	"merchant_id": 110,
	"first_name": "fname",
	"last_name": "lname",
	"mobile_number": "7303963669",
	"email_id": "dummy.email@pinelabs.com",
	"country_code": "91",
	"response_code": 1,
	"response_message": "SUCCESS"
}

Get Customer

Get customer allows the merchant to fetch the details of the customers he has created. For this, the merchant needs to pass a unique customer identifier of the customer i.e. customer_id.

This API requires authentication information in the request payload header. Authentication details can be found from here.

GET : customer/{customerId}

get customer/customer_id

Form Data

long

Unique Customer Id.


curl --location --request GET 'https://dummy.base.url/customer/10073' \
--header 'Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ'

import requests
url = "https://dummy.base.url/customer/10073"
payload = {}
headers = {
  'Authorization': 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ'
}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))

require "uri"
require "net/http"
url = URI("https://dummy.base.url/customer/10073")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
response = https.request(request)
puts response.read_body

 "https://dummy.base.url/customer/10073",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://dummy.base.url/customer/10073")
  .method("GET", null)
  .addHeader("Authorization", "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ")
  .build();
Response response = client.newCall(request).execute();

{
	"customer_id": 1164,
	"customer_ref_no": "poiuytrwqq8762711",
	"merchant_id": 110,
	"first_name": "fname",
	"last_name": "lname",
	"mobile_number": "7303963669",
	"email_id": "dummy.email@pinelabs.com",
	"country_code": "91",
	"response_code": 1,
	"response_message": "SUCCESS"
}








Update Customer

Update Customer API plays a key role to update the details of existing customers. The merchant needs to supply the customer_id of customer for which the details are to be changed along with the details to be changed. The details which are not passed will remain as is.

This API requires authentication information in the request payload header. Authentication details can be found from here.

POST : update/customer/{CustomerId}

post update/customer/customer_id

Form Data

long

Unique Customer Id.

Varchar(20)

Mobile Number of Customer

Varchar(100)

Email Id of Customer

Varchar(200)

First Name of Customer

Varchar(200)

Last Name of Cusomer

Varchar(10)

Country Code

Request Parameters:

Name Description Data Type
mobile_number (optional) Mobile Number of Customer Varchar(20)
email_id (optional) Email Id of Customer Varchar(100)
first_name (optional) First Name of Customer Varchar(100)
last_name (optional) Last Name of Cusomer Varchar(200)
country_code (optional) Country Code Varchar(10)

curl --location --request POST 'https://dummy.base.url/update/customer/10073' \
--header 'Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ' \
--header 'Content-Type: application/json' \
--data-raw '{
  "country_code": "91",
  "mobile_number": "7303963669",
  "email_id": "dummy.email@pinelabs.com",
  "first_name": "fname",
  "last_name": "lname",
  "customer_ref_no": "5"  
}'																	
																

import http.client
import mimetypes
conn = http.client.HTTPSConnection("dummy.base.url")
payload = "{\n  \"country_code\": \"91\",\n  \"mobile_number\": \"7303963669\",\n  \"email_id\": \"dummy.email@pinelabs.com\",\n  \"first_name\": \"fname\",\n  \"last_name\": \"lname\",\n  \"customer_ref_no\": \"5\"\n  \n}\n"
headers = {
  'Authorization': 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ',
  'Content-Type': 'application/json'
}
conn.request("POST", "/update/customer/10073", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))																	
																

require "uri"
require "net/http"

url = URI("https://dummy.base.url/update/customer/10073")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
request["Content-Type"] = "application/json"
request.body = "{\n  \"country_code\": \"91\",\n  \"mobile_number\": \"7303963669\",\n  \"email_id\": \"dummy.email@pinelabs.com\",\n  \"first_name\": \"fname\",\n  \"last_name\": \"lname\",\n  \"customer_ref_no\": \"5\"\n  \n}\n"

response = https.request(request)
puts response.read_body

 "https://dummy.base.url/update/customer/10073",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n  \"country_code\": \"91\",\n  \"mobile_number\": \"7303963669\",\n  \"email_id\": \"dummy.email@pinelabs.com\",\n  \"first_name\": \"fname\",\n  \"last_name\": \"lname\",\n  \"customer_ref_no\": \"5\"\n  \n}\n",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"country_code\": \"91\",\n  \"mobile_number\": \"7303963669\",\n  \"email_id\": \"dummy.email@pinelabs.com\",\n  \"first_name\": \"fname\",\n  \"last_name\": \"lname\",\n  \"customer_ref_no\": \"5\"\n  \n}\n");
Request request = new Request.Builder()
  .url("https://dummy.base.url/update/customer/10073")
  .method("POST", body)
  .addHeader("Authorization", "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

{
    "customer_id": 103,
    "merchant_id": 240,
    "first_name": "fname",
    "last_name": "lname",
    "mobile_number": "7303963669",
    "email_id": "dummy.email@pinelabs.com",
    "country_code": "91",
    "response_code": 1,
    "response_message": "SUCCESS"
}

Order

In order section merchant can create an order, inquire about an order already placed and also request for refund of a particular order.

Create Order

Order represents the shopping cart in the payment journey. Order plays a central part in the payment flow as the subsequent transactions e.g. payment, refund, get status are linked to it. For this, an order must be identified uniquely and you can create and assign a random and unique order_id to the order. This order_id can be used for the subsequently linked transactions to the order.

An order comprises of the following details:
Order Identifier - order_id
Payment Details - Amount, Currency, Preferred PG
Customer details - Customer Id, Customer Email, Customer Mobile
Product details - Product id
Address - Billing Address and Shipping Address
Other details

Order Id Generation:
API URL- /api/v2/order/create
Content Type- application/json

post api/v2/order/create

Form Data

string

SHA256 of (Base64 request encoded payload)

x-verify : SHA256 of (Base64 request encoded payload). Click on 'Generate Base64 Request' button and copy the Base64 string and generate the x-verify by using the Secret key. This will be passed in the request header. Refer github for How to generate the x-verify.
int

Merchant unique identification id provided by Pine Labs

string(50)

Merchant unique access code provided by Pine Labs

string(500)

Merchant return url.

string(200)

Unique Order id of transaction maintained at Merchant end

long

Total Payment amount in paise

long

Currency Code

string(100)

Email Id of Customer

string(100)

Mobile Number of Customer

int

Customer Id (Received during Create Customer API), to be sent if card is to be saved for Customer



Request Parameters:

Name Data Type Value Description
merchant_data Complex Type
 - merchant_id (required) int Merchant unique identification id provided by Pine Labs
 - merchant_access_code (required) String(50) Merchant unique access code provided by Pine Labs
 - order_id (required) String(200) Unique Order id of transaction maintained at Merchant end
 - merchant_return_url (required) String(500)
payment_info_data (required) Complex Type
 - amount (required) Long Total Payment amount in paise
 - currency_code (required) String INR
 - order_desc (optional) String Merchant's order description
customer_data Complex Type Either Customer Id To be sent
or if Customer Id is not created at Pine Labs' Plural XT's end then rest all Customer Details need to be sent for implementing Saved Card functionality
 - customer_id (optional) int Customer Id (Received during Create Customer API), to be sent if card is to be saved for Customer
 - customer_ref_no (optional) String(100) Unique Reference Number of Customer at Merchant's end
 - mobile_number (optional) String(20) Mobile Number of Customer
 - email_id (optional) String(100) Email Id of Customer
 - first_name (optional) String(200) First Name of Customer
 - last_name (optional) String(200) Last Name of Customer
 - country_code (optional) String(10) Country Code
billing_address_data Complex Type
 - first_name (optional) String(50)
 - last_name (optional) String(50)
 - address1 (optional) String(200)
 - address2 (optional) String(200)
 - address3 (optional) String(200)
 - pincode (optional) String(50)
 - city (optional) String(50)
 - state (optional) String(50)
 - country (optional) String(50)
shipping_address_data Complex Type
 - first_name (optional) String(50)
 - last_name (optional) String(50)
 - address1 (optional) String(200)
 - address2 (optional) String(200)
 - address3 (optional) String(200)
 - pincode (optional) String(50)
 - city (optional) String(50)
 - state (optional) String(50)
 - country (optional) String(50)
additional_info_data Complex Type
 - rfu1 (optional) String(200)
 - Rfu2 (optional) String(200)
 - Rfu3 (optional) String(200)
 - Rfu4 (optional) String(200)
 - Rfu5 (optional) String(200)
 - Rfu6 (optional) String(200)
 - Rfu7 (optional) String(200)
 - Rfu8 (optional) String(200)
 - Rfu9 (optional) String(200)
 - rfu10 (optional) String(200)
 - rfu11 (optional) String(200)
 - rfu12 (optional) String(200)
 - rfu13 (optional) String(200)
 - rfu14 (optional) String(200)
 - rfu15 (optional) String(200)
 - rfu16 (optional) String(200)
 - rfu17 (optional) String(200)
 - rfu18 (optional) String(200)
 - rfu19 (optional) String(200)
 - rfu20 (optional) String(200)
product_info_data
 - product_details[] (optional) Array of Product Details which Need to send for Implementing Brand EMI
 - productDetails (optional)
{
"product_code":"",
"product_amount":""
}
txn_data Complex Type
 - navigation_mode (required) int 7 Seamless navigation mode
 - payment_mode (required) String 10 Payment mode to do transaction. For UPI value is 10
 - transaction_type (optional) int 1 Purchase transaction
 - time_stamp (optional) Long UnixTimeStamp of current transaction time

curl --location --request POST 'https://dummy.base.url/api/v2/order/create' \
--header 'cache-control: no-cache' \
--header 'postman-token: 58162b8a-54be-4f13-934d-07199ce8982d' \
--header 'x-verify: 968BD5729C92668755FB1FCE1FB' \
--header 'Content-Type: application/json' \
--header 'Cookie: ASP.NET_SessionId=zjvzodvatuaxp2o0rnf2xapz' \
--data-raw '{"request": "ewoKICAgICJtZXJjaGFudF9kYXRhIjogewoKICAgICAgICAibWVyY2hhbnRfaWQiOiAxMTI4NSwKCiAgICAgICAgIm1lcmNoYW50X2FjY2Vzc19jb2RlIjogIjEwYzg0ZTNlLWE0ZmMtNGNhNS1iMjk1LTg2NjM5MWZmMTA4YiIsCgogICAgICAgICJtZXJjaGFudF9yZXR1cm5fdXJsIjogImh0dHA6Ly8xOTIuMTY4LjEwMS4yMDU6OTA3My9jaGFyZ2luZ3Jlc3BuZXcuYXNweCIsCgogICAgICAgICJvcmRlcl9pZCI6ICIzNVNTUzI1MTAwMDAxU1MyMzQ0b29vd3d3bzBlZWUwMzMiCgogICAgfSwKCiAgICAicGF5bWVudF9pbmZvX2RhdGEiOiB7CgogICAgICAgICJhbW91bnQiOiAxMDAwMDAwLAoKICAgICAgICAiY3VycmVuY3lfY29kZSI6ICJJTlIiLAoKICAgICAgICAicHJlZmVycmVkX2dhdGV3YXkiOiJIREZDIiwKCiAgICAgICAgIm9yZGVyX2Rlc2MiOiJURVNUIE9SREVSISIKCiAgICB9LAoKICAgICJjdXN0b21lcl9kYXRhIjogewoKICAgICAgICAiY3VzdG9tZXJfaWQiOiAzNSwKCiAgICAgICAgIm1vYmlsZV9ubyI6ICI5OTExODQ0NDA0IiwKCiAgICAgICAgImVtYWlsX2lkIjogIm5laGEubWFkYW5AcGluZWxhYnMuY29tIgoKICAgIH0sCgogICAgImJpbGxpbmdfYWRkcmVzc19kYXRhIjogewoKICAgICAgICAiZmlyc3RfbmFtZSI6ICJoYXJzaCIsCgogICAgICAgICJsYXN0X25hbWUiOiAia3VtYXIiLAoKICAgICAgICAiYWRkcmVzczEiOiAiaG9uIDE1IiwKCiAgICAgICAgImFkZHJlc3MyIjogImxhbCBrdXJ0aSIsCgogICAgICAgICJhZGRyZXNzMyI6ICJqYWxhbmRoYXIiLAoKICAgICAgICAicGluY29kZSI6ICIxNDQwMDUiLAoKICAgICAgICAiY2l0eSI6ICJOT0lEQSIsCgogICAgICAgICJzdGF0ZSI6ICJQVU5KQUIiLAoKICAgICAgICAiY291bnRyeSI6ICJJTkRJQSIKCiAgICB9LAoKICAgICJzaGlwcGluZ19hZGRyZXNzX2RhdGEiOiB7CgogICAgICAgICJmaXJzdF9uYW1lIjogImhhcnNoIiwKCiAgICAgICAgImxhc3RfbmFtZSI6ICJrdW1hciIsCgogICAgICAgICJhZGRyZXNzMSI6ICJob24gMTUiLAoKICAgICAgICAiYWRkcmVzczIiOiAibGFsIGt1cnRpIiwKCiAgICAgICAgImFkZHJlc3MzIjogImphbGFuZGhhciIsCgogICAgICAgICJwaW5jb2RlIjogIjE0NDAwNSIsCgogICAgICAgICJjaXR5IjogIk5PSURBIiwKCiAgICAgICAgInN0YXRlIjogIlBVTkpBQiIsCgogICAgICAgICJjb3VudHJ5IjogIklORElBIgoKICAgIH0sCgogICAgInByb2R1Y3RfaW5mb19kYXRhIjogewoKICAgICAgICAicHJvZHVjdF9kZXRhaWxzIjogWwoKICAgICAgICAgICAgewoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2NvZGUiOiAiNDAiLAoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2Ftb3VudCI6IDEwMDAwMDAKCiAgICAgICAgICAgIH0KCiAgICAgICAgXQoKICAgIH0sCgogICAgImFkZGl0aW9uYWx=="
}'																			
																		

import requests

url = "https://dummy.base.url/api/v2/order/create"

payload = "{\"request\": \"ewoKICAgICJtZXJjaGFudF9kYXRhIjogewoKICAgICAgICAibWVyY2hhbnRfaWQiOiAxMTI4NSwKCiAgICAgICAgIm1lcmNoYW50X2FjY2Vzc19jb2RlIjogIjEwYzg0ZTNlLWE0ZmMtNGNhNS1iMjk1LTg2NjM5MWZmMTA4YiIsCgogICAgICAgICJtZXJjaGFudF9yZXR1cm5fdXJsIjogImh0dHA6Ly8xOTIuMTY4LjEwMS4yMDU6OTA3My9jaGFyZ2luZ3Jlc3BuZXcuYXNweCIsCgogICAgICAgICJvcmRlcl9pZCI6ICIzNVNTUzI1MTAwMDAxU1MyMzQ0b29vd3d3bzBlZWUwMzMiCgogICAgfSwKCiAgICAicGF5bWVudF9pbmZvX2RhdGEiOiB7CgogICAgICAgICJhbW91bnQiOiAxMDAwMDAwLAoKICAgICAgICAiY3VycmVuY3lfY29kZSI6ICJJTlIiLAoKICAgICAgICAicHJlZmVycmVkX2dhdGV3YXkiOiJIREZDIiwKCiAgICAgICAgIm9yZGVyX2Rlc2MiOiJURVNUIE9SREVSISIKCiAgICB9LAoKICAgICJjdXN0b21lcl9kYXRhIjogewoKICAgICAgICAiY3VzdG9tZXJfaWQiOiAzNSwKCiAgICAgICAgIm1vYmlsZV9ubyI6ICI5OTExODQ0NDA0IiwKCiAgICAgICAgImVtYWlsX2lkIjogIm5laGEubWFkYW5AcGluZWxhYnMuY29tIgoKICAgIH0sCgogICAgImJpbGxpbmdfYWRkcmVzc19kYXRhIjogewoKICAgICAgICAiZmlyc3RfbmFtZSI6ICJoYXJzaCIsCgogICAgICAgICJsYXN0X25hbWUiOiAia3VtYXIiLAoKICAgICAgICAiYWRkcmVzczEiOiAiaG9uIDE1IiwKCiAgICAgICAgImFkZHJlc3MyIjogImxhbCBrdXJ0aSIsCgogICAgICAgICJhZGRyZXNzMyI6ICJqYWxhbmRoYXIiLAoKICAgICAgICAicGluY29kZSI6ICIxNDQwMDUiLAoKICAgICAgICAiY2l0eSI6ICJOT0lEQSIsCgogICAgICAgICJzdGF0ZSI6ICJQVU5KQUIiLAoKICAgICAgICAiY291bnRyeSI6ICJJTkRJQSIKCiAgICB9LAoKICAgICJzaGlwcGluZ19hZGRyZXNzX2RhdGEiOiB7CgogICAgICAgICJmaXJzdF9uYW1lIjogImhhcnNoIiwKCiAgICAgICAgImxhc3RfbmFtZSI6ICJrdW1hciIsCgogICAgICAgICJhZGRyZXNzMSI6ICJob24gMTUiLAoKICAgICAgICAiYWRkcmVzczIiOiAibGFsIGt1cnRpIiwKCiAgICAgICAgImFkZHJlc3MzIjogImphbGFuZGhhciIsCgogICAgICAgICJwaW5jb2RlIjogIjE0NDAwNSIsCgogICAgICAgICJjaXR5IjogIk5PSURBIiwKCiAgICAgICAgInN0YXRlIjogIlBVTkpBQiIsCgogICAgICAgICJjb3VudHJ5IjogIklORElBIgoKICAgIH0sCgogICAgInByb2R1Y3RfaW5mb19kYXRhIjogewoKICAgICAgICAicHJvZHVjdF9kZXRhaWxzIjogWwoKICAgICAgICAgICAgewoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2NvZGUiOiAiNDAiLAoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2Ftb3VudCI6IDEwMDAwMDAKCiAgICAgICAgICAgIH0KCiAgICAgICAgXQoKICAgIH0sCgogICAgImFkZGl0aW9uYWxfaW5mb19kYXRhIjogewoKICAgICAgICAicmZ1MSI6ICIxMjMiCgogICAgfQoKfQ==\"\n\n}"
headers = {
  'cache-control': 'no-cache',
  'postman-token': '58162b8a-54be-4f13-934d-07199ce8982d',
  'x-verify': '968BD5729C92668755FB1FCE1FB',
  'Content-Type': 'application/json',
  'Cookie': 'ASP.NET_SessionId=zjvzodvatuaxp2o0rnf2xapz'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

require "uri"
require "net/http"

url = URI("https://dummy.base.url/api/v2/order/create")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["cache-control"] = "no-cache"
request["postman-token"] = "58162b8a-54be-4f13-934d-07199ce8982d"
request["x-verify"] = "968BD5729C92668755FB1FCE1FB"
request["Content-Type"] = "application/json"
request["Cookie"] = "ASP.NET_SessionId=zjvzodvatuaxp2o0rnf2xapz"
request.body = "{\"request\": \"ewoKICAgICJtZXJjaGFudF9kYXRhIjogewoKICAgICAgICAibWVyY2hhbnRfaWQiOiAxMTI4NSwKCiAgICAgICAgIm1lcmNoYW50X2FjY2Vzc19jb2RlIjogIjEwYzg0ZTNlLWE0ZmMtNGNhNS1iMjk1LTg2NjM5MWZmMTA4YiIsCgogICAgICAgICJtZXJjaGFudF9yZXR1cm5fdXJsIjogImh0dHA6Ly8xOTIuMTY4LjEwMS4yMDU6OTA3My9jaGFyZ2luZ3Jlc3BuZXcuYXNweCIsCgogICAgICAgICJvcmRlcl9pZCI6ICIzNVNTUzI1MTAwMDAxU1MyMzQ0b29vd3d3bzBlZWUwMzMiCgogICAgfSwKCiAgICAicGF5bWVudF9pbmZvX2RhdGEiOiB7CgogICAgICAgICJhbW91bnQiOiAxMDAwMDAwLAoKICAgICAgICAiY3VycmVuY3lfY29kZSI6ICJJTlIiLAoKICAgICAgICAicHJlZmVycmVkX2dhdGV3YXkiOiJIREZDIiwKCiAgICAgICAgIm9yZGVyX2Rlc2MiOiJURVNUIE9SREVSISIKCiAgICB9LAoKICAgICJjdXN0b21lcl9kYXRhIjogewoKICAgICAgICAiY3VzdG9tZXJfaWQiOiAzNSwKCiAgICAgICAgIm1vYmlsZV9ubyI6ICI5OTExODQ0NDA0IiwKCiAgICAgICAgImVtYWlsX2lkIjogIm5laGEubWFkYW5AcGluZWxhYnMuY29tIgoKICAgIH0sCgogICAgImJpbGxpbmdfYWRkcmVzc19kYXRhIjogewoKICAgICAgICAiZmlyc3RfbmFtZSI6ICJoYXJzaCIsCgogICAgICAgICJsYXN0X25hbWUiOiAia3VtYXIiLAoKICAgICAgICAiYWRkcmVzczEiOiAiaG9uIDE1IiwKCiAgICAgICAgImFkZHJlc3MyIjogImxhbCBrdXJ0aSIsCgogICAgICAgICJhZGRyZXNzMyI6ICJqYWxhbmRoYXIiLAoKICAgICAgICAicGluY29kZSI6ICIxNDQwMDUiLAoKICAgICAgICAiY2l0eSI6ICJOT0lEQSIsCgogICAgICAgICJzdGF0ZSI6ICJQVU5KQUIiLAoKICAgICAgICAiY291bnRyeSI6ICJJTkRJQSIKCiAgICB9LAoKICAgICJzaGlwcGluZ19hZGRyZXNzX2RhdGEiOiB7CgogICAgICAgICJmaXJzdF9uYW1lIjogImhhcnNoIiwKCiAgICAgICAgImxhc3RfbmFtZSI6ICJrdW1hciIsCgogICAgICAgICJhZGRyZXNzMSI6ICJob24gMTUiLAoKICAgICAgICAiYWRkcmVzczIiOiAibGFsIGt1cnRpIiwKCiAgICAgICAgImFkZHJlc3MzIjogImphbGFuZGhhciIsCgogICAgICAgICJwaW5jb2RlIjogIjE0NDAwNSIsCgogICAgICAgICJjaXR5IjogIk5PSURBIiwKCiAgICAgICAgInN0YXRlIjogIlBVTkpBQiIsCgogICAgICAgICJjb3VudHJ5IjogIklORElBIgoKICAgIH0sCgogICAgInByb2R1Y3RfaW5mb19kYXRhIjogewoKICAgICAgICAicHJvZHVjdF9kZXRhaWxzIjogWwoKICAgICAgICAgICAgewoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2NvZGUiOiAiNDAiLAoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2Ftb3VudCI6IDEwMDAwMDAKCiAgICAgICAgICAgIH0KCiAgICAgICAgXQoKICAgIH0sCgogICAgImFkZGl0aW9uYWxfaW5mb19kYXRhIjogewoKICAgICAgICAicmZ1MSI6ICIxMjMiCgogICAgfQoKfQ==\"\n\n}"

response = https.request(request)
puts response.read_body

 "https://dummy.base.url/api/v2/order/create",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\"request\": \"ewoKICAgICJtZXJjaGFudF9kYXRhIjogewoKICAgICAgICAibWVyY2hhbnRfaWQiOiAxMTI4NSwKCiAgICAgICAgIm1lcmNoYW50X2FjY2Vzc19jb2RlIjogIjEwYzg0ZTNlLWE0ZmMtNGNhNS1iMjk1LTg2NjM5MWZmMTA4YiIsCgogICAgICAgICJtZXJjaGFudF9yZXR1cm5fdXJsIjogImh0dHA6Ly8xOTIuMTY4LjEwMS4yMDU6OTA3My9jaGFyZ2luZ3Jlc3BuZXcuYXNweCIsCgogICAgICAgICJvcmRlcl9pZCI6ICIzNVNTUzI1MTAwMDAxU1MyMzQ0b29vd3d3bzBlZWUwMzMiCgogICAgfSwKCiAgICAicGF5bWVudF9pbmZvX2RhdGEiOiB7CgogICAgICAgICJhbW91bnQiOiAxMDAwMDAwLAoKICAgICAgICAiY3VycmVuY3lfY29kZSI6ICJJTlIiLAoKICAgICAgICAicHJlZmVycmVkX2dhdGV3YXkiOiJIREZDIiwKCiAgICAgICAgIm9yZGVyX2Rlc2MiOiJURVNUIE9SREVSISIKCiAgICB9LAoKICAgICJjdXN0b21lcl9kYXRhIjogewoKICAgICAgICAiY3VzdG9tZXJfaWQiOiAzNSwKCiAgICAgICAgIm1vYmlsZV9ubyI6ICI5OTExODQ0NDA0IiwKCiAgICAgICAgImVtYWlsX2lkIjogIm5laGEubWFkYW5AcGluZWxhYnMuY29tIgoKICAgIH0sCgogICAgImJpbGxpbmdfYWRkcmVzc19kYXRhIjogewoKICAgICAgICAiZmlyc3RfbmFtZSI6ICJoYXJzaCIsCgogICAgICAgICJsYXN0X25hbWUiOiAia3VtYXIiLAoKICAgICAgICAiYWRkcmVzczEiOiAiaG9uIDE1IiwKCiAgICAgICAgImFkZHJlc3MyIjogImxhbCBrdXJ0aSIsCgogICAgICAgICJhZGRyZXNzMyI6ICJqYWxhbmRoYXIiLAoKICAgICAgICAicGluY29kZSI6ICIxNDQwMDUiLAoKICAgICAgICAiY2l0eSI6ICJOT0lEQSIsCgogICAgICAgICJzdGF0ZSI6ICJQVU5KQUIiLAoKICAgICAgICAiY291bnRyeSI6ICJJTkRJQSIKCiAgICB9LAoKICAgICJzaGlwcGluZ19hZGRyZXNzX2RhdGEiOiB7CgogICAgICAgICJmaXJzdF9uYW1lIjogImhhcnNoIiwKCiAgICAgICAgImxhc3RfbmFtZSI6ICJrdW1hciIsCgogICAgICAgICJhZGRyZXNzMSI6ICJob24gMTUiLAoKICAgICAgICAiYWRkcmVzczIiOiAibGFsIGt1cnRpIiwKCiAgICAgICAgImFkZHJlc3MzIjogImphbGFuZGhhciIsCgogICAgICAgICJwaW5jb2RlIjogIjE0NDAwNSIsCgogICAgICAgICJjaXR5IjogIk5PSURBIiwKCiAgICAgICAgInN0YXRlIjogIlBVTkpBQiIsCgogICAgICAgICJjb3VudHJ5IjogIklORElBIgoKICAgIH0sCgogICAgInByb2R1Y3RfaW5mb19kYXRhIjogewoKICAgICAgICAicHJvZHVjdF9kZXRhaWxzIjogWwoKICAgICAgICAgICAgewoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2NvZGUiOiAiNDAiLAoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2Ftb3VudCI6IDEwMDAwMDAKCiAgICAgICAgICAgIH0KCiAgICAgICAgXQoKICAgIH0sCgogICAgImFkZGl0aW9uYWxfaW5mb19kYXRhIjogewoKICAgICAgICAicmZ1MSI6ICIxMjMiCgogICAgfQoKfQ==\"\n\n}",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "postman-token: 58162b8a-54be-4f13-934d-07199ce8982d",
    "x-verify: 968BD5729C92668755FB1FCE1FB",
    "Content-Type: application/json",
    "Cookie: ASP.NET_SessionId=zjvzodvatuaxp2o0rnf2xapz"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"request\": \"ewoKICAgICJtZXJjaGFudF9kYXRhIjogewoKICAgICAgICAibWVyY2hhbnRfaWQiOiAxMTI4NSwKCiAgICAgICAgIm1lcmNoYW50X2FjY2Vzc19jb2RlIjogIjEwYzg0ZTNlLWE0ZmMtNGNhNS1iMjk1LTg2NjM5MWZmMTA4YiIsCgogICAgICAgICJtZXJjaGFudF9yZXR1cm5fdXJsIjogImh0dHA6Ly8xOTIuMTY4LjEwMS4yMDU6OTA3My9jaGFyZ2luZ3Jlc3BuZXcuYXNweCIsCgogICAgICAgICJvcmRlcl9pZCI6ICIzNVNTUzI1MTAwMDAxU1MyMzQ0b29vd3d3bzBlZWUwMzMiCgogICAgfSwKCiAgICAicGF5bWVudF9pbmZvX2RhdGEiOiB7CgogICAgICAgICJhbW91bnQiOiAxMDAwMDAwLAoKICAgICAgICAiY3VycmVuY3lfY29kZSI6ICJJTlIiLAoKICAgICAgICAicHJlZmVycmVkX2dhdGV3YXkiOiJIREZDIiwKCiAgICAgICAgIm9yZGVyX2Rlc2MiOiJURVNUIE9SREVSISIKCiAgICB9LAoKICAgICJjdXN0b21lcl9kYXRhIjogewoKICAgICAgICAiY3VzdG9tZXJfaWQiOiAzNSwKCiAgICAgICAgIm1vYmlsZV9ubyI6ICI5OTExODQ0NDA0IiwKCiAgICAgICAgImVtYWlsX2lkIjogIm5laGEubWFkYW5AcGluZWxhYnMuY29tIgoKICAgIH0sCgogICAgImJpbGxpbmdfYWRkcmVzc19kYXRhIjogewoKICAgICAgICAiZmlyc3RfbmFtZSI6ICJoYXJzaCIsCgogICAgICAgICJsYXN0X25hbWUiOiAia3VtYXIiLAoKICAgICAgICAiYWRkcmVzczEiOiAiaG9uIDE1IiwKCiAgICAgICAgImFkZHJlc3MyIjogImxhbCBrdXJ0aSIsCgogICAgICAgICJhZGRyZXNzMyI6ICJqYWxhbmRoYXIiLAoKICAgICAgICAicGluY29kZSI6ICIxNDQwMDUiLAoKICAgICAgICAiY2l0eSI6ICJOT0lEQSIsCgogICAgICAgICJzdGF0ZSI6ICJQVU5KQUIiLAoKICAgICAgICAiY291bnRyeSI6ICJJTkRJQSIKCiAgICB9LAoKICAgICJzaGlwcGluZ19hZGRyZXNzX2RhdGEiOiB7CgogICAgICAgICJmaXJzdF9uYW1lIjogImhhcnNoIiwKCiAgICAgICAgImxhc3RfbmFtZSI6ICJrdW1hciIsCgogICAgICAgICJhZGRyZXNzMSI6ICJob24gMTUiLAoKICAgICAgICAiYWRkcmVzczIiOiAibGFsIGt1cnRpIiwKCiAgICAgICAgImFkZHJlc3MzIjogImphbGFuZGhhciIsCgogICAgICAgICJwaW5jb2RlIjogIjE0NDAwNSIsCgogICAgICAgICJjaXR5IjogIk5PSURBIiwKCiAgICAgICAgInN0YXRlIjogIlBVTkpBQiIsCgogICAgICAgICJjb3VudHJ5IjogIklORElBIgoKICAgIH0sCgogICAgInByb2R1Y3RfaW5mb19kYXRhIjogewoKICAgICAgICAicHJvZHVjdF9kZXRhaWxzIjogWwoKICAgICAgICAgICAgewoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2NvZGUiOiAiNDAiLAoKICAgICAgICAgICAgICAgICJwcm9kdWN0X2Ftb3VudCI6IDEwMDAwMDAKCiAgICAgICAgICAgIH0KCiAgICAgICAgXQoKICAgIH0sCgogICAgImFkZGl0aW9uYWx==\"\n\n}");
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/v2/order/create")
  .method("POST", body)
  .addHeader("cache-control", "no-cache")
  .addHeader("postman-token", "58162b8a-54be-4f13-934d-07199ce8982d")
  .addHeader("x-verify", "968BD5729C92668755FB1FCE1FB")
  .addHeader("Content-Type", "application/json")
  .addHeader("Cookie", "ASP.NET_SessionId=zjvzodvatuaxp2o0rnf2xapz")
  .build();
Response response = client.newCall(request).execute();

{
	"token": "werm%2fw9ovVSMnCp2QbuivtNg5Gz6zrxism9xBXcN%2b%2fc%3w",
	"rapidpay_order_id": "68072",
	"response_code": 1,
	"response_message": "SUCCESS"
}

HEADERS:

Header name Header value
Content-Type application/json
X-VERIFY SHA256of (Base64 request encoded payload)

Parameters Name Data Type Value Description
response_code int 1- Success Transaction
1- Failure Transaction
Pine Labs would provide all response codes list
response_message String Description the exact reason of transaction failure
order_id String Order Id generated by Pine Labs' Plural XT
token String Unique token for process payment transaction. Token expires after predefined time span. The same token needs to pass in next server to server API call to process transaction




Step 2. When order creation response received then merchant needs to call second consecutive server to server call which would process the payment to create unique transction id. In this API call merchant need to pass Card/UPI/GPAY/Netbanking transaction related data.

API URL- "/api/v2/process/payment?
token={token}" 
Content Type- application/json
post api/v2/process/payment?token=token

Form Data

string

Unique token for process payment transaction. Token expire after predefined time span. The same token needs to pass in next server to server API call to process transaction

Request Parameters:

Name Data Type Value Description
payment_mode (required) int 1 - CC/DC
3 - Netbanking
4 - EMI
10 - UPI
14 - Debit EMI
11 - Wallet
navigation_mode (required) int 2 - Redirect
7 - Seamless
saved_card_id (optional) Long Saved Card id received while saving card through saved card API
card_data If Payment Mode is CC/DC, then either Card Data or Saved Card Id should be sent
 - card_number (required) String(19)
 - cvv (required) String(6)
 - card_holder_name (required) String(150)
 - card_expiry_year (required) String(2)
 - card_expiry_month (required) String(4)
 - is_card_to_be_saved(By default it is false) (optional) Boolean
netbanking_data To be sent if netbanking transaction
 - pay_code(required, for Netbanking Transactions) String Payment Code for Bank, through which netbanking transaction is to be done
upi_data To be sent if UPI transaction
 - vpa(required, for UPI) String
 - mobile_no(required, for GPay) String Mobile number registered for UPI
 - upi_option (required) String UPI Option like GPay,UPI, etc.
wallet_data To be sent if Wallet transaction
 - wallet_code (required) String Wallet Code
 - mobile_number (optional) String Mobile Number


{
"redirect_url": "http://dummy.base.url/pinepg/v2/process/payment
?token={token}",
    "response_code": 1,
    "response_message": "SUCCESS"
}

Order Inquiry

Order Inquiry API enables the merchant to get the status of the order created by the merchant. For this, the merchant needs to supply the order ID of the order for which the status is sought.

This API requires authentication information in the request payload header. Authentication details can be found from here.

get api/pg/orders/order_id

Form Data

long

Order Id for which order to be enquiry.


curl --location --request GET 'https://dummy.base.url/api/pg/orders/489' \
--header 'Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ'

import requests

url = "https://dummy.base.url/api/pg/orders/489"

payload = {}
headers = {
  'Authorization': 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

require "uri"
require "net/http"

url = URI("https://dummy.base.url/api/pg/orders/489")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"

response = https.request(request)
puts response.read_body

 "https://dummy.base.url/api/pg/orders/489",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/pg/orders/489")
  .method("GET", null)
  .addHeader("Authorization", "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ")
  .build();
Response response = client.newCall(request).execute();

{
    "merchant_data": {
"merchant_id": 11240,
"order_id": "678847-tyufyk6g8888ufyiuli7iyfulhgftfygyfyyu"
    },
    "order_data": {
"agg_order_id": 489,
"amount": 200,
"currency_code": "INR",
"order_desc": "TEST ORDER!",
"status": "REFUNDED",
"refund_amount": 200
    },
    "response_code": 1,
    "response_message": "SUCCESS"
}


















































Refund

Refund allows to create a refund of the charges for which the transaction has already been done successfully and not refunded previously.

This API requires authentication information in the request payload header. Authentication details can be found from here.

POST : api/pg/payments/:payment_id/refund
(payment_id, which is to be refunded)
Request Parameters:

post api/pg/payments/payment_id/refund

Form Data

long

Unique payment order id.

long

Amount to be refunded.

Varchar(100)

Unique Txn Id generated at.

Name Description Data Type
Amount (required) Amount to be refunded Long
unique_merchant_txn_id (required) Unique Txn Id generated at Merchant's end for Transaction Varchar(100)

curl --location --request POST 'https://dummy.base.url/api/pg/payments/362843/refund' \
--header 'Authorization: Basic MTEyODk6MWQ5MjUxMzEtMGUzZC00YThjLWE5YjItNzJiMzExNTI3OWVk' \
--header 'Content-Type: application/json' \
--data-raw '{ 
 "amount": 550000,
 "unique_merchant_txn_id": "refund-199"
 }'																	
																

import requests

url = "https://dummy.base.url/api/pg/payments/362843/refund"

payload = "{ \r\n \"amount\": 550000,\r\n \"unique_merchant_txn_id\": \"refund-199\"\r\n }"
headers = {
  'Authorization': 'Basic MTEyODk6MWQ5MjUxMzEtMGUzZC00YThjLWE5YjItNzJiMzExNTI3OWVk',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

require "uri"
require "net/http"

url = URI("https://dummy.base.url/api/pg/payments/362843/refund")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic MTEyODk6MWQ5MjUxMzEtMGUzZC00YThjLWE5YjItNzJiMzExNTI3OWVk"
request["Content-Type"] = "application/json"
request.body = "{ \r\n \"amount\": 550000,\r\n \"unique_merchant_txn_id\": \"refund-199\"\r\n }"

response = https.request(request)
puts response.read_body

 "https://dummy.base.url/api/pg/payments/362843/refund",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{ \r\n \"amount\": 550000,\r\n \"unique_merchant_txn_id\": \"refund-199\"\r\n }",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic MTEyODk6MWQ5MjUxMzEtMGUzZC00YThjLWE5YjItNzJiMzExNTI3OWVk",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \r\n \"amount\": 550000,\r\n \"unique_merchant_txn_id\": \"refund-199\"\r\n }");
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/pg/payments/362843/refund")
  .method("POST", body)
  .addHeader("Authorization", "Basic MTEyODk6MWQ5MjUxMzEtMGUzZC00YThjLWE5YjItNzJiMzExNTI3OWVk")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

{
  "merchant_data": {
    "merchant_id": 1,
    "order_id": "01051159"
  },
  "order_data": {
    "agg_order_id": 218,
    "amount": 100,
    "refund_amount": 100,
    "currency_code": 356,
    "order_desc": "TEST ORDER!",
    "status": "REFUNDED"
  },
  "payment_info_data": {
    "unique_merchant_txn_id": "11148306",
    "pine_pg_transaction_id": "348844",
    "parent_pine_pg_transaction_id": "348843",
    "status": "6",
    "txn_completion_date_time": "03/06/2024 11:49:06AM",
    "amount_in_paisa": "100",
    "captured_amount_in_paisa": "0",
    "refund_amount_in_paisa": "100",
    "txn_response_code": "1",
    "txn_response_msg": "SUCCESS",
    "acquirer_name": "HDFC",
    "payment_mode": "1"
  },
  "response_code": 1,
  "response_message": "SUCCESS"
}
Response will also have x-verify in header, which is SHA256(Base64(Response))






















Cards

Cards section enables a merchant to save customer card, get details of the card for a customer and delete a saved customer card.

Save Card

Using Save Card API a merchant can store cards against the customers profile in the Pine Labs' Plural XT Card Vault. These cards can be used for the future transctions to be done by the customer. Credit card as well as Debit cards can be stored. Against a single customer, multiple cards can be stored.

This API requires authentication information in the request payload header. Authentication details can be found from here.

POST : api/customer/card/save
Request Parameters:

post api/customer/card/save

Form Data

int

Customer ID of Customer

Varchar(500)

Card number of Customer

Varchar(4)

Card Expiry Year

Varchar(2)

Card Expiry Month

Varchar(100)

Card holder Name

Name Description Type
customer_data
 - customer_id (required) Customer id of Customer int
card_data
 - card_number (required) Card number varchar(500)
 - expiry_year (required) Card Expiry Year Varchar(4)
 - expiry_month (required) Card Expiry Month varchar(2)
 - card_holder_name (required) Card holder Name Varchar(100)

curl --location --request POST 'https://dummy.base.url/api/customer/card/save' \
--header 'Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ' \
--header 'Content-Type: application/json' \
--header 'Cookie: __RequestVerificationToken=g6aftPOwKH8P3NYVbRzdkbsaj7t5q8WhScDw_zsa1FbYa1ojg9twalbA-UUuQ0HwEwbO7R-t-a0xhOJmp45FP1eZOUPwLYCx9O1g9IHy6E01' \
--data-raw '{
  "customer_data": {
    "customer_id": 10073
  },
  "card_data": {
    "card_number": "4012001037141112",
    "expiry_year": "2024",
    "expiry_month": "11",
    "card_holder_name": "Dummy Name"
  }
}'																			
																		

import requests

url = "https://dummy.base.url/api/customer/card/save"

payload = "{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"card_number\": \"4012001037141112\",\n    \"expiry_year\": \"2024\",\n    \"expiry_month\": \"11\",\n    \"card_holder_name\": \"Dummy Name\"\n  }\n}\n\n"
headers = {
  'Authorization': 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ',
  'Content-Type': 'application/json',
  'Cookie': '__RequestVerificationToken=g6aftPOwKH8P3NYVbRzdkbsaj7t5q8WhScDw_zsa1FbYa1ojg9twalbA-UUuQ0HwEwbO7R-t-a0xhOJmp45FP1eZOUPwLYCx9O1g9IHy6E01'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

require "uri"
require "net/http"

url = URI("https://dummy.base.url/api/customer/card/save")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
request["Content-Type"] = "application/json"
request["Cookie"] = "__RequestVerificationToken=g6aftPOwKH8P3NYVbRzdkbsaj7t5q8WhScDw_zsa1FbYa1ojg9twalbA-UUuQ0HwEwbO7R-t-a0xhOJmp45FP1eZOUPwLYCx9O1g9IHy6E01"
request.body = "{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"card_number\": \"4012001037141112\",\n    \"expiry_year\": \"2024\",\n    \"expiry_month\": \"11\",\n    \"card_holder_name\": \"Dummy Name\"\n  }\n}\n\n"

response = https.request(request)
puts response.read_body

 "https://dummy.base.url/api/customer/card/save",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"card_number\": \"4012001037141112\",\n    \"expiry_year\": \"2024\",\n    \"expiry_month\": \"11\",\n    \"card_holder_name\": \"Dummy Name\"\n  }\n}\n\n",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ",
    "Content-Type: application/json",
    "Cookie: __RequestVerificationToken=g6aftPOwKH8P3NYVbRzdkbsaj7t5q8WhScDw_zsa1FbYa1ojg9twalbA-UUuQ0HwEwbO7R-t-a0xhOJmp45FP1eZOUPwLYCx9O1g9IHy6E01"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"card_number\": \"4012001037141112\",\n    \"expiry_year\": \"2024\",\n    \"expiry_month\": \"11\",\n    \"card_holder_name\": \"Dummy Name\"\n  }\n}\n\n");
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/customer/card/save")
  .method("POST", body)
  .addHeader("Authorization", "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ")
  .addHeader("Content-Type", "application/json")
  .addHeader("Cookie", "__RequestVerificationToken=g6aftPOwKH8P3NYVbRzdkbsaj7t5q8WhScDw_zsa1FbYa1ojg9twalbA-UUuQ0HwEwbO7R-t-a0xhOJmp45FP1eZOUPwLYCx9O1g9IHy6E01")
  .build();
Response response = client.newCall(request).execute();

{
	"expiry_year": "2022",
	"expiry_month": "12",
	"card_holder_name": "Dummy Name",
	"saved_card_id": 16,
	"assosiciation_type": "MASTERCARD",
	"issuer_id": 3,
	"masked_card_number": "401200******1112",
	"card_holder_mobile_no": null,
	"issuer_name": null,
	"card_type_id": 0,
	"response_code": 1,
	"response_message": "SUCCESS"
}






Get Saved Card

A merchant can fetch the details of saved cards against a customer. For this, the merchant needs to supply the customer_id of the customer.

This API requires authentication information in the request payload header. Authentication details can be found from here.

POST : api/customer/card/fetch

post api/customer/card/fetch

Form Data

int

Customer ID of Customer

Name Description Type
customer_data
 - customer_id (required) Customer id of Customer int







































curl --location --request POST 'https://dummy.base.url/api/customer/card/fetch' \
--header 'Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ' \
--header 'Content-Type: application/json' \
--data-raw '{
  "customer_data": {
    "customer_id":  10073
  }
}'
																		

import requests

url = "https://dummy.base.url/api/customer/card/fetch"

payload = "{\n  \"customer_data\": {\n    \"customer_id\":  10073\n  }\n}\n"
headers = {
  'Authorization': 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

require "uri"
require "net/http"

url = URI("https://dummy.base.url/api/customer/card/fetch")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
request["Content-Type"] = "application/json"
request.body = "{\n  \"customer_data\": {\n    \"customer_id\":  10073\n  }\n}\n"

response = https.request(request)
puts response.read_body

 "https://dummy.base.url/api/customer/card/fetch",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n  \"customer_data\": {\n    \"customer_id\":  10073\n  }\n}\n",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"customer_data\": {\n    \"customer_id\":  10073\n  }\n}\n");
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/customer/card/fetch")
  .method("POST", body)
  .addHeader("Authorization", "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

{
	"card_details": [
		{
			"expiry_year": "2022",
			"expiry_month": "12",
			"card_holder_name": "Dummy Name",
			"saved_card_id": 16,
			"assosiciation_type": "MASTERCARD",
			"issuer_id": 3,
			"masked_card_number": "401200******1112",
			"card_holder_mobile_no": null,
			"issuer_name": null,
			"card_type_id": 0,
			"response_code": 0,
			"response_message": null
		}
	],
	"response_code": 1,
	"response_message": "SUCCESS"
}


Delete Saved Card

A merchant can delete the stored cards of a customer. For this, the merchant needs to pass customer_id and the saved card id of the card which needs to be deleted. A card once deleted can not be retrieved.

This API requires authentication information in the request payload header. Authentication details can be found from here.

POST : api/customer/card/delete
Request Parameters:

post api/customer/card/delete

Form Data

int

Customer ID of Customer

Long

Saved Card Id received during Saving Card Data

Name Description Type
customer_data
 - saved_card_id (required) Saved Card Id received during Saving Card Data Long

curl --location --request POST 'https://dummy.base.url/api/customer/card/delete' \
--header 'Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ' \
--header 'Content-Type: application/json' \
--data-raw '{
  "customer_data": {
    "customer_id": 10073
  },
  "card_data": {
    "saved_card_id": 16
  }
}'																			
																		

import requests

url = "https://dummy.base.url/api/customer/card/delete"

payload = "{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"saved_card_id\": 16\n  }\n}\n"
headers = {
  'Authorization': 'Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

require "uri"
require "net/http"

url = URI("https://dummy.base.url/api/customer/card/delete")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ"
request["Content-Type"] = "application/json"
request.body = "{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"saved_card_id\": 16\n  }\n}\n"

response = https.request(request)
puts response.read_body

 "https://dummy.base.url/api/customer/card/delete",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"saved_card_id\": 16\n  }\n}\n",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"customer_data\": {\n    \"customer_id\": 10073\n  },\n  \"card_data\": {\n    \"saved_card_id\": 16\n  }\n}\n");
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/customer/card/delete")
  .method("POST", body)
  .addHeader("Authorization", "Basic XYZ6ZGJmODFmMjgtYjgxOC00ZjllLTgyYzktMjBmNmNhNTZ")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

{
	"response_code": 1,
	"response_message": "SUCCESS"
}





EMI

EMI/ Debit EMI Transaction Flow :

Step 1. Call EMI Calculator API to fetch EMI schemes

POST API URL- /api/V2/emi/calculator
Content Type- application/json

Request Parameters:

post api/V2/emi/calculator

Form Data

int

Merchant unique identification id provided by Pine Labs

Varchar(50)

Merchant unique access code provided by Pine Labs

Long

Amount in Paisa for Fetching EMI Schemes

Varchar

Product Code

Varchar

Product Amount

Name Description Type
merchant_data
 - merchant_id (required) Merchant unique identification id provided by Pine Labs int
 - merchant_access_code (required) Merchant unique access code provided by Pine Labs Varchar(50)
payment_data
 - amount_in_paisa (required) Amount in Paisa for Fetching EMI Schemes long
product_details Array of Product Details for Brand EMI
 - { "product_code": "",
"product_amount": } (optional)

curl -X POST \
  https://dummy.base.url/api/v2/emi/calculator \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -H 'postman-token: df4c04f1-f43b-9112-a53f-b90c61ec7f9d'

import http.client

conn = http.client.HTTPSConnection("dummy.base.url")

headers = {
    'content-type': "application/x-www-form-urlencoded",
    'cache-control': "no-cache",
    'postman-token': "7c43024f-18ab-fbc3-ce1d-3218ffced17b"
    }

conn.request("POST", "/api/v2/emi/calculator", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

require 'uri'
require 'net/http'

url = URI("https://dummy.base.url/api/v2/emi/calculator")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request["cache-control"] = 'no-cache'
request["postman-token"] = '61a18353-f1e5-21cc-d03d-9498c8e1bef0'

response = http.request(request)
puts response.read_body

setUrl('https://dummy.base.url/api/v2/emi/calculator');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'postman-token' => 'e880884a-b584-73a0-75b0-460356156be6',
  'cache-control' => 'no-cache',
  'content-type' => 'application/x-www-form-urlencoded'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://dummy.base.url/api/v2/emi/calculator")
  .post(null)
  .addHeader("content-type", "application/x-www-form-urlencoded")
  .addHeader("cache-control", "no-cache")
  .addHeader("postman-token", "0232286f-ef78-0155-5795-747803d88c09")
  .build();

Response response = client.newCall(request).execute();

{
  "issuer": [
    {
      "list_emi_tenure": [
{
"offer_scheme": {
  "product_details": [
    {
      "schemes": [
{
"scheme_id": 3470,
"program_type":106,
"is_scheme_valid": true
}
      ],
      "product_code": "40",
      "product_amount": 1000000,
      "subvention_cashback_discount": 200000,
      "product_discount": 0,
      "subvention_cashback_discount_percentage": 100000,
      "product_discount_percentage": 0,
      "subvention_type": 2,
      "additional_cashback": "Hi there is additional casback of rs 100",
      "bank_interest_rate_percentage": 100000,
      "bank_interest_rate": 13369
    }
  ],
  "emi_scheme": null
},
"tenure_id": "3",
"tenure_in_month": "3",
"monthly_installment": 271123,
"bank_interest_rate": 100000,
"interest_pay_to_bank": 13369,
"total_offerred_discount_cashback_amount": 200000,
"loan_amount": 800000,
"auth_amount": 800000
}
      ],
      "issuer_name": "SBI",
      "is_debit_emi_issuer": false
    }
  ],
  "response_code": 1,
  "response_message": "SUCCESS"
}																
								






















































































































Step 2. Scheme Validation

POST API URL- /api/v2/scheme/validation
Content Type- application/json

post api/v2/scheme/validation

Form Data

emi_data : For Tryit feature, the request payload attributes are derived from the Step-1.

Request Parameters:

Name Description Type
merchant_data
 - merchant_id (required) Merchant unique identification id provided by Pine Labs int
 - merchant_access_code (required) Merchant unique access code provided by Pine Labs Varchar(50)
payment_data
card_data Card Data which is to be validated against EMI Scheme
 - amount_in_paisa (required) Amount in Paisa for Validating EMI Scheme Long
 - card_number (required) Card Number Varchar(19)
 - Cvv (required) CVV Varchar(6)
 - card_expiry_year (required) String() 2 Characters
 - card_expiry_month (required) String() 4 Characters
emi_data (required) Offer Scheme Fetched in EMI Calculator API, which you want to avail against Card

curl -X POST \
  https://dummy.base.url/api/v2/scheme/validation \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: e37f1287-72f6-046e-710e-4881d5592b0a' \
  -d '
{
  "merchant_data": {
 "merchant_id": 100	,
  "merchant_access_code": "ACCESS_CODE"
  
  },
  "payment_data": {

    "amount_in_paisa": 550000
    
  },
  
  "card_data":{
  	"card_number":"4012001037141112",
  	"card_expiry_year":"2024",
  	"card_expiry_month":"09",
  	"card_holder_name":"Dummy Name"
  },
  "emi_data": {
      "offer_scheme": {
                        "product_details": [
                            {
                                "schemes": [
                                    {
                                        "scheme_id": "8183",
                                        "program_type": 106,
                                        "is_scheme_valid": true
                                    }
                                ],
                                "product_code": "40",
                                "product_amount": 550000,
                                "subvention_cashback_discount": 0,
                                "product_discount": 0,
                                "subvention_cashback_discount_percentage": 0,
                                "product_discount_percentage": 0,
                                "subvention_type": 3,
                                "bank_interest_rate_percentage": 150000,
                                "bank_interest_rate": 13805
                            }
                        ],
                        "emi_scheme": null
                    },
                    "tenure_id": "3",
                    "tenure_in_month": "3",
                    "monthly_installment": 187935,
                    "bank_interest_rate": 150000,
                    "interest_pay_to_bank": 13805,
                    "total_offerred_discount_cashback_amount": 0,
                    "loan_amount": 550000,
                    "auth_amount": 550000
                }
}'

import http.client

conn = http.client.HTTPSConnection("dummy.base.url")

payload = "\r\n{\r\n  \"merchant_data\": {\r\n \"merchant_id\": 100\t,\r\n  \"merchant_access_code\": \"ACCESS_CODE\"\r\n  \r\n  },\r\n  \"payment_data\": {\r\n\r\n    \"amount_in_paisa\": 550000\r\n    \r\n  },\r\n  \r\n  \"card_data\":{\r\n  \t\"card_number\":\"4012001037141112\",\r\n  \t\"card_expiry_year\":\"2024\",\r\n  \t\"card_expiry_month\":\"09\",\r\n  \t\"card_holder_name\":\"Dummy Name\"\r\n  },\r\n  \"emi_data\": {\r\n      \"offer_scheme\": {\r\n                        \"product_details\": [\r\n                            {\r\n                                \"schemes\": [\r\n                                    {\r\n                                        \"scheme_id\": \"8183\",\r\n                                        \"program_type\": 106,\r\n                                        \"is_scheme_valid\": true\r\n                                    }\r\n                                ],\r\n                                \"product_code\": \"40\",\r\n                                \"product_amount\": 550000,\r\n                                \"subvention_cashback_discount\": 0,\r\n                                \"product_discount\": 0,\r\n                                \"subvention_cashback_discount_percentage\": 0,\r\n                                \"product_discount_percentage\": 0,\r\n                                \"subvention_type\": 3,\r\n                                \"bank_interest_rate_percentage\": 150000,\r\n                                \"bank_interest_rate\": 13805\r\n                            }\r\n                        ],\r\n                        \"emi_scheme\": null\r\n                    },\r\n                    \"tenure_id\": \"3\",\r\n                    \"tenure_in_month\": \"3\",\r\n                    \"monthly_installment\": 187935,\r\n                    \"bank_interest_rate\": 150000,\r\n                    \"interest_pay_to_bank\": 13805,\r\n                    \"total_offerred_discount_cashback_amount\": 0,\r\n                    \"loan_amount\": 550000,\r\n                    \"auth_amount\": 550000\r\n                }\r\n}\r\n"

headers = {
    'content-type': "application/json",
    'postman-token': "78753e6f-b06e-f236-ecb8-ebd1d383e740",
    'cache-control': "no-cache"
    }

conn.request("POST", "/api/v2/scheme/validation", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

require 'uri'
require 'net/http'

url = URI("https://dummy.base.url/api/v2/scheme/validation")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["postman-token"] = 'd1cfcb51-c0f8-f27d-6b5d-8bf8aa2f8b06'
request["cache-control"] = 'no-cache'
request.body = "\r\n{\r\n  \"merchant_data\": {\r\n \"merchant_id\": 100\t,\r\n  \"merchant_access_code\": \"ACCESS_CODE\"\r\n  \r\n  },\r\n  \"payment_data\": {\r\n\r\n    \"amount_in_paisa\": 550000\r\n    \r\n  },\r\n  \r\n  \"card_data\":{\r\n  \t\"card_number\":\"4012001037141112\",\r\n  \t\"card_expiry_year\":\"2024\",\r\n  \t\"card_expiry_month\":\"09\",\r\n  \t\"card_holder_name\":\"Dummy Name\"\r\n  },\r\n  \"emi_data\": {\r\n      \"offer_scheme\": {\r\n                        \"product_details\": [\r\n                            {\r\n                                \"schemes\": [\r\n                                    {\r\n                                        \"scheme_id\": \"8183\",\r\n                                        \"program_type\": 106,\r\n                                        \"is_scheme_valid\": true\r\n                                    }\r\n                                ],\r\n                                \"product_code\": \"40\",\r\n                                \"product_amount\": 550000,\r\n                                \"subvention_cashback_discount\": 0,\r\n                                \"product_discount\": 0,\r\n                                \"subvention_cashback_discount_percentage\": 0,\r\n                                \"product_discount_percentage\": 0,\r\n                                \"subvention_type\": 3,\r\n                                \"bank_interest_rate_percentage\": 150000,\r\n                                \"bank_interest_rate\": 13805\r\n                            }\r\n                        ],\r\n                        \"emi_scheme\": null\r\n                    },\r\n                    \"tenure_id\": \"3\",\r\n                    \"tenure_in_month\": \"3\",\r\n                    \"monthly_installment\": 187935,\r\n                    \"bank_interest_rate\": 150000,\r\n                    \"interest_pay_to_bank\": 13805,\r\n                    \"total_offerred_discount_cashback_amount\": 0,\r\n                    \"loan_amount\": 550000,\r\n                    \"auth_amount\": 550000\r\n                }\r\n}\r\n"

response = http.request(request)
puts response.read_body

setUrl('https://dummy.base.url/api/v2/scheme/validation');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'postman-token' => 'b766a076-599f-997e-688d-111a086efba0',
  'content-type' => 'application/json'
));

$request->setBody('
{
  "merchant_data": {
 "merchant_id": 100	,
  "merchant_access_code": "ACCESS_CODE"
  
  },
  "payment_data": {

    "amount_in_paisa": 550000
    
  },
  
  "card_data":{
  	"card_number":"4012001037141112",
  	"card_expiry_year":"2024",
  	"card_expiry_month":"09",
  	"card_holder_name":"Dummy Name"
  },
  "emi_data": {
      "offer_scheme": {
                        "product_details": [
                            {
                                "schemes": [
                                    {
                                        "scheme_id": "8183",
                                        "program_type": 106,
                                        "is_scheme_valid": true
                                    }
                                ],
                                "product_code": "40",
                                "product_amount": 550000,
                                "subvention_cashback_discount": 0,
                                "product_discount": 0,
                                "subvention_cashback_discount_percentage": 0,
                                "product_discount_percentage": 0,
                                "subvention_type": 3,
                                "bank_interest_rate_percentage": 150000,
                                "bank_interest_rate": 13805
                            }
                        ],
                        "emi_scheme": null
                    },
                    "tenure_id": "3",
                    "tenure_in_month": "3",
                    "monthly_installment": 187935,
                    "bank_interest_rate": 150000,
                    "interest_pay_to_bank": 13805,
                    "total_offerred_discount_cashback_amount": 0,
                    "loan_amount": 550000,
                    "auth_amount": 550000
                }
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "\r\n{\r\n  \"merchant_data\": {\r\n \"merchant_id\": 100\t,\r\n  \"merchant_access_code\": \"ACCESS_CODE\"\r\n  \r\n  },\r\n  \"payment_data\": {\r\n\r\n    \"amount_in_paisa\": 550000\r\n    \r\n  },\r\n  \r\n  \"card_data\":{\r\n  \t\"card_number\":\"4012001037141112\",\r\n  \t\"card_expiry_year\":\"2024\",\r\n  \t\"card_expiry_month\":\"09\",\r\n  \t\"card_holder_name\":\"Dummy Name\"\r\n  },\r\n  \"emi_data\": {\r\n      \"offer_scheme\": {\r\n                        \"product_details\": [\r\n                            {\r\n                                \"schemes\": [\r\n                                    {\r\n                                        \"scheme_id\": \"8183\",\r\n                                        \"program_type\": 106,\r\n                                        \"is_scheme_valid\": true\r\n                                    }\r\n                                ],\r\n                                \"product_code\": \"40\",\r\n                                \"product_amount\": 550000,\r\n                                \"subvention_cashback_discount\": 0,\r\n                                \"product_discount\": 0,\r\n                                \"subvention_cashback_discount_percentage\": 0,\r\n                                \"product_discount_percentage\": 0,\r\n                                \"subvention_type\": 3,\r\n                                \"bank_interest_rate_percentage\": 150000,\r\n                                \"bank_interest_rate\": 13805\r\n                            }\r\n                        ],\r\n                        \"emi_scheme\": null\r\n                    },\r\n                    \"tenure_id\": \"3\",\r\n                    \"tenure_in_month\": \"3\",\r\n                    \"monthly_installment\": 187935,\r\n                    \"bank_interest_rate\": 150000,\r\n                    \"interest_pay_to_bank\": 13805,\r\n                    \"total_offerred_discount_cashback_amount\": 0,\r\n                    \"loan_amount\": 550000,\r\n                    \"auth_amount\": 550000\r\n                }\r\n}\r\n");
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/v2/scheme/validation")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("postman-token", "4673d9cc-64f0-c73e-2da8-851cfe1509be")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

{
  "response_code": 1,
  "response_message": "SUCCESS"
}																	























Step 3. Create Order

(Same as Order ID Generation, For other Payment Modes)

amount :Provide the same product_amount used in Step-1 during Order creation.
Try it

Step 4. Process Payment

API URL- "/api/v2/process/payment?token={token}"
Content Type- application/json

post api/v2/process/payment?token=token

Form Data

Varchar

Unique Token.

emi_data : For Tryit feature, the request payload attributes are derived from the Step-1.
If it is CC, Use the Redirect URL from response received here, to complete Order Confirmation step.

Request Parameters:

Name Data Type Value Description
txn_data Complex Type
 - payment_mode (required) int 4 - EMI
14 - Debit EMI
 - navigation_mode (required) int 2 - Redirect
7 - Seamless
 - saved_card_id (optional) Long If transaction is to be done using Saved Card, then Saved Card id received while saving card through saved card API
card_data Card Data which is to be validated against EMI Scheme
 - card_number (required) String(19)
 - cvv (required) String(19)
 - card_expiry_month (required) String(4)
emi_data (required) Offer Scheme Fetched in EMI Calculator API, which you want to avail against Card


curl --location --request POST 'https://dummy.base.url/api/v2/process/payment?token={token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"card_data": {
"card_number": "4012001037141112",
"cvv": "566",
"card_holder_name": "Dummy Name",
"card_expiry_year": "2024",
"card_expiry_month": "10",
"is_card_to_be_saved": false
},
"txn_data": {
"payment_mode": 4,
"navigation_mode": 7
},
"emi_data": {
      "offer_scheme": {
  "product_details": [
      {
"schemes": [
    {
"scheme_id": "8174",
"program_type": 106,
"is_scheme_valid": true
    }
],
"product_code": "40",
"product_amount": 550000,
"subvention_cashback_discount": 13475,
"product_discount": 0,
"subvention_cashback_discount_percentage": 24500,
"product_discount_percentage": 0,
"subvention_type": 1,
"additional_cashback": "An additional cashback of Rs 500 is to be given to the user.",
"bank_interest_rate_percentage": 150000,
"bank_interest_rate": 13468
      }
  ],
  "emi_scheme": null
},
"tenure_id": "3",
"tenure_in_month": "3",
"monthly_installment": 183331,
"bank_interest_rate": 150000,
"interest_pay_to_bank": 13468,
"total_offerred_discount_cashback_amount": 13475,
"loan_amount": 536525,
"auth_amount": 550000
      }
}
'															

import requests
url = "https://dummy.base.url/api/v2/process/payment?token={token}"
payload = "{\n\"card_data\": {\n\"card_number\": \"4012001037141112\",\n\"cvv\": \"566\",\n\"card_holder_name\": \"Dummy Name\",
\n\"card_expiry_year\": \"2024\",\n\"card_expiry_month\": \"10\",\n\"is_card_to_be_saved\": false\n},
\n\"txn_data\": {\n\"payment_mode\": 4,\n\"navigation_mode\": 7\n},\n\"emi_data\": {\n      \"offer_scheme\": {\n  \"product_details\": [\n      {\n\"schemes\": [\n    {\n\"scheme_id\": \"8174\",\n\"program_type\": 106,\n\"is_scheme_valid\": true\n    }\n],\n\"product_code\": \"40\",\n\"product_amount\": 550000,\n\"subvention_cashback_discount\": 13475,\n\"product_discount\": 0,\n\"subvention_cashback_discount_percentage\": 24500,\n\"product_discount_percentage\": 0,\n\"subvention_type\": 1,\n\"additional_cashback\": \"An additional cashback of Rs 500 is to be given to the user.\",\n\"bank_interest_rate_percentage\": 150000,\n\"bank_interest_rate\": 13468\n      }\n  ],\n  \"emi_scheme\": null\n},\n\"tenure_id\": \"3\",\n\"tenure_in_month\": \"3\",\n\"monthly_installment\": 183331,\n\"bank_interest_rate\": 150000,\n\"interest_pay_to_bank\": 13468,\n\"total_offerred_discount_cashback_amount\": 13475,\n\"loan_amount\": 536525,\n\"auth_amount\": 550000\n      }\n}\n"
headers = {
  'Content-Type': 'application/json',
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
require "uri"
require "net/http"
url = URI("https://dummy.base.url/api/v2/process/payment?token={token}")
https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = "{\n\"card_data\": {\n\"card_number\": \"4012001037141112\",\n\"cvv\": \"566\",\n\"card_holder_name\": \"Dummy Name\",
\n\"card_expiry_year\": \"2024\",\n\"card_expiry_month\": \"10\",\n\"is_card_to_be_saved\": false\n},
\n\"txn_data\": {\n\"payment_mode\": 4,\n\"navigation_mode\": 7\n},
\n\"emi_data\": {\n      \"offer_scheme\": {\n  \"product_details\": [\n      {\n\"schemes\": [\n    {\n\"scheme_id\": \"8174\",\n\"program_type\": 106,\n\"is_scheme_valid\": true\n    }\n],\n\"product_code\": \"40\",\n\"product_amount\": 550000,\n\"subvention_cashback_discount\": 13475,\n\"product_discount\": 0,\n\"subvention_cashback_discount_percentage\": 24500,\n\"product_discount_percentage\": 0,\n\"subvention_type\": 1,\n\"additional_cashback\": \"An additional cashback of Rs 500 is to be given to the user.\",\n\"bank_interest_rate_percentage\": 150000,\n\"bank_interest_rate\": 13468\n      }\n  ],\n  \"emi_scheme\": null\n},\n\"tenure_id\": \"3\",\n\"tenure_in_month\": \"3\",\n\"monthly_installment\": 183331,\n\"bank_interest_rate\": 150000,\n\"interest_pay_to_bank\": 13468,\n\"total_offerred_discount_cashback_amount\": 13475,\n\"loan_amount\": 536525,\n\"auth_amount\": 550000\n      }\n}\n"

response = https.request(request)
puts response.read_body
															style="display: block;">

setUrl('https://dummy.base.url/api/v2/process/payment?token={token}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/json',
  
));
$request->setBody('{\n"card_data": {\n"card_number": "4012001037141112",\n"cvv": "566",\n"card_holder_name": "Dummy Name",\n"card_expiry_year": "2024",\n"card_expiry_month": "10",\n"is_card_to_be_saved": false\n},\n"txn_data": {\n"payment_mode": 4,\n"navigation_mode": 7\n},\n"emi_data": {\n"offer_scheme": {\n"product_details": [\n{\n"schemes": [\n{\n"scheme_id": "8174",\n"program_type": 106,\n"is_scheme_valid": true\n}\n],\n"product_code": "40",\n"product_amount": 550000,\n"subvention_cashback_discount": 13475,\n"product_discount": 0,\n"subvention_cashback_discount_percentage": 24500,\n"product_discount_percentage": 0,\n"subvention_type": 1,\n"additional_cashback": "An additional cashback of Rs 500 is to be given to the user.",\n"bank_interest_rate_percentage": 150000,\n"bank_interest_rate": 13468\n}\n],\n"emi_scheme": null\n},\n"tenure_id": "3",\n"tenure_in_month": "3",\n"monthly_installment": 183331,\n"bank_interest_rate": 150000,\n"interest_pay_to_bank": 13468,\n"total_offerred_discount_cashback_amount": 13475,\n"loan_amount": 536525,\n"auth_amount": 550000\n}\n}\n');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
echo $response->getBody();
  }
  else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}																	

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\"card_data\": {\n\"card_number\": \"4012001037141112\",\n\"cvv\": \"566\",\n\"card_holder_name\": \"Dummy Name\",\n\"card_expiry_year\": \"2024\",\n\"card_expiry_month\": \"10\",\n\"is_card_to_be_saved\": false\n},\n\"txn_data\": {\n\"payment_mode\": 4,\n\"navigation_mode\": 7\n},\n\"emi_data\": {\n\"offer_scheme\": {\n\"product_details\": [\n    {\n\"schemes\": [\n{\n\"scheme_id\": \"8174\",\n\"program_type\": 106,\n\"is_scheme_valid\": true\n}\n],\n\"product_code\": \"40\",\n\"product_amount\": 550000,\n\"subvention_cashback_discount\": 13475,\n\"product_discount\": 0,\n\"subvention_cashback_discount_percentage\": 24500,\n\"product_discount_percentage\": 0,\n\"subvention_type\": 1,\n\"additional_cashback\": \"An additional cashback of Rs 500 is to be given to the user.\",\n\"bank_interest_rate_percentage\": 150000,\n\"bank_interest_rate\": 13468\n    }\n],\n\"emi_scheme\": null\n},\n\"tenure_id\": \"3\",\n\"tenure_in_month\": \"3\",\n\"monthly_installment\": 183331,\n\"bank_interest_rate\": 150000,\n\"interest_pay_to_bank\": 13468,\n\"total_offerred_discount_cashback_amount\": 13475,\n\"loan_amount\": 536525,\n\"auth_amount\": 550000\n}\n}\n");
Request request = new Request.Builder()
  .url("https://dummy.base.url/api/v2/process/payment?token={token}")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();																	

{
  "redirect_url": "https://dummy.base.url/v2/process/payment?token={token}",
  "response_code": 1,
  "response_message": "SUCCESS"
}																	
									

Step 5. Order Confirmation

Use the Redirect URL generated from process payment step to complete the transaction.