Latpay API

Latpay API Sample
Introduction

The LatPay API provides a suite of solutions to manage the entire Checkout process along with transaction management. Our API has been built with security as its core and offers all features as required by both the back office operations team as well as ease of integration for your technical team.

By accessing the LatPay payment management engine through the API, you will be able to manage the entire cash flow from collection to payout. The LatPay platform also gives you the ability to process in over 140 currencies and settle in 26 major currencies, all in real time. The API is designed in such a way that a single unified model to integrate for card, alternate payment and bank transfer is possible. So high level of code reusability and quick integration is possible.

Our API integration is very simple. However, if you need to contact us for technical support, please e-mail us at techsupport@lpsmail.com. For sandbox access, please send email to techsupport@lpsmail.com. Signing up for the sandbox will give you access to a test MID through which you can check out live responses, make demo transactions and explore features.

Getting Started

Our documentation was designed to be easy to use. Our API calls are grouped by resources which you will see in the navigation menu on the left frame.

These are the base API URLs for the LATPAY environments:

Sandbox: <<<Endpoint provided on signup to test MID>>>

Production: <<<Endpoint provided on issue of live MID>>>

MediaType: application/json

Checkout

The Checkout API call will initialise an order in the Latpay system and begin the checkout process for the customer. The response will provide a unique transaction id, order id to acknowledge order acceptance and state of transaction. The response code indicates the type of response along with status and error codes to indicate the actual status and if rejected, the reason for rejection.

The Checkout API call includes a mandatory parameter “notifyurl” which must be populated to indicate the callback to notify the transaction status.

Card

The Checkout API is part of a unified API request to process authorisations. To use cards as payment mode, indicate the “billing” section with type set to “card” as shown the sample request.

Batch Authorisation

Latpay offers batch API to submit authorisation request in a batch. A batch can be upto 10k transactions. The process flow will be for each batch request, the API will validate the request and acknowledge receipt of batch with a batchid and status pending. Latpay enterprise Gateway will then sweep all pending batches and will notify the status of transactions in each batch in a callback notification.

Batch Submission

Request


Field Type Mandatory
merchant_User_Id string Required
merchantpwd string Required
batchreference string Required
transaction[] Transaction Required
notifyurl string Optional
Batch Authorisation
{
"batchauthorisation":
    {
     "merchant_User_Id": "test_user",
     "merchantpwd": "v!@qst",
     "batchreference": "test01",
     "transaction":[
      {
        "consumer": 
           {
           "firstname": "Thirlok",
           "lastname": "Shankar",
           "phone": "1234567890",
           "email": "email@domain.com"
           },
        "billing":
           {
           "type": "card",
           "card":
                {
                    "name": "name on card",
                    "pan": "4200000000000000",
                    "exp": "12/25",
                    "cvc": "123"
                }
            "address" :
                 {
                   "line1" : "Southbank House",
                   "line2" : "",
                   "city" : "London",
                   "state" : "",
                   "country" : "GB",
                   "zipcode" : "SE1",
                  }
            },
        "order":
          {
          "reference": "lpstest123",
          "currency": "USD",
          "amount": "2.00"
          }
        },
       
        {
          "consumer": 
              {
               "firstname": "Ian",
               "lastname": "Vidamour",
               "phone": "1234567890",
               "email": "email@domain.com"
               },
           "billing":
             {
               "type": "card",
               "card":
                 {
                  "name": "name on card",
                  "pan": "4200000000000002",
                  "exp": "12/25",
                  "cvc": "345"
                 }
                "address" :
                 {
                   "line1" : "Southbank House",
                   "line2" : "",
                   "city" : "London",
                   "state" : "",
                   "country" : "GB",
                   "zipcode" : "SE1",
                   }
              },
            "order":
               {
                  "reference": "lpstest456",
                  "currency": "USD",
                  "amount": "5.00"
                }
              }
            ],
        notifyurl: "https://www.notifyurl.aspx"
     }
  }
Acknowledgement

Response


Field Type Response
batchid string Required
batchcount numeric Required
status Status Required
Failure
Success
Error

Prescreen Failure

{
"response":
   {
     "batchid" : "123456",
     "batchcount": "10000",
     "status": 
      {
         "responsetype": "0",
         "statuscode": "1",
         "errorcode": "1001",
         "errordesc": "Authentication failed"
      }
    }
}

Batch Accepted

{
"response":
   {
    "batchid" : "123456",
    "batchcount": "10000",
    "status": 
      {
         "responsetype": "8",
         "statuscode": "2",
         "errorcode": "00",
         "errordesc": "Batch accepted for processing"
      }
 
    }
}

System Error

{
"response":
   {
     "batchid" : "123456",
     "batchcount": "10000",
     "status": 
      {
         "responsetype": "8",
         "statuscode": "1",
         "errorcode": "9000",
         "errordesc": "System Error"
      }
    }
}
Notification

Response


Field Type Mandatory
batchid string Required
batchcount numeric Required
batchreference String Required
transaction[] Transaction Required
Notification
{
 "batchauthorisation":
    {
      "batchid" : "123456",
      "batchcount": "10000",
      "batchreference": "ref123",
      "status": 
                {
                "responsetype": "4",
                "statuscode": "0",
                "errorcode": "00",
                "errordesc": "Batch processing completed"
                 }
      "transaction":[
           {
           "transactionid": "74580250",
           "consumer": 
                {
                "firstname": "Thirlok",
                "lastname": "Shankar",
                "phone": "1234567890",
                "email": "email@domain.com"
                },
           "billing":
                {
                "type": "card",
                "card":
                    {
                    "name": "name on card",
                    "pan": "420000XXXXXX0000",
                    "exp": "12/25",
                    "cvc": "XXX"
                    },
                 "address" : 
                   {
                    "line1" : "Southbank House",
                    "line2" : "",
                    "city" : "London",
                    "state" : "",
                    "country" : "GB",
                    "zipcode" : "SE1",
                    }
                },
           "order":
                {
                "reference": "lpstest123",
                "currency": "USD",
                "amount": "2.00"
                },
           "status": 
                {
                "responsetype": "1",
                "statuscode": "0",
                "errorcode": "00",
                "errordesc": "Transaction approved"
                 }
 
            },
        "transaction":
            {
               "transactionid": "74580251",
               "consumer": 
                  {
                   "firstname": "Ian",
                   "lastname": "Vidamour",
                   "phone": "1234567890",
                   "email": "email@domain.com"
                  },
               "billing":
                 {
                  "type": "card",
                  "card":
                      {
                       "name": "name on card",
                       "pan": "420000XXXXXX0002",
                       "exp": "12/25",
                       "cvc": "XXX"
                      },
                  "address" : 
                     {
                       "line1" : "Southbank House",
                       "line2" : "",
                       "city" : "London",
                       "state" : "",
                       "country" : "GB",
                       "zipcode" : "SE1",
                      }
                  },
               "order":
                   {
                     "reference": "lpstest456",
                     "currency": "USD",
                     "amount": "5.00"
                   },
               "status": 
                   {
                     "responsetype": "1",
                     "statuscode": "1",
                     "errorcode": "05",
                     "errordesc": "Do not honor"
                    }
                }
            ]
 
    }
  }
