NAV

Introduction

Welcome to the Newgen Payments API documentation. Newgen’s API enables you to accept payments, retrieve transaction data, refund transaction, retrieve refund transaction data and a whole lot more.

Here are Newgen Payments’ Official Payment Extensions to integrate with the leading Shopping Carts:

Here are Newgen Payments’ officially-developed and supported API Wrappers to easily integrate with our Payments API:

Payment API

Partner PSPs can use this API to send a payment transaction to be processed by Newgen’s payment gateway. This API functions as a client-side POST, either with form data (utilizing Newgen’s provided data wrappers) or a JSON object. The result is a redirect of the client browser to the appropriate bank URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

Currently, iframes are not supported for Net Banking payments due to bank requirements. Newgen can customize any intermediate pages to fit the look and feel of the partner or end-merchant. The Payment API supports the options of (1) using the Partner’s own payment page or (2) using Newgen’s hosted payment page.

With Hosted Payment Page [HPP]

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html",
    "showConfirmationPage": "true",
    "cartURL": "http://www.domain.com/Cart.html",
    "productURL": "http://www.domain.com/Product.html"
 },
  "summary":
  {
    "totalValue": "19.07",
    "details":
    {
      "subtotal": "19.41",
      "tax": "0.03",
      "shippingCharges": "0.55"
    },
    "discount":
    {
      "discountValue": "0.40",
      "couponCode": "FIRST40",
      "couponCodeDetails": "Get $0.4 off on every transaction. *T&C apply"
    }
  },
  "items":
  [
    {
      "itemName": "RBK fitness shoes",
      "itemId": "ITM001",
      "itemPricePerUnit": "2.49",
      "itemQuantity": "2"
    },
    {
      "itemName": "Nike DriFit T-shirt",
      "itemId": "ITM002",
      "itemPricePerUnit": "1.99",
      "itemQuantity": "1"
    }
  ]
 }

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500
cartURL http://www.domain.com/Cart.html Cart URL where the client is redirected to, if continue shopping button is clicked Alphanumeric Y 500
productURL http://www.domain.com/Product.html Product URL where the client is redirected to, to be shared in summary/confirmation page Alphanumeric Y 500
showConfirmationPage true Flag to indicate whether to show confirmation/summary page or not Alphabet N 5
summary: Key for Product Summary object
totalValue 19.07 Total Value of Product Numeric Y 16
details: Key for Total Amount Details object
subtotal 19.99 MRP Value of Product Numeric Y 16
tax 0.03 Tax on Product Amount Numeric Y 16
shippingCharges 0.55 Shipping Charges of Product Numeric Y 16
discount: Key for Total Amount Details object
discountValue 0.40 Dscount Value of Product Numeric Y 16
couponCode FIRST40 Value of Coupon Code Alphanumeric Y 255
couponCodeDetails Get $0.4 off on every transaction. T&C apply Details of Coupon Code Alphanumeric Y 255
items: Key for Items object
itemName RBK fitness shoes Name of the Item Alphanumeric Y 255
itemId ITM001 Unique Id of the Item Alphanumeric Y 100
itemPricePerUnit 2.49 Individual Price of the Item Numeric Y 16
itemQuantity 2 Number of Items Numeric N 6

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled
cartURL Cart URL where the client is redirected to, if continue shopping button is clicked
productURL Product URL where the client is redirected to, to be shared in summary/confirmation page

Shopping Cart Plugin Checkout - Card Payments

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "paymentMode": "CreditCard",
    "cardType": "VisaCard"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html",
    "showConfirmationPage": "true",
    "cartURL": "http://www.domain.com/Cart.html",
    "productURL": "http://www.domain.com/Product.html"
 },
  "summary":
  {
    "totalValue": "19.07",
    "details":
    {
      "subtotal": "19.41",
      "tax": "0.03",
      "shippingCharges": "0.55"
    },
    "discount":
    {
      "discountValue": "0.40",
      "couponCode": "FIRST40",
      "couponCodeDetails": "Get $0.4 off on every transaction. *T&C apply"
    }
  },
  "items":
  [
    {
      "itemName": "RBK fitness shoes",
      "itemId": "ITM001",
      "itemPricePerUnit": "2.49",
      "itemQuantity": "2"
    },
    {
      "itemName": "Nike DriFit T-shirt",
      "itemId": "ITM002",
      "itemPricePerUnit": "1.99",
      "itemQuantity": "1"
    }
  ]
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode CreditCard Y Type of Payment Alphanumeric Y 35
cardType VisaCard Type of Card Alphabet N 30
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500
cartURL http://www.domain.com/Cart.html Cart URL where the client is redirected to, if continue shopping button is clicked Alphanumeric Y 500
productURL http://www.domain.com/Product.html Product URL where the client is redirected to, to be shared in summary/confirmation page Alphanumeric Y 500
showConfirmationPage true Flag to indicate whether to show confirmation/summary page or not Alphabet N 5
summary: Key for Product Summary object
totalValue 19.07 Total Value of Product Numeric Y 16
details: Key for Total Amount Details object
subtotal 19.99 MRP Value of Product Numeric Y 16
tax 0.03 Tax on Product Amount Numeric Y 16
shippingCharges 0.55 Shipping Charges of Product Numeric Y 16
discount: Key for Total Amount Details object
discountValue 0.40 Dscount Value of Product Numeric Y 16
couponCode FIRST40 Value of Coupon Code Alphanumeric Y 255
couponCodeDetails Get $0.4 off on every transaction. T&C apply Details of Coupon Code Alphanumeric Y 255
items: Key for Items object
itemName RBK fitness shoes Name of the Item Alphanumeric Y 255
itemId ITM001 Unique Id of the Item Alphanumeric Y 100
itemPricePerUnit 2.49 Individual Price of the Item Numeric Y 16
itemQuantity 2 Number of Items Numeric N 6

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled
cartURL Cart URL where the client is redirected to, if continue shopping button is clicked
productURL Product URL where the client is redirected to, to be shared in summary/confirmation page

Shopping Cart Plugin Checkout - (iDeal,Paypal,Sofort,Giropay,Sepa and PaySafeCard)

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "paymentMode": "IDEAL",
    "bankCode": "ING"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html",
    "showConfirmationPage": "true",
    "cartURL": "http://www.domain.com/Cart.html",
    "productURL": "http://www.domain.com/Product.html"
 },
  "summary":
  {
    "totalValue": "19.07",
    "details":
    {
      "subtotal": "19.41",
      "tax": "0.03",
      "shippingCharges": "0.55"
    },
    "discount":
    {
      "discountValue": "0.40",
      "couponCode": "FIRST40",
      "couponCodeDetails": "Get $0.4 off on every transaction. *T&C apply"
    }
  },
  "items":
  [
    {
      "itemName": "RBK fitness shoes",
      "itemId": "ITM001",
      "itemPricePerUnit": "2.49",
      "itemQuantity": "2"
    },
    {
      "itemName": "Nike DriFit T-shirt",
      "itemId": "ITM002",
      "itemPricePerUnit": "1.99",
      "itemQuantity": "1"
    }
  ]
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_\=-*]+$ Y 100
paymentMode IDEAL Y Type of Payment Alphanumeric Y 35
bankCode ING C Bank ID provided by Partner Alphabet Y 50
holder John Doe C Account Holder Name Alphanumeric Y 150
bic GIBAATWWXXX C Bank Identifier Code (mandatory for Giropay/Sepa method) Alphanumeric N 11
iban AT152011128161647502 C International Bank Account Number (mandatory for Giropay/Sepa method) Alphanumeric N 31
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500
cartURL http://www.domain.com/Cart.html Cart URL where the client is redirected to, if continue shopping button is clicked Alphanumeric Y 500
productURL http://www.domain.com/Product.html Product URL where the client is redirected to, to be shared in summary/confirmation page Alphanumeric Y 500
showConfirmationPage true Flag to indicate whether to show confirmation/summary page or not Alphabet N 5
summary: Key for Product Summary object
totalValue 19.07 Total Value of Product Numeric Y 16
details: Key for Total Amount Details object
subtotal 19.99 MRP Value of Product Numeric Y 16
tax 0.03 Tax on Product Amount Numeric Y 16
shippingCharges 0.55 Shipping Charges of Product Numeric Y 16
discount: Key for Total Amount Details object
discountValue 0.40 Dscount Value of Product Numeric Y 16
couponCode FIRST40 Value of Coupon Code Alphanumeric Y 255
couponCodeDetails Get $0.4 off on every transaction. T&C apply Details of Coupon Code Alphanumeric Y 255
items: Key for Items object
itemName RBK fitness shoes Name of the Item Alphanumeric Y 255
itemId ITM001 Unique Id of the Item Alphanumeric Y 100
itemPricePerUnit 2.49 Individual Price of the Item Numeric Y 16
itemQuantity 2 Number of Items Numeric N 6

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled
cartURL Cart URL where the client is redirected to, if continue shopping button is clicked
productURL Product URL where the client is redirected to, to be shared in summary/confirmation page

