Retrieve payment history

Each account has a payment history that details financial transactions made against an account.

Payment histories for all accounts

REST API

Use the Payment History endpoint of Customer Services API with the appropriate query parameters to retrieve the desired results:

GET https://<ServerURL>/CustomerServices/v1.0/payments[?fromDatetime][&toDatetime][&businessAccountId]

  • The businessAccountId query parameter returns all the transactions of all accounts associated with the business.

  • fromDatetime and toDatetime are used to indicate the date range for the transactions

SOAP WS

The GetPaymentHistoryForDateRange returns the payment histories for all accounts associated with the requesting user, where the transaction date falls in a supplied range of dates.

Since this API call does not have pagination, our recommendation is to apply smaller date ranges (not more than 30 days) otherwise, you may receive timeout errors.

Sample request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:deb="Debitsuccess.WebServices.WCF" xmlns:deb1="http://schemas.datacontract.org/2004/07/Debitsuccess.WebServices.Core"> <soapenv:Header/> <soapenv:Body> <deb:GetPaymentHistoryForDateRange> <deb:request> <deb1:DateCreated>2020-08-10</deb1:DateCreated> <deb1:Id>123</deb1:Id> <deb1:RequestInitiator>ReqInit1</deb1:RequestInitiator> <deb1:User> <deb1:Password>#password</deb1:Password> <deb1:Username>username</deb1:Username> </deb1:User> <deb1:EndDate>2020-07-11</deb1:EndDate> <deb1:StartDate>2020-07-09</deb1:StartDate> </deb:request> </deb:GetPaymentHistoryForDateRange> </soapenv:Body> </soapenv:Envelope>

Sample Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <ActivityId CorrelationId="50754d67-4849-48c4-a9c8-aeb338de04cf" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId> </s:Header> <s:Body> <GetPaymentHistoryForDateRangeResponse xmlns="Debitsuccess.WebServices.WCF"> <GetPaymentHistoryForDateRangeResult xmlns:a="http://schemas.datacontract.org/2004/07/Debitsuccess.WebServices.Core" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <a:DateCreated>2020-08-10T16:13:01.2157238+12:00</a:DateCreated> <a:Id>04fd4635-df49-4420-b4ff-6501c33e8f64</a:Id> <a:ResponseNotes> <a:ResponseMessageNote> <a:Code>00</a:Code> <a:Note>Success</a:Note> <a:NoteType>Info</a:NoteType> </a:ResponseMessageNote> </a:ResponseNotes> <a:Status>Succeed</a:Status> <a:Payments> <a:Payment> <a:Id i:nil="true"/> <a:AccountReferenceNo>DEA2885115</a:AccountReferenceNo> <a:BatchNumber>6046386</a:BatchNumber> <a:Description i:nil="true"/> <a:ExternalAccountReferenceNo>MEL28</a:ExternalAccountReferenceNo> <a:ExternalTransactionIdentifier/> <a:PaymentAmount>2.00</a:PaymentAmount> <a:PaymentCode>OneOffPayment</a:PaymentCode> <a:PaymentDate>2020-07-10T10:15:54.857</a:PaymentDate> <a:PaymentErrorCode>NoError</a:PaymentErrorCode> <a:PaymentId>1530462302</a:PaymentId> <a:PaymentType>CreditCard</a:PaymentType> <a:ReversedPaymentId>0</a:ReversedPaymentId> <a:CommissionAmount>0.06</a:CommissionAmount> <a:RetryCount>0</a:RetryCount> </a:Payment> <a:Payment> <a:Id i:nil="true"/> <a:AccountReferenceNo>DEA2885115</a:AccountReferenceNo> <a:BatchNumber>6046387</a:BatchNumber> <a:Description>Chocolate cake - Pay API</a:Description> <a:ExternalAccountReferenceNo>MEL28</a:ExternalAccountReferenceNo> <a:ExternalTransactionIdentifier/> <a:PaymentAmount>125.35</a:PaymentAmount> <a:PaymentCode>OneOffPayment</a:PaymentCode> <a:PaymentDate>2020-07-10T10:37:00.603</a:PaymentDate> <a:PaymentErrorCode>NoError</a:PaymentErrorCode> <a:PaymentId>1530462303</a:PaymentId> <a:PaymentType>CreditCard</a:PaymentType> <a:ReversedPaymentId>0</a:ReversedPaymentId> <a:CommissionAmount>3.76</a:CommissionAmount> <a:RetryCount>0</a:RetryCount> </a:Payment> </a:Payments> </GetPaymentHistoryForDateRangeResult> </GetPaymentHistoryForDateRangeResponse> </s:Body> </s:Envelope>

