Hosted Payment Page API
Version History
Date | Version | Details |
---|---|---|
1.0 | Initial release | |
29/12/22 | 1.1 | Added Tags Mandate |
13/01/23 | 1.2 | Disclaimer option in personalization is added |
16/03/23 | 1.3 | $0 Card Validation to update expired cards for tokenized transactions. |
Prerequisites
- For Sandbox (UAT)
Users should be onboarded on iPOSpays sandbox(UAT) environment as a merchant and have a valid CloudPOS TPN.
- For Production (Live)
Users should be onboarded on iPOSpays production environment as a merchant and have a valid CloudPOS TPN.
If you do not have a TPN, contact your ISO or support@dejavoo.io
Get Auth Token
- Step 1 : Login to your merchant account and go to settings.
- Step 2 : Under Generate Ecom/TOP Merchant Keys section select TPN and Generate Token
HPP URL to Request Payment Page
iPOS HPP APIs are completely RESTful, and all our responses are returned in JSON. Note that the URL will be different for production. Once the integration has been completed, please write an email to devsupport@denovosystem.com to get production credentials.
List of HPP APIs
-
getHostedPaymentPage API Retrieves the URL for the hosted payment page.
-
queryPaymentStatus API Checks the status of a payment.
HPP - getHostedPaymentPage API reference
Request Parameters
getHostedPaymentPage API request contains 6 primary objects
Objects | Description |
---|---|
token * | AuthToken information to be sent in the header of the request |
merchantAuthentication * | Contains information about the merchant authentication details like TPN number, unique transaction reference id, etc… |
transactionRequest * | Contains information about the transactions like Type, Amount, Calculate Fee, Tips prompt, etc… |
notificationOption * | Contains information about the Notify options to be enabled to the merchants |
preferences * | Contains information about the avsVerification enabling or not, e-Receipt notify to customer enabling or not |
personalization | Contains parameters that control the payment form theme & color for that transaction |
Request Method
HTTP Request Method | POST |
---|
getHostedPaymentPage – Post API Endpoint
Objects | Description |
---|---|
Sandbox (UAT) URL: | https://payment.ipospays.tech/api/v1/external-payment-transaction |
Production (Live) URL: | https://payment.ipospays.com/api/v1/external-payment-transaction |
Request Parameters : Header
Objects | Description |
---|---|
token | AuthToken |
JSON Content-Type | application/json |
Request Parameters Body
Field | Type | Description | ||
---|---|---|---|---|
merchantAuthentication ( Obj ) | ||||
merchantId * | number | TPN for the merchant which is generated on iPOSpays portal. | ||
transactionReferenceId * | string | Unique transaction reference id, which can be used to status check later | ||
transactionRequest ( Obj ) | ||||
transactionType * | Number | Type of transactions to be processed. Note: 1 - refers to SALE transaction 2 - refers to CARD VALIDATION (PREAUTH) transaction to validate the given card with amount 0 value | ||
amount * | String | (USD) Amount to be charged from customer card / account. Amount should be multiplied by 100 and sent. For example: If the requesting amount is $100 then the amount that should be sent is $10000. Because our API will consider the last 2 digits as $100.00 Length: 8 characters Format: 12525 (125.25 $ X 100) | ||
calculateFee | Default | Fees to be calculated and added to the initial amount in the payment form. If set to true -> iPOS-HPP access Fees details based on STEAM params and add it with base amount & display it. If set to false -> iPOS-HPP, will not consider the fee calculation | ||
tipsInputPrompt * | Boolean | Whether to ask customers to input the tips in the payment page. Note: if set to true -> iPOS-HPP will prompt & ask the customer to tip on the payment page. If set to false -> iPOS-HPP, will not show tip on the payment page. | ||
calcuateTax * | String | Tax to be calculated and added with the given amount in the payment input page, to charge from the customer. If set to true -> iPOS-HPP access Taxes details based on the TPN parameters rams and calculate the total amount & display it. If set to false -> iPOS-HPP, will consider the ‘amount’ input field (inclusive of tax) as Total amount to deduct | ||
feeAmount | String | Fee amount to be charged from the customer. Ensure the amount is multiplied by 100 before sending. Length: 8 characters Format: 12525 (125.25 $ X 100) if calculateFee is set to false -> Merchant can send fee amount along with this request. | ||
feeLabel | String | Fee label can be mentioned here. Format: Alphanumeric Length: up-to 32 characters | ||
tipAmount | String | Tip amount to be added. Ensure the amount is multiplied by 100 before sending. Length: 8 characters Format: 12525 (125.25 $ X 100) if tipsInputPrompt is set to false -> Merchant can send tip amount along with this request | ||
lTaxAmount | String | Local tax amount to be charged from the customer. Ensure the amount is multiplied by 100 before sending. if calculateTax is set to false -> Merchant can send local tax amount along with this request Length: 8 characters Format: 12525 (125.25 $ X 100) | ||
lTaxLabel | String | Local tax label can be mentioned here. Format: Alphanumeric Length: up-to 32 characters | ||
gTaxAmount | String | State tax amount to be charged from the customer. Ensure the amount is multiplied by 100 before sending. Length: 8 characters Format: 12525 (125.25 $ X 100) if calculateTax is set to false -> Merchant can send state tax amount along with this request | ||
gTaxLabel | String | State tax label can be mentioned here. Format: Alphanumeric Length: up-to 32 characters |
Field | Type | Description | ||
---|---|---|---|---|
txReferenceTag1 ( Obj ) | ||||
tagLabel | String | Reference tag-1 label can be mentioned here Format: Alphanumeric Length: up-to 25 Example value: Vehicle number Note: if tagLabel input is given, it will be reflected in the payment form. | ||
tagValue | string | Reference tag-1 value can be mentioned here Format: Alphanumeric Length: up-to 25 Note: if tagValue input is given, it will be reflected in the payment form. if tagLabel input is given and tagValue input is empty, then we will prompt customer to input the tag value in the payment page form | ||
isTagMandate | Boolean | If isTagMandate is set to true -> tag field value input will be set to mandate to the customer in the payment page form. Values: true or false | ||
txReferenceTag2 ( Obj ) | ||||
tagLabel | String | Reference tag-2 label can be mentioned here Format: Alphanumeric Length: up-to 25 Example value: Vehicle number Note: if tagLabel input is given, will be reflected in the payment form | ||
tagValue | string | Reference tag-2 value can be mentioned here Format: Alphanumeric Length: up-to 25 Note: if tagValue input is given, it will be reflected in the payment form. if tagLabel input is given and tagValue input is empty, then we will prompt customer to input the tag value in the payment page form | ||
isTagMandate | Boolean | If isTagMandate is set to true -> tag field value input will be set to mandate to the customer in the payment page form. Values: true or false | ||
txReferenceTag3 ( Obj ) | ||||
tagLabel | String | Reference tag-3 label can be mentioned here Format: Alphanumeric Length: up-to 25 Example value: Vehicle number Note: if tagLabel input is given, will be reflected in the payment form | ||
tagValue | string | Reference tag-3 value can be mentioned here Format: Alphanumeric Length: up-to 25 Note: if tagValue input is given, it will be reflected in the payment form. if tagLabel input is given and tagValue input is empty, then we will prompt customer to input the tag value in the payment page form | ||
isTagMandate | Boolean | If isTagMandate is set to true -> tag field value input will be set to mandate to the customer in the payment page form. Values: true or false |
Field | Type | Description | ||
---|---|---|---|---|
notificationOption ( obj ) | ||||
notifyBySMS * | Boolean | Whether to notify Payment status to the given merchant mobile number by SMS or not. Values: true or false if set to ‘true’ -> will send the payment status as SMS to the given merchant mobile number. If set to ‘false’ -> no notification will be sent. | ||
mobileNumber | string | Merchant mobile number to which notification to be sent. Length: 13 Note: If notificationBySMS is set to true then this field input is mandatory | ||
notifyByPOST * | Boolean | Payment status will be sent to the given merchant postAPI Url upon requesting notifyByPOST is set to true. Values: true or false | ||
postAPI | String | Call-back API Url to which the payment status response to be notify. Format: should be a http or https Url | ||
notifyByRedirect * | Boolean | If set to true, to the given call-back or return Url to which iPOS-HP send or post the payment status response payload. Values: true or false | ||
authHeader | String | postAPI Url auth token key Format: Alphanumeric Length: <= 50 characters | ||
returnUrl | String | Merchant call-back or return Url, to which the payment status (success or decline) will be notified by iPOS-HP with response payloads. Format: should be a http / https Url | ||
failureUrl | String | Merchant failure call-back or return, to which the payment (declined or failure) status will be notified. Format: Should be a http/https Url Note: if this entity input is empty, the payment failure status will be sent to returnUrl. | ||
cancelUrl | String | Cancel Url of merchant site. If customer wants to skip or cancel the payment and return to merchant site. Format: should be http / https Url. |
About above Payment Status Notifications
Merchants who want to integrate for e-commerce -> can request notifyByRedirect method to response the payment status to the given call-back Url. Also, can request for notifyByPOST
Merchants who want to integrate for Quick Pay / Send Link / QR code / TOP -> can use notifyBySMS method to response the payment status to the given merchant mobile number.
If merchants have webserver with API, can also request real-time notify by enabling notifyByPOST set to ‘true’ to send the payment status to the given post API Url.
Field | Type | Description | ||
---|---|---|---|---|
preferences ( Obj ) | ||||
integrationType * | Number | It refers the type/source of iPOS-HP integration Values: 1,2,3,4 Note: 1 - E-Commerce portal 2 - E-Commerce mobile App 3 - Quick pay / Send link 4 - QR code 5 - Tap on phone | ||
avsVerification * | Boolean | If it’s set to ‘true’ -> Customers will be asked to input the street & zip-code details in the credit card input page in-order to do the address verifications. Values: ‘true’ or ‘false’ | ||
eReceipt * | Boolean | To send payment status notification to customers by Mobile SMS and/or E-Mail. Values: ‘true’ or ‘false’ | ||
eReceiptInputPrompt * | Boolean | Whether to ask the customer to input the mobile number in-order to send the status of the payment. Values: ‘true’ or ‘false’ Note: if set to ‘true’, iPOS-HP will prompt & ask the user to input the mobile and/or email, merchant not required to send the customer’s name, mobile or email on request parameters. If it is set to ‘false’ and eReceipt is set to ‘true’, then the merchant must send the customer’s mobile number and/or customer’s email to notify the payment status to customers. | ||
customerName | String | Customer full-name, will be used as salutation while notifying the payment status to the customer upon request by the merchant. Format: Alphabets, space Length: 25 characters Note: This input field is required, if eReceipt set to ‘true’ | ||
customerEmail | String | Customer e-mail id to which payment status will be notified if requested Format: E-mail id Note: This input field is required, if eReceipt set to ‘true’ and eReceiptInputPrompt is set to false | ||
customerMobile | String | Customer mobile number to which payment status will be notified if requested. Format: +xxxxxxxxxxxx Length: 13 Note: This input field is required, If eReceipt set to ‘true’ | ||
requestCardToken * | Boolean | Card token value request, in-order to use it for further consecutive transaction requests. Values: true or false Note: If set to ‘true’, iPOS-HPP will respond with card token value. If it is set to ‘false’, iPOS-HPP will respond, none. | ||
shortenURL | Boolean | shorten URL, in-order for the HPP to send a shortened URL instead of the long URL Values: true or false Note: If set to ‘true’, HPP will send a shortened URL instead of a long URL. If it set to ‘false’, HPP will send a shortened URL instead of a long URL. | ||
sendPaymentLink | Boolean | Payment Link will trigger to provide customerMobile and customer Email if the flag is true Values : true or false | ||
integrationVersion | String | New Enhancements will be add with v2 version if this field is passing we will consider as old request changes will not reflect Values : v2 The base amount excludes the tip, and the ACH response code is set to 200 instead of 0. |
CVV Verification CVV verification must be enabled on the portal for it to work.
To enable:
- Navigate to S.T.E.A.M → Search TPN → Edit Parameter → Transaction.
- Under Card Entry Mode, enable Mandatory CVV.
Field | Type | Description | ||
---|---|---|---|---|
Personalization obj ( Optional ) | ||||
merchantName | String | Merchant / DBA name to be displayed in the payment input page. Length: 35 characters | ||
logoUrl | String | Logo image Url to be shown in the hosted payment input page. Format: Logo image Url should be a http / https | ||
themeColor | String | Hosted payment input page theme colour Length: 7 chars | ||
description | String | Merchant descriptions to be displayed in the payment input page. Length: 150 characters | ||
payNowButtonText | String | Pay now button text. Length: 15 characters Example Value: ‘Pay Now’ | ||
buttonColor | String | Hosted payment button color Format: E-mail id Note: This input field is required, if eReceipt set to ‘true’ and eReceiptInputPrompt is set to false | ||
cancelButtonText | String | Cancel now button/link text. Example Value: ‘Pay Now’ Length: 15 characters | ||
disclaimer | String | Merchant disclaimer information if any, to be displayed in the payment input page. Length: 150 characters Note: If set to ‘true’, HPP will send a shortened URL instead of a long URL. If it set to ‘false’, HPP will send a shortened URL instead of a long URL. |
Above personalization enables merchant to personalize the iPOS-HP payment input page with them logo, theme, Pay Now button colour. If the personalization entities values are not given, iPOS-HP will show the default settings.
AVS (Obj) - Conditional (avsVerification is true below Object need to Provide)
Field | Type | Description |
---|---|---|
Zip | String | Zipcode information is used to qualify for the interchange fee, Length : 5 characters |
StreetNo | String | street information is used to qualify for the interchange fee , Length : 25 characters |
All above request fields variable are case sensitive
Response Parameters - Generated URL page request (getHPP)
Generate HPP Url page request – Success
Variable Name | Type | Description |
---|---|---|
message * | String | URL generated successfully |
information * | String | HPP (Hosted Payment Page) form url |
Generate HPP Url page request – Failure
errors (Obj)
Objects | Type | Description |
---|---|---|
field * | String | Error input fields |
message * | String | Error message |
All above request fields variable are case sensitive
Response Parameters - Payment Processor Notification Response
Field | Type | Description | ||
---|---|---|---|---|
iposHPResponse ( obj ) | ||||
responseCode * | Number | iPOS-HP response code Values: 200 - Payment success / Generated URL success 400 - Payment failure or declined / Generated URL failure 401 - Cancelled by Customer 402 - Rejected by Customer | ||
responseMessage * | String | Values: Successful, Declined, Cancelled by Customer, Rejected by Customer, GeneratedURL Success, GeneratedURL Failure | ||
errResponseCode`**` * | Alphanumeric | iPOS-HP error response codeType: Number Values: PG error response code / payment processor error response code Note: upon ‘responseCode’ 200, this errResponseCode and errResponseMessage will be in response payload Length: up-to 3 characters PG Response code ( 3 digits) Example: 500, 501, 502,… Processor Response code (2 characters) Example: 00, 05, … # Error code & message details shared in below doc | ||
errResponseMessage * | String | iPOS-HP error response message Values: PG error response message / Payment processor error response message Note: upon ‘responseCode’ 200, this errResponseCode and errResponseMessage will be in response payload # Error code & message details shared in below doc | ||
transactionReferenceId * | String | Merchant unique transaction reference id Format: Alphanumeric Length: up-to 20 characters | ||
transactionType * | Number | Type of transactions processed. Note: 1 – SALE, 2 – CARD VALIDATION | ||
transactionNumber | Number | Invoice of Transaction number Length: 4 digits | ||
batchNumber | Number | Batch Number Length: 3 digits | ||
cardType | String | Credit / Debit Card Type Values: VISA, MASTERCARD, AMEX, DISCOVER, DINNERS, JCB | ||
cardLast4Digit | Number | Credit card last 4 digits Length: 4 digits | ||
amount | Float | Base or Total Amount charged from customer Format: xxxxxx.xx | ||
tips | Float | Tip amount charged from customer Format: xxxxxx.xx | ||
customFee | Float | Custom Fee charged from customer Format: xxxxxx.xx | ||
localTax | Float | Local tax amount charged from customer Format: xxxxxx.xx | ||
stateTax | Float | State tax amount charged from customer Format: xxxxxx.xx Length: 8 | ||
totalAmount | Float | Total Amount charged from customer Format: xxxxxx.xx Length: 8 | ||
responseApprovalCode | String | Response Approval Code Format: Alphanumeric Length: 6 chars Example: TAS164 | ||
rrn | Number | Unique retrieval reference number Format: xxxxxx.xx Length: 12 characters | ||
transactionId * | Number | iPOS-HP unique transaction id Length: 32 characters | ||
cardToken | String | Card token value, in-order to use it for further consecutive transaction requests. Values: <card-token-value> Note: if requestCardToken is set to ‘true’, iPOS-HPP will respond with card token value. If requestCardToken is set to ‘false’, it will respond, none. | ||
avsRspMsg | String | AVS Response Message returned based on the processor response.The possible return values as follows : Values : ADDRESS MATCH, NO MATCH,EXACT MATCH,ZIP MATCH,AVS UNBL TO VIFY,AVS UNAVL TO PRC,AVS SRVC NT ALWD |
avs(Obj)
Field | Description |
---|---|
Zip | In API request received/customer entered zip code will be returned in response. |
StreetNo | In API request received/customer entered street will be returned in response. |
All above request fields variable are case sensitive
Post Request Parameters – JSON sample
1. notifyByReturn – Request
{
"token": "authToken", //Example: "f0bed899539742309eebd8XXXX7edcf615888XXXXXXXX"
"content-type": "application/json"
};
{
"merchantAuthentication": {
"merchantId": "TPN_NUMBER",
"transactionReferenceId": "Transaction Reference Id"
},
"transactionRequest": {
"transactionType": 1/2,
"amount": "Amount-value", // Example 1000 for 10$ i.e. 10x100
"calculateFee": true/false,
"tipsInputPrompt": true/false,
"calculateTax": true/false,
"feeAmount": "FEE-Amount-value", // Example 1000 for 10$ i.e. 10x100
"feeLabel": "Fee Label",
"lTaxAmount": "L-TAX-Amount-value", // Example 1000 for 10$ i.e. 10x100
"lTaxLabel": "Local-Tax-Label",
"gTaxAmount": "G-TAX-Amount-value", // Example 1000 for 10$ i.e. 10x100
"gTaxLabel": "State Tax label",
"txReferenceTag1": {
"tagLabel": "Tag-label-1", // Example “Vehicle Number”
"tagValue": "Tag-1 value", // Example “TN43AA445”
"isTagMandate": true/false
},
"txReferenceTag2": {
"tagLabel": "Tag-label-2",
"tagValue": "Tag-2 value",
"isTagMandate": true/false
},
"txReferenceTag3": {
"tagLabel": "Tag-label-3",
"tagValue": "Tag-3 value",
"isTagMandate": true/false
}
},
"notificationOption": {
"notificationBySMS": false,
"mobileNumber": "",
"notifyByPOST": false,
"authHeader": "",
"postAPI": "",
"notifyByRedirect": true,
"returnUrl": "<return url>", // Example https://www.merchanturl.com/thankyou/success.php
"failureUrl": "<failure url>", // Example https://www.merchanturl.com/thankyou/failure.php
"cancelUrl": "<cancel url>" // Example https://www.merchanturl.com/checkout.php
},
"preferences": {
"integrationType": "HPP integration type",
"avsVerification": true/false,
"eReceipt": true/false,
"eReceiptInputPrompt": true/false,
"customerName": "Customer_Name",
"customerEmail": "Customer_Email",
"customerMobile": "Customer_mobile_number_with_ISD_code",
"requestCardToken": true/false,
"shortenURL": true/false,
"sendPaymentLink": true/false,
"integrationVersion": "v2"
},
"personalization": {
"merchantName": "Merchant / DBS Name",
"logoUrl": "http or https image url", // Eg., "https://merchanturl.com/logo/images/logo-name.png"
"themeColor": "theme colour", // Example #808080
"description": "Merchant given description",
"payNowButtonText": "pay now button text", // Example "Pay Now"
"buttonColor": "pay button colour", // Example #808080
"cancelButtonText": "cancel button text", // Example "Go to merchant site"
"disclaimer": "Disclaimer information can be placed here" // Example "Only VISA card accepted"
}
}
2. notifyBySMS – Request
{
"token": "authToken", //Example: "f0bed899539742309eebd8XXXX7edcf615888XXXXXXXX"
"content-type": "application/json"
};
{
"merchantAuthentication": {
"merchantId": "TPN_NUMBER",
"transactionReferenceId": "Transaction Reference Id"
},
"transactionRequest": {
"transactionType": 1,
"amount": "Amount-value", // example 1000 for 10$ i.e. 10x100
"calculateFee": true,
"tipsInputPrompt": true,
"calculateTax": true,
"feeAmount": "FEE-Amount-value", // Example 1000 for 10$ i.e. 10x100
"feeLabel": "Fee Label",
"lTaxAmount": "L-TAX-Amount-value", // Example 1000 for 10$ i.e. 10x100
"lTaxLabel": "Local-Tax-Label",
"gTaxAmount": "G-TAX-Amount-value", // Example 1000 for 10$ i.e. 10x100
"gTaxLabel": "State Tax label",
"txReferenceTag1": {
"tagLabel": "Tag-label-1", // Example “Vehicle Number”
"tagValue": "Tag-1 value", // Example “TN43AA445”
"isTagMandate": true
},
"txReferenceTag2": {
"tagLabel": "Tag-label-2",
"tagValue": "Tag-2 value",
"isTagMandate": true
},
"txReferenceTag3": {
"tagLabel": "Tag-label-3",
"tagValue": "Tag-3 value",
"isTagMandate": true
}
},
"notificationOption": {
"notificationBySMS": true,
"mobileNumber": "Merchant Mobile Number Ex +17878787878",
"notifyByPOST": false,
"authHeader": "",
"postAPI": "",
"notifyByRedirect": false,
"returnUrl": "",
"failureUrl": "",
"cancelUrl": ""
},
"preferences": {
"integrationType": "HPP integration type", // Example for e-commerce value is 1
"avsVerification": true,
"eReceipt": true,
"eReceiptInputPrompt": true,
"customerName": "Customer_Name",
"customerEmail": "Customer_Email",
"customerMobile": "Customer_mobile_number_with_ISD_code",
"requestCardToken": true,
"shortenURL": true
},
"personalization": {
"merchantName": "Merchant / DBS Name", // Example "walmart"
"logoUrl": "http or https image url", // Eg., "https://merchanturl.com/logo/images/logo-name.png"
"themeColor": "theme colour", // Example #808080
"description": "Merchant given description",
"payNowButtonText": "pay now button text", // Example "Pay Now"
"buttonColor": "pay button colour", // Example #808080
"cancelButtonText": "cancel button text", // Example "Go to merchant site"
"disclaimer": "Disclaimer information can be placed here" // Example "Only VISA card accepted"
}
}
3. notifyByPOST – Request
{
"token": "authToken", //Example: "f0bed899539742309eebd8XXXX7edcf615888XXXXXXXX"
"content-type": "application/json"
};
{
"merchantAuthentication": {
"merchantId": "TPN_NUMBER",
"transactionReferenceId": "Transaction Reference Id"
},
"transactionRequest": {
"transactionType": 1,
"amount": "Amount-value",
"calculateFee": true,
"tipsInputPrompt": true,
"calculateTax": true,
"feeAmount": "FEE-Amount-value",
"feeLabel": "Fee Label",
"lTaxAmount": "L-TAX-Amount-value",
"lTaxLabel": "Local-Tax-Label",
"gTaxAmount": "G-TAX-Amount-value",
"gTaxLabel": "State Tax label",
"txReferenceTag1": {
"tagLabel": "Tag-label-1",
"tagValue": "Tag-1 value",
"isTagMandate": true
},
"txReferenceTag2": {
"tagLabel": "Tag-label-2",
"tagValue": "Tag-2 value",
"isTagMandate": true
},
"txReferenceTag3": {
"tagLabel": "Tag-label-3",
"tagValue": "Tag-3 value",
"isTagMandate": true
}
},
"notificationOption": {
"notificationBySMS": false,
"mobileNumber": "",
"notifyByPOST": true,
"authHeader": "API Access token",
"postAPI": "Merchant post API Url",
"notifyByRedirect": false,
"returnUrl": "",
"failureUrl": "",
"cancelUrl": ""
},
"preferences": {
"integrationType": "HPP integration type",
"avsVerification": true,
"eReceipt": true,
"eReceiptInputPrompt": true,
"customerName": "Customer_Name",
"customerEmail": "Customer_Email",
"customerMobile": "Customer_mobile_number_with_ISD_code",
"requestCardToken": true,
"shortenURL": true
},
"personalization": {
"merchantName": "Merchant / DBS Name",
"logoUrl": "http or https image url",
"themeColor": "theme colour",
"description": "Merchant given description",
"payNowButtonText": "pay now button text",
"buttonColor": "pay button colour",
"cancelButtonText": "cancel button text",
"disclaimer": "Disclaimer information can be placed here"
}
}
Post Response Parameters – JSON Sample
Upon Form Token Generated URL success / failure response
{
"message": "Url generated Successful",
"information": "https://payment.ipospays.tech/api/v1/externalPay?t=< token-value >"
}
{
"message": "URL generated successfully",
"information": "https://api.denovosystem.tech/v1/sl/344r0Cd101101T312"
}
{
"errors": [
{
"field": "merchantAuthentication.merchantId",
"message": "Invalid Merchant Id"
},
{
"field": "transactionRequest.transactionType",
"message": "Invalid Transaction Type"
}
]
}
{
"iposHPResponse": {
"responseCode": "iPOS-HP response code like 200, 400,...",
"responseMessage": "Successful/Declined/Cancelled By Customer/Rejected By Customer",
"errResponseCode": "Error response code",
"errResponseMessage": "Error response message",
"transactionReferenceId": "merchant unique transaction reference id sent on request",
"transactionType": "1-sale/ 2-card validation",
"transactionId": "Unique transaction Id of iPOS-HPP",
"transactionNumber": "4 digits of transaction number from processor",
"batchNumber": "3 digits of batch number from processor",
"cardType": "VISA/MASTERCARD/etc...",
"cardLast4Digit": "last 4 digit of credit/debit card",
"amount": "base amount or total amount charged",
"tips": "tip amount",
"customFee": "custom fee",
"localTax": "local tax",
"stateTax": "state tax",
"totalAmount": "total amount charged",
"responseApprovalCode": "response approval code from processor ex: TAS164",
"rrn": "retrieval reference number from processor #219313501821",
"cardToken": "card-token-value",
"avsRespMeg": "ADDRESS MATCH",
"avs": {
"Zip": "100004",
"StreetNo": "15205 North Kierland Blvd. Suite 100"
}
}
}
HPP API – Integration References
import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
// Import HttpClientModule and add Providers: [HttpClient] in your module.ts file
export interface Payload {
merchantAuthentication: MerchantAuthentication;
transactionRequest: TransactionRequest;
personalization: Personalization;
notificationOption: NotificationOption;
preferences: Preferences;
}
export interface MerchantAuthentication {
merchantId: string;
transactionReferenceId: string;
}
export interface TransactionRequest {
transactionType: number;
amount: number;
calculateFee: boolean;
invoiceNumber: string;
}
export interface Personalization {
logo: string;
themeColor: string;
description: string;
payNowButtonText: string;
buttonColor: string;
cancelButtonText: string;
}
export interface NotificationOption {
returnUrl: string;
failureUrl: string;
authHeader: string;
cancelUrl: string;
notifyByRedirect: boolean;
notifyByPOST: boolean;
postAPI: string;
mobileNumber: string;
notifyBySMS: boolean;
}
export interface Preferences {
eReceipt: boolean;
avsVerification: boolean;
customerName: string;
customerEmail: string;
customerMobile: string;
integrationType: number;
requestCardToken: boolean;
}
export interface PaymentSuccessResponse {
information: string; // This will be the redirect URL
message: string;
}
export interface PaymentFailureResponse {
errors?: ErrorsEntity[] | null;
}
export interface ErrorsEntity {
field: string;
message: string;
}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
generatedTpn: string = '';
generatedToken: string = '';
routeUrl: string = 'Your Route URL Here';
paymentUrl: string = 'Your Route URL';
// All the URLs should be trimmed. No trailing and leading white spaces
payload: Payload = {
merchantAuthentication: {
merchantId: this.generatedTpn,
transactionReferenceId: Math.random().toString(36).slice(2),
},
transactionRequest: {
transactionType: 1,
amount: 100, // Amount (e.g., 100 = 1$)
calculateFee: true,
invoiceNumber: '',
},
personalization: {
logo: 'https://www.example.com/image/img.jpg', // Logo image URL
themeColor: '#80DEEA',
description: 'Your Description Here',
payNowButtonText: 'Pay Now',
buttonColor: '#80DEEA',
cancelButtonText: 'Reset',
},
notificationOption: {
returnUrl: this.routeUrl,
failureUrl: '',
authHeader: '',
cancelUrl: '',
notifyByRedirect: true,
notifyByPOST: false,
postAPI: '',
mobileNumber: '',
notifyBySMS: false,
},
preferences: {
eReceipt: false,
avsVerification: true,
customerName: '',
customerEmail: '',
customerMobile: '',
integrationType: 1,
requestCardToken: true,
},
};
constructor(private httpClient: HttpClient) {}
async ngOnInit() {
try {
const result = (await this.getPaymentForm(this.payload)) as PaymentSuccessResponse;
const redirectUrl = result.information;
window.open(redirectUrl, '_self');
} catch (err) {
// Handle error here
console.error('Payment form request failed', err);
}
}
getPaymentForm(payload: Payload) {
const httpOptions = {
headers: new HttpHeaders({
token: this.generatedToken,
withCredentials: 'false',
}),
};
return new Promise((resolve, reject) => {
this.httpClient.post(this.paymentUrl, payload, httpOptions).subscribe(
(data: PaymentSuccessResponse | any) => {
resolve(data);
},
(error: PaymentFailureResponse) => {
reject(error);
}
);
});
}
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://payment.ipospays.tech/api/v1/external-payment-transaction',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode(array(
"merchantAuthentication" => array(
"merchantId" => "",
"transactionReferenceId" => ""
),
"transactionRequest" => array(
"transactionType" => 1,
"amount" => "400",
"calculateFee" => true,
"txReferenceTag1" => array(
"tagLabel" => "TEST",
"tagValue" => "TAG"
),
"txReferenceTag2" => array(
"tagLabel" => "TEST1",
"tagValue" => "TAG1"
),
"txReferenceTag3" => array(
"tagLabel" => "TEST2",
"tagValue" => "TAG2"
)
),
"personalization" => array(
"logoUrl" => "",
"themeColor" => "",
"description" => "",
"payNowButtonText" => "",
"buttonColor" => "",
"cancelButtonText" => ""
),
"notificationOption" => array(
"postAPI" => "",
"failureUrl" => "",
"returnUrl" => "",
"notifyByRedirect" => false,
"notifyBySMS" => false,
"notifyByPOST" => false,
"authHeader" => "",
"cancelUrl" => "",
"mobileNumber" => ""
),
"preferences" => array(
"integrationType" => 1,
"eReceipt" => true,
"avsVerification" => true,
"eReceiptInputPrompt" => true,
"customerName" => "",
"customerEmail" => "",
"customerMobile" => "",
"requestCardToken" => true
)
)),
CURLOPT_HTTPHEADER => array(
'token: ',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
$reqjson = json_decode($response, true);
// Uncomment below if you want to redirect based on the response
// header("Location: " . $reqjson['information']);
?>
HPP – queryPaymentStatus API
What is Query API?
Query API lets merchants “pull” information from the gateway. It allows merchant to query the status of payment. Use same transaction reference id used while calling HPP Request Payment Page API. This dataset can then be used to create in-house reports and analytics.
If the requestCardToken field is set to true as part of the Sale transaction request parameters in the getHPP API, the queryPaymentStatus API response will include the cardToken value when the merchant makes the request.
Query API URL
Objects | Description |
---|---|
Sandbox URL: | https://api.ipospays.tech/v1/queryPaymentStatus |
Production Live URL: | https://api.ipospays.com/v1/queryPaymentStatus |
Request Header Info
Authorization | API key |
---|
Request Query Params
Objects | Description |
---|---|
TPN * | TPN number |
transactionReferenceId | Merchant unique transaction reference id |
Response Params
Field | Type | Description | ||
---|---|---|---|---|
iposHPResponse object ( ) | ||||
responseCode * | Number | iPOS-HP response code Values: 200 - Payment success / Generated URL success 400 - Payment failure or declined / Generated URL failure 401 - Cancelled by Customer 402 - Rejected by Customer | ||
responseMessage * | String | iPOS-HP response message Values: Successful, Declined, Cancelled by Customer, Rejected by Customer | ||
errResponseCode`**` * | Alphanumeric | iPOS-HP error response codeType: Number Values: PG error response code / payment processor error response code Note: upon ‘responseCode’ 200, this errResponseCode and errResponseMessage will be in response payload Length: up-to 3 characters PG Response code ( 3 digits) Example: 500, 501, 502,… Processor Response code (2 characters) Example: 00, 05, … # Error code & message details shared in below doc | ||
errResponseMessage`**` * | String | iPOS-HP error response message Values: PG error response message / Payment processor error response message Note: upon ‘responseCode’ 200, this errResponseCode and errResponseMessage will be in response payload # Error code & message details shared in below doc | ||
transactionReferenceId * | String | Merchant unique transaction reference id Format: Alphanumeric Length: up-to 25 characters | ||
transactionType * | Number | Type of transactions processed. Note: 1 – sale, 2 - card validation , 2 – void, 3 - refund | ||
transactionNumber | Number | Invoice of Transaction number Length: 4 digits | ||
batchNumber | Number | Batch Number Length: 3 digits | ||
cardType | String | Credit / Debit Card Type Values: VISA, MASTERCARD, AMEX, DISCOVER, DINNERS, JCB | ||
cardLast4Digit | Number | Credit card last 4 digits Length: 4 digits | ||
amount | Float | Base or Total Amount charged from customer Format: xxxxxx.xx | ||
tips | Float | Tip amount charged from customer Format: xxxxxx.xx | ||
customFee | Float | Custom Fee charged from customer Format: xxxxxx.xx | ||
localTax | Float | Local tax amount charged from customer Format: xxxxxx.xx | ||
stateTax | Float | State tax amount charged from customer Format: xxxxxx.xx Length: 8 | ||
totalAmount | Float | Total Amount charged from customer Format: xxxxxx.xx Length: 8 | ||
responseApprovalCode | String | Response Approval Code Format: Alphanumeric Length: 6 chars Example: TAS164 | ||
rrn | Number | Unique retrieval reference number Format: xxxxxx.xx Length: 12 characters | ||
transactionId * | Number | iPOS-HP unique transaction id Length: 32 characters | ||
cardToken | String | Card token value, in-order to use it for further consecutive transaction requests. Values: <card-token-value> Note: if requestCardToken is set to ‘true’, iPOS-HPP will respond with card token value. If requestCardToken is set to ‘false’, it will respond, none. |
Query API – Request Sample
https://api.ipospays.tech/v1/queryPaymentStatus?tpn=<tpn number>&transactionReferenceId=<Merchant Transaction Reference Id>
Query API
{
"iposHPResponse": {
"responseCode": < iPOS-HP response code >,
"responseMessage": "Successful/Decined/Cancelled By Customer/Rejected By Customer",
"errResponseCode": < Error response code >,
"errResponseMessage": < Error response message >,
"transactionReferenceId": < merchant transaction reference id >,
"transactionId": < Unique transaction Id of iPOS-HP >
"transactionType": < 1-sale/2-card validation >,
"transactionNumber": < 4 digits of transaction number from processor >,
"batchNumber": < 3 digits of batch number from processor >,
"cardType": < VISA/MASTERCARD/etc...>,
"cardLast4Digit": < last 4 digit of credit/debit card >,
"amount": < base amount or total amount charged >,
"tips": < tip amount >,
"customFee": < custom fee >,
"localTax": < local tax >,
"stateTax": < state tax >,
"totalAmount": < total amount charged >,
"responseApprovalCode": < ex: TAS164 from processor >,
"rrn": < retrieval reference number >
"cardToken":"card-token-value"
}
}
How to request for card Token in part of sale transaction
- Get Hosted Payment Page API allows merchants to get a response of card token value/string to use it for further transactions like Sale & Recurring Payments.
- In Sale transaction type request payload, if requestCardToken is set to true, iPOS-HPP will respond with card token value as cardToken & consumer id as consumerId. if requestCardToken is set to false, iPOS-HPP will respond, none.
requestCardToken Request Payload
{
"merchantAuthentication": {
. . . //merchant auth key & values
},
"transactionRequest": {
"transactionType":1/2 // 1 - Sale / 2 - Card Validation
. . . //other transaction request key & values
},
"notificationOption": {
. . . //notification option request key & values
},
"preferences": {
"integrationType": "HPP integration type",
"avsVerification": true/false,
"eReceipt": true/false,
"eReceiptInputPrompt": true/false,
"customerName": "Customer_Name",
"customerEmail": "Customer_Email",
"customerMobile": "Customer_mobile_number_with_ISD_code",
"requestCardToken": true // value can be true or false
},
"personalization": {
. . . //personalization request key & values
},
}
cardToken Value Response
{
"iposHPResponse": {
"responseCode": "iPOS-HP response code like 200, 400,...",
"responseMessage": "Successful/Declined/Cancelled By Customer/Rejected By Customer",
"errResponseCode": "Error response code",
"errResponseMessage": "Error response message",
"transactionReferenceId": "merchant unique transaction reference id sent on request",
"transactionType": "1-sale/2-card validation",
"transactionId": "Unique transaction Id of iPOS-HPP"
"transactionNumber": "4 digits of transaction number from processor",
"batchNumber": "3 digits of batch number from processor",
"cardType": "VISA/MASTERCARD/etc...",
"cardLast4Digit": "last 4 digit of credit/debit card",
"amount": "base amount or total amount charged",
"tips": "tip amount",
"customFee": "custom fee",
"localTax": "local tax",
"stateTax": "state tax",
"totalAmount": "total amount charged",
"responseApprovalCode": "response approval code from processor ex: TAS164",
"rrn": "retrieval reference number from processor #219313501821",
"cardToken": "card-token-value"
}
}
{
"iposHPResponse": {
"responseCode": "iPOS-HP response code like 200, 400,...",
"responseMessage": "Successful/Declined/Cancelled By Customer/Rejected By Customer",
"errResponseCode": "Error response code",
"errResponseMessage": "Error response message",
"transactionReferenceId": "merchant unique transaction reference id sent on request",
"transactionType": "1-sale/2-void/3-refund",
"transactionId": "Unique transaction Id of iPOS-HPP"
"transactionNumber": "4 digits of transaction number from processor",
"batchNumber": "3 digits of batch number from processor",
"cardType": "VISA/MASTERCARD/etc...",
"cardLast4Digit": "last 4 digit of credit/debit card",
"amount": "base amount or total amount charged",
"tips": "tip amount",
"customFee": "custom fee",
"localTax": "local tax",
"stateTax": "state tax",
"totalAmount": "total amount charged",
"responseApprovalCode": "response approval code from processor ex: TAS164",
"rrn": "retrieval reference number from processor #219313501821"
}
}
How to Request for a CARD VALIDATION Transaction
The getHostedPaymentPage API allows merchants to validate the card to use it for further transactions like tokenized Sale & Recurring Payments. In the request payload, if transactionType is set to 2, and the amount value is set to 0, iPOS-HPP API will validate the card input entered by the customer on the payment page form.
{
"merchantAuthentication": {
. . . //merchant auth key & values
},
"transactionRequest": {
"transactionType": 2 // Card Validation
. . . //other transaction request key & values
},
"notificationOption": {
. . . //notification option request key & values
},
"preferences": {
"integrationType": "HPP integration type",
"avsVerification": true/false,
"eReceipt": true/false,
"eReceiptInputPrompt": true/false,
"customerName": "Customer_Name",
"customerEmail": "Customer_Email",
"customerMobile": "Customer_mobile_number_with_ISD_code",
"requestCardToken": true // to receive card token in API response
},
"personalization": {
. . . //personalization request key & values
},
}
Sample Response:
{
"message": "Url generated successfully",
"information": "https://payment.ipospays.tech/api/v1/externalPay?t=<token-value>"
}
{
"errors": [
{
"field": "merchantAuthentication.merchantId",
"message": "Invalid Merchant Id"
},
{
"field": "transactionRequest.transactionType",
"message": "Invalid Transaction Type"
}, ...
]
}
CARD VALIDATION - SAMPLE RESPONSE
(Result based on the transaction's success or failure as received from the payment processor)
{
"iposHPResponse": {
"responseCode": "iPOS-HP response code like 200, 400,...",
"responseMessage": "Successful/Declined/Cancelled By Customer/Rejected By Customer",
"errResponseCode": "Error response code",
"errResponseMessage": "Error response message",
"transactionReferenceId": "merchant unique transaction reference id sent on request",
"transactionType": 2,
"transactionId": "Unique transaction Id of iPOS-HPP"
"transactionNumber": "4 digits of transaction number from processor",
"batchNumber": "3 digits of batch number from processor",
"cardType": "VISA/MASTERCARD/etc...",
"cardLast4Digit": "last 4 digit of credit/debit card",
"amount": "0",
"tips": "",
"customFee": "",
"localTax": "",
"stateTax": "",
"totalAmount": "total amount charged",
"responseApprovalCode": "response approval code from processor ex: TAS164",
"rrn": "retrieval reference number from processor #219313501821",
"cardToken": "card-token-response-value"
}
}
Error Codes and Their Meaning
For a complete list of error codes and their explanations, please visit our Error Codes Reference Page.