Skip to main content

CC EMI API INTEGRATION.

Overview

This document explains how to integrate the Pine Labs edge payment gateway in seamless mode.

Implementation Details

Below apis need to be integrated:

Accept Payment:

It initiates the transaction. Merchant must pass unique merchant txn reference number, amount, and other parameters.

URL:

UAT https://uat.pinepg.in/api/v2/accept/payment Production https://pinepg.in/api/v2/accept/payment

Request Headers:

HEADERS:

Header nameHeader value
Content-Typeapplication/json
X-VERIFYSHA256of (Base64 request encoded payload)

Body Param

Parameter NameTypeDescriptionMandatory(M)/Optional
merchant_dataObjectIt contains information about merchant.M
payment_dataObjectIt contains information about payment data.M
txn_dataObjectIt contains transaction related dataM
customer_dataObjectIt contains information about customer data.Merchants who are on aggregator model must pass this dataO
udf_dataObjectIt contains user defined fields. Merchant can pass it transaction specific data in these fieldsO

merchant_data

Parameter NameTypeDescriptionMandatory(M)/Optional/Conditional
merchant_idintMerchant id provided by pinelabsM
merchant_access_codestringMerchant access code provided by pine labsM
unique_merchant_txn_idstringUnique transaction id maintained by merchant for each transactionM
merchant_return_urlstringMerchant return url on which browser response will be sent.Mandatory in the case of EMIM

payment_data

Parameter NameTypeDescriptionMandatory(M)/Optional/Conditional
amount_in_paisalongTransaction amount in paiseM

txn_data

Parameter NameTypeDescriptionMandatory(M)/Optional/Conditional
navigation_modeIntNavigation mode 2 for Redirect7 for SeamlessM
payment_modeStringIt will contain csv of valid payment mode Ids.In case of seamless mode only single payment mode to be specified.M
transaction_typeInt1 for ‘Purchase’M
time_stampLongUnix timestampO

customer_data

Parameter NameTypeDescriptionMandatory(M)/Optional/Conditional
email_idstringCustomer email idO
first_namestringCustomer first nameO
last_namestringCustomer last nameO
customer_idstringCustomer id maintained at merchant endO
mobile_nostring10 digit mobile numberO
billing_dataObjectCustomer billing address detailsO
shipping_dataObjectCustomer Shipping address detailsO

udf_data

Parameter NameTypeDescriptionMandatory(M)/Optional/Conditional
udf_field_1stringUser defined FieldsO
udf_field_2stringUser defined FieldsO
udf_field_3stringUser defined FieldsO
udf_field_4stringUser defined FieldsO
udf_field_5stringUser defined FieldsO

billing_data

Parameter NameTypeDescriptionMandatory(M)/Optional/Conditional
address1stringAddress 1O
address2stringAddress 2O
address3stringAddress 3O
pincodestringPin codeO
citystringCity nameO
statestringState nameO
countrystringCountry nameO

shipping_data

Parameter NameTypeDescriptionMandatory(M)/Optional/Conditional
first_nameStringFirst name entered in shipping addressO
last_nameStringLast name entered in shipping addressO
mobile_nostringMobile number entered in shipping addressO
address1stringAddress 1O
address2stringAddress 2O
address3stringAddress 3O
pincodestringPin codeO
citystringCity nameO
statestringState nameO
countrystringCountry nameO

Sample Request

Json Payload

{
"merchant_data": {
"merchant_id": 3473,
"merchant_access_code": "57e39383-b053-4db9-a708-26d8971886e7",
"unique_merchant_txn_id": "testorder786",
"merchant_return_url": "http://localhost:53132/ChargingResp.aspx"
},
"payment_data": {
"amount_in_paisa": 1100000
},
"txn_data": {
"navigation_mode": "7",
"payment_mode": "4",
"transaction_type": "1",
"time_stamp": 157588000000
}
}

BASE 64 encoded request:

{
"request": "ewogICJtZXJjaGFudF9kYXRhIjogewogICAgIm1lcmNoYW50X2lkIjogMzQ3MywKICAgICJtZXJjaGFudF9hY2Nlc3NfY29kZSI6ICI1N2UzOTM4My1iMDUzLTRkYjktYTcwOC0yNmQ4OTcxODg2ZTciLAogICAgInVuaXF1ZV9tZXJjaGFudF90eG5faWQiOiAidGVzdG9yZGVyNzg2IiwKICAgICJtZXJjaGFudF9yZXR1cm5fdXJsIjogImh0dHA6Ly9sb2NhbGhvc3Q6NTMxMzIvQ2hhcmdpbmdSZXNwLmFzcHgigi-CiAgfSwKICAicGF5bWVudF9kYXRhIjogewogICAgImFtb3VudF9pbl9wYWlzYSI6IDExMDAwMDAKICB9LAogICJ0eG5fZGF0YSI6IHsKICAgICJuYXZpZ2F0aW9uX21vZGUiOiAiNyIsCiAgICAicGF5bWVudF9tb2RlIjogIjQiLAogICAgInRyYW5zYWN0aW9uX3R5cGUiOiAiMSIsCiAgICAidGltZV9zdGFtcCI6IDE1NzU4ODAwMDAwMAogIH0KfQo="
}

Response

Params

Parameter NameTypeDescription
response_codeintIt notifies the result of api processing. Value 1 denotes success.
response_messagestringIt denotes the message corresponding to above code
tokenstringIt is the token created for a transaction. You need to pass it in the subsequent calls.
redirect_urlStringRedirect url on which customer needs to be redirected. This parameter will be present only in redirect mode.

Sample Response

Redirect mode

{
"token": "ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4%3d",
"response_code": 1,
"response_message": "SUCCESS",
"redirect_url": "http://hostname:port/api/v2/process/payment?token=ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4% 3d"
}

In redirect mode api will return a url on which customer needs to be redirected. Pine Labs payment page will get open after redirection. On CardlessEMI the same redirect mode api will return a url on which customer needs to be redirected to the payment page you need to enter mobile number for the eligibility check to load the relevant Issuers.

Seamless mode

{
"token": "S01ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4%3d",
"response_code": 1,
"response_message": "SUCCESS"
}

In seamless mode api will not a redirect url and subsequent api needs to be called.

Failure response

{
"response_code": -1,
"response_message": "FAILURE"
}

Process Payment

Payment data against transaction will be passed in this call. This api will be called in seamless mode.

For Cardless transactions data against will be passed in this same call as well.

Token received in previous call needs to be part of this call.

http://hostname:port/api/v2/process/payment?token= ubrjAgbVaJVrGz67y%2fZCjCveYWNymE7ULAlOO7FCbz4%3d "

Request

UAT https://uat.pinepg.in/api/v2/process/payment?token=BJ5Dj5o 5dh6jZaWCTAv%2fnwJj0h%2f3Eiq2HgY14%2fMOP7k%3d Production https://pinepg.in/api/v2/process/payment?token=BJ5Dj5o5dh 6jZaWCTAv%2fnwJj0h%2f3Eiq2HgY14%2fMOP7k%3d

Body Params

Parameter NameTypeDescription Mandatory/Optional/Conditional
card_dataObjectIt contains card data.It is mandatory for cards and EMI transaction
emi_dataObjectIt contains EMI data.Mandatory for EMI
netbanking_dataObjectIt contains net banking codes.Mandatory for net banking transaction
wallet_dataObjectIt contains wallet information.Mandatory for wallet transaction
additional_dataObjectReserved for Future Use
cardless_dataObjectIt contains cardless emi information.Mandatory for cardless emi transaction

card_data

Parameter NameTypeDescription Mandatory/Optional/Conditional
card_numberStringCard number
card_expiry_yearStringCard expiry year having format YYYY
card_expiry_monthStringCard expiry month having format MM
card_holder_nameStringCard holder name
cvvStringCard CVV

additional_data

Parameter NameTypeDescription
mobile_numberstring10 digit mobile number

emi_data