Batch Status Check
Request
Field Type Mandatory
merchant_User_Id string Required
merchantpwd string Required
batchreference string Required
batchcount numeric Required
batchid string Optional
Request
{
"batchauthorisation":
     {
        "merchant_User_Id": "test_user",
        "merchantpwd": "v!@qst",
        "batchreference": "test01",
        "batchcount": "10000",
        "batchid": "12345"
     }
}
Response

Field Type Mandatory
merchant_User_Id string Required
merchantpwd string Required
batchreference string Required
batchcount numeric Required
batchid string Optional
transaction[] Transaction Required
Failure
Success
Pending / Inprogress
Error

Prescreen Failure

{
"batchauthorisation":
     {
         "batchid" : "",
         "batchcount": "10000",
         "batchreference": "test01",
         "status": 
	     {
	       "responsetype": "0",
	       "statuscode": "1",
	       "errorcode": "2001",
	       "errordesc": "Invalid Batch Details"
	      }
    }
}

Batch Accepted

{
"batchauthorisation":
     {
         "batchid" : "123456",
         "batchcount": "10000",
         "batchreference": "test01",
         "status": 
              {
                "responsetype": "6",
                "statuscode": "0",
                "errorcode": "00",
                "errordesc": "Batch processing completed"
                }
         "transaction":[
              {
                "transactionid": "74580250",
                "consumer": 
                 {
                   "firstname": "Thirlok",
                   "lastname": "Shankar",
                   "phone": "1234567890",
                   "email": "email@domain.com"
                  },
                "billing":
                   {
                    "type": "card",
                    "card":
                        {
                          "name": "name on card",
                          "pan": "420000XXXXXX0000",
                          "exp": "12/25",
                          "cvc": "XXX"
                        },
                    "address" : 
                        {
                          "line1" : "Southbank House",
                          "line2" : "",
                          "city" : "London",
                          "state" : "",
                          "country" : "GB",
                          "zipcode" : "SE1",
                        }
                    },
                "order":
                   {
                      "reference": "lpstest123",
                      "currency": "USD",
                      "amount": "2.00"
                   },
                "status": 
                   {
                       "responsetype": "1",
                       "statuscode": "0",
                       "errorcode": "00",
                       "errordesc": "Transaction approved"
                    }
               },
              
               {
                "transactionid": "74580251",
                "consumer": 
                   {
                   "firstname": "Ian",
                   "lastname": "Vidamour",
                   "phone": "1234567890",
                   "email": "email@domain.com"
                   },
               "billing":
                 {
                   "type": "card",
                   "card":
                      {
                       "name": "name on card",
                       "pan": "420000XXXXXX0002",
                       "exp": "12/25",
                       "cvc": "XXX"
                       },
                   "address" : 
                     {
                      "line1" : "Southbank House",
                      "line2" : "",
                      "city" : "London",
                      "state" : "",
                      "country" : "GB",
                      "zipcode" : "SE1",
                     }
                 },
               "order":
                  {
                    "reference": "lpstest456",
                    "currency": "USD",
                    "amount": "5.00"
                   },
               "status": 
                  {
                    "responsetype": "1",
                    "statuscode": "1",
                    "errorcode": "05",
                    "errordesc": "Do not honor"
                   }
                }
            ]
 
     }
}

Batch Pending / Inprogress

{
"batchauthorisation":
	 {
	     "batchid" : "123456",
	     "batchcount": "10000",
	     "batchreference": "test01",
		 "status": 
		       {
		           "responsetype": "6",
		           "statuscode": "2",
		           "errorcode": "2003",
		           "errordesc": "Batch still in pending / Inprogress"
		         }
	   }
	}

System Error

{
	"batchauthorisation":
	     {
	         "batchid" : "123456",
	         "batchcount": "10000",
	         "batchreference": "test01",
		     "status": 
		                   {
		                       "responsetype": "6",
		                       "statuscode": "1",
		                       "errorcode": "9000",
		                       "errordesc": "System Error"
		                    }
	      }
	}
Embedded Form

The Embedded UI - Checkout (Card) is a two step process, first step to dynamically create a payment form to securely collect customer’s card details without handling sensitive data and a server side API call for confirmation of capture of checkout transactions.

  1. Latpay Embedded Form - Checkout securely collects customer payment information and returns a card token dynamically during payment form submission. This token along with your other checkout details are then submitted to your server by the browser
  1. The token generated is then used by your server side code to make an API call for the capture. By capturing card details from the client side and tokenising the sensitive information, the card details never pass through your server. Hence the integration is fully PCI-compliant.

Account Registration

The first step will be to obtain a Latpay processing account enabled for Embedded UI - Checkout.Register Now.

Payment Form Creation

The next step is to securely collect card details. Embedded UI - Checkout creates UI components that are hosted in Latpay in your payment form, rather than you creating them directly.

Add this script tag in the head section of your Checkout HTML page:

<script src="https://lateralpayments.com/checkout/scripts/latpay2.js"></script>

This script should be loaded directly from https://lateralpayments.com

Authentication

Next, to authenticate the merchant account to enable binding of Checkout elements into the payment page. This is performed by calling the open() function on the Latpay Checkout script. This should be called on the Page Onload() event. The following Javascript code sample can be used as a template. The function provides an option to handle authentication failure for e.g. to alert website admins or write to log etc.

LatpayCheckout.open

({

merchantid: issued by latpay ,

publickey: issued by latpay,

‘status’: function (status) {}

//merchat can write custom logic to get alerted

});

On the payment form, to allow the Embedded UI - Checkout elements to be binded, it is necessary to create an empty DOM container (div tag) with the unique id “latpay-element”. This should be within your payment form and placed in location where you would like to have the card elements to be displayed.

<form method="post" action="your-own-server-side-page"> <div id=latpay-element> </div>

<button id="customButton">Checkout</button>

</form>

To customise the user interface styles, the following classes can be added as inline style to overwrite the default behaviour of the card element UI. The available style classes and its default configuration used in Embedded UI - Checkout element are:

CSS details

Card element style

/This selector is used for set required field "" color*/

span.latpay-required {

color: red;

font-weight: bold;

}

/*This selector points to form labels */

div.latpay-elements-field > label {

color: #999 !important;

font-size: 12px !important;

}

/This selector points to CVC box while pay using card token/

div.latpay-elements-field {

padding: 10px 5px;

}

/This selector points all input boxes/

div.latpay-elements-field > input {

width: 100%;

margin-top: 5px;

border: 1px solid #d9d9d9;

background: #fff !important;

padding: 6px;

font-size: 18px !important;

color: grey !important;

}

/This selector points card brand logo/

i.latpay-credit-card-brand {

position: absolute;

right: 8%;

margin-top: -37px;

display: block;

width: 30px;

height: 24px;

background: no-repeat url(http://localhost/martfury/wp-content/plugins/hps/images/credit-card.svg);

}

/This selector points division between Expiry Date and CVC/

div.latpay-flex {

display: flex;

justify-content: space-between;

padding-bottom: 5%;

}

/This selector points division width Expiry Date and CVC/

div#latpay-exp-element, div#latpay-cvc-element {

width: 50%;

}

