Query

Bambora allows you to query the status of a transaction at any time, this API call is useful if the initial transaction request times out and you are unaware of the transaction status. The query transaction will return all transaction results that match the data submitted in the transaction elements.

SOAP Method: QueryTransaction

POSThttps://demo.bambora.co.nz/interface/api/dts.asmx

Example 1 - Query a single payment

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:dts="http://www.ippayments.com.au/interface/api/dts">
<soapenv:Header/>
<soapenv:Body>
<dts:QueryTransaction>
<dts:queryXML>
<![CDATA[
	<QueryTransaction>
      		<Criteria>
            		<AccountNumber>your_accountnumber</AccountNumber>
            		<TrnStartTimestamp>2017-06-23 00:00:00</TrnStartTimestamp>
            		<TrnEndTimestamp>2017-06-24 23:59:59</TrnEndTimestamp>
            		<CustNumber>your_custnumber</CustNumber>
            		<CustRef>your_custref</CustRef>
            		<Amount>1000</Amount>    
     		</Criteria>
     		<Security>
            		<UserName>your_api_username</UserName>
            		<Password>your_api_password</Password>
     		</Security> 
</QueryTransaction>	
]]>    
</dts:queryXML>
</dts:QueryTransaction>
</soapenv:Body>
</soapenv:Envelope>

Example 2 - Query a single payment with additional data

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:dts="http://www.ippayments.com.au/interface/api/dts">
<soapenv:Header/>
<soapenv:Body>
<dts:QueryTransaction>
<dts:queryXML>
<![CDATA[
	<QueryTransaction>
      		<Criteria>
            		<AccountNumber>your_accountnumber</AccountNumber>
            		<TrnStartTimestamp>2017-06-23 00:00:00</TrnStartTimestamp>
            		<TrnEndTimestamp>2017-06-24 23:59:59</TrnEndTimestamp>
            		<CustNumber>your_custnumber</CustNumber>
            		<CustRef>your_custref</CustRef>
            		<Amount>1000</Amount>    
     		</Criteria>
		<AdditionalData>
	     		<Core>Amount</Core>
	    		<Core>CustRef</Core>
	     		<Core>CustNumber</Core>
             		<Core>TrnTypeID</Core>
             		<Core>TrnStatusID</Core>
      		</AdditionalData>
     		<Security>
            		<UserName>your_api_username</UserName>
            		<Password>your_api_password</Password>
     		</Security> 
</QueryTransaction>	
]]>    
</dts:queryXML>
</dts:QueryTransaction>
</soapenv:Body>
</soapenv:Envelope>

REQUEST BODY SCHEMA

The list below provides an overview of the available transaction elements that should be submitted in the XML request.

Please be aware to be compliant with PCI rules. We encourage validating data sent in the marked fields (*) for PCI compliance, before submitting the request to Bambora.

ParameterFormatMANDATORY
/OPTIONAL
Description
AccountNumberAlpha/Num(16)MThis value dictates which account the transaction will be processed through.
TrnStartTimestampAlpha/Num(19)MThe start date/time for the transaction search. Format yyyy-MMM-dd HH:MM:SS
TrnEndTimestampAlpha/Num(19)MThe end date/time for the transaction search. Format yyyy-MMM-dd HH:MM:SS
CustNumber *Alpha/Num(64)OAn additional reference for the transaction sent by you for reporting purposes.
CustRef *Alpha/Num(64)OA reference for the transaction sent by you for reporting purposes.
Amount Numeric(10)O Amount entered in cent value e.g. $55.00 = 5500
Receipt Numeric(10)OSearch for a specific transaction in the time frame via a previously provided receipt number.
TrnTypeNumeric(1)OThe transaction type.
CardNumberPrefixNumeric(4)OFirst four digits of credit card number.
CardNumberSuffixNumeric(3)OLast three digits of credit card number.
ExpMNumeric(2)OExpiry month of customer credit card.
ExpYNumeric(4)OExpiry year of customer credit card.
CardHolderName *Alpha/Num(64)OName as it appears on credit card.
AccNoNumeric(16)OAU Bank account number.
For NZ bank details: The NZ Bank Account and Suffix should be included in this field with hyphen. For example, 0111110-00
AccRoutingNumeric(16)OAccount routing number (BSB in Australia).
For NZ bank details: The NZ Bank and Branch codes should be included in this field with with hyphen. For example, 03-0105
AdditionalDataN/AOThis is an XML node only. Additional fields only required if you wish to receive the elements back.
AdditionalData/
Core
N/AOThis is an XML node only. Additional fields only required if you wish to receive the elements back.
AdditionalData/
Core/
Amount
Alpha(6)OAmount passed in the query request.
AdditionalData/
Core/
CustRef
Alpha(7)OAdditional transactional reference passed in the query request.
AdditionalData/
Core/
CustNumber *
Alpha(10)OMerchant assigned unique customer number passed in the query request.
AdditionalData/
Core/
TrnTypeID
Alpha(9)OTrnTypeID associated to the found transaction.
AdditionalData/
Core/
TrnStatusID
Alpha(11)OTrnStatusID associated to the found transaction.
Security/UsernameAlpha/Num(32)MAPI Username
Security/PasswordAlpha/Num(16)MAPI Password