Parameter NameTypeDescription
offer_schemeObjectIt contains information about offer applicable on each product.
tenure_idIntTenure Id specified at pine labs end.
tenure_in_monthStringTenure name specified at pine labs end.
monthly_installmentLongEmi amount in paise.
bank_interest_rateLongInterest rate for which bank emi is calculated. Its value is percentage multiplied by 10000.
interest_pay_to_bankLongInterest pay to bank in paise.
total_offerred_discount_cashback_amountLongTotal sum of discount applicable on cart. It is in paise.
loan_amountLongAmount in paise on which loan will be booked.
auth_amountLongBank authorization amount in paise.

offer_scheme

Parameter NameTypeDescription
product_detailsArray of objectsIt contains information about product.
emi_schemeObjectIt contains information about bank EMI scheme.

product_details

Parameter NameTypeDescription
product_codeStringProduct code.
product_amountLongProduct amount in paise.
subvention_cashback_discountLongSubvention discount cashback amount in paise. Only applicable when subvention is present.
product_discountLongProduct discount amount in paise. Only applicable if product discount is present.
subvention_cashback_discount_percentageLongSubvention discount cashback percentage. Its value is percentage multiplied by 10000.
product_discount_percentageLongProduct discount cashback percentage. Its value is percentage multiplied by 10000.
subvention_typeIntIt tells offer type. 1-No cost EMI 2-Low cost EMI 3-Standard EMI.
additional_cashbackStringAdditional cashback text.
bank_interest_rateLongAmount in paise.
bank_interest_rate_percentageLongPercentage multiplied by 10000.
schemesArray of objectsIt contains list of program applicable on product.

emi_scheme

Parameter NameTypeDescription
scheme_idLongIt tells scheme id applicable on product.
program_typeIntIt tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount.
is_scheme_validBoolIs scheme is valid.

schemes

Parameter NameTypeDescription
scheme_idLongIt tells scheme id applicable on product.
program_typeIntIt tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount.
is_scheme_validBoolIs scheme is valid.

cardless_data

Parameter NameTypeMandatory/Optional/Conditional
issuernameStringIssuer Name
tenureIntLoan Month tenure details
country_codeStringCustomer Mobile Code
mobile_numberStringCustomer Mobile Number

Sample request

EMI Sample Request

{
"card_data": {
"card_number": "4012007141112",
"card_expiry_year": "2020",
"card_expiry_month": "09",
"card_holder_name": "harsh",
"cvv": "123"
},
"emi_data": {
"offer_scheme": {
"product_details": [
{
"schemes": [
{
"scheme_id": 1682,
"program_type": 112,
"is_scheme_valid": true
}
],
"product_code": "SM-G975FCWG",
"product_amount": 550000,
"subvention_cashback_discount": 60209,
"product_discount": 0,
"subvention_cashback_discount_percentage": 0,
"product_discount_percentage": 0,
"subvention_type": 1
},
{
"schemes": [],
"product_code": "40",
"product_amount": 550000,
"subvention_cashback_discount": 0,
"product_discount": 0,
"subvention_cashback_discount_percentage": 0,
"product_discount_percentage": 0
}
],
"emi_scheme": {
"scheme_id": 1683,
"program_type": 105,
"is_scheme_valid": true
}
},
"tenure_id": "18",
"tenure_in_month": "18",
"monthly_installment": 64867,
"bank_interest_rate": 150000,
"interest_pay_to_bank": 127815,
"total_offerred_discount_cashback_amount": 60209,
"loan_amount": 1039791,
"auth_amount": 1039791
}
}

Card Sample Request

{
"card_data": {
"card_number": "4012001037141112",
"card_expiry_year": "2019",
"card_expiry_month": "12",
"card_holder_name": "harsh",
"cvv": "123"
}
}

Sample Card Details for Testing:

Card Number: 4012001037141112

Expiry: 11/27

Name: TEST

CVV : 123

Cardless Emi

{
"cardless_data": {
"issuer": {
"name": "AXIO/SBI"
},
"tenure": 12,
"customer": {
"phone": {
"country_code": "091",
"mobile_number": "9578036789"
}
}
}
}

Response

Params