/*This selector points error-list section */

li.latpay-error-list {

color: #b81c23;

font-weight: bold !important;

}

@media (max-width: 520px) and (min-width: 300px) {

div.payment_box {

padding: 0px !important;

}

div.latpay-elements-field > input {

font-size: 15px !important;

} }

Payment Token Handling along with Card Token

An event listener must be added to trap the customer submit action when the customer fills in the card details. The processpayment() must be called to submit the customer card details to Latpay and generate a Payment TransToken and along with it the CardToken (which can be used for repeat purchases of same customer). The Checkout elements have built in form validation which handles all format errors during card details entry. In case of error during Payment TransToken generation, it will be returned as error, which can then be handled on the listener. Once the request is successful, the request can be continued to submit to your server.

LatpayCheckout.processpayment({

amount: ‘transaction amount’ ,

currency: ‘transaction currency’ ,

reference: ‘transaction reference’ ,

description: ‘transaction description’ ,

status: function (token) {

if(token == “success”){

// Transtoken generated succesfully, you can proceed to form post after completing any custom work as necessary return true;

}

else if(token == “failed”){

// if transaction generation failed, merchant can complete any custom work and prevent form post e.preventDefault();

}

}

});

});

The following Javascript code sample template shows an implementation for the event listener

// Onload or click event

LatpayCheckout.open({

merchantid: ‘test_hps’ ,

publickey: ‘querygfdsazar’

});

$("#customButton").click(function (e) {

LatpayCheckout.processpayment({

amount: transaction amount ,

currency: transaction currency ,

reference: transaction reference ,

description: transaction description,

status: function (token) {

if(token == “success”){

// Transtoken generated succesfully, you can proceed to form post after completing any custom work as necessary return true;

}

else if(token == “failed”){

// if transaction generation failed, merchant can complete any custom work and prevent form post e.preventDefault();

}

}

});

});

});

Authorise the payment

After the customer has submitted the card details and Payment TransToken generated and submitted to your server, you can use it to authorise the payment. On your server, you can retrieve the TransToken and other details from the POST parameters submitted by your form. Then an API call should be made server to server to authorise the payment.

The request and response fields for authorise the payment API call provided below.

Capture Confirmation of Checkout

Once checkout is completed and the payment form is successfully submitted to your server side code along with cardtoken, an API call can be made to confirm the capture of transaction. To get the transtoken using form collection

Example in PHP code : $_REQUEST[‘transtokenval’] ;

Method : Post Url : https://lateralpayments.com/checkout-staging/Testcheckout/Capture

Note that unless a capture confirmation call is made, no finalisation of authorisation of fund against the card is made. Hence it is important to ensure capture call is made after checkout completion

Request
API Type Mandatory
Amount money Required
Currency string Required
Status Status Required
Transtoken string Required
Datakey string Required
Merchantuserid string Required
Reference string Required
Description string Optional
Example 1
{
    "amount":"0.10",
    "currency":"AUD",
    "status":"0",
    "transtoken":"iRc2jMXATo\/UYXCTkjDLbbKb+Ai0eXx\/cahLmePGaYOVLAdbYrHoGngOoeldZo0V",
    "datakey":"skhjhdashgau",
    "merchantuserid":"test_hps",
    "reference":"3811b2a16309ba9f20d8e51ebce782b8a09962eb",
    "description":"3811b2a16309ba9f20d8e51ebce782b8a09962eb"
    
}
Response
API Type Mandatory
Datakey string Required
Cardtoken string Required
Amount money Required
Currency string Required
Reference string Required
Description string Optional
Status Status Required
API
Request

The payload of Checkout request must contain details of the authentication, customer, order details. For a seamless experience for customer, all purchase details can be included as well. The request & response parameters table below summarises the field requirements for Checkout along with mandatory field indicators . For the full list of parameters, including what is and is not mandatory, refer our API Reference section.

Checkout Request

Checkout URL Parameters


API Type Mandatory
Accountid string Required
Storeid string Required
Deviceid string Required
Merchantkey** String Required
Consumer Consumer Required
Order Order Required
Callback_params Callback param Optional
Billing Billing Required

** Refer the “merchantkey” construction details in Authentication section

Card Transaction
Token Transaction
{
   "accountid": "test_lpsv2",
   "storeid":"ST1",
   "deviceid":" Ter1",
   "merchantkey":"a746ff9621d67a6d1b8d7bb6174fea00",
   "consumer": 
      {
       "firstname": "thirlok",
       "lastname": "shankar",
       "phone": "1234567890",
       "email": "thirlok@lpsmail.com"
      },
    "order":
      {
          "reference": "lpstest123",
          "currency": "USD",
          "amount": "2",
          "purchasesummary": "Ecomm purchase list",
          "purchasedetail": [
           {
             "productid": "1890",
             "productname": "Smart watch",
             "productsku": "shop_dept_item_12434",
             "productdescription": "Android Smart wear design # tyfg45667",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2",
             "priceperunit": "0.5"
           },
           {
             "productid": "1891",
             "productname": "Smart card",
             "productsku": "shop_dept_item_7895",
             "productdescription": "Kingston Smart SD Card # sd43545",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2",
             "priceperunit": "0.5"
           }
         ]
        },
    "callback_params":
       {
       "param1": "value1",
       "param2": "value2",
       "param3": "value3",
       "param4": "value4",
       "param5": "value5"
       },
    "billing":
       {
         "type": "card",
              "card":
                {
                  "name": "name on card",
                  "pan": "4200000000000000",
                  "exp": "12/25",
                  "cvc": "123"
                },
              "address" : 
                {
                  "line1" : "Southbank House",
                  "line2" : "",
                  "city" : "London",
                  "state" : "",
                  "country" : "GB",
                  "zipcode" : "SE1",
                },
              "fees" : 
                {
                  "processingfee": "0.25"
                }
              
         
        }
}
{
   "accountid": "test_pos",
   "storeid": "store1",
   "deviceid": "latapydssj5",
   "merchantkey": "84961a8c564ffc4551eebfc937114226851c5260c4039d76ec4127eda15272d6",
   "consumer": 
        {
          "firstname": "thirlok",
          "lastname": "shankar",
          "phone": "1234512345",
          "email": "thirlok@lpsmail.com"
        },
    "order":
        {
          "reference": "lpstest123",
          "currency": "AUD",
          "amount": "0.02",
          "purchasesummary": "Ecomm purchase list", 
          "purchasedetail": [
              {
                "productid": "1890",
                "productname": "Smart watch",
                "productsku": "shop_dept_item_12434",
                "productdescription": "Android Smart wear design # tyfg45667",
                "productcategory": "Electronics",
                "productURL": "http://lateralpaymentsolutions.com",
                "quantity": "2",
                "priceperunit": "0.5"
               },
             {
               "productid": "1891",
               "productname": "Smart card",
               "productsku": "shop_dept_item_7895",
               "productdescription": "Kingston Smart SD Card # sd43545",
               "productcategory": "Electronics",
               "productURL": "http://lateralpaymentsolutions.com",
               "quantity": "2",
                "priceperunit": "0.5"
              }
         ]
        },
     "callback_params":
       {
          "param1": "value1",
          "param2": "value2",
          "param3": "value3",
          "param4": "value4",
          "param5": "value5"
        },
     "billing":
         {
           "type": "card",
     "card":
         {
          "token" : "0x2a70aa24c86a53f06f057ecbf5acca7ebe383df4",
          "cvc" : "123"
          } ,
     "address": 
        {
          "line1": "Southbank House",
          "line2": "",
          "city": "London",
          "state": "",
          "country": "GB",
          "zipcode": "SE1"
        },
     "fees":
        {
           "processingfee": "1.0"
        }
      }
    }