RESPONSE

Example 1 - Query response

<QueryResponseMatchingCount="2" MatchingReturned="2" Error="0">
<Response>
    <ResponseCode>0</ResponseCode>
    <Timestamp>23-Feb-2017 16:06:41</Timestamp>
    <Receipt>90891389</Receipt>
    <SettlementDate>23-Feb-2017</SettlementDate>
    <DeclinedCode></DeclinedCode>
    <DeclinedMessage></DeclinedMessage>
</Response>
<Response>
    <ResponseCode>0</ResponseCode>
    <Timestamp>28-Feb-2017 16:06:41</Timestamp>
    <Receipt>90890123</Receipt>
    <SettlementDate>28-Feb-2017</SettlementDate>
    <DeclinedCode></DeclinedCode>
    <DeclinedMessage></DeclinedMessage>
</Response>
</QueryResponse>

Example 2 - Query response with AdditionalData

<QueryResponseMatchingCount="2" MatchingReturned="2" Error="0">
<Response>
    <ResponseCode>0</ResponseCode>
    <Timestamp>23-Feb-2017 16:06:41</Timestamp>
    <Receipt>90891389</Receipt>
    <SettlementDate>23-Feb-2017</SettlementDate>
    <DeclinedCode></DeclinedCode>
    <DeclinedMessage></DeclinedMessage>
    <Amount>1000</Amount>
    <CustNumber>12345678</CustNumber>
    <CustRef>123456</CustRef>
    <TrnTypeID>48</TrnTypeID>
    <TrnStatusID>1</TrnStatusID>
</Response>
<Response>
    <ResponseCode>0</ResponseCode>
    <Timestamp>28-Feb-2017 16:06:41</Timestamp>
    <Receipt>90891389</Receipt>
    <SettlementDate>28-Feb-2017</SettlementDate>
    <DeclinedCode></DeclinedCode>
    <DeclinedMessage></DeclinedMessage>
    <Amount>1000</Amount>
    <CustNumber>12345678</CustNumber>
    <CustRef>123456</CustRef>
    <TrnTypeID>48</TrnTypeID>
    <TrnStatusID>1</TrnStatusID>
</Response>
</QueryResponse>

RESPONSE BODY SCHEMA

The following list provides an overview of available response elements.

ParameterFormatDescription
QueryResponseN/AThis node has three attributes:

‘MatchingCount’ - the number of active payment schedules found. This count will determine how many ‘QueryResponse/Response’ elements there are – one for each returned transaction.

‘MatchingReturned’ – This is the number of matches actually returned – with a maximum of 1000.

‘Error’ – will contain one of the following values:
1 - Invalid username/password
2 - Invalid Account Number
3 - Invalid Cust Number
99 - Exception encountered

Please note that issues with dates will return an exception ‘99’.
ResponseCodeNumericResponse code of the submitted request.

0 = Approved
1 = Not Approved
TimestampAlpha/NumTimestamp is the date and time that Bambora has received the transaction request. The format is dd-MMM-yyyy hh:mm:ss
ReceiptAlpha/NumReceipt number of the submitted payment.
SettlementDateAlpha/NumThe settlement date of the submitted payment returned in the following format DD-MM-YYYY
DeclinedCodeAlpha/NumThis field is blank if the submitted payment is approved, otherwise, declined code is populated.
DeclinedMessageAlpha/NumThis field is black if the submitted payment is approved, otherwise, declined message is populated.
AmountNumericAdditional fields only returned if you have.
Amount passed in the Single Query Request.
CustRefAlpha/NumAdditional fields only returned if you have.
Additional transactional reference passed the Single Query Request.
CustNumberAlpha/NumAdditional fields only returned if you have.
Unique customer number passed in the Single Query Request.
TrnTypeIDNumericAdditional fields only returned if you have.
TrnTypeID associated to the found transaction.
TrnStatusIDNumericAdditional fields only returned if you have.
TrnStatusID associated to the found transaction.