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.
Parameter | Format | MANDATORY /OPTIONAL | Description |
---|---|---|---|
AccountNumber | Alpha/Num(16) | M | This value dictates which account the transaction will be processed through. |
TrnStartTimestamp | Alpha/Num(19) | M | The start date/time for the transaction search. Format yyyy-MMM-dd HH:MM:SS |
TrnEndTimestamp | Alpha/Num(19) | M | The end date/time for the transaction search. Format yyyy-MMM-dd HH:MM:SS |
CustNumber * | Alpha/Num(64) | O | An additional reference for the transaction sent by you for reporting purposes. |
CustRef * | Alpha/Num(64) | O | A 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) | O | Search for a specific transaction in the time frame via a previously provided receipt number. |
TrnType | Numeric(1) | O | The transaction type. |
CardNumberPrefix | Numeric(4) | O | First four digits of credit card number. |
CardNumberSuffix | Numeric(3) | O | Last three digits of credit card number. |
ExpM | Numeric(2) | O | Expiry month of customer credit card. |
ExpY | Numeric(4) | O | Expiry year of customer credit card. |
CardHolderName * | Alpha/Num(64) | O | Name as it appears on credit card. |
AccNo | Numeric(16) | O | AU 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 |
AccRouting | Numeric(16) | O | Account 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 |
AdditionalData | N/A | O | This is an XML node only. Additional fields only required if you wish to receive the elements back. |
AdditionalData/ Core | N/A | O | This is an XML node only. Additional fields only required if you wish to receive the elements back. |
AdditionalData/ Core/ Amount | Alpha(6) | O | Amount passed in the query request. |
AdditionalData/ Core/ CustRef | Alpha(7) | O | Additional transactional reference passed in the query request. |
AdditionalData/ Core/ CustNumber * | Alpha(10) | O | Merchant assigned unique customer number passed in the query request. |
AdditionalData/ Core/ TrnTypeID | Alpha(9) | O | TrnTypeID associated to the found transaction. |
AdditionalData/ Core/ TrnStatusID | Alpha(11) | O | TrnStatusID associated to the found transaction. |
Security/Username | Alpha/Num(32) | M | API Username |
Security/Password | Alpha/Num(16) | M | API 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.
Parameter | Format | Description |
---|---|---|
QueryResponse | N/A | This 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’. |
ResponseCode | Numeric | Response code of the submitted request. 0 = Approved 1 = Not Approved |
Timestamp | Alpha/Num | Timestamp is the date and time that Bambora has received the transaction request. The format is dd-MMM-yyyy hh:mm:ss |
Receipt | Alpha/Num | Receipt number of the submitted payment. |
SettlementDate | Alpha/Num | The settlement date of the submitted payment returned in the following format DD-MM-YYYY |
DeclinedCode | Alpha/Num | This field is blank if the submitted payment is approved, otherwise, declined code is populated. |
DeclinedMessage | Alpha/Num | This field is black if the submitted payment is approved, otherwise, declined message is populated. |
Amount | Numeric | Additional fields only returned if you have. Amount passed in the Single Query Request. |
CustRef | Alpha/Num | Additional fields only returned if you have. Additional transactional reference passed the Single Query Request. |
CustNumber | Alpha/Num | Additional fields only returned if you have. Unique customer number passed in the Single Query Request. |
TrnTypeID | Numeric | Additional fields only returned if you have. TrnTypeID associated to the found transaction. |
TrnStatusID | Numeric | Additional fields only returned if you have. TrnStatusID associated to the found transaction. |