Response

The response to checkout API indicates the status of transaction along with unique transaction and order id’s. In case of asynchronous payments where customer will be completing payments, the status will usually acknowledge as pending and final status notified on callback to URL sent on the notifyurl parameter.

Checkout Response

Checkout URL Parameters


API Type Mandatory
Accountid string Required
Storeid string Required
Deviceid string Required
Transactionid numeric Required
Customerid numeric Required
Responsekey** string Required
Transactiondate_utc String Required
Status Status Required
Consumer Consumer Required
Order Order Required
Callback_params Callback param Optional
Billing Billing Required

** Refer the “responsekey” details in Authentication section

Application/json
{
   "accountid": "test_lpsv2",
   "storeid":"ST1",
   "deviceid":" Ter1",
   "transactionid": "39678",
   "customerid":"123",
   "responsekey":"a746ff9621d67a6d1b8d7bb6174fea00",
   "transactiondate_utc": "26/03/2020 07:01:00",
   "status": 
      {
         "responsetype": "1",
         "statuscode": "0",
         "errorcode": "0",
         "errordesc": ""
      },
   "consumer": 
     {
       "firstname": "thirlok",
       "lastname": "shankar",
       "phone": "1234567890",
        "email": "thirlok@lpsmail.com"
     },
   "order":
     {
        "orderid":"345"
        "reference": "lpstest123",
        "currency": "USD",
        "amount": "2",
        "purchasesummary": "Ecomm purchase list",
        "purchasedetail": [
           {
             "productid": "1890",
             "productname": "Smart watch",
             "productsku": "shop_dept_item_12434",
             "productdescription": "Android Smart wear design # tyfg45667",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2",
             "priceperunit": "0.5"
            },
            {
             "productid": "1890",
             "productname": "Smart card",
             "productsku": "shop_dept_item_7895",
             "productdescription": "Kingston Smart SD Card # sd43545",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2",
             "priceperunit": "0.5"
            }
        ]
      },
   "callback_params":
      {
       "param1": "value1",
       "param2": "value2",
       "param3": "value3",
       "param4": "value4",
       "param5": "value5"
      },
   "billing":
       {
         "type": "card",
              "card":
                {
                    "name": "name on card",
                    "pan": "420000******0000",
                    "exp": "12/25",
                    "token": "0xcc6a72fac6e4cafd1dc09b5aaa5d6ae06706d9b3"
                },
              "address" : 
                {
                    "line1" : "Southbank House",
                    "line2" : "",
                    "city" : "London",
                    "state" : "",
                    "country" : "GB",
                    "zipcode" : "SE1",
                },
              "fees":
                {
                    "processingfee": "0.25"
                },
	"authresponse":
	      {
		"banktransactionno":  "673645",
		"authcode": "84645",
		"gatewayreference": "867674634"
	     }
	
         
        }
 
}
Auth Status Check

Auth Status Check API call offers the ability to query the status of transaction in realtime. This API can be used for querying of transaction status in case if no response back for the original authorisation request. It can also be used to verify transaction status as an additional check from server, if in case the authorisation was initiated from a client side application.

Request
Field Type Mandatory
Accountid string Required
Storeid string Required
Deviceid string Required
Merchantkey** String Required
Transactionid String Optional
Order Order Required
Billing Billing Required

**Refer the “merchantkey” construction details in Authentication section

Example 1
{
"accountid": "test_pos",
"storeid": "store1",
"deviceid": "latapydssj5",
"merchantkey": "438ffbde7fd3b34e83abd80f7bca67cdd98559e1ea01d06c212dd97a67361364",
"transactionid": "5507",
"order":
   {
    "reference": "lpstest123",
    "currency": "AUD",
    "amount": "0.02",
    "purchasesummary": "Ecomm purchase list" 
    },
"billing":
        {
        "type": "card"
        }
}
Response
Field Type Mandatory
Accountid string Required
Storeid string Required
Deviceid string Required
Transactionid String Optional
Responsekey** String Required
Customerid String Required
Transactiondate_utc string Required
Consumer Consumer Required
Order Order Required
Billing Billing Required
Status Status Required

** Refer the “responsekey” details in Authentication section