Payment history of a single account

REST API

Use the Payment History endpoint of Customer Services API with the appropriate query parameters to retrieve the desired results:

GET https://<ServerURL>/CustomerServices/v1.0/payments[?accountId]

  • The accountId query parameter returns all the transactions for the specified account.

  • fromDatetime and toDatetime are used to indicate the date range for the transactions

SOAP WS

To retrieve the payment history of a single account use the GetPaymentHistoryByAccountId method.

Sample request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:deb="Debitsuccess.WebServices.WCF" xmlns:deb1="http://schemas.datacontract.org/2004/07/Debitsuccess.WebServices.Core"> <soapenv:Header/> <soapenv:Body> <deb:GetPaymentHistoryByAccountId> <deb:request> <deb1:DateCreated>2020-08-10</deb1:DateCreated> <deb1:Id>123</deb1:Id> <deb1:RequestInitiator>ReqInit1</deb1:RequestInitiator> <deb1:User> <deb1:Password>#password</deb1:Password> <deb1:Username>username</deb1:Username> </deb1:User> <deb1:AccountReferenceNo>DEA2885115</deb1:AccountReferenceNo> <deb1:ExternalAccountReferenceNo></deb1:ExternalAccountReferenceNo> </deb:request> </deb:GetPaymentHistoryByAccountId> </soapenv:Body> </soapenv:Envelope>

Sample Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <ActivityId CorrelationId="5938b61c-81c4-4210-abf6-8d4a54c0f2b8" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId> </s:Header> <s:Body> <GetPaymentHistoryByAccountIdResponse xmlns="Debitsuccess.WebServices.WCF"> <GetPaymentHistoryByAccountIdResult xmlns:a="http://schemas.datacontract.org/2004/07/Debitsuccess.WebServices.Core" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <a:DateCreated>2020-08-10T16:17:17.0032176+12:00</a:DateCreated> <a:Id>18837869-d815-42d4-ae49-7f55badfe548</a:Id> <a:ResponseNotes> <a:ResponseMessageNote> <a:Code>00</a:Code> <a:Note>Success</a:Note> <a:NoteType>Info</a:NoteType> </a:ResponseMessageNote> </a:ResponseNotes> <a:Status>Succeed</a:Status> <a:Payments> <a:Payment> <a:Id i:nil="true"/> <a:AccountReferenceNo>DEA2885115</a:AccountReferenceNo> <a:BatchNumber>6046397</a:BatchNumber> <a:Description>Chocolate cake - Pay API</a:Description> <a:ExternalAccountReferenceNo>MEL28</a:ExternalAccountReferenceNo> <a:ExternalTransactionIdentifier/> <a:PaymentAmount>125.35</a:PaymentAmount> <a:PaymentCode>OneOffPayment</a:PaymentCode> <a:PaymentDate>2020-07-15T07:34:38.843</a:PaymentDate> <a:PaymentErrorCode>NoError</a:PaymentErrorCode> <a:PaymentId>1530462314</a:PaymentId> <a:PaymentType>DirectCreditMasterOrVisa</a:PaymentType> <a:ReversedPaymentId>0</a:ReversedPaymentId> <a:CommissionAmount>3.76</a:CommissionAmount> <a:RetryCount>0</a:RetryCount> </a:Payment> <a:Payment> <a:Id i:nil="true"/> <a:AccountReferenceNo>DEA2885115</a:AccountReferenceNo> <a:BatchNumber>6046387</a:BatchNumber> <a:Description>Chocolate cake - Pay API</a:Description> <a:ExternalAccountReferenceNo>MEL28</a:ExternalAccountReferenceNo> <a:ExternalTransactionIdentifier/> <a:PaymentAmount>125.35</a:PaymentAmount> <a:PaymentCode>OneOffPayment</a:PaymentCode> <a:PaymentDate>2020-07-10T10:37:00.603</a:PaymentDate> <a:PaymentErrorCode>NoError</a:PaymentErrorCode> <a:PaymentId>1530462303</a:PaymentId> <a:PaymentType>DirectCreditMasterOrVisa</a:PaymentType> <a:ReversedPaymentId>0</a:ReversedPaymentId> <a:CommissionAmount>3.76</a:CommissionAmount> <a:RetryCount>0</a:RetryCount> </a:Payment> </a:Payments> </GetPaymentHistoryByAccountIdResult> </GetPaymentHistoryByAccountIdResponse> </s:Body> </s:Envelope>

Related Articles

 

© 2021 Debitsuccess. All rights reserved