GETDailyTransaction API

The GETDailyTransactions web service is used to obtain a list of all transactions for a merchant on a particular date, this is presented in a JSON format. Whereas, the GETDailyTransactionsCSV web service obtains a list of all transactions on a particular date in a CSV format. These are normally used for reconciliation purposes and can be called at any time.

GETDailyTransaction/GETDailyTransactionCSV Request

The common request parameters used for the API call are:

Name Type & Length Examples
Date ISO 8601 Date/Time as a string of format YYYY-MM-DDTHH:mm:SS+HH 2023-06-30T19:45:00+11
StatusCodes Comma separated list of status codes to filter by. Specifying nothing will return all transactions Completed,Initiated,Failed

To formulate a GETDailyTransactions / GETDailyTransactionsCSV call, you must append date to the query string like so:

 //Retrieves all the transactions for the day
https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactions?date=2023-02-26
https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactionsCSV?date=2023-02-26

Merchants can optionally specify statuscodes to narrow the report

//Merchants interested in Completed Transactions
https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactions?date=2023-01-01&statuscodes=Completed
https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactionsCSV?date=2023-01-01&statuscodes=Completed
//Merchants interested in Completed and ReceiptUnverified Transactions
https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactions?date=2023-02-26&statuscodes=Completed,ReceiptUnverified
https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactionsCSV?date=2023-02-26&statuscodes=Completed,ReceiptUnverified

You can specify a time range with use of the endDate parameter only for the GETDailyTransactions call :

//all transactions between 5:45PM on 01/01/01, and 8PM on 01/01/23.
https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactions?date=2023-01-01T17:45:00&endDate=2023-01-01T20:00:00

GETDailyTransaction Response

Name Description Data Type JSON Data Type Possible Values
AmountPaid The actual amount paid for the transaction Decimal.Value upto 2 decimal places. Number 12.24
BankReceiptNo The internet banking receipt number provided from the internet banking receipt page String String
CurrencyCode The currency of the transaction String String Possible values are aligned with ISO Standard ISO 4217
EndDateTime The date and time the transaction was completed Datetime String
EstablishedDateTime The date and time of the POLi server when the InitiateTransaction request was received Datetime String
FinancialInstitutionCode The code of the Financial Institution the payment was made from String String
FinancialInstitutionName The name of the Financial Institution the payment was made from String String
MerchantCode Merchant code provided to you by POLi String String
MerchantCommonName The merchant common name String String
MerchantData The merchant data that was passed in the InitiateTransaction request for round trip purposes String String
MerchantReference The merchant reference passed in the InitiateTransaction request String String
PaymentAmount The amount of the transaction Decimal.Value upto 2 decimal places. Number
TransactionRefNo The POLi ID associated with the transaction String String A unique 12 digit reference to a POLi transaction
TransactionStatusCode A status code that indicates the outcome of the transaction String String

GETDailyTransactions Example

PHP

$token = $_POST["Token"];
if(is_null($token)) {
    $token = $_GET["token"];
}

 $auth = base64_encode("SS64xxxxx:AuthCode12345"); //ADD YOUR CREDENTIALS
 $header = array();
 $header[] = 'Authorization: Basic '.$auth;
 $date = "14/08/2023";

 $ch = curl_init("https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactions?date=".$date);
 //See the cURL documentation for more information: http://curl.haxx.se/docs/sslcerts.html
 //We recommend using this bundle: https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt
 curl_setopt( $ch, CURLOPT_CAINFO, "ca-bundle.crt");
 curl_setopt( $ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
 curl_setopt( $ch, CURLOPT_HTTPHEADER, $header);
 curl_setopt( $ch, CURLOPT_HEADER, 0);
 curl_setopt( $ch, CURLOPT_POST, 1);
 curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_builder);
 curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0);
 curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
 $response = curl_exec( $ch );
 curl_close ($ch);

 $json = json_decode($response, true);

 print_r($json);

C# Sharp

var auth = 
System.Convert.ToBase64String
(System.Text.Encoding.UTF8.GetBytes('S61xxxxx:AuthCode12345'));

var myRequest = 
System.Net.WebRequest.Create
("https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactions?date=01-01-2001");
myRequest.Method = "GET";
myRequest.Headers.Add("Authorization", "Basic "+auth);