Without HPP : Card Payments

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "paymentMode": "CreditCard",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "paymentDetail":
    {
      "cardNumber": "4012001037167778",
      "cardType": "VisaCard",
      "expYear": "2019",
      "expMonth": "12",
      "nameOnCard": "John",
      "saveDetails": "true",
      "cvv": "123"
    }
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length(Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode CreditCard Y Type of Payment Alphanumeric Y 35
paymentDetail: Key for Transaction’s Payment Details object
cardNumber 4012001037167778 Y Credit or Debit Card Number Numeric N 19
cardType VisaCard Y Type of Card Alphabet N 30
expYear 2019 Y Expiry Year of Card Numeric N 4
expMonth 12 Y Expiry Month of Card Numeric N 2
nameOnCard John Y Card Holder Name Alphanumeric Y 150
saveDetails true Flag to indicate if Customer wants to save their card details with Newgen Alphabet N 5
cvv 123 Y Three or four digit CVV on Card Numeric N 4
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled

Without HPP : E-Bank Payments (Giropay and Sepa)

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "paymentMode": "GIROPAY",
    "paymentDetail":
    {
      "iban":"DE23100000001234567890" ,
      "bic": "MARKDEF1100",
      "holder" : "John Doe"
    },
    "currencyCode": "EUR",
    "txnReference": "REF00L00000"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length(Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode GIROPAY Y Type of Payment Alphanumeric Y 35
paymentDetail: Key for Transaction’s Payment Details object
holder John Doe C Account Holder Name Alphanumeric Y 150
bic GIBAATWWXXX Y Bank Identifier Code (Required for Giropay/Sepa method) Alphanumeric Y 11
iban AT152011128161647502 Y International Bank Account Number (Required for Giropay/Sepa method) Alphanumeric Y 31
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled

Without HPP : E-Bank Payments (iDeal,Paypal,Sofort and PaySafeCard)

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "paymentMode": "IDEAL",
    "paymentDetail":
    {
      "bankCode":  "ING_TEST"
    },
    "currencyCode": "EUR",
    "txnReference": "REF00L00000"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length(Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode IDEAL Y Type of Payment Alphanumeric Y 35
paymentDetail: Key for Transaction’s Payment Details object
bankCode ING Y Bank ID provided by Partner Alphabet Y 50
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled

Synchronous Flow : Card Payments

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "paymentMode": "CreditCard",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "async" : "false",
    "paymentDetail":
    {
      "cardNumber": "4012001037167778",
      "cardType": "VisaCard",
      "expYear": "2019",
      "expMonth": "12",
      "nameOnCard": "John",
      "saveDetails": "true",
      "cvv": "123"
    }
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length(Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode CreditCard Y Type of Payment Alphanumeric Y 35
async false Y Flag for Synchronous Payment flow. Set ‘false’ to perform payment Synchronously Alphabet N 10
paymentDetail: Key for Transaction’s Payment Details object
cardNumber 4012001037167778 Y Credit or Debit Card Number Numeric N 19
cardType VisaCard Y Type of Card Alphabet N 30
expYear 2019 Y Expiry Year of Card Numeric N 4
expMonth 12 Y Expiry Month of Card Numeric N 2
nameOnCard John Y Card Holder Name Alphanumeric Y 150
saveDetails true Flag to indicate if Customer wants to save their card details with Newgen Alphabet N 5
cvv 123 Y Three or four digit CVV on Card Numeric N 4
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500

Response Parameters :

In the response, Newgen’s payment gateway will send the status of the transaction along with response code.

{
"merchantId": "dutch123",
"cardType": "VisaCard",
"respMsg": "Transaction Successful",
"paymentModes": "CreditCard",
"currencyCode": "EUR",
"txnAmount": 12,
"respCode": 200,
"txnReference": "REF00L00000",
"status": "Successful",
"statusCode": 200
}

Plugin Details API (To get Associated Payment Methods of Merchant)

Partner PSP or its merchants can use this API to get the Associated Payment Methods of Merchant through Newgen’s system.

Example JSON object (To get Plugin Details):

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "merchantID": "dutch123",
  "currencyCode" : "EUR"
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Length(Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y
CurrencyCode EUR Y Currency Type Alphabet N

Response Parameters :

{
    "EUR": {
        "IDEAL": {
            "ABN_AMRO": "ABN AMRO Bank",
            "ING": "ING Bank",
            "SNS Bank": "SNS Bank",
            "Rabobank": "Rabobank",
            "ING_TEST": "Regio Bank",
            "ASN Bank": "ASN Bank"
        },
        "PAYPAL": "PAYPAL",
        "BCMC": "Bancontact MisterCash",
        "DIRECTDEBIT_SEPA": "SEPA",
        "SOFORTUEBERWEISUNG": "SOFORT",
        "GIROPAY": "GIROPAY",
        "Cards": {
            "DebitCard": {
                "VisaCard": "Visa",
                "MasterCard": "Master Card"
            },
            "CreditCard": {
                "VisaCard": "Visa",
                "AmericanExpress": "American Express",
                "MasterCard": "Master Card"
            }
        }
    }
}

Response Parameters [If there was an error during transaction] :

Parameter Sample Value Description
response Response Object for the transaction
responseCode 110 Error Code (Refer to Response Codes)
description Invalid Merchant ID Description For Error Code (Refer to Response Codes)

Recurring Payment API

Partner PSPs can use this API to send a recurring payment transaction to be processed by Newgen’s payment gateway. This API functions as a client-side POST, either with form data (utilizing Newgen’s provided data wrappers) or a JSON object. The result is a redirect of the client browser to the appropriate bank URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

Currently, iframes are not supported for Net Banking payments due to bank requirements. Newgen can customize any intermediate pages to fit the look and feel of the partner or end-merchant. The Payment API supports the options of (1) using the Partner’s own payment page or (2) using Newgen’s hosted payment page. Recurring Payment is only available for selected payment methods like Credit Cards and Sepa.

Create/Update Subscription plan

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "merchantID": "dutch123",
  "plan":{
    "txnReference": "REF00L00000",
    "planName" : "Gold Offer",
    "installmentFrequency":1,
    "installmentCount" : 13,
    "installmentPeriod" : "week",
    "currencyCode" : "EUR",
    "txnAmount" : 20.00,
    "trialDays" : 12,
    "subscriptionPlanId" : "EETTEEW"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
plan: Key for Subscription Plan object
txnAmount 20.00 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
currencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.\$_-*]+$ Y 100
planName Gold Offer Y Name of the Subscription Plan Alphanumeric Y 150
trialDays 12 Number of Days before the actual initiation of Recurring Payment Numeric N 6
installmentCount 13 C Number of installment for recurring including the current transaction Numeric N 6
installmentPeriod week C Set the period of the recurring payment like week, months etc. Alphabet N 10
installmentFrequency 1 C Set the frequency/interval for the recurring payment like 1 week,2 weeks,1 month or 2months etc. Numeric N 6
subscriptionPlanId EETTEEW C Subscription Plan ID Alphanumeric Y 50

Response Parameters [If there was an error during api call] :

Parameter Sample Value Description
response Response Object for the API
responseCode 163 Error Code (Refer to Response Codes)
description Plan not Created Subscription Plan Already exists

Response Parameters [If Create Plan API call is Successful] :

{
  "trialDays": 12,
  "InstallmentCount": 13,
  "merchantId": "dutch123",
  "InstallmentFrequency": 1,
  "subscriptionPlanId": "@NBDT52YA6",
  "subscriptionPlanName": "Gold offer2",
  "InstallmentPeriod": "week",
  "creationDate": "Sat Feb 18 18:51:08 IST 2017",
  "currencyCode": "EUR",
  "txnAmount": "20",
  "status": "success"
}

Replace Plan of existing Subscription

POST https://demoapi.newgenpayments.com/partnerAPI

{
    "merchantID": "dutch123",
    "replacePlan": {
        "subscriptionPlanId": "NBDT52YA6",
        "oldPlanId": "MKGHTYU",
        "customerId": "USR33300012",
        "txnReference": "REF1484907744040"
    }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
replacePlan: Key for Replace Plan object
subscriptionPlanId NBDT52YA6 Y Subscription Plan ID Alphanumeric Y 50
oldPlanId MKGHTYU Y Existing Subscription Plan ID Alphanumeric Y 50
customerId USR33300012 Y Customer ID Alphanumeric Y 35
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.\$_-*]+$ Y 100

Response Parameters [If there was an error during api call] :

Parameter Sample Value Description
response Response Object for the API
responseCode 165 Error Code (Refer to Response Codes)
description Plan not Found Subscription Plan ID is incorrect or Plan not created

Response Parameters [If api call is Successful] :

Parameter Sample Value Description
response Response Object for the API
responseCode 171 Response Code (Refer to Response Codes)
description Plan Replace Success Subscription Plan has been replaced Successfully

Get Subscription Plan Details

{
    "merchantID": "dutch123",
    "planDetails": {
        "currencyCode": "EUR",
    }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
planDetails: Key for Plan Details object
currencyCode EUR Y Currency Type Alphabet N 3

Response Parameters [If there was an error during api call] :

Parameter Sample Value Description
response Response Object for the API
responseCode 400 Error Code (Refer to Response Codes)
description Invalid Data Invalid Data in Plan Details

Update/Remove Recurring Payment

{
    "merchantID": "dutch123",
    "subscription": {
        "trialDays": "12",
        "installmentFrequency": "1",
        "installmentCount": "13",
        "removeSubscription": "false",
        "installmentPeriod": "week",
        "planName": "Gold offer",
        "currencyCode": "EUR",
        "txnAmount": "20",
        "txnReference": "REF1476854254402"
    }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
subscription: Key for Subscription object
trialDays 12 Number of Days before the actual initiation of Recurring Payment Numeric N 6
installmentCount 13 C Number of installment for recurring including the current transaction Numeric N 6
installmentPeriod week C Set the period of the recurring payment like week, months etc. Alphabet N 10
installmentFrequency 1 C Set the frequency/interval for the recurring payment like 1 week,2 weeks,1 month or 2months etc. Numeric N 6
removeSubscription false C Flag to remove Existing Subscription or not Alphabet N 5
txnAmount 20.00 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
currencyCode EUR Y Currency Type Alphabet N 3
txnReference REF1476854254402 Y Merchant order number ^[0-9 a-zA-Z.\$_-*]+$ Y 100
planName Gold Offer Y Name of the Subscription Plan Alphanumeric Y 150

Response Parameters [If there was an error during api call] :

Parameter Sample Value Description
response Response Object for the API
responseCode 177 Error Code (Refer to Response Codes)
description Recurring Payment not Found Recurring Payment not Found

Response Parameters [If Update Subscription call was successful] :

{
  "nextInstallmentDate": "2017-02-17 00:00:00.0",
  "trialDays": 12,
  "InstallmentCount": 13,
  "InstallmentFrequency": 1,
  "subscriptionPlanId": "",
  "planId": "active",
  "InstallmentPeriod": "week",
  "paymentDate": "2017-01-20 00:00:00.0",
  "currencyCode": "EUR",
  "txnAmount": "20",
  "txnReference": "REF1476854254402"
}

Response Parameters [If Remove Subscription call was successful] :

Parameter Sample Value Description
response Response Object for the API
responseCode 178 Response Code
description Recurring Payment Deleted Successfully Recurring Payment Deleted Successfully

Recurring Payment details

{
  "merchantID": "dutch123",
    "subscriptionDetails": {
        "customerID": "USR33300012",
        "txnReference": "REF1484907744040"
    }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
subscriptionDetails: Key for Subscription Details object
customerId USR33300012 Y Customer ID Alphanumeric Y 35
txnReference REF1484907744040 Y Merchant order number ^[0-9 a-zA-Z.\$_-*]+$ Y 100

Response Parameters [If Subscription Details API call was successful] :

[
  {
    "trialDays": 12,
    "subscriptionPlanId": "",
    "installmentDone": 3,
    "txnReference": "REF1484907744040",
    "merchantName": "R Webconcepts BV",
    "nextInstallmentDate": "17/02/2017 00:00",
    "remainingAmount": "260.00",
    "InstallmentCount": 13,
    "merchantId": "dutch123",
    "InstallmentFrequency": 1,
    "customerId": "USR33300012",
    "InstallmentPeriod": "week",
    "paymentDate": "20/01/2017 00:00",
    "currencyCode": "EUR",
    "txnAmount": "20.00",
    "status": 1
  },
  {
    "count": 1
  }
]

Response Parameters [If there was an error during api call] :

Parameter Sample Value Description
response Response Object for the API
responseCode 177 Error Code (Refer to Response Codes)
description Recurring Payment not Found Recurring Payment not Found

Recurring With Hosted Payment Page [HPP]

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html",
    "showConfirmationPage": "true",
    "cartURL": "http://www.domain.com/Cart.html",
    "productURL": "http://www.domain.com/Product.html"
 },
 "recurring":
 { "initiate": "true",
   "installmentCount": "13",
   "installmentFrequency": "1",
   "installmentPeriod": "week",
   "subscriptionPlanId": "DRTTY676",
   "sendInvoice": "true"
 },
  "summary":
  {
    "totalValue": "19.07",
    "details":
    {
      "subtotal": "19.41",
      "tax": "0.03",
      "shippingCharges": "0.55"
    },
    "discount":
    {
      "discountValue": "0.40",
      "couponCode": "FIRST40",
      "couponCodeDetails": "Get $0.4 off on every transaction. *T&C apply"
    }
  },
  "items":
  [
    {
      "itemName": "RBK fitness shoes",
      "itemId": "ITM001",
      "itemPricePerUnit": "2.49",
      "itemQuantity": "2"
    },
    {
      "itemName": "Nike DriFit T-shirt",
      "itemId": "ITM002",
      "itemPricePerUnit": "1.99",
      "itemQuantity": "1"
    }
  ]
 }

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
currencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500
cartURL http://www.domain.com/Cart.html Cart URL where the client is redirected to, if continue shopping button is clicked Alphanumeric Y 500
productURL http://www.domain.com/Product.html Product URL where the client is redirected to, to be shared in summary/confirmation page Alphanumeric Y 500
showConfirmationPage true Flag to indicate whether to show confirmation/summary page or not Alphabet N 5
recurring: Key for Recurring Payment Details object
initiate true C Flag to on/off the recurring payment Alphabet N 5
installmentCount 12 C Number of installment for recurring including the current transaction Numeric N 6
installmentPeriod week C Set the period of the recurring payment like week, months etc. Alphabet N 10
installmentFrequency 1 C Set the frequency/interval for the recurring payment like 1 week,2 weeks,1 month or 2months etc. Numeric N 6
subscriptionPlanId DRTTY676 C Field to indicate the recurring under the previously created plan Alphanumeric Y 50
sendInvoice true Flag to indicate whether to send invoice for recurring payment or not Alphabet N 5
summary: Key for Product Summary object
totalValue 19.07 Total Value of Product Numeric Y 16
details: Key for Total Amount Details object
subtotal 19.99 MRP Value of Product Numeric Y 16
tax 0.03 Tax on Product Amount Numeric Y 16
shippingCharges 0.55 Shipping Charges of Product Numeric Y 16
discount: Key for Total Amount Details object
discountValue 0.40 Dscount Value of Product Numeric Y 16
couponCode FIRST40 Value of Coupon Code Alphanumeric Y 255
couponCodeDetails Get $0.4 off on every transaction. T&C apply Details of Coupon Code Alphanumeric Y 255
items: Key for Items object
itemName RBK fitness shoes Name of the Item Alphanumeric Y 255
itemId ITM001 Unique Id of the Item Alphanumeric Y 100
itemPricePerUnit 2.49 Individual Price of the Item Numeric Y 16
itemQuantity 2 Number of Items Numeric N 6

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled
cartURL Cart URL where the client is redirected to, if continue shopping button is clicked
productURL Product URL where the client is redirected to, to be shared in summary/confirmation page

Recurring Payment for Shopping Cart Plugin Checkout - Card Payments

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "paymentMode": "CreditCard",
    "cardType": "VisaCard"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html",
    "showConfirmationPage": "true",
    "cartURL": "http://www.domain.com/Cart.html",
    "productURL": "http://www.domain.com/Product.html"
 },
 "recurring":
 { "initiate": "true",
   "installmentCount": "13",
   "installmentFrequency": "1",
   "installmentPeriod": "week",
   "subscriptionPlanId": "DRTTY676",
   "sendInvoice": "true"
 },
  "summary":
  {
    "totalValue": "19.07",
    "details":
    {
      "subtotal": "19.41",
      "tax": "0.03",
      "shippingCharges": "0.55"
    },
    "discount":
    {
      "discountValue": "0.40",
      "couponCode": "FIRST40",
      "couponCodeDetails": "Get $0.4 off on every transaction. *T&C apply"
    }
  },
  "items":
  [
    {
      "itemName": "RBK fitness shoes",
      "itemId": "ITM001",
      "itemPricePerUnit": "2.49",
      "itemQuantity": "2"
    },
    {
      "itemName": "Nike DriFit T-shirt",
      "itemId": "ITM002",
      "itemPricePerUnit": "1.99",
      "itemQuantity": "1"
    }
  ]
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
currencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode CreditCard Y Type of Payment Alphanumeric Y 35
cardType VisaCard Y Type of Card Alphabet N 30
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500
cartURL http://www.domain.com/Cart.html Cart URL where the client is redirected to, if continue shopping button is clicked Alphanumeric Y 500
productURL http://www.domain.com/Product.html Product URL where the client is redirected to, to be shared in summary/confirmation page Alphanumeric Y 500
showConfirmationPage true Flag to indicate whether to show confirmation/summary page or not Alphabet N 5
recurring: Key for Recurring Payment Details object
initiate true C Flag to on/off the recurring payment Alphabet N 5
installmentCount 12 C Number of installment for recurring including the current transaction Numeric N 6
installmentPeriod week C Set the period of the recurring payment like week, months etc. Alphabet N 10
installmentFrequency 1 C Set the frequency/interval for the recurring payment like 1 week,2 weeks,1 month or 2months etc. Numeric N 6
subscriptionPlanId DRTTY676 C Field to indicate the recurring under the previously created plan Alphanumeric Y 50
sendInvoice true Flag to indicate whether to send invoice for recurring payment or not Alphabet N 5
summary: Key for Product Summary object
totalValue 19.07 Total Value of Product Numeric Y 16
details: Key for Total Amount Details object
subtotal 19.99 MRP Value of Product Numeric Y 16
tax 0.03 Tax on Product Amount Numeric Y 16
shippingCharges 0.55 Shipping Charges of Product Numeric Y 16
discount: Key for Total Amount Details object
discountValue 0.40 Dscount Value of Product Numeric Y 16
couponCode FIRST40 Value of Coupon Code Alphanumeric Y 255
couponCodeDetails Get $0.4 off on every transaction. T&C apply Details of Coupon Code Alphanumeric Y 255
items: Key for Items object
itemName RBK fitness shoes Name of the Item Alphanumeric Y 255
itemId ITM001 Unique Id of the Item Alphanumeric Y 100
itemPricePerUnit 2.49 Individual Price of the Item Numeric Y 16
itemQuantity 2 Number of Items Numeric N 6

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled
cartURL Cart URL where the client is redirected to, if continue shopping button is clicked
productURL Product URL where the client is redirected to, to be shared in summary/confirmation page

Recurring Payment for Shopping Cart Plugin Checkout - (iDeal,Paypal,Sofort,Giropay,Sepa and PaySafeCard)

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "paymentMode": "IDEAL",
    "bankCode": "ING"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html",
    "showConfirmationPage": "true",
    "cartURL": "http://www.domain.com/Cart.html",
    "productURL": "http://www.domain.com/Product.html"
 },
 "recurring":
 { "initiate": "true",
   "installmentCount": "13",
   "installmentFrequency": "1",
   "installmentPeriod": "week",
   "subscriptionPlanId": "DRTTY676",
   "sendInvoice": "true"
 },
  "summary":
  {
    "totalValue": "19.07",
    "details":
    {
      "subtotal": "19.41",
      "tax": "0.03",
      "shippingCharges": "0.55"
    },
    "discount":
    {
      "discountValue": "0.40",
      "couponCode": "FIRST40",
      "couponCodeDetails": "Get $0.4 off on every transaction. *T&C apply"
    }
  },
  "items":
  [
    {
      "itemName": "RBK fitness shoes",
      "itemId": "ITM001",
      "itemPricePerUnit": "2.49",
      "itemQuantity": "2"
    },
    {
      "itemName": "Nike DriFit T-shirt",
      "itemId": "ITM002",
      "itemPricePerUnit": "1.99",
      "itemQuantity": "1"
    }
  ]
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length (Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
currencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode IDEAL Y Type of Payment Alphanumeric Y 35
bankCode ING Bank ID provided by Partner Alphabet Y 50
holder John Doe C Account Holder Name Alphanumeric Y 150
bic GIBAATWWXXX Bank Identifier Code (mandatory for Giropay/Sepa method) Alphanumeric N 11
iban AT152011128161647502 International Bank Account Number (mandatory for Giropay/Sepa method) Alphanumeric N 31
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500
cartURL http://www.domain.com/Cart.html Cart URL where the client is redirected to, if continue shopping button is clicked Alphanumeric Y 500
productURL http://www.domain.com/Product.html Product URL where the client is redirected to, to be shared in summary/confirmation page Alphanumeric Y 500
showConfirmationPage true Flag to indicate whether to show confirmation/summary page or not Alphabet N 5
recurring: Key for Recurring Payment Details object
initiate true C Flag to on/off the recurring payment Alphabet N 5
installmentCount 12 C Number of installment for recurring including the current transaction Numeric N 6
installmentPeriod week C Set the period of the recurring payment like week, months etc. Alphabet N 10
installmentFrequency 1 C Set the frequency/interval for the recurring payment like 1 week,2 weeks,1 month or 2months etc. Numeric N 6
subscriptionPlanId DRTTY676 C Field to indicate the recurring under the previously created plan Alphanumeric Y 50
sendInvoice true Flag to indicate whether to send invoice for recurring payment or not Alphabet N 5
summary: Key for Product Summary object
totalValue 19.07 Total Value of Product Numeric Y 16
details: Key for Total Amount Details object
subtotal 19.99 MRP Value of Product Numeric Y 16
tax 0.03 Tax on Product Amount Numeric Y 16
shippingCharges 0.55 Shipping Charges of Product Numeric Y 16
discount: Key for Total Amount Details object
discountValue 0.40 Dscount Value of Product Numeric Y 16
couponCode FIRST40 Value of Coupon Code Alphanumeric Y 255
couponCodeDetails Get $0.4 off on every transaction. T&C apply Details of Coupon Code Alphanumeric Y 255
items: Key for Items object
itemName RBK fitness shoes Name of the Item Alphanumeric Y 255
itemId ITM001 Unique Id of the Item Alphanumeric Y 100
itemPricePerUnit 2.49 Individual Price of the Item Numeric Y 16
itemQuantity 2 Number of Items Numeric N 6

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled
cartURL Cart URL where the client is redirected to, if continue shopping button is clicked
productURL Product URL where the client is redirected to, to be shared in summary/confirmation page

Recurring Payment for Without HPP : Card Payments

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "paymentMode": "CreditCard",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "paymentDetail":
    {
      "cardNumber": "4012001037167778",
      "cardType": "VisaCard",
      "expYear": "2019",
      "expMonth": "12",
      "nameOnCard": "John",
      "saveDetails": "true",
      "cvv": "123"
    }
  },
  "recurring":
  { "initiate": "true",
    "installmentCount": "13",
    "installmentFrequency": "1",
    "installmentPeriod": "week",
    "subscriptionPlanId": "DRTTY676",
    "sendInvoice": "true"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length(Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
currencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode CreditCard Y Type of Payment Alphanumeric Y 35
paymentDetail: Key for Transaction’s Payment Details object
cardNumber 4012001037167778 Y Credit or Debit Card Number Numeric N 19
cardType VisaCard Y Type of Card Alphabet N 30
expYear 2019 Y Expiry Year of Card Numeric N 4
expMonth 12 Y Expiry Month of Card Numeric N 2
nameOnCard John Y Card Holder Name Alphanumeric Y 150
saveDetails true Flag to indicate if Customer wants to save their card details with Newgen Alphabet N 5
cvv 123 Y Three or four digit CVV on Card Numeric N 4
recurring: Key for Recurring Payment Details object
initiate true C Flag to on/off the recurring payment Alphabet N 5
installmentCount 12 C Number of installment for recurring including the current transaction Numeric N 6
installmentPeriod week C Set the period of the recurring payment like week, months etc. Alphabet N 10
installmentFrequency 1 C Set the frequency/interval for the recurring payment like 1 week,2 weeks,1 month or 2months etc. Numeric N 6
subscriptionPlanId DRTTY676 C Field to indicate the recurring under the previously created plan Alphanumeric Y 50
sendInvoice true Flag to indicate whether to send invoice for recurring payment or not Alphabet N 5
url: Key for URL object
successURL http://www.domain.com/response.jsp Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/response.jsp Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/response.jsp Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled

Recurring Payment for Without HPP : E-Bank Payments (Sepa)

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "paymentMode": "GIROPAY",
    "paymentDetail":
    {
      "iban":"DE23100000001234567890" ,
      "bic": "MARKDEF1100"
    },
    "currencyCode": "EUR",
    "txnReference": "REF00L00000"
  },
  "recurring":
  { "initiate": "true",
    "installmentCount": "13",
    "installmentFrequency": "1",
    "installmentPeriod": "week",
    "subscriptionPlanId": "DRTTY676",
    "sendInvoice": "true"
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI`

Query Parameters

Parameter Sample Value Required Description Format Length(Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y
lastName Doe Billing Address Last Name Alphanumeric Y
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y
city Amsterdam Billing Address City Alphanumeric Y
state North Holland Billing Address State/Region/Province Alphanumeric Y
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y
country Netherlands Billing Address Country Alphanumeric Y
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y
sLastName Doe Receiver’s Last Name Alphanumeric Y
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y
sCity Amsterdam Receiver’s City Alphanumeric Y
sState North Holland Receiver’s State Alphanumeric Y
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y
sCountry Netherlands Receiver’s Country Alphanumeric Y
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y
currencyCode EUR Y Currency Type Alphabet N
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y
paymentMode GIROPAY Y Type of Payment Alphanumeric Y
paymentDetail: Key for Transaction’s Payment Details object
holder John Doe C Account Holder Name Alphanumeric Y
bic GIBAATWWXXX Y Bank Identifier Code (Required for Sepa method) Alphanumeric Y
iban AT152011128161647502 Y International Bank Account Number (Required for Sepa method) Alphanumeric Y
recurring: Key for Recurring Payment Details object
initiate true C Flag to on/off the recurring payment Alphabet N
installmentCount 12 C Number of installment for recurring including the current transaction Numeric N
installmentPeriod week C Set the period of the recurring payment like week, months etc. Alphabet N
installmentFrequency 1 C Set the frequency/interval for the recurring payment like 1 week,2 weeks,1 month or 2months etc. Numeric N
subscriptionPlanId DRTTY676 C Field to indicate the recurring under the previously created plan Alphanumeric Y
sendInvoice true Flag to indicate whether to send invoice for recurring payment or not Alphabet N
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled

Tokenization API

Partner PSP or its merchants can use this API to do a transaction with saved cards/tokens and can also get the tokens or delete the existing token through Newgen’s system.

Tokenization Payment API also functions as a client-side POST, either with form data (utilizing Newgen’s provided data wrappers) or a JSON object. The result is a redirect of the client browser to the appropriate bank URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

Example JSON object (To get Tokens):

POST https://demoapi.newgenpayments.com/partnerAPI

{
    "customerID":"USR33300012",
    "merchantID":"dutch123"
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Description Format Length(Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric
customerID USR33300012 Y Customer ID Alphanumeric

Response Sample :

{
  "total": 1,
  "tokens": [
    {
      "expiryDate": "2020_10",
      "maskedToken": "420000-XXXXXX-0000",
      "cardHolderName": "John Doe",
      "id": "420000-07162135223022533561-0000",
      "issuer": "VisaCard"
    }
  ]
}

Response Parameters :

Parameter Sample Value Description
total 1 Total no of tokens
tokens Array of the tokens Objects
expiryDate 2020_10 Expiry Date of Card
maskedToken 420000-XXXXXX-0000 Masked Value of Card
cardHolderName John Doe Card Holder Name
id 420000-07162135223022533561-0000 token Id for Card
issuer VisaCard Card Type/Issuer

Response Sample [If there was an error during transaction] :

{
  "response":{
    "responseCode" :114,
    "description"  : "Invalid Card Details"
  }
}

Response Parameters [If there was an error during transaction] :

Parameter Sample Value Description
response Response Object for the transaction
responseCode 114 Error Code (Refer to Response Codes)
description Invalid Card Details Description For Error Code (Refer to Response Codes)

Example JSON object (To delete Token):

POST https://demoapi.newgenpayments.com/partnerAPI

{
    "customerID":"USR33300012",
    "merchantID":"dutch123",
    "tokenID":"420000-07162135223022533561-0000"
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Length(Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y
customerID USR33300012 Y Customer ID Alphanumeric Y
tokenID 420000-07162135223022533561-0000 Y token Id for the Card to be Deleted Alphanumeric Y

Response Sample :

{
  "description": "Card Removed Successfully.",
  "respCode": 200
}

Response Parameters :

Parameter Sample Value Description
response Response Object for the transaction
responseCode 200 Error Code (Refer to Response Codes)
description Card Removed Successfully Description For Error Code (Refer to Response Codes)

Response Sample [If there was an error during transaction] :

{
  "response":{
    "responseCode" :114,
    "description"  : "Invalid Card Details"
  }
}

Response Parameters [If there was an error during transaction] :

Parameter Sample Value Description
response Response Object for the transaction
responseCode 114 Error Code (Refer to Response Codes)
description Invalid Card Details Description For Error Code (Refer to Response Codes)

Example JSON object (Tokenization Payment):

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "lang": "nl",
  "merchant":
  {
    "merchantID": "dutch123",
    "customerID": "USR33300012"
  },
  "customer":
  {
    "billingAddress":
    {
      "firstName": "John",
      "lastName": "Doe",
      "addressLine1": "Singel 101",
      "addressLine2": "117 NG",
      "city": "Amsterdam",
      "state": "North Holland",
      "zip": "1000",
      "country": "Netherlands",
      "mobileNo": "31-232567456",
      "emailId": "john@newgenpayments.com"
    },
    "shippingAddress":
    {
      "sFirstName": "John",
      "sLastName": "Doe",
      "sAddressLine1": "Singel 101",
      "sAddressLine2": "117 NG",
      "sCity": "Amsterdam",
      "sState": "North Holland",
      "sZip": "1000",
      "sCountry": "Netherlands",
      "sMobileNo": "31-232567456",
      "sEmailId": "john@newgenpayments.com"
    }
  },
  "transaction":
  {
    "txnAmount": "19.99",
    "paymentMode": "CreditCard",
    "currencyCode": "EUR",
    "txnReference": "REF00L00000",
    "paymentDetail":
    {
      "tokenID": "420000-07162135223022533561-0000"
    }
  },
  "url":
  {
    "successURL": "http://www.domain.com/SuccessResponse.html",
    "failURL": "http://www.domain.com/FailResponse.html",
    "cancelURL": "http://www.domain.com/CancelResponse.html"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Special Characters Allowed Length(Max)
lang nl Language code for Payment Page Alphabet (According to ISO 3166-1) N 3
merchant: Key for Merchant object
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y 50
customerID USR33300012 Will be provided by Merchant (will be a unique ID for each of their customers) Alphanumeric Y 35
customer: Key for Customer object
billingAddress: Key for Customer’s Billing object
firstName John Billing Address First Name Alphanumeric Y 100
lastName Doe Billing Address Last Name Alphanumeric Y 100
addressLine1 Singel 101 Billing Address Line 1 Alphanumeric Y 125
addressLine2 117 NG Billing Address Line 2 Alphanumeric Y 125
city Amsterdam Billing Address City Alphanumeric Y 50
state North Holland Billing Address State/Region/Province Alphanumeric Y 50
zip 1000 Billing Address Zip Code/Pin Code Alphanumeric Y 15
country Netherlands Billing Address Country Alphanumeric Y 50
mobileNo 31-232567456 Billing Mobile No. (incl. country code) numeric Y 25
emailId john@newgenpayments.com Billing Email ID Alphanumeric Y 255
shippingAddress: Key for Customer’s Shipping object
sFirstName John Receiver’s First Name Alphanumeric Y 100
sLastName Doe Receiver’s Last Name Alphanumeric Y 100
sAddressLine1 Singel 101 Receiver’s Address Line 1 Alphanumeric Y 125
sAddressLine2 117 NG Receiver’s Address Line 2 Alphanumeric Y 125
sCity Amsterdam Receiver’s City Alphanumeric Y 50
sState North Holland Receiver’s State Alphanumeric Y 50
sZip 1000 Receiver’s Zip Code/Pin Code Alphanumeric Y 15
sCountry Netherlands Receiver’s Country Alphanumeric Y 50
sMobileNo 31-232567456 Receiver’s Mobile No. (incl. country code) numeric Y 25
sEmailId john@newgenpayments.com Receiver’s Email ID Alphanumeric Y 255
transaction: Key for Transaction object
txnAmount 19.99 Y Transaction Amount [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y 16
CurrencyCode EUR Y Currency Type Alphabet N 3
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y 100
paymentMode CreditCard Y Type of Payment Alphanumeric Y 35
async true/false Flag for Synchronous Flow. Set false for Synchronous flow Alphabet Y 10
paymentDetail: Key for Transaction’s Payment Details object
tokenID 420000-07162135223022533561-0000 Y token Id for the Card to be Deleted Alphanumeric Y 100
url: Key for URL object
successURL http://www.domain.com/SuccessResponse.html Y Return URL where the client is redirected to, if transaction is successful Alphanumeric Y 500
failURL http://www.domain.com/FailResponse.html Y Return URL where the client is redirected to, if transaction fails Alphanumeric Y 500
cancelURL http://www.domain.com/CancelResponse.html Y Return URL where the client is redirected to, if transaction is cancelled Alphanumeric Y 500

Response Parameters :

In the response, Newgen’s payment gateway will redirect the client to one of the following URLs, depending on the transaction’s success/failure/cancellation.

Redirect URL Description
successURL Return URL where the client is redirected to, if transaction is successful
failURL Return URL where the client is redirected to, if transaction fails
cancelURL Return URL where the client is redirected to, if transaction is cancelled

Refund API

Partner PSPs can use this API to send a refund request to be processed by Newgen’s payment gateway. Refunds do not require user interaction, therefore they can be done via server-side API without client-side redirects.

Example JSON object (To Refund a Transaction):

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "merchantID": "dutch123",
  "refund":
  {
    "txnReference": "REF00L00000",
    "refundInvoiceNo": "GC123456789",
    "refundAmount": "10.00",
    "comments": "First refund"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Length(Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y
refund: Key for Refund object
txnReference REF00L00000 Y Merchant order number ^[0-9 a-z A-Z.$_-*]+$ Y
refundInvoiceNo GC123456789 Merchant’s invoice no. for Refund Alphanumeric Y
refundAmount 10.00 Y Amount to be refunded (partial refund) [+]{0,1}[0-9]{1,10}+([.][0-9]{1,4})? Y
comments First refund Comments or Details of Refund made Alphanumeric Y

Response Parameters [If refund has been processed successfully] :

Parameter Sample Value Description
description Refund has been processed successfully Success Message provided by Newgen if Transaction is refunded.
responseCode 200 response code of the API call

Response Parameters [If there was an error during refund] :

Parameter Sample Value Description
response Response Object for the transaction
responseCode 110 Error Code (Refer to Response Codes)
description Invalid Merchant ID Description For Error Code (Refer to Response Codes)

Example JSON object (To Refund Details):

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "merchantID": "dutch123",
  "refundStatus":
  {  
    "txnReference":"REF00L00000"
  }
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Length(Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y
refundStatus: Key for Refund object
txnReference REF00L00000 Y Merchant order number ^[0-9 a-zA-Z.$_-*]+$ Y

Response Parameters [If no refund has been made yet] :

Parameter Sample Value Description
totalTxnAmount 19.99 Total Amount of the Transaction
commission 0.49 Newgen Commission on Transaction
taxes 0.01 Govt. Taxes
surcharge 0.01 Additional surcharge applied
netCreditAmount 19.48 Net Credit Amount in Merchant Account
provider HDFC Provider/Bank Name
totalDeductions 0.51 Total of all Taxes and Commissions
remainingRefundAmount 19.48 Maximum Amount that can be refunded
currencyCode EUR Currency Type
paymentMode IDEAL Type of Payment
billing: Key for Billing object
userName John Doe Billing Address User Name
address Singel 101 117 NG Billing address
city Amsterdam Billing Address City
state North Holland Billing Address State
zip 1000 Billing Address Zip
country Netherlands Billing Address Country
mobileNo 31-232567456 Billing Mobile No.
emailId john@newgenpayments.com Billing Email ID
shipping: Key for Shipping object
sFirstName John Receiver’s First Name
sLastName Doe Receiver’s Last Name
sAddress Singel 101 117 NG Receiver’s Address
sCity Amsterdam Receiver’s City
sState North Holland Receiver’s State
sZip 1000 Receiver’s Zip Code/Pin Code
sCountry Netherlands Receiver’s Country
sMobileNo 31-232567456 Receiver’s Mobile No.
sEmailId john@newgenpayments.com Receiver’s Email ID

Response Parameters [If refund (full/partial) has already been made] :

Parameter Sample Value Description
totalTxnAmount 19.99 Total Amount of the Transaction
commission 0.49 Newgen Commission on Transaction
taxes 0.01 Govt. Taxes
surcharge 0.01 Additional surcharge applied
netCreditAmount 19.48 Net Credit Amount in Merchant Account
provider HDFC Provider/Bank Name
totalDeductions 0.51 Total of all Taxes and Commissions
remainingRefundAmount 19.99 Maximum Amount that can be refunded
currencyCode EUR Currency Type
paymentMode IDEAL Type of Payment
billing: Key for Billing object
userName John Doe Billing Address User Name
address Singel 101 117 NG Billing address
city Amsterdam Billing Address City
state North Holland Billing Address State
zip 1000 Billing Address Zip
country Netherlands Billing Address Country
mobileNo 31-232567456 Billing Mobile No.
emailId john@newgenpayments.com Billing Email ID
shipping: Key for Shipping object
sFirstName John Receiver’s First Name
sLastName Doe Receiver’s Last Name
sAddress Singel 101 117 NG Receiver’s Address
sCity Amsterdam Receiver’s City
sState North Holland Receiver’s State
sZip 1000 Receiver’s Zip Code/Pin Code
sCountry Netherlands Receiver’s Country
sMobileNo 31-232567456 Receiver’s Mobile No.
sEmailId john@newgenpayments.com Receiver’s Email ID
refund: Key for Refund object
refundDate 12-07-2015 Date of Refund
refundAmount 10.00 Amount refunded
doneBy John Name of the person refunded the amount
refundInvoiceNo GC123456789 Invoice Number generated by Merchant
comments First refund Any additional comment from user

Response Parameters [If there was an error during refund] :

Parameter Sample Value Description
response Key for Error Object
responseCode 110 Error Code (Refer to Response Codes)
description Invalid Merchant ID Description For Error Code (Refer to Response Codes)

Transaction Status API

Partner PSP or its merchants can use this API to check the status of a transaction that has already been processed through Newgen’s system. Transaction status checks do not require user interaction, therefore they can be done via server-side API without client-side redirects.

Example JSON object (To get Transaction Status):

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "merchantID": "dutch123",
  "txnReference": "REF00L00000"
}

HTTP Request

POST https://demoapi.newgenpayments.com/partnerAPI

Query Parameters

Parameter Sample Value Required Description Format Length(Max)
merchantID dutch123 Y Will be provided by Newgen (will be a unique ID for every Merchant of Partner PSP) Alphanumeric Y
txnReference REF00L00000 Y Merchant order number “^[0-9 a-zA-Z.$_-*]+$” Y

Response Sample :

{
    "reconciliationDate": "29/07/2017 13:58",
    "orderId": "153200",
    "taxes": "EUR 1.00",
    "txnReference": "REF00L00000",
    "settlementStatus": "Pending",
    "gatewayFee": "EUR -0.11",
    "txnCharges": "EUR -1.74",
    "summary": {
        "totalTxnAmount": "EUR 145.00",
        "totalFee": "EUR -1.85",
        "totalCreditAmount": "EUR 143.15",
        "totalGatewayFee": "EUR -0.11",
        "totalTxnCharges": "EUR -1.74"
    },
    "paymentMode": "IDEAL",
    "retryOption": 0,
    "mId": "dutch123",
    "merchant": "Dutch Merchant",
    "recurringStatus": false,
    "settlementDate": "29/07/2017 13:58",
    "recurringTxnCount": 0,
    "transactionDate": "25/07/2017 13:58",
    "token": {
        "saved": false,
        "errorCode": 1
    },
    "card": {
    "threeDSecure": "Not Enrollled",
    "binDetails": {
      "sub_brand_id": "006",
      "bin_family": "400087",
      "bin": "248300000",
      "card_length": "19",
      "latitude": "",
      "sub_brand": "Visa Plus",
      "card_type": "Debit Card",
      "product_name": "Reserved",
      "country_code": "US",
      "bank": "",
      "commercial_level": 1,
      "product_id": "E",
      "country_name": "United States",
      "end_bin": "401999099",
      "brand": "Visa",
      "country_id": "840",
      "commercial_level_type": "",
      "longitude": ""
    },
    "cardNo": "XXXX XXXX XXXX 1114"
  },
    "reconciliationStatus": "Pending",
    "totalFee": "EUR -1.85",
    "creditAmount": "EUR 143.15",
    "txnAmount": "EUR 145.00",
    "status": "Successful",
    "statusCode": 200,
  "OriginalTxnStatus":"Successful",
  "OriginalTxnStatusCode":200
}

Response Parameters :

Parameter Sample Value Description
txnReference REF00L00000 Merchant Transaction Reference
orderId 153200 Merchant Webstore Order ID
transactionDate 25/07/2017 13:56 Date of Transaction
status Successful Transaction Status (e.g. Successful/Pending/Failed)
merchant dutch123 Merchant Name
paymentMode IDEAL Type of Payment
reconciliationDate 29/06/2017 13:56 Date of Reconciliation
settlementDate 29/06/2017 13:56 Date of Settlement
reconciliationStatus Reconciled Status of Reconciliation (e.g. Reconciled/Pending)
settlementStatus Settled Status of Settlement (e.g. Settled/Pending)
txnAmount 145.0 Transaction Amount
totalFee EUR 1.85 Total of all Taxes and Commission
summary Amount Summary for the transaction
totalTxnAmount 145.0 Total Transaction Amount
totalCreditAmount 143.15 Total Credit Amount to Merchant
totalGatewayFee 0.11 Total Gateway Fee Charged (Including Declined and Processing Fee)
totalTxnCharges 1.74 Total Transaction Charges
token Object consisting of saved cards/token status for the particular trnasaction
saved true/false Indicates whether the token has been saved or notice
errorCode refer to tokenization error codes response code for tokenization
card Object for Card Details
threeDSecure Not Enrolled/ Successful 3D Enrollment Status of the Card
cardNo XXXX XXXX XXXX 1114 Masked Card Number
binDetails Object for Bin Details(valid for successful payment only)
sub_brand Visa Plus Sub brand of the Card
card_type Debit Card Type of the Card
product_name Reserved Product Specification of the Card
card_length 19 Total length of the Card
country_code US Card Issuer Country Code
country_name United States Card Issuer Country Name
bin_family 400087 Bin Family of the Card
brand Visa Type of the Card
commercial_level 1 Commercial Code of the Card
creditAmount EUR 143.15 Net Credit Amount in Merchant Account
OriginalTxnStatus Successful Status of the Original Transaction
OriginalTxnStatusCode 200 Status Code of the Original Transaction
recurringStatus true/false Indicates the number of recurring transactions under this transaction
statusCode 200 Error Code (Refer to Response Codes)
retryOption 0 Indicates the number of retry transactions Associated with main transactions
secondRetry Array of Retry transactions details

[Response Parameters of Retry transaction will be same as the parent transactions]

Response Parameters [If there was an error during transaction] :

Parameter Sample Value Description
response Response Object for the transaction
responseCode 110 Error Code (Refer to Response Codes)
description Invalid Merchant ID Description For Error Code (Refer to Response Codes)

API Wrappers

These extensions connect your Web shop to Newgen Payments’ cloud-based PCI DSS 3.0 Level-1 certified international payment gateway. Your customers get the convenience and speed of our intuitive payment process, fully mobile-optimized payment pages, and a wide range of payment options. The wrappers are free for all merchants to use and integrate into their online stores.

This is the official PHP wrapper for Newgen Payments. This wrapper connects your PHP webstore with the Newgen Payments API.
This API wrapper functions as a client-side POST, taking input of form data and sending a properly-formatted JSON object to the Newgen Payments API server. The result is a redirect of the client browser to the appropriate bank/payment method URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

In order to connect to the API, the wrapper should be deployed in an environment with PHP versions greater than or equal to 5.2.1.

  1. Extract the .zip file and place it on your server directory.
  2. Open index.php file on the server. Here, you can view the various payment options: (1) using the Partner’s own payment page or (2) using Newgen’s hosted payment page and much more.
  3. After selecting an option, you will be redirected to a form in which you have to fill the details. The fields which are being shown are the required fields that you have to send from your webstore to the wrapper by a POST request to our provided Controller (Controller.php). This method is required to access and use any API functionality (Hpp, WithoutHpp, Refund, Refund Status and Transaction Status).
  4. The Controller.php file is located inside the Controller folder of the wrapper. You will need to send the appropriate data (parameters of the table shown in the Payment API) to Controller.php, which will auto-parse the data into the required formats and automatically send it to the Newgen Payment Gateway API.
  5. Inside the Controller.php file, you can see that there is a variable named api_url in which you have to provide the Newgen Payments API URL.

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Wrappers are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

This is the official PHP wrapper for Newgen Payments. This wrapper connects your PHP webstore with the Newgen Payments API.
This API wrapper functions as a client-side POST, taking input of form data and sending a properly-formatted JSON object to the Newgen Payments API server. The result is a redirect of the client browser to the appropriate bank/payment method URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

In order to connect to the API, the wrapper should be deployed in an environment with jdk versions greater than or equal to 1.7 and jre greater than or equal to 7 and tomcat version 7.

  1. Extract the .zip file and place it on your server directory.
  2. Run the extracted files as a project on the tomcat server (default project startup [domain]:8080/[project folder]). Here, you can view the various payment options: (1) using the Partner’s own payment page or (2) using Newgen’s hosted payment page and other APIs.
  3. After selecting an API option, you will be redirected to a form in which you have to fill the details. The fields which are being shown are the required fields that you have to send from your webstore to the wrapper by a POST request using our NewgenAPI.js wrapper file. This method is required to access and use any API functionality (Hpp, WithoutHpp, Refund, Refund Status and Transaction Status).
  4. The NewgenAPI.js file is located inside the js folder of the wrapper. You will need to send the appropriate data (parameters of the table shown in the Payment API) using NewgenAPI.js) , which will auto-parse the data into the required formats and automatically send it to the Newgen Payment Gateway API.
  5. Inside each of the API forms, you can see that there is a submitForm() function inside the onclick action of the submit button, which is a built in function of NewgenAPI.js in which you have to provide the Newgen Payments API URL and form id.

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Wrappers are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

This is the official Python wrapper for Newgen Payments. This wrapper connects your Python webstore with the Newgen Payments API.
This API wrapper functions as a client-side POST, taking input of form data and sending a properly-formatted JSON object to the Newgen Payments API server. The result is a redirect of the client browser to the appropriate bank/payment method URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

In order to connect to the API, you have to install Python and setup Django on your system.

  1. Extract the .zip file and place it on your server directory.
  2. Inside the extracted folder, you will see a file named manage.py.
  3. Now open command prompt from the folder and run following command which will start the Django development server: python manage.py runserver
  4. Open index.html file on the server. Here, you can view the various payment options: (1) using the Partner’s own payment page or (2) using Newgen’s hosted payment page and much more.
  5. After selecting an API option, you will be redirected to a form in which you have to fill the details. The fields which are being shown are the required fields that you have to send from your webstore to the wrapper by a POST request to our provided JS File (NewgenAPI.js). This method is required to access and use any API functionality (Hpp, WithoutHpp, Refund, Refund Status and Transaction Status).
  6. The NewgenAPI.js file is located inside the js folder of the wrapper whose path is :
    NewgenPaymentsPythonAPI\newgen\newgenpayments\static\js.
    You will need to send the appropriate data (parameters of the table shown in the Payments API) to NewgenAPI.js, which will auto-parse the data into the required formats and automatically send it to the Newgen Payment Gateway API.
  7. Inside each of the API forms, you can see that there is a submitForm() function which is a built in function of NewgenAPI.js in which you have to provide the Newgen Payments API URL and form id.

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Wrappers are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

This is the official C# wrapper for Newgen Payments. This wrapper connects your C# webstore with the Newgen Payments API.
This API wrapper functions as a client-side POST, taking input of form data and sending a properly-formatted JSON object to the Newgen Payments API server. The result is a redirect of the client browser to the appropriate bank/payment method URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

  1. Add the NewgenCSharp.dll and Newtonsoft.Json.dll in the References
  2. Add the namespace NewgenC_Sharp.properties in the file to be used

Know more about C# References

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Wrappers are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

Shopping Cart Module

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Plugins are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

1. Installation Requirements

We recommend having Magento installed before proceeding with the installation of the Newgen Payments plugin.
Download Magento (Open Link and go to Release Archive for Magento [1.5.x - 1.9.x]): Click Here

2. Checking the plugin version

The plugin version currently in use can be found in the configuration files:
app/code/community/Newgen/gateway/etc/config.xml

3. Installation via FTP/Manually(CPanel)

4. Installation via Magento Connect

1. Basic configuration

The basic configuration settings can be accessed via:

Labels Description
Enabled Enable or disable the Newgen Payments plugin.
API Key The API Key is provided upon signing up with Newgen Payments
API Token The API token is provided upon signing up with Newgen Payments
Title Provide a Title for the Newgen Payments plugin which is to be shown on the checkout page
Merchant ID Merchant ID is provided upon signing up with Newgen Payments
New order status Default (Pending)
Payment applicable from countries Allows you to set the visibility of the Newgen Payments plugin to ‘All Allowed Countries’ or ‘Specific Countries’.
Sort order Assign a specific sort order to the Newgen Payments plugin on the checkout page

1. Plugin not showing in the Payment Methods(Admin Panel)

The following steps should resolve the error:

2. Service Temporarily Unavailable

Sometimes a pre-existing or underlying issue with a Magento site can cause the plugin installation to fail mid-way. When this happens, your Magento site may appear to be in maintenance mode causing the message:
503 – Service is unavailable to show up in the frontend.
To resolve this:
Login via FTP/CPanel to your website and remove or rename the “maintenance.flag” file in the root directory.

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Plugins are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

1. Installation Requirements

You should have both WordPress and WooCommerce installed before proceeding with the installation of the Newgen Payments plugin for WooCommerce.

2. Installation

Unpack the content of the .ZIP file to the below mentioned directory of the merchant website:
wordpress\wp-content\plugins

1. Adding and Configuring Newgen Payments Plugin

Labels Description
Enable/Disable Enable or disable the Newgen Payments plugin for WooCommerce.
Description Provide a Description for Newgen Payments plugin which is to be shown on the checkout page.
Merchant ID Merchant ID is provided upon signing up with Newgen Payments.
API Key The API Key is provided upon signing up with Newgen Payments.
API Secret The API token is provided upon signing up with Newgen Payments.

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Plugins are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

1. Installation Requirements

Prestashop should be installed before proceeding with the installation of the Newgen Payments module for Prestashop
Download Prestashop: Click Here

2. Installation

Unpack the content of the .ZIP file, and upload the “modules” folder to the Prestashop root directory. This can be accomplished by making use of an FTP client / CPanel.

OR

Open the admin panel and navigate to MODULES -> Modules and select Add a new module, then choose Newgen Payments module .ZIP file.

1. Adding and Configuring Newgen Payments Plugin

Labels Description
Merchant ID Merchant ID is provided upon signing up with Newgen Payments.
API Token The API Token is provided upon signing up with Newgen Payments.
API Key The API Key provided upon signing up with Newgen Payments.

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Plugins are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

1. Installation Requirements

You should have OpenCart installed before proceeding with the installation of the Newgen Payments plugin for OpenCart.
Download OpenCart: Click Here

2. Installation

Unpack the content of the .ZIP file to the main directory of your website. This can be accomplished by making use of an FTP program or you can directly copy it to the main directory using CPanel.

1. Installing and activating the Newgen Payments plugin

2. Configuring the Newgen Payments plugin


Labels Description
Merchant ID Merchant ID is provided upon signing up with Newgen Payments
API Key The API Key is provided upon signing up with Newgen Payments
API Token The API token is provided upon signing up with Newgen Payments
Title Provide a Title for the Newgen Payments plugin which is to be shown on the checkout page
Order status Default (Canceled)
Geo Zone Allows you to set the visibility of the Newgen Payments plugin to ‘All Allowed Countries’ or ‘Specific Countries’
Status Enable or disable the Newgen Payments plugin
Sort order Assign a specific sort order to the Newgen Payments plugin on the checkout page

Send us a request at info@newgenpayments.com with your unique merchant ID provided by Newgen Payments.
The Plugins are for use by merchants registered with Newgen Payments.

For further questions or feedback, kindly send us your questions or suggestions to:
info@newgenpayments.com

Encryption Standards

API Calls

Following encryption method is used of plaintext data encryption in our API Wrappers and Shopping Cart Plugins.

POST https://demoapi.newgenpayments.com/partnerAPI

{
  "apiKey" : "dutch123",
  "payLoad": "e2c8425a8e1960f7809bb8ef78dd7a039865495d0aa58d9ef1f5a1bf694c0f399d8baca2c38982a9b28e8d179cc0e28553c1ab2d916d92a2eb3710e17c3893df9266b80893ebfea24f02df4a71078e5760aa9aea63eed2c5e8f47f897fbc060bb3a7d4d2825946f2e06476905b03d54161853a051c1adc01d10a5d0f6c529777c12e2817d5a9095dd651d80ebcfe3e41f3c3c69a6e72b27c9ab402cc298b4686f8b13c1a9a3ccaa4fcaee97aa3d080534366b8c2d9a937a3c455773808e4bb40f3d6cb2a700cc3cf7aab97d32d60441cc4bdf2aac58b1897bd3a3a97e065556adf3bd96e87375f68f8fc056e448ec698e6f71826b15dd4e31b8b9a788e43e33c86dc26f4c7117807088fbc7ed9a120d6003a31027eb51e229029030457695743f63844b6ca20b4237b35af229e0e12660f06ad615a477fba7c33f70fe01b8f0baeaaf56ebd5402fd123baa3cee4ffd38d1004a78a07c2344d74749eff10cebb4025c3ffde31a6b66b1f05727cc26a7daca1425491c6ef196cf0e830daa066796a19cba8772c8f2416d82153cc0fefdc25f3accb34f88099d551749edce674cc79d2d5806cb112383620ff3996ccd7004885a37fd4121c1e6cd8a8cd1c7261d9dbf2b4c58062645dd430f9ca634d1272346b52c83d4eba12ba175880dd9586a7fbfff360b815528c7764f326f0b9c499718de91a88ee71358fd2dd2fae9420b42a90eb5937a5b488e28a9a16b8d8b0cc0228826c71a40e9a3d0ed2746d94cd15def0768432914647c107ce7b62bb036f49fd3061c541c2727cc37ab5c2278abd88768ebf2fa5adee66c894835ef858afe4580e3da324ac55bfe47bba1b31fd45ec171d4a42b64490eb61ecc17d10cb115549f330ac885d5376128e6cf4d356c29c2caf1a9025dbaf159125d011010fe1be8cc9b78c798261e7526c15c8779273964ab8edcab7415f601b4fd6fd21aa58aad1d3f70397093d7b7a38c9538bb17a8e74ba7198a8f2b66ff2aa42754b9c0b069926fb472fcb203aab25a70dd1abdf6bbd5f4a125466b3eb06867c281effb35a9bbbb31fe6429333778557f94855f187d3d9262dba933c89d2d36fea36ca5a5229c0d25c52c284d2048a7080ecdc86e6fe6c31b250e256e5fdb7addeb4afc998dded5970b2a833f781a13ea61e3ee7d6dd57c65477243bb1d38ee8dd07e8d85c28e4adf5c7a3cc92d980ae25b42acb5259af422f43e07bd3fe24520bce98983d83939640a7089d6bd59efee92521e2eba4d5ae2e3f09b39ef749f6323cd104f766d398ac9768f1cf03683163f51fd63"
}

Response Codes

Codes apply to both payment and other API calls

Error Code Meaning
0 Transaction Failed
021 Invalid Country
100 Pending
101 Invalid Transaction ID
102 Transaction Amount Limit Exceeded
103 Bank Code not Valid
104 Currency Code not Valid
105 Associated Bank not Found
106 Payment Type not Valid
107 Transaction not Processed Completely
108 Failed to Initialize Payment
109 Merchant Configuration not Found
110 Invalid Merchant ID
111 Invalid Payment Method
112 Transaction Failed by Bank
113 URL not Valid
114 Card Details not Valid
115 No Cards Found
116 Duplicate Transaction Reference
117 Transaction Cancelled By Customer
118 Invalid Transaction Amount
119 User Account does not Exists
120 Fraudulent Transaction
124 Transaction under processing for Identification As Fraud
125 Invalid 3D Secure
126 Transaction Threshold Exceeded
127 Merchant Threshold Exceeded
128 Invalid PIN/CVV
129 Withdraw Threshold Exceeded
130 Invalid Transaction Details
131 Invalid Card Holder Name
132 Invalid Pares Authenticaion
133 AVS Check Failed
134 Invalid Configuration/Registration Details
135 Transaction can’t be Captured
136 Transaction cant be Reversed
137 Transaction can’t be Preauthorised
138 Reconciliation not processed
139 Invalid Email Address format
140 Invalid Mobile/Contact number
141 Invalid IP Details
142 Invalid Date of Birth
143 Invalid Date Format
144 Service Fee is not proper
145 Continue Shopping
150 The format of the values in request is Invalid
151 Payment Retry Error
152 Payment Mode Unavailable
155 Transaction Recurrence Error
157 Transaction Timed Out
158 Fraud Pending Transaction
159 The payment details are not valid for synchronous flow
160 Payment Page not found
161 API Role not found
163 Plan Creation Failed’
164 Plan Replacement Failed
165 Plan not found
179 No Card Found
180 Invalid TokenID Provided
181 Token Removed
200 Transaction Successful
400 Unknown Request (Transaction Refused)
401 Unauthorized
405 Invalid value Supplied
1004 Card Already Registered
1029 Access not Allowed
1031 Refund not Allowed
1032 Refund Amount Processed
1033 Refund Amount exceeding Transaction Amount
1034 Refund Request Failed
1035 Batch Reconciliation Configuration not Defined
1041 No Sufficient Funds in Nodal
1047 Refund Percentage Configuration is Invalid
1048 Refund Amount Exceed Threshold
2024 IP Blacklisted
2025 Device Blacklisted
2026 User Account Blacklisted
2027 Business Rules Violated
20001 Transaction Failed by Risk Module

C# Wrapper

Introduction


This is the official C# wrapper for Newgen Payments. This wrapper connects your C# webstore with the Newgen Payments API.

This API wrapper functions as a client-side POST, taking input of form data and sending a properly-formatted JSON object to the Newgen Payments API server. The result is a redirect of the client browser to the appropriate bank/payment method URL. Upon a successful, failed, or cancelled transaction, the client will be redirected to the URL specified in the API.

Prerequisites

In order to connect to the API, you should have the following artefacts:

  1. Newgen API Credentials: API_KEY and API_TOKEN which you will be provided from Newgen for authenticating all calls to the Newgen API.
  2. Newgen Endpoints: NEWGEN_ENDPOINT and NEWGEN_TEST_ENDPOINT are already defined in the Constants of the project so you can use them directly.

API Class Reference

Payment Class

Constructor Summary

Definition Description
public Payment(string apiKey,string accessToken,string customerID,Certificate certificate,string endpoint) Payment Constructor to initialize the Payment Object with API_KEY, API_TOKEN, CustomerID, Certificate instance and endpoint parameters.
public Payment(string apiKey,string accessToken,string customerID,string lang,Certificate certificate,string endpoint) Payment Constructor to initialize the Payment Object with API_KEY, API_TOKEN, CustomerID, Lang ,Certificate instance and endpoint parameters. public Payment(string apiKey,string accessToken,string customerID,string lang,string orderId,Certificate certificate,string endpoint)

Method Summary

Definition Description
public Dictionary getHPPPaymentObject(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,URLDetails urlDetails) Method to get the HPP Payment Object. It will return a dictionary which contains data and endpoint fields.
public Dictionary getCardPaymentObject(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,CardDetails cardDetails,URLDetails urlDetails) Method to get the Card Payment Object for HPP Flow. It will return a dictionary which contains data and endpoint fields.
public Dictionary getCardPaymentObjectPlugin(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,CardDetails cardDetails,URLDetails urlDetails) Method to get the Card Payment Object for Shopping Cart Plugin Flow. It will return a dictionary which contains data and endpoint fields.
public Dictionary getCardPaymentObjectNoHPP(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,CardDetails cardDetails,URLDetails urlDetails) Method to get the Card Payment Object for NoHPP API Flow. It will return a dictionary which contains data and endpoint fields.
public Dictionary getTokenPaymentObject(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,TokenDetails tokenDetails,URLDetails urlDetails) Method to get the Token Payment Object. It will return a dictionary which contains data and endpoint fields.
public Dictionary getIDEALPaymentObject(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,IDEALDetails iDealDetails, URLDetails urlDetails) Method to get the iDEAL Payment Object for HPP Flow. It will return a dictionary which contains data and endpoint fields.
public Dictionary getIDEALPaymentObjectPlugin(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,IDEALDetails iDealDetails, URLDetails urlDetails) Method to get the iDEAL Payment Object for Shopping Cart Plugin Flow. It will return a dictionary which contains data and endpoint fields.
public Dictionary getIDEALPaymentObjectNoHPP(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,IDEALDetails iDealDetails, URLDetails urlDetails) Method to get the iDEAL Payment Object for NoHPP Flow. It will return a dictionary which contains data and endpoint fields.
public string getTransactionStatus(string txnReference) Method to get the Transaction Status
public string getPluginDetails(string currencyCode) Method to get the Associated Payment methods and currencies of a Merchant
public string getTokenPaymentObjectAsync(TransactionDetails transactionDetails,CustomerDetails customerDetails,SummaryDetails summaryDetails,TokenDetails tokenDetails,URLDetails urlDetails){ Method to process Tokenization Payment in Synchronous Flow

AddressDetails Class

Constructor Summary

Definition Description
public AddressDetails(string firstName,string lastName,string country,string mobileNo,string emailId,string addressLine1,string addressLine2,string zip,string city,string state) AddressDetails Constructor to initialize the AddressDetails Object with billing or shipping parameters

URLDetails Class

Constructor Summary

Definition Description
public URLDetails(string returnURL, bool showConfirmationPage) URLDetails Constructor to initialize the URLDetails Object with returnURL and showConfirmationPage parameters
public URLDetails(string successURL, string failURL, string cancelURL, bool showConfirmationPage) URLDetails Constructor to initialize the URLDetails Object with successURL,failURL,cancelURL and showConfirmationPage parameters

TransactionDetails Class

Constructor Summary

Definition Description
public TransactionDetails(string txnAmount, string currencyCode, string txnReference, string paymentMode) TransactionDetails Constructor to initialize the TransactionDetails Object with txnAmount,currencyCode,txnReference and paymentMode parameters
public TransactionDetails(string txnAmount, string currencyCode, string txnReference) TransactionDetails Constructor to initialize the TransactionDetails Object for HPP with txnAmount,currencyCode,txnReference parameters
public TransactionDetails(string txnAmount, string currencyCode, string txnReference, string paymentMode,string isAsync) TransactionDetails Constructor to initialize the TransactionDetails Object for HPP with txnAmount,currencyCode,txnReference, isAsync Flag (with value either “true” or “false”) parameters

DiscountDetails Class

Constructor Summary

Definition Description
public DiscountDetails(string couponCodeDetails,string discountValue,string couponCode) DiscountDetails Constructor to initialize the DiscountDetails Object with couponCodeDetails,discountValue and couponCode parameters

ItemDetails Class

Constructor Summary

Definition Description
public ItemDetails(string itemId,string itemName,string itemQuantity,string itemPricePerUnit) ItemDetails Constructor to initialize the ItemDetails Object with itemId,itemName,itemQuantity and itemPricePerUnit parameters

SummaryDetails Class

Constructor Summary

Definition Description
public SummaryDetails(string totalAmount, string subtotalAmount, string shippingCharges, string taxes) SummaryDetails Constructor to initialize the SummaryDetails Object with totalAmount,subtotalAmount,shippingCharges and taxes parameters
public SummaryDetails(string totalAmount, string subtotalAmount, string shippingCharges, string taxes,DiscountDetails discountDetails) SummaryDetails Constructor to initialize the SummaryDetails Object with totalAmount,subtotalAmount,shippingCharges, taxes and discountDetails parameters
public SummaryDetails(string totalAmount, string subtotalAmount, string shippingCharges, string taxes,List itemDetails) SummaryDetails Constructor to initialize the SummaryDetails Object with totalAmount,subtotalAmount,shippingCharges, taxes and itemDetails parameters
public SummaryDetails(string totalAmount, string subtotalAmount, string shippingCharges, string taxes,DiscountDetails discountDetails,List itemDetails) SummaryDetails Constructor to initialize the SummaryDetails Object with totalAmount,subtotalAmount,shippingCharges, taxes, discountDetails and itemDetails parameters

CustomerDetails Class

Constructor Summary

Definition Description
public CustomerDetails(AddressDetails billingAddress,AddressDetails shippingAddress) CustomerDetails Constructor to initialize the CustomerDetails Object with billingAddress and shippingAddress parameters
public CustomerDetails(AddressDetails billingAddress) CustomerDetails Constructor to initialize the CustomerDetails Object for HPP with billingAddress parameters

CardDetails Class

Constructor Summary

Definition Description
public CardDetails(string cardType) CardDetails Constructor to initialize the CardDetails Object with cardType parameters
public CardDetails(string cardType,string cardNumber,string expMonth,string expYear,string nameOnCard,string cvv,string saveDetails) CardDetails Constructor to initialize the CardDetails Object for HPP with cardType,cardNumber,expMonth,expYear,nameOnCard,cvv and saveDetails parameters

IDEALDetails Class

Constructor Summary

Definition Description
public IDEALDetails(string bankCode) IDEALDetails Constructor to initialize the IDEALDetails Object with bankCode parameter

Certificate Class

Constructor Summary

Definition Description
public Certificate(string certPath,string keyPath) Certificate Class Constructor to initialize the Certificate Object with Certificate Path and Key Path as parameters
public Certificate(FileStream certStream,FileStream keyStream) Certificate Class Constructor to initialize the Certificate Object with Certificate and Key FileStream as parameters
public Certificate(string certStream,string keyStream,bool isStream) Certificate Class Constructor to initialize the Certificate Object with Certificate and Key Stream as parameters along with flag to indicate stream as string. Use true for string value.
public Certificate(byte[] certificateBuffer,byte[] keyChainBuffer) Certificate Class Constructor to initialize the Certificate Object with Certificate and Key values as byte array parameters

Helpers Class

Method Summary

Definition Description
public static byte[] GetBytesFromPEM(string pemString, PemStringType type) Method to get the corresponding byte arrays of certificate or key depending on PemStringType. PemStringType can be a PemStringType.Certificate for certificate or PemStringType.RsaPrivateKey for RSA Private Key

RefundDetails Class

Constructor Summary

Definition Description
public RefundDetails(string refundInvoiceNo,string refundAmount,string comments) RefundDetails Constructor to initialize the RefundDetails Object with refundInvoiceNo,refundAmountand comments parameter

Refund Class

Constructor Summary

Definition Description
public Refund(string apiKey, string accessToken,Certificate certificate,string endpoint) Refund Constructor to initialize the Refund Object with apiKey, accessToken,Certificate instance and endpoint parameters.

Method Summary

Definition Description
public string getRefundDetails(string txnReference) Method to get the refund details of the transaction that has been made
public string processRefund(string txnReference,RefundDetails refundDetails) Method to process the refund of a transaction that has been made

TokenDetails Class

Constructor Summary

Definition Description
public TokenDetails(string tokenID) TokenDetails Constructor to initialize the TokenDetails Object with tokenID parameter
public TokenDetails(string tokenID,string cvv) TokenDetails Constructor to initialize the TokenDetails Object with tokenID and cvv parameters

Token Class

Constructor Summary

Definition Description
public Token(string apiKey,string accessToken,string customerID,Certificate certificate,string endpoint) Token Constructor to initialize the Token Object with apiKey, accessToken, customerID, Certificate instance and endpoint parameters.

Method Summary

Definition Description
public string getCustomerTokens() Method to get the token details for a particular customer
public string deleteCustomerToken(string tokenID) Method to delete the specific token

API Examples

With Hosted Payment Page (For Cards)


For using the withHPP API, use the code snippet provided below.


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

FileStream certfs = new FileStream(certPath, FileMode.Open, FileAccess.Read);

Byte[] certByte = new byte[certfs.Length];

certfs.Read(certByte, 0, System.Convert.ToInt32(certfs.Length));

FileStream keyfs = new FileStream(keyPath, FileMode.Open, FileAccess.Read);

Byte[] keyByte = new byte[keyfs.Length];

keyfs.Read(keyByte, 0, System.Convert.ToInt32(keyfs.Length));

Certificate Certificate = new Certificate(certByte,keyByte);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

CardDetails cardDetails = new CardDetails(string.Empty);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

Dictionary<string, object> data = payment.getCardPaymentObject(transaction,customerDetails,summary,cardDetails,urlDetails);

string encryptedValue = data["data"].ToString();

string endpoint = data["endpoint"].ToString();

With Hosted Payment Page (For iDeal)


For using the withHPP API, use the code snippet provided below.


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

IDEALDetails idealDetails = new IDEALDetails(<bankCode>);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

Dictionary<string, object> data = payment.getIDEALPaymentObject(transaction,customerDetails,summary,idealDetails,urlDetails);

string encryptedValue = data["data"].ToString();

string endpoint = data["endpoint"].ToString();

Shopping Cart Plugin Checkout (For Cards)


For using the Plugin Checkout Card Payment API, use the code snippet provided below.


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

CardDetails cardDetails = new CardDetails(<cardType>);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

Dictionary<string, object> data = payment.getCardPaymentObjectPlugin(transaction,customerDetails,summary,cardDetails,urlDetails);

string encryptedValue = data["data"].ToString();

string endpoint = data["endpoint"].ToString();

Shopping Cart Plugin Checkout (For iDeal)


For using the Plugin Checkout iDeal Payment API, use the code snippet provided below.

string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

IDEALDetails idealDetails = new IDEALDetails(<bankCode>);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

Dictionary<string, object> data = payment.getIDEALPaymentObjectPlugin(transaction,customerDetails,summary,idealDetails,urlDetails);

string encryptedValue = data["data"].ToString();

string endpoint = data["endpoint"].ToString();

Without Hosted Payment Page (For Cards)


For using the WithoutHPP Card Payment API, use the code snippet given below.


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

CardDetails cardDetails = new CardDetails(NewgenConstant.VISA,<cardNumber>,<expMonth>,<expYear>,<nameOnCard>,<cvv>,<saveDetails>);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

Dictionary<string, object> data = payment.getCardPaymentObjectNoHPP(transaction,customerDetails,summary,cardDetails,urlDetails);

string encryptedValue = data["data"].ToString();

string endpoint = data["endpoint"].ToString();

Without Hosted Payment Page (For iDeal)


For using the WithoutHPP iDeal Payment API, use the code snippet given below.


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

IDEALDetails idealDetails = new IDEALDetails(<bankCode>);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

Dictionary<string, object> data = payment.getIDEALPaymentObjectNoHPP(transaction,customerDetails,summary,idealDetails,urlDetails);

string encryptedValue = data["data"].ToString();

string endpoint = data["endpoint"].ToString();

Card Tokenization API


Get Token Details

string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Token token = new Token(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

string response = token.getCustomerTokens();

Delete Token


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Token token = new Token(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

string response = token.deleteCustomerToken(<tokenId>);

Tokenization Payment


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>);

TokenDetails tokenDetails = new TokenDetails(<tokenID>);

Dictionary<string, object> data = payment.getTokenPaymentObject(transaction,customerDetails,summary,tokenDetails,urlDetails);

string encryptedValue = data["data"].ToString();

string endpoint = data["endpoint"].ToString();

Tokenization Payment (Synchronous Flow)


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

string isAsync = "false";

AddressDetails billingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

AddressDetails shippingAddress = new AddressDetails(<firstName>,<lastName>,<country>,<mobileNo>,<emailId>,<addressLine1>,<addressLine2>,<zip>,<city>,<state>);

URLDetails urlDetails = new URLDetails(<returnURL>, <flag to show confirmation page (true/false)>);

SummaryDetails summary = new SummaryDetails(<txnAmount>,<subtotal>,<shippingCharges>,<tax>,<discountDetails>);

CustomerDetails customerDetails = new CustomerDetails(billingAddress,shippingAddress);

TransactionDetails transaction = new TransactionDetails(<txnAmount>, <currencyCode>, <txnReference>, <paymentMode>,isAsync);

TokenDetails tokenDetails = new TokenDetails(<tokenID>);

string data = payment.getTokenPaymentObjectAsync(transaction,customerDetails,summary,tokenDetails,urlDetails);

Transaction Status API



string txnReference = "sample_reference";

string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

string response = payment.getTransactionStatus(<txnReference>);

Refund API


Refund Details API


string txnReference = "sample_reference";

string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Refund refund = new Refund(API_KEY,API_TOKEN,certificate,endpoint);

string response = refund.getRefundDetails(<txnReference>);

Process Refund

string txnReference = "sample_reference";

string refundInvoiceNo = "sample_invoice";

string refundAmount = "12";

string comments = "sample_comments";

string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Refund refund = new Refund(API_KEY,API_TOKEN,certificate,endpoint);

RefundDetails refundDetails = new RefundDetails(<refundInvoiceNo>,<refundAmount>,<comments>);

string response = refund.processRefund(<txnReference>,refundDetails);

Plugin Details API


Plugin Details API


string endpoint = NewgenConstant.NEWGEN_TEST_API_ENDPOINT;

Certificate certificate = new Certificate(<your certificate path>,<your key path>);

Payment payment = new Payment(API_KEY,API_TOKEN,<customerID>,certificate,endpoint);

string response = payment.getPluginDetails(<currencyCode>);