getReport

Pull a built-in or custom report from the merchant console.

Description

This method retrieves a report from the merchant console. Any reports, including custom reports, may be retrieved. The returned data is base 64 encoded. The format of the returned data can be HTML, comma separated (cvs), or tab separated (tab).

Names of built-in reports are prefaced with "CreditCard:", "Check:" or "Customer:". For example, to pull "Sales by Date" for credit cards, the "Report" parameter would be set to "CreditCard:Sales by Date."

To pull a custom credit card or check report, prefix the name with "Custom:" or "CustomCheck:" For example, to pull a custom report titled "Recurring Declines" set the "Report" parameter to "Custom:Recurring Declines." Customer reports can only be created from within the merchant console. If none of the built-in or custom reports provide data required, see the custom search methods (ie searchTransactionsCustom) for more flexibility.

See also searchTransactionsCustom, searchCustomersCustom

Syntax

string getReport ( ueSecurityToken Token, string Report, FieldValue Options, string Format )

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
string Report Name of report to retrieve.
FieldValue Options Array of FieldValue objects specifying report options such as (StartDate and EndDate)
string Format Format of returned report data. Possible values are: html, csv, or tab.

Return Value

Type Description
string Returns specified report data according to parameters set in search.

Exceptions

The following exceptions (errors) are applicable to this method.

Code Message Advice
20014 Unsupported file format Valid file formats are html, csv or tab.
20028 Requested Report not found Double check the name of the report.
20029 Unable to retrieve requested report An account configuration issue was encountered while generating the report. Contact support for assistance.

Available Reports

Credit Card Reports

Report Name Description
creditcard:errors by date Credit card transactions resulting in errors, sorted by date
creditcard:errors by source Credit card transactions resulting in errors, sorted by source key
creditcard:errors by reason Credit card transactions resulting in errors, sorted by reason
creditcard:errors by user Credit card transactions resulting in errors, sorted by user
creditcard:declines by date Credit card transactions resulting in declines, sorted by date
creditcard:declines by source Credit card transactions resulting in declines, sorted by source key
creditcard:declines by reason Credit card transactions resulting in declines, sorted by reason
creditcard:declines by user Credit card transactions resulting in declines, sorted by user
creditcard:sales by date Credit card transactions resulting in approval, sorted by date
creditcard:sales by source Credit card transactions resulting in approval, sorted by source key
creditcard:sales by reason Credit card transactions resulting in approval, sorted by reason
creditcard:sales by user Credit card transactions resulting in approval, sorted by user

Check Reports

Report Name Description
check:Deposit Report Check transactions sorted by estimated deposit date
check:All Transactions by Date All Check transactions sorted by date (does not include errors)
check:settled by date Check transactions that have been marked as settled, sorted by date
check:settled by source Check transactions that have been marked as settled, sorted by source
check:settled by users Check transactions that have been marked as settled, sorted by user
check:returns by date Check transactions that have been marked as returned, sorted by date
check:returns by source Check transactions that have been marked as returned, sorted by source
check:returns by reason Check transactions that have been marked as returned, sorted by reason
check:returns by user Check transactions that have been marked as returned, sorted by user
check:declines by date Check transactions were rejected by check processor, sorted by date
check:declines by source Check transactions were rejected by check processor, sorted by sourcekey
check:declines by reason Check transactions were rejected by check processor, sorted by reason
check:declines by user Check transactions were rejected by check processor, sorted by user

Customer Reports

Report Name Description
customer:Pending Billing by Date The next instance of a customer's recurring billing, sorted by next bill date
customer:Pending Billing by Source The next instance of a customer's recurring billing, sorted by Source
customer:Future Billing by Date All instances of a customer's recurring billing within the specified date range, sorted by bill date
customer:Future Billing by Source All instances of a customer's recurring billing within the specified date range, sorted by Source
customer:Billing History by Date Transactions results for recurring billing, sorted by billing date
customer:Billing History by Source Transactions results for recurring billing, sorted by Source
customer:Expired Cards Customers who have an expired credit card on file
customer:Expiring before Next Billing Customers that have a credit card that will expire before the next payment is scheduled to run
customer:Expiring by Date Range Customers that have a credit card expiring in the future

Examples

PHP

For directions on how to set up the WSDL link, create "$token" and "$client", go to PHP Soap How-to.

    <?php

    try {

      $Options = array(
        array('Field'=>'StartDate', 'Value'=>'2007/01/01'),
        array('Field'=>'EndDate', 'Value'=>'2007/04/01')
      );
      $Format='csv';
      $Report='CreditCard:Errors By Date';

      $res=$client->getReport($token, $Report, $Options, $Format);  
      $data=base64_decode($res);
      print_r($data);

    }

    catch (SoapFault $e) {
      die("Get Transaction failed :" .$e->getMessage());
      }

    ?>

.NET VB

    Dim report As String
            report = "creditcard:errors by date"
            Dim options(0 To 1) As newtek.FieldValue
            options(0) = New newtek.FieldValue
            options(1) = New newtek.FieldValue
            options(0).Field = "Start date"
            options(0).Value = "2010-08-01"
            options(1).Field = "End date"
            options(1).Value = "2010-08-16"

            Dim format As String
            format = "csv"
            Dim response As String

            response = client.getReport(token, report, options, format)
            Dim binary_data As Byte() = Convert.FromBase64String(response)


            MsgBox(System.Text.Encoding.UTF8.GetString(binary_data))

.NET C

                string report = "creditcard:errors by date ";

                newtek.FieldValue[] options = new newtek.FieldValue[2];
                for (int i = 0; i < 2; i++)
                {
                    options[i] = new newtek.FieldValue();
                }

                options[0].Field = "StartDate"; options[0].Value = "2010-08-01";
                options[1].Field = "EndDate";   options[1].Value = "2010-08-16";

                string format = "csv";

                string response;

                try
                    {
                       response = client.getReport(token, report, options, format);
                       Byte[] binaryData = new Byte[3];
                       binaryData = Convert.FromBase64String(response);

                       MessageBox.Show(Encoding.UTF8.GetString(binaryData));

                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message);
                    }

XML

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn:newtek" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <ns1:getReport>
    <Token xsi:type="ns1:ueSecurityToken">
    <ClientIP xsi:type="xsd:string">192.168.0.1</ClientIP>
    <PinHash xsi:type="ns1:ueHash">
    <HashValue xsi:type="xsd:string">cb451c1c7cd0c9928933c074d6e4b239</HashValue>
    <Seed xsi:type="xsd:string">1234</Seed>
    <Type xsi:type="xsd:string">md5</Type>
    </PinHash>
    <SourceKey xsi:type="xsd:string">_0409i1S8XvmVj3ndoBG0HlBu32kYD3t</SourceKey>
    </Token>
    <Report xsi:type="xsd:string">creditcard:declines by user</Report>
    <Format xsi:type="xsd:string">csv</Format>
    <Options SOAP-ENC:arrayType="ns1:FieldValue[2]" xsi:type="ns1:FieldValueArray">
    <item xsi:type="ns1:FieldValue">
    <Field xsi:type="xsd:string">StartDate</Field>
    <Value xsi:type="xsd:string">2013/01/01</Value>
    </item>
    <item xsi:type="ns1:FieldValue">
    <Field xsi:type="xsd:string">EndDate</Field>
    <Value xsi:type="xsd:string">2013/12/12</Value>
    </item>
    </Options>
    </ns1:getReport>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>