Accepted
Prescreen Failed
{
    "accountid": "test_pos",
    "storeid": "store1",
    "deviceid": "latapydssj5",
    "transactionid": "5507",
    "responsekey": "F5AC56F7CE677853C0E2E4637546A004EC8AB0FC397D9190CB07C686942BDB8B",
    "customerid": "106",
    "transactiondate_utc": "17/04/2020 11:10",
    "consumer": 
       {
        "firstname": "thirlok",
        "lastname": "shankar",
        "phone": "1234512345",
        "email": "thirlok@lpsmail.com"
       },
    "order": 
       {
        "orderid": "5496",
        "reference": "lpstest123",
        "currency": "AUD",
        "amount": "0.02",
        "purchasesummary": "Ecomm purchase list"
       },
    "billing": 
      {
        "type": "card",
        "card": 
           {
            "name": "aswani",
            "pan": "420000XXXXXX0000",
            "exp": "03/21",
            "token": "0x2a70aa24c86a53f06f057ecbf5acca7ebe383df4"
           },
        "fees": 
           {
            "processingfee": "2.00"
            },
        "authresponse": 
            {
            "banktransactionno": "7008682104  ",
            "authcode": "",
            "gatewayreference": "76122834"
            }
       },
    "status": 
       {
        "responsetype": "6",
        "statuscode": "0",
        "errorcode": "",
        "errordesc": ""
       }
}
{
    "accountid": "test_pos",
    "storeid": "store1",
    "deviceid": "latapydssj5",
    "transactionid": "5367",
    "responsekey": "C93E5C54B01E71BB16C1A8CCEEB2F2F94B96DEB8854C396CD19B7FCB5E9FC1C0",
    "customerid": "106",
    "transactiondate_utc": "30/03/2020 07:11:00",
    "consumer": {
        "firstname": "thirlok",
        "lastname": "shankar",
        "phone": "1234512345",
        "email": "thirlok@lpsmail.com"
       },
    "order": {
        "orderid": "5356",
        "reference": "lpstest123",
        "currency": "AUD",
        "amount": "0.12",
        "purchasesummary": "Ecomm purchase list"
        },
    "billing": {
        "type": "card",
        "card": {
            "name": "aswani",
            "pan": "420000XXXXXX0000",
            "exp": "03/21",
            "token": "0x2a70aa24c86a53f06f057ecbf5acca7ebe383df4"
           },
        "authresponse": {
            "banktransactionno": "7008532746  ",
            "authcode": "",
            "gatewayreference": "75924657"
          }
        },
    "status": {
        "responsetype": "0",
        "statuscode": "2",
        "errorcode": "1001",
        "errordesc": "Authentication failed for Merchant"
    }
}
Reports
Request
API Type Mandatory
Accountid string Required
Storeid string Required
Deviceid string Required
Merchantkey String Required
Startdate String Required
Enddate String Required
Example 1
{
     "accountid":"test_pos",
     "storeid":"store1",
     "deviceid":"latapydssj5",
     "merchantkey":"F71933713E0279B9AFDE5AEF4CB72F71C1A46C386C50248A1F90A931B1907396",
     "startdate":"01/02/2019",
     "enddate":"01/02/2019"
    
}
Response
API Type Mandatory
Accountid string Required
Storeid string Required
Deviceid string Required
Responsekey String Required
Status Status Required
Transaction[] Transaction Required
Example 1
{
    "accountid": "test_pos",
    "storeid": "store1",
    "deviceid": "latapydssj5",
    "responsekey": "958D572150DC06C45384C72A2F0CCACC95800B7EADFC6AA53A7F5C67C4339572",
    "status": {
        "responsetype": "10",
        "statuscode": "0",
        "errorcode": "",
        "errordesc": ""
    },
    "transactions": [
        {
            "transactionid": "3674",
            "amount": "2.00",
            "currency": "AUD",
            "transtype": "1",
            "reference": "lpstest123",
            "transactiondate": "01/02/2019 09:17",
            "pan": "4200000000000000",
            "status": {
                "responsetype": "1",
                "statuscode": "0",
                "errorcode": "",
                "errordesc": ""
            }
        },
        {
            "transactionid": "3673",
            "amount": "2.00",
            "currency": "AUD",
            "transtype": "1",
            "reference": "lpstest123",
            "transactiondate": "01/02/2019 08:00",
            "pan": "",
            "status": {
                "responsetype": "1",
                "statuscode": "0",
                "errorcode": "",
                "errordesc": ""
            }
        },
        {
            "transactionid": "3672",
            "amount": "2.00",
            "currency": "AUD",
            "transtype": "1",
            "reference": "lpstest123",
            "transactiondate": "01/02/2019 07:49",
            "pan": "",
            "status": {
                "responsetype": "1",
                "statuscode": "0",
                "errorcode": "",
                "errordesc": ""
            }
        },
        {
            "transactionid": "3671",
            "amount": "2.00",
            "currency": "AUD",
            "transtype": "1",
            "reference": "lpstest123",
            "transactiondate": "01/02/2019 07:19",
            "pan": "",
            "status": {
                "responsetype": "1",
                "statuscode": "0",
                "errorcode": "",
                "errordesc": ""
            }
        }
    ]
}
Alternate Payment

The Checkout API is part of a unified API request to process authorisations. To use alternate payments as payment mode, indicate the “billing” section with type set to “alt” and “the service code” as shown the sample request.

Request

The payload of Checkout request must contain details of the authentication, customer, order details. For a seamless experience for customer, all purchase details can be included as well. For the full list of parameters, including what is and is not mandatory, refer our API Reference section.

Alternate Payment Request

Alternate Payment URL Parameters


API Type Mandatory
Accountid string Required
Storeid string Required
Deviceid string Required
Merchantkey String Required
Consumer Consumer Required
Order Order Required
Callback_Params Callback param Optional
Billing Billing Required
Notifyurl string Required
Application/json
{
   "accountid": "test_lpsv2",
   "storeid":"ST1",
   "deviceid":" Ter1",
   "merchantkey":"a746ff9621d67a6d1b8d7bb6174fea00",
 } ,
   "consumer": 
{
       "firstname": "thirlok",
       "lastname": "shankar",
       "phone": "1234567890",
        "email": "thirlok@lpsmail.com"
},
   "order":
{
         "orderid":"345",
          "reference": "lpstest123",
         "currency": "USD",
          "amount": "2",
          "purchasesummary": "Ecomm purchase list",
          "purchasedetail": [
           {
             "productid": "1890",
             "productname": "Smart watch",
             "productsku": "shop_dept_item_12434",
             "productdescription": "Android Smart wear design # tyfg45667",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2",
             "priceperunit": "0.5"
            },
           {
             "productid": "1890",
             "productname": "Smart card",
             "productsku": "shop_dept_item_7895",
             "productdescription": "Kingston Smart SD Card # sd43545",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2',
             "priceperunit": "0.5"
            }
       ]
},
    "callback_params":
{
       "param1": "value1",
       "param2": "value2",
       "param3": "value3",
       "param4": "value4",
       "param5": "value5"
},
    "billing":
{
         "type": "alt",
		  "servicecode": "Alipay"	 
},
  "notifyurl": "https://www.notifyurl.aspx"
}
Response

The response to checkout API indicates the status of transaction along with unique transaction and order id’s. In case of asynchronous payments where customer will be completing payments, the status will usually acknowledge as pending and final status notified on callback to URL sent on the notifyurl parameter.

Alternate Payment Response

Alternate Payment URL Parameters


API Type Mandatory
Accountid string Required
Responsekey string Required
Storeid string Required
Deviceid string Required
Consumer Consumer Required
Order Order Required
Callback_Params Callback param Optional
Billing Billing Required
Status Status Required
Notifyurl string Required
Application/json
{
   "accountid": "test_lpsv2",
   "storeid":"ST1",
   "deviceid":" Ter1",
   "transactionid": "39678",
   "customerid":"123",
   "responsekey":"a746ff9621d67a6d1b8d7bb6174fea00",
   "status": 
      {
         "responsetype": "1",
         "statuscode": "2",
         "errorcode": "0",
         "errordesc": ""
      } ,
   "consumer": 
     {
       "firstname": "thirlok",
       "lastname": "shankar",
       "phone": "1234567890",
        "email": "thirlok@lpsmail.com"
     },
   "order":
     {
         "orderid":"345",
          "reference": "lpstest123",
         "currency": "USD",
          "amount": "2",
          "purchasesummary": "Ecomm purchase list",
          "purchasedetail": [
           {
             "productid": "1890",
             "productname": "Smart watch",
             "productsku": "shop_dept_item_12434",
             "productdescription": "Android Smart wear design # tyfg45667",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2",
             "priceperunit": "0.5"
           },
          {
             "productid": "1890",
             "productname": "Smart card",
             "productsku": "shop_dept_item_7895",
             "productdescription": "Kingston Smart SD Card # sd43545",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": "2",
             "priceperunit": "0.5"
           }
        ]
      },
   "callback_params":
      {
       "param1": "value1",
       "param2": "value2",
       "param3": "value3",
       "param4": "value4",
       "param5": "value5"
      },
   "billing":
      {
       "type": "alt",
	   "servicecode": "Alipay"		 
      },
  "notifyurl": "https://www.notifyurl.aspx"
}
Service Code

Latpay API currently supports the following services:

Service Service Code
Alipay QR Alipay
Direct Debit

The Checkout API is part of a unified API request to process authorisations. To use direct debit as payment mode, indicate the “billing” section with type set to “dd” as shown the sample request.

Request

