SearchTransactions

  • Method
    SlimCD.Reports.SearchTransactions2

    Purpose
    Search all transactions for specific properties, standardized to match GetTransactionDetails2.

    Description
    Returns a standard Transaction item for each item in the search criteria. Transaction search is done by date range. Just the count, or the transactions themselves can be returned. A maximum can be set so that the return set is limited. The order can be reversed by specifying “reverseorder” in the search criteria, which causes the items to be returned with the most recent first. The search itself can contain any of the following items:

    • clientid
    • siteid
    • firstname
    • lastname
    • city
    • state
    • zip
    • email
    • amount
    • clienttransref
    • transtype
    • cardnumber
    • cardid
    • cardpart
    • clerkname
    • gateid

    If a gateid is specified with a max record count of 1, only that record will be returned. Otherwise, the gateid value will cause records with a gateid greater than or equal to the specified gateid to be returned. Pagination can be done by specifying a gateid value on the second and subsequent calls to SearchTransactions. To perform pagination: 1. Limit the number of records returned my specifying the maxrecords, and omitting the gateid value. 2. On subsequent calls, specify a “gateid” that is one GREATER than the last gateid returned from previous searches. 3. If you are specifying “reverseorder”, then specify a gateid that is one LESS than the last gateid returned.

    Business Rules

    Link to something

    Argument List

    Name Required Usage
    SearchTransactionsRequest Required Object containing properties for the request
    timeout Optional Integer wait time, in seconds, before timeout response is generated
    callback* Optional Function to call upon completion of asynchronous request

    *for JavaScript only

    SearchTransactions Argument List

    Name Required Usage
    SearchTransactionsRequest Required Object containing properties for the request
    timeout Optional Integer wait time, in seconds, before timeout response is generated
    callback* Optional Function to call upon completion of asynchronous request

    *for JavaScript only

    SearchTransactions Request Fields

    Field Name Type Length Required Description
    Username string 20 require Username or API Access Credential that accesses web service.
    Password string 20 require Plaintext password for the client account.
    SiteID integer 10 optional Assigned by the Slim CD administrator.
    RecordCountOnly bool 5 require * true/false
    MaxRecords int 12 require * maximum number of records returnd by the Search
    StartDate date 10 require * Date of beginning of search.
    GateID date 10 require * Date of end of search
    ClientID string 10 conditional Assigned by the Slim CD administrator.
    FirstName string 10 require First name of cardholder
    LastName string 10 require Last name of cardholder
    City string 10 require City
    State string 10 require state
    Zip integer 10 require Zip code
    E-Mail string 10 require Cardholder Email address
    Amount integer 12 require Amount to credit (USD)
    ClientTransfer integer 20 require Client-supplied transaction identifier, (i.e. receipt number) which will be passed to the credit card network for specific industry types.
    TransType integer 18 require (See Transaction Type Table for Legal Values)
    CardNumber integer 20 conditional Card number – used for verification
    CardID int 12 not require Integer representing unique card value returned by SearchTransaction
    CardPart string 4 not require First 4 or last 4 of card (last 3 for amex)
    ClerkName string 20 optional Clerk/Salesperson Name/ID
    GateID integer 12 conditional Gateway ID for previous transaction.
    ReverseOrder string 3 conditional yes/no, causes results to be reversed with most recent first

    1. Passwords are required except when the username is set to an API Access Credential, in which case it should be passed in as an empty string.

    2. If an API Access Credential is only authorized for a single sites, passing in the default siteid value of zero will close the currently open batch for that single site.

    3. If the API Access Credential is authorized for multiple sites, the SiteID must be specified to indicate which batch to close.

    4. If the username is set to a clientid or username other than an API Access Credential, you must specify a non-zero siteidto indicate which batch to close.

    5. The batchnumber should always be passed as an empty string to close the open batch. Specifying a batch number will re-close an existing batch and may result in duplicate charges.

    Reply Fields

    reply outer tag for the reply data block
    response Success, FAIL, Error
    response code 0, 1, 2 (respective) matching the above
    description If successful, this will contain the single word, OK. Otherwise it will contain a description of failure or error which occurred
    reponseurl The Slimcd.com url which was called for this operation
    datablock The confirmation text returned from the server.

    Reply Hierarchy

    • reply
      • response
      • responsecode
      • description
      • responseurl
      • datablock
        • Transactions
          • Transactions
            • gateid
            • transactiondate
            • transtype
            • processor
            • siteid
            • batchno
            • approved
            • cardtype
            • cardid
            • cardnumber
            • amount
            • authcode
            • cvv2reply
            • avsreply
            • trackindicator
            • voided
            • requestingip
            • firstname
            • lastname
            • address
            • city
            • state
            • zip
            • country
            • phone
            • email
            • clerkname
            • po
            • salestax
            • salestaxtype
            • tip
            • clienttransref
            • giftbalance
            • cashback

    Remarks

    • General
      1. Names in name/value pairs are NOT case-sensitive
      2. Names inside XML tags ARE case-sensitive
    • Function-Specific
      1. None
  • Include

    Method

    Request

    Reply

    Sample Code

    Downloads

    Download full sample source.


     

  • Include

    Method

    Request

    JSON Reply

    Sample Code

    Downloads
    Download full sample source.


  • Include

    Method

    Request

    Reply

    Cross Reference: Client

    Sample Code

    Downloads
    Download full sample source.


  • Include

    Method

    Request

    Reply

    Cross Reference: Client

    Sample Code

    Downloads

    Download full sample source.


  • Include

    Method

    request

    Reply

    Sample Code

     


  • Method

    Request

    Reply

    Sample Code

    Downloads
    Download full sample source.


  • URL

    Protocols

        • SOAP/XML
        • HTTP POST
        • HTTP GET

    Request


    The sample above shows the name/value pairs that would be send with HTTP POST

    Status Codes

    Status Code Status Description Explanation
    200 200 OK Approved or declined attempts will return a response with an XML reply block
    500 500 Internal Server Error The response will not contain XML, as a server error has occurred.

    Reply Output is in XML format if a status code of 200 is returned.

    If the block’s tag does not indicate “Success”, the tag will contain an error description which can be displayed to the end-user

    Sample Code


    The sample above shows the use of an API Access Credential with a blank password, and specifies a long timeout for CloseBatch

    The sample above shows the clientid, siteid and password. BatchNumber is always blank.

    DOWNLOAD

    EXERCISER TOOL

    Remarks

    • Remarks Go here
  • URL

    Protocols

    • HTTP POST
    • HTTP GET

    This function accepts either name/value pairs or JSON

    Request

    Reply

    Sample Code


    The sample above shows the use of an API Access Credential with a blank password, and specifies a long timeout for CloseBatch

    The sample above shows the clientid, siteid and password. BatchNumber is always blank.

    The sample above shows the use jQuery cross-domain POST with jsonp, sends an API Access Credential with a blank password, and specifies a long timeout for CloseBatch. Note that the service can be specified on the URL or inside the request object as another json data item

    The sample above shows the use jQuery cross-domain POST with name/value pairs, sends an API Access Credential with a blank password, and specifies a long timeout for CloseBatch. Note that the service can be specified on the URL or inside the request object as another name/value pair
    $data = array(“username” => “1032”, “password” => “289075”,
    “recordcountonly” => “”, “maxrecords” => “”, “startdate” => “”,
    “enddate” => “”, “clientid” => “”, “siteid” => “228226448”, “firstname” => “”, “lastname” => “”, “city” => “”, “state” => “”, “zip” => “”, “email” => “”, “amount” => “”, “clienttransref” => “”,
    “transtype” => “”, “cardnumber” => “”, “cardid” => “”,
    “cardpart” => “”, “clerkname” => “”, “gateid” => “”,
    “reverseorder” => “”);

    $data_string = json_encode($data);

    $ch = curl_init(‘https://stats.slimcd.com/soft/json/jsonscript.asp?service=SearchTransactions2’);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // receive server response …
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
    curl_setopt($ch, CURLOPT_HTTPHEADER,
    array(
    ‘Content-Type: application/json’,
    ‘Content-Length: ‘ . strlen($data_string)
    )
    );

    $server_output = curl_exec($ch);

    $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

    if ($http_status != 200 ||
    ($contentType <> ‘text/javascript’ && $contentType <> ‘application/json’)) {

    $reply = (object) array(‘response’=>’Error’, ‘responsecode’=>’2’,
    ‘description’ => $server_output ,
    ‘responseurl’ => curl_getinfo( $ch,
    CURLINFO_EFFECTIVE_URL) ,
    ‘datablock’ => ”);

    $result = (object) array(‘reply’ => $reply) ;
    }
    else {
    $result = json_decode($server_output);
    }
    echo $result->reply->response . ‘:’ . $result->reply->description;

    ?>

    Remarks

    1. None