Parameter NameTypeDescription
response_codeintIt notifies the result of api processing. Value 1 denotes success.
response_messagestringIt denotes the message corresponding to above code
redirect_urlStringCustomer should be redirected to below url.
api_urlStringApi url on which you need to make subsequent request
offer_schemeObjectIt contains information about offer applicable on each product

offer_scheme

Parameter NameTypeDescription
product_detailsArray of objectsIt contains information about product.
emi_schemeObjectIt contains information about bank EMI scheme.

product_details

Parameter NameTypeDescription
product_codeStringProduct code.
product_amountLongProduct amount in paise.
subvention_cashback_discountLongSubvention discount cashback amount in paise. Only applicable when subvention is present.
product_discountLongProduct discount amount in paise. Only applicable if product discount is present.
subvention_cashback_discount_percentageLongSubvention discount cashback percentage. Its value is percentage multiplied by 10000.
product_discount_percentageLongProduct discount cashback percentage. Its value is percentage multiplied by 10000.
subvention_typeIntIt tells offer type. 1-No cost EMI 2-Low cost EMI 3-Standard EMI.
additional_cashbackStringAdditional cashback text.
bank_interest_rateLongAmount in paise.
bank_interest_rate_percentageLongPercentage multiplied by 10000.
schemesArray of objectsIt contains list of program applicable on product.

emi_scheme

Parameter NameTypeDescription
scheme_idLongIt tells scheme id applicable on product.
program_typeIntIt tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount.
is_scheme_validBoolIs scheme is valid.

schemes

Parameter NameTypeDescription
scheme_idLongIt tells scheme id applicable on product.
program_typeIntIt tells scheme of which type. 105-Bank EMI 106-Brand EMI 108-Product Discount 112-Subvention discount.
is_scheme_validBoolIs scheme is valid.
reasonsArray of objectDescription for failure of schemes

Reasons

Parameter NameTypeDescription
reason_codeintIt denotes the reason code
reason_messageStringIt denotes the reason message again the code

Sample Response

Successful response for Cards, EMI, CardlessEMI for process payment api

{
"response_code": 1,
"response_message": "SUCCESS",
"redirect_url": "http://hostname:port/pinepg/v2/process/payment?token=848RFsu%2bRnNcSsaZdzEgkeosvCc2o5lK TV4uKJF%2fcjE%3d"
}

Payment Modes

PAYMENT_MODE_IDPAYMENT_MODE_NAME
1CREDIT/DEBIT CARD
4EMI
14DEBIT EMI
19CARDLESS EMI

Transaction Status

TXN_STATUS_IDTXN_STATUS_NAMEDESCRIPTION
-10Cancelledwhen the user cancels the transaction.
-8Velocity Check FailedVelocity check failed for EMI transactions
-7Failure Transaction has failed due to some reasons e.g. bank session time out, insufficient funds. Payer needs to re-initiate the transaction.
-6RejectedTransaction has been rejected.
1InitiatedPine Labs payment gateway has not received response from Payment Provider/Bank. For all such transactions, We will retry the transaction, post which the transaction status will be updated to ‘Captured‘ or‘AuthReceived’ or ‘Rejected’.
4Captured'Captured' call is successful. Funds will be transferred to merchant account.
6RefundedRefund of the transaction is successful.
7Query CompleteQuery of the transaction is successful captured
9Partially RefundedTransaction is partially refuned
10Refund InitiatedWhen refund of aggregator transaction is initiated

CARDLESS INFORMATION DATA:

AXIO Data:

Test Mobile number for AXIO system:

9999412233,9999412234,9999412235,9999412236,9999412237,9999412238,9999412239, 9999412240,9999412241,9999412242

Test Data OTP = 123456

PAN =XYZPA1234A (For Ekyc)

DOB = 21-07-1980

Aadhaar = 9999 9999 1234

Aadhaar OTP = 123456

UPI ID - Any valid upi id like ‘nametest@ybl’

SBI Data:

username: -sbipre03 Password: -a1234567. Mobile no:-(need to map)

username: -sbipre04 Password: -a1234567. mobile no:-(need to map)

username: -sbitek03 Password: -a1234567. mobile no: -9578036789