var response = (System.Net.HttpWebResponse)myRequest.GetResponse();
var data = response.GetResponseStream();
var streamRead = new StreamReader(data);
Char[] readBuff = new Char[response.ContentLength];
int count = streamRead.Read(readBuff, 0, (int)response.ContentLength);
while (count > 0)
{
    var outputData = new String(readBuff, 0, count);
    Console.Write(outputData);
    count = streamRead.Read(readBuff, 0, (int)response.ContentLength);
    dynamic latest = JsonConvert.DeserializeObject(outputData);
}
response.Close();
data.Close();
streamRead.Close();

PHP for CSV

$token = $_POST["Token"];
if(is_null($token)) {
    $token = $_GET["token"];
}

 $auth = base64_encode("SS64xxxxx:AuthCode12345"); //ADD YOUR CREDENTIALS
 $header = array();
 $header[] = 'Authorization: Basic '.$auth;
 $date = "14/08/2014";

 $ch = curl_init("https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactionsCSV?date=".$date);
 //See the cURL documentation for more information: http://curl.haxx.se/docs/sslcerts.html
 //We recommend using this bundle: https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt
 curl_setopt( $ch, CURLOPT_CAINFO, "ca-bundle.crt");
 curl_setopt( $ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
 curl_setopt( $ch, CURLOPT_HTTPHEADER, $header);
 curl_setopt( $ch, CURLOPT_HEADER, 0);
 curl_setopt( $ch, CURLOPT_POST, 1);
 curl_setopt( $ch, CURLOPT_POSTFIELDS, $json_builder);
 curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0);
 curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
 $response = curl_exec( $ch );
 curl_close ($ch);

 $json = json_decode($response, true);

 print_r($json);

C Sharp for CSV

var auth = 
System.Convert.ToBase64String
(System.Text.Encoding.UTF8.GetBytes("SS64xxxxx:AuthCode12345"); //ADD YOUR CREDENTIALS

var myRequest = 
System.Net.WebRequest.Create
("https://poliapi.apac.paywithpoli.com/api/v2/Transaction/GetDailyTransactionsCSV?date=01-01-2001");
myRequest.Method = "GET";
myRequest.Headers.Add("Authorization", "Basic "+auth);

var response = (System.Net.HttpWebResponse)myRequest.GetResponse();
var data = response.GetResponseStream();
var streamRead = new StreamReader(data);
Char[] readBuff = new Char[response.ContentLength];
int count = streamRead.Read(readBuff, 0, (int)response.ContentLength);
while (count > 0)
{
    var outputData = new String(readBuff, 0, count);
    Console.Write(outputData);
    count = streamRead.Read(readBuff, 0, (int)response.ContentLength);
    dynamic latest = JsonConvert.DeserializeObject(outputData);
}
response.Close();
data.Close();
streamRead.Close();

GETDailyTransactions Response Example

JSON

    {
        "AmountPaid": 0.0,
        "BankReceiptNo": null,
        "CurrencyCode": "NZD",
        "EndDateTime": "2023-09-26T09:30:32.107",
        "EstablishedDateTime": "2023-09-26T09:03:41.413",
        "FinancialInstitutionCode": null,
        "FinancialInstitutionName": null,
        "MerchantCode": "SS64xxxxx",
        "MerchantCommonName": "Your Company Name",
        "MerchantReference": "",
        "MerchantData": "",
        "PaymentAmount": 20.0,
        "TransactionRefNo": "996537748727",
        "TransactionStatusCode": "TimedOut",
        "CurrencyName": "New Zealand Dollar",
        "CustomerReference": null,
        "PayerAcctNumber": null,
        "PayerAcctSortCode": null,
        "PayerAcctSuffix": "",
        "TransactionStatus": "TimedOut"
    }

CSV

AmountPaid,BankReceiptNo,CurrencyCode,EndDateTime,EstablishedDateTime,FinancialInstitutionCode,FinancialInstitutionName,MerchantCode,MerchantCommonName,MerchantReference,PaymentAmount,TransactionReference,TransactionStatusCode,MerchantData
0,,NZD,2023-09-27T06:48:17,2023-09-27T06:47:42,iBankNZ01,iBank NZ 01,SS64xxxxx,Your Company Name,,1,996537775065,Failed,
1,"a8PKFrQnwl6LCq",NZD,2023-09-27T06:31:37,2023-09-27T06:31:16,iBankNZ01,iBank NZ 01,SS64xxxxx,Your Company Name,123,1,996537774733,Completed,