getReceipts

Retrieve list of custom receipt templates

Description

This method allows you pull a list of the receipt templates based on the target receipt type. This type can be "Email", "Print" or "Both".

An array of Receipt objects is returned. For efficiency reasons, the actual templates (Receipt.TemplateHTML and Receipt.TemplateText) are not returned by this method. Use getReceipt to pull the full Receipt object including the templates.

If an error occurs, an exception will be thrown.

See also getReceipt

Syntax

Receipts getReceipts ( ueSecurityToken, Target)

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and retrieve the custom fields.
string Target Type of receipts to retreive (Print, Email or Both)

Return Value

Name Description
Receipt Returns an array of Receipt objects

Exceptions

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

Code Message Advice
20034 Error pulling receipt templates 'Internal server error pulling list of receipts, wait and try again or contact support

Examples

PHP

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

    <?php

    try {
      $templates = $client->getReceipts($token, "Email");
    }

    catch(SoapFault $e) {

      echo $e->getMessage();

    }

    ?>

VB

For directions on how to set up the WSDL link and create the "token" and "client" variables, go to the Visual Basic .Net Soap How-to.

    Dim target As String
            target = "email"
            Dim receipt() As newtek.Receipt

            receipt = client.getReceipts(token, target)
            MsgBox(receipt.Length)

.NET C

For directions on how to set up the WSDL link and create the "token" and "client" variables, go to the C Sharp .Net Soap How-to.

                string target = "email";

                try
                {
                    newtek.Receipt[] receipt = client.getReceipts(token, target);
                    MessageBox.Show(string.Concat(receipt.Length));

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

XML

Request:

    <?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:getReceipts>
    <Token xsi:type="ns1:ueSecurityToken">
    <ClientIP xsi:type="xsd:string">123.123.123.123</ClientIP>
    <PinHash xsi:type="ns1:ueHash">
    <HashValue xsi:type="xsd:string">0435eeb0fd2e419e6fdb136d16f5338fd61012c6</HashValue>
    <Seed xsi:type="xsd:string">11422802808-test</Seed>
    <Type xsi:type="xsd:string">sha1</Type>
    </PinHash>
    <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey>
    </Token>
    <Target xsi:type="xsd:string">Both</Target>
    </ns1:getReceipts>
    </SOAP-ENV:Body>

Response:

    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn:newtek"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <ns1:getReceiptsResponse>
    <getReceiptsReturn SOAP-ENC:arrayType="ns1:Receipt[3]" xsi:type="ns1:ReceiptArray">
    <item xsi:type="ns1:Receipt">
    <ReceiptRefNum xsi:type="xsd:string">1</ReceiptRefNum>
    <Name xsi:type="xsd:string">addReceipt1909111717</Name>
    <Subject xsi:type="xsd:string">1561375697</Subject>
    <FromEmail xsi:type="xsd:string">test@test22.com</FromEmail>
    <Target xsi:type="xsd:string">email</Target>
    <ContentType xsi:type="xsd:string">both</ContentType>
    </item>
    <item xsi:type="ns1:Receipt">
    <ReceiptRefNum xsi:type="xsd:string">4</ReceiptRefNum>
    <Name xsi:type="xsd:string">tranapi</Name>
    <Subject xsi:type="xsd:string">Transaction[result.response]-Invoice#[post.UMinvoice]
    </Subject>
    <FromEmail xsi:type="xsd:string">test@tmcode.com</FromEmail>
    <Target xsi:type="xsd:string">email</Target>
    <ContentType xsi:type="xsd:string">text</ContentType>
    </item>
    <item xsi:type="ns1:Receipt">
    <ReceiptRefNum xsi:type="xsd:string">7</ReceiptRefNum>
    <Name xsi:type="xsd:string">tranapi_customer</Name>
    <Subject xsi:type="xsd:string">Customer Receipt</Subject>
    <FromEmail xsi:type="xsd:string">support@newtekgateway.com</FromEmail>
    <Target xsi:type="xsd:string">email</Target>
    <ContentType xsi:type="xsd:string">text</ContentType>
    </item>
    </getReceiptsReturn>
    </ns1:getReceiptsResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>