The payload of Checkout request must contain details of the authentication, customer, order details. For a seamless experience for customer, all purchase details can be included as well. For the full list of parameters, including what is and is not mandatory, refer our API Reference section.

Direct Debit Request

Direct Debit URL Parameters


API Type Mandatory
Accountid string Required
storeid string Required
deviceid string Required
merchantkey string Required
consumer Consumer Required
order Order Required
callback_params Callback param Optional
billing Billing Required
notifyurl string Required
Application/json
{
   "accountid": "test_pos",
   "storeid":"store1",
   "deviceid":"latapydssj5",
   "merchantkey":"394DE40765DE5C7CE579CBC29C066AE98ABB56C3E05DD2AC19603F54227ED9CA",
   "consumer": 
{
       "firstname": "thirlok",
       "lastname": "shankar",
       "phone": "1234567890",
        "email": "thirlok@lpsmail.com"
},
    "order":
{
         "reference": "lpstest123",
         "currency": "USD",
          "amount": "0.12",
          "purchasesummary": "Ecomm purchase list",
          "purchasedetail": [
           {
             "productid": "1890",
             "productname": "Smart watch",
             "productsku": "shop_dept_item_12434",
             "productdescription": "Android Smart wear design # tyfg45667",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": 2,
             "priceperunit": 0.5
           },
           {
             "productid": "1891",
             "productname": "Smart card",
             "productsku": "shop_dept_item_7895",
             "productdescription": "Kingston Smart SD Card # sd43545",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": 1,
             "priceperunit": 0.2
            }
        ]
},
    "callback_params":
{
       "param1": "value1",
       "param2": "value2",
       "param3": "value3",
       "param4": "value4",
       "param5": "value5"
},
    "billing":
{
         "type": "dd",
         "directdebit":
			{
				"bsb": "123456",
				"accountnumber": "8766565465",
				"accountname": "My account"
			},
	     "address":
	        {
                "line1": "Southbank House",
                "line2": "",
                "city": "London",
                "state": "",
                "country": "GB",
                "zipcode": "SE1"
             },
          "fees": 
             {
                 "processingfee": "0.25"
             }
},
  "notifyurl": "https://www.notifyurl.aspx"
}
Response

The response to checkout API indicates the status of transaction along with unique transaction and order id’s. In case of asynchronous payments where customer will be completing payments, the status will usually acknowledge as pending and final status notified on callback to URL sent on the notifyurl parameter.

Direct Debit Response

Direct Debit URL Parameters


API Type Mandatory
accountid string Required
storeid string Required
deviceid string Required
transactionid numeric Required
customerid string Required
responsekey string Required
consumer Consumer Required
order Order Required
callback_params Callback param Optional
billing Billing Required
status Status Required
Application/json
{
   "accountid": "test_lpsv2",
   "storeid":"ST1",
   "deviceid":" Ter1",
   "transactionid": "39678",
   "customerid":"123",
   "responsekey":"a746ff9621d67a6d1b8d7bb6174fea00",
    "status": 
      {
         "responsetype": "2",
         "statuscode": "2",
         "errorcode": "0",
         "errordesc": ""
     } ,
   "consumer": 
     {
       "firstname": "thirlok",
       "lastname": "shankar",
       "phone": "1234567890",
        "email": "thirlok@lpsmail.com"
     },
  "order":
     {
         "orderid":"345",
          "reference": "lpstest123",
         "currency": "USD",
          "amount": 2,
          "purchasesummary": "Ecomm purchase list",
          "purchasedetail": [
           {
             "productid": "1890",
             "productname": "Smart watch",
             "productsku": "shop_dept_item_12434",
             "productdescription": "Android Smart wear design # tyfg45667",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": 2,
             "priceperunit": 0.5
           },
           {
             "productid": "1890",
             "productname": "Smart card",
             "productsku": "shop_dept_item_7895",
             "productdescription": "Kingston Smart SD Card # sd43545",
             "productcategory": "Electronics",
             "productURL": "http://lateralpaymentsolutions.com",
             "quantity": 2,
             "priceperunit": 0.5
           }
         ]
      },
    "callback_params":
      {
       "param1": "value1",
       "param2": "value2",
       "param3": "value3",
       "param4": "value4",
       "param5": "value5"
       },
    "billing":
       {
         "type": "dd",
         "directdebit":
		    {
				"bsb": "123456",
				"accountnumber": "876*****65",
				"accountname": "My account"
			},
		 "address": 
		    {
               "line1": "Southbank House",
               "line2": "",
               "city": "London",
               "state": "",
               "country": "GB",
               "zipcode": "SE1"
            },
         "fees":  
           {
              "processingfee": "0.25"
           }
					
         }
  
}
Process Notification
API Type Mandatory
accountid string Required
storeid string Required
deviceid string Required
transactionid numeric Required
responsekey string Required
customerid string Required
transactiondate_utc string Required
Consumer Consumer Required
Order Order Required
billing Billing Required
Status Status Required
Example 1
{
    "accountid":"test_lpsv2",
    "storeid":"ST1",
    "deviceid":"Ter1",
    "transactionid":"39678",
    "responsekey":"a746ff9621d67a6d1b8d7bb6174fea00",
    "customerid":"123",
    "transactiondate_utc":"07/04/2020 00:40:00",
    "consumer":
        {
          "firstname":"thirlok",
          "lastname":"shankar",
          "phone":"1234567890",
          "email":"thirlok@lpsmail.com"
            
        },
    "order":
        {
            "orderid":"345",
            "reference":"lpstest123",
            "currency":"AUD",
            "amount":"0.01",
            "purchasesummary":"Ecomm purchase list"
            
        },
    "billing":
        {
            "type":"dd",
            "directdebit":
               {
                   "bsb":"650000",
                   "accountnumber":"111111",
                   "accountname":"My account"
                   
                },
            "authresponse":
               { 
                   "banktransactionno":"",
                   "authcode":"",
                   "gatewayreference":"123"
                   
               }
            
          },
        "status":
            {
                "responsetype":"4",
                "statuscode":"0",
                "errorcode":"",
                "errordesc":""
                
            }
    
}
Returns
Returns Notification
API Type Mandatory
accountid string Required
storeid string Required
deviceid string Required
transactionid numeric Required
responsekey string Required
customerid string Required
transactiondate_utc string Required
consumer Consumer Required
order Order Required
billing Billing Required
status Status Required
Example 1
{
    "accountid":"test_lpsv2",
    "storeid":"ST1",
    "deviceid":"Ter1",
    "transactionid":"39678",
    "responsekey":"a746ff9621d67a6d1b8d7bb6174fea00",
    "customerid":"123",
    "transactiondate_utc":"07/04/2020 00:40:00",
    "consumer":
        {
            "firstname":"thirlok",
            "lastname":"shankar",
            "phone":"1234567890",
            "email":"thirlok@lpsmail.com"
            
        },
    "order":
       {
           "orderid":"345",
           "reference":"lpstest123",
           "currency":"AUD",
           "amount":"0.01",
           "purchasesummary":"Ecomm purchase list"
           
       },
    "billing":
        {
            "type":"dd",
            "directdebit":
                 {
                     "bsb":"032053",
                     "accountnumber":"111114",
                     "accountname":"My account"
                     
                 },
            "authresponse":
                {
                    "banktransactionno":"",
                    "authcode":"",
                    "gatewayreference":"123"
                    
                }
            
        },
    "status":
       {
           "responsetype":"11",
           "statuscode":"1",
           "errorcode":"5056",
           "errordesc":"Refer to Customer"
           
        }
    
}
Status Check

Status Check API call offers the ability to query the status of transaction in realtime. This API can be used for querying of transaction status in case if no response back for the original authorisation request. It can also be used to verify transaction status as an additional check from server, if in case the authorisation was initiated from a client side application.

Request
Field Type Mandatory
accountid string Required
storeid string Required
deviceid string Required
merchantkey** string Required
transactionid string Conditional
order Order Required
billing Billing Required

** Refer the “merchantkey” construction details in Authentication section

Example 1
{
"accountid": "test_pos",
"storeid": "store1",
"deviceid": "latapydssj5",
"merchantkey": "127bb857ce2302012068afdb35f336d680de2d36ebf8c9f00d13b5a5542f8293",
"transactionid":"5800",
"order":
{
"reference": "HubTest123@25052020_12311",
"currency": "AUD",
"amount": "0.12",
"purchasesummary": "x"
},
"billing":
{
"type": "dd"
}
}
Response
Field Type Mandatory
accountid string Required
storeid string Required
deviceid string Required
transactionid string Required
responsekey** string Required
customerid string Required
transactiondate_utc string Required
consumer Consumer Required
order Order Required
billing Billing Required
status Status Required

** Refer the “responsekey” details in Authentication section

Example 1
{
    "accountid": "test_pos",
    "storeid": "store1",
    "deviceid": "latapydssj5",
    "transactionid": "5800",
    "responsekey": "19518330367F2BD6B92025A528C6EDEFB7BF379943FAC12AD369694CAE29EC60",
    "customerid": "2",
    "transactiondate_utc": "25/05/2020 13:11",
    "consumer": {
        "firstname": "thirlok",
        "lastname": "shankar",
        "phone": "1234567890",
        "email": "thirlok@lpsmail.com"
    },
    "order": {
        "orderid": "5789",
        "reference": "HubTest123@25052020_12311",
        "currency": "AUD",
        "amount": "0.12",
        "purchasesummary": "x"
    },
    "billing": {
        "type": "dd",
        "directdebit": {
            "bsb": "650-000",
            "accountnumber": "111XXXX111",
            "accountname": "Thirlok shankar"
        },
        "fees": {
            "processingfee": "0.25"
        },
        "authresponse": {
            "banktransactionno": "LATPAYDD0000000892",
            "authcode": "",
            "gatewayreference": "892"
        }
    },
    "status": {
        "responsetype": "6",
        "statuscode": "0",
        "errorcode": "",
        "errordesc": ""
    }
}
Reversal

Merchants can post a request to the unified gateway to refund/reversal a previously successfully authorized transaction. When a request is submitted, the gateway performs a series of checks and then responds back to the merchant. Refunds/Reversal are checked by LPS staff before they are sent to the bank.

Card
Request

The payload of reversal must contain details of the original checkout request. For the full list of parameters, refer our API Reference section.

Reversal Request

Reversal URL Parameters


API Type Mandatory
accountid string Required
storeid string Required
deviceid string Required
merchantkey** string Required
transactionid string Conditional
amount money Required
currency string Required
reference string Required
reversaldetails Reversal Details Required
transtype*** string Required

** Refer the “merchantkey” construction details in Authentication section

*** Refer below table for reversal transaction types to be sent in request

Reversal can be used for transaction which has been authorised successfully. It can also be used for transactions for which no response has been received, in that case transactionid can be omittied. In this scenario, if the transaction was successful , then the reversal will be attempted. If the transaction was not successful, then the reversal will fail.

Application/json
Sample:
  {
      "accountid": "test_pos",
      "storeid": "store1",
      "deviceid": "latapydssj5",
      "merchantkey": "6cfd95f50c322eba55858d9ae16cedf86b4d5acada6bfd9a27ade7c26fb393db",
      "transactionid": "5175",
      "amount": "0.12",
      "currency": "AUD",
      "reference": "lpstest123",
      "reversaldetails": 
        {
         "type": "standard",
         "reason": "Customer doesnt want the service - so requesting reversal"
         }
         "transtype": "3"
   }
Reversal Type
Type Description
standard Reversal type to send when processing refunds/voids for general business process
fraud Reversal type to send when processing refunds/voids for suspicious fraud transactions
Reversal Transaction Types
Code Type
2 Refund
3 Void
Response

The response to reversal API indicates the status of transaction whether it was successfully reversed and also will contain unique transaction and order id’s.

Reversal Respose

Reversal URL Parameters

API Type Mandatory
accountid string Required
storeid string Required
deviceid string Required
transactionid numeric Required
status Status Required
reversaldetails Reversal Details Required
responsekey** string Required
transtype string Required

** Refer the “responsekey” details in Authentication section

Application/json
Sample:
{
    "accountid":"test_pos",
    "storeid":"store1",
    "deviceid":"latapydssj5",
    "transactionid":"6602",
    "status":
       {
           "responsetype":"1",
           "statuscode":"0",
           "errorcode":"",
           "errordesc":""
       },
     "reversaldetails":
        {
            "type":"standard",
            "reason":"Customer doesnt want the service - so requesting reversal"
         },
      "responsekey":"958D572150DC06C45384C72A2F0CCACC95800B7EADFC6AA53A7F5C67C4339572",
      "transtype":"3"
    
}
Authentication

Each API call will need to be authenticated by way of a merchantid issued by LatPay along with a key, which will be a SHA-256 hash of a set of post fields along with a predefined secret agreed between merchant & Latpay at the time of account setup.

Checkout Request

In case of Checkout request, the authentication key is “merchantkey” which is a SHA2 hash of the following parameters.

Name Description
Amount Purchase amount – 2 decimal places
Currency The 3 digit ISO currency code
deviceid a unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (Provided on account setup)
TerminalSecret (Secret passphrase provided by merchant to Latpay during account setup)

Sample:

Name Description
Amount 1.00
Currency USD
deviceid ST1
TerminalSecret bK5NDRFgLv3
SHA-256 Hash Value 025a7953b87b3677bb058222abb3482933e8d66dfe6206d26720e64646402bed
Checkout Response

In case of Checkout response, the authentication key is “responsekey” which is a SHA2 hash of the following parameters.

Name Description
Amount Purchase amount – 2 decimal places
Currency The 3 digit ISO currency code
deviceid a unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (Provided on account setup)
ResponseSecret (Secret passphrase provided by Latpay to merchant during account release)

Sample:

Name Description
Amount 1.00
Currency USD
deviceid ST1
TerminalSecret bK5NDRFgLv3
SHA-256 Hash Value 025a7953b87b3677bb058222abb3482933e8d66dfe6206d26720e64646402bed
Reversal Request

In case of Reversal request, the authentication key is “merchantkey” which is a SHA-256 hash of the following parameters.

When transactionid Posted

Name Description
transactionid Unique id provided by Latpay
amount Purchase amount – 2 decimal places
currency The 3 digit ISO currency code
deviceid A unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (Provided on account setup)
TerminalSecret Secret passphrase provided by merchant to Latpay during account setup

When transactionid Omitted

Name Description
amount Purchase amount – 2 decimal places
currency The 3 digit ISO currency code
deviceid A unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (Provided on account setup)
TerminalSecret Secret passphrase provided by merchant to Latpay during account setup
Reversal Response

Responsekey which is a SHA2 hash of the following parameters:

Name Description
accountid merchant account provided by Latpay
storeid unique id for each store (provided on account setup)
deviceid a unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (provided on account setup)
Responsesecret secret passphrase provided by Latpay to merchant during account setup
Status Check Request

In case of Status check request, the authentication key is “merchantkey” which is a SHA-256 hash of the following parameters.

When transactionid Posted

Name Description
transactionid Unique id provided by Latpay
amount Purchase amount – 2 decimal places
currency The 3 digit ISO currency code
deviceid A unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (Provided on account setup)
TerminalSecret Secret passphrase provided by merchant to Latpay during account setup

When transactionid Omitted

Name Description
amount Purchase amount – 2 decimal places
currency The 3 digit ISO currency code
deviceid A unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (Provided on account setup)
TerminalSecret Secret passphrase provided by merchant to Latpay during account setup
Status Check Response

Responsekey which is a SHA2 hash of the following parameters:

Name Description
accountid merchant account provided by Latpay
storeid unique id for each store (provided on account setup)
deviceid a unique number assigned and linked to a specific point-of-sale (POS) terminal or workstation (provided on account setup)
Responsesecret secret passphrase provided by Latpay to merchant during account setup
Notification

All Latpay API requests, on completion, will also generate a callback to merchant server to indicate the status of transaction in addition to the response. The status of the transaction will be received in “notifyurl” which will be given in checkout api call. The response fields sent in notification will be identifical to those of API response fields.

Response Codes
Transaction Types

Transtype:

Code Type
1 Auth
2 Refund
3 Void
Response Types
Value Description
0 LPS / Prescreen response
1 Bank / Service response
2 Pending / Intermediate / 3d Enrolled Response
3 Redirection Response
4 Notification Response
5 Auth Request Response
6 Statuscheck
7 ManageSCSS
8 Acknowledgement
9 Checkout
10 Reports
11 Returns
Status Codes
Value Description
0 Approved
1 Declined / Rejected
2 Pending
Error Codes
Code Description Reason
90 Communication Failure Communication Failure, Unknown error
1001 Authentication failed for Merchant Wrong id, password or IP supplied
1002 Merchant account inactive Merchant account inactive
9000 Unexpected error Incorrect data types, unknown error
9001 Missing required field Mandatory field(s) missing
9004 Bank gateway not enabled Bank gateway not enabled
CARD
1004 Customer has exceeded allowed transactions number for 24 hours Velocity control on purchases per day reached
1005 Purchase amount check *** Repeated amounts being purchased
1006 Invalid credit card number Incorrect digit length for card type
1007 Invalid credit card expiry details. Card expiry invalid
1008 Luhn’s modulus check failed. CC number is invalid for card type
1009 PO Box error *** Bill address contains a PO Box address
1010 Failed Country lookup Bill country is on a negative country list
1011 Failed IP lookup Customer IP is on a negative IP list
1012 Failed BIN lookup Card BIN is on a negative list
1013 Customer card no. exceeded bank rejection limit Card rejection limit reached
1014 Customer blocked Customer is temporarily blocked pending investigation
1015 Minimum purchase check Purchase amount is below a specified level
1016 Failed IP check. *** Customer IP not in allowed list of IPs’.
1020 MOTO block MOTO not enabled.
1021 Recurring block Recurring not enabled.
9002 Mastercard transactions blocked *** MasterCard not enabled.
9003 Currency Block*** Currency NOT enabled.
BATCH
2001 Invalid Batch Details Invalid BatchId or batch reference
2002 Duplicate Request Duplicate Request
2003 Batch still in pending / Inprogress Batch still in pending / Inprogress
2004 Max transaction limit exceeded Transaction amount exceeds the Per Transaction Limit
REFUND
4001 Merchant login details incorrect
4003 LPS transaction id is invalid / not found
4004 Transaction has already been canceled / fully refunded
4008 Transaction cannot be canceled, past cutoff period
4005 Refund amount is not equal to transaction amount
4014 Refund currency is not equal to transaction curency
DD
5011 Merchant Account inactive
5012 Missing Account Configuration
5013 Invalid BSB Account
5021 Merchant Reference already exists
RETURNS
5051 Invalid BSB Number Invalid BSB Number
5052 Payment Stopped Payment Stopped
5053 Account Closed Account Closed
5054 Customer deceased Customer deceased
5055 No acc/incorrect acc Number No acc/incorrect acc Number
5056 Refer to Customer Refer to Customer
5057 Deleted Deleted
5058 Invalid User ID Number Invalid User ID Number
5059 Technically Invalid Technically Invalid
STATUSCHECK
6003 Transaction not found
API Reference
Address

Address

Name Type Length
line1 string 100
line2 string 100
city string 20
state string 3
country string 2
zipcode string 6
string
Transaction
Field Type length
transactionid numeric
consumer Consumer
billing Billing
order Order
status Status
Object
Billing

Checkout Request Billing Parameters

Name Type Length
type string 10
servicecode string 10
card Card
address Address
fees Fees
authresponse Auth Response
direct debit Directdebit
Object
Card

Card

Name Type Length
name string 100
pan string 30
exp string 20
cvc string 3
token string 50
Object
Callback param

CallbackParams Parameters

Name Type Length
param1 string 200
param2 string 200
param3 string 200
param4 string 200
param5 string 200
Object
Checkout
Name Type Length
accountid string 50
storeid string 50
deviceid string 50
merchantkey string 100
responsekey String 100
consumer Consumer
billing Billing
order Order
callbackparams Callback param
status Status
notifyurl String URL 255
Object
Consumer

Consumer Details

Name Type Length
firstname string 200
lastname string 200
phone string 200
email string 200
Object
Directdebit

Directdebit

Name Type Length
bsb numeric 07
accountnumber numeric 09
accountname numeric 32
Object
Order

Order Parameters

Name Type Length
orderid string 30
reference string 200
currency string 3
amount string 5
purchasesummary string 200
purchasedetail
productid numeric
productname string 200
productsku string 200
productdescription string 200
productcategory string 200
productURL string 200
quantity numeric
priceperunit money
Object
Reversal Details
Name Type Length
type string 15
reason string 200
Object
Reversal
Name Type Length
accountid string 50
storeid string 50
deviceid string 50
transactionid string 10
merchantkey string 100
responsekey string 100
amount money
currency string 3
reference numeric 200
transtype numeric 1
status Status
reversaldetails Reversal Details
Object
Status

Status

Name Type Length
response type numeric 10
statuscode numeric 10
messagecode numeric 10
errorcode numeric 10
errordesc string 200
Object
Fees
Name Type Length
processingfee String 5
Object
Auth Response
Name Type Length
banktransactionno string 50
authcode string 10
gatewayreference string 100
Object