Knowledgebase:
GetAccountTransactions
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 03 October 2017 01:41 PM

Syntax

 GetAccountTransactions(AccountId As Long , FromDate As String, ToDate as String)

Description

The GetAccountTransactions operation returns a 2 Dimensional String array which holds the given account transactions. It holds closed transactions data
for the statement.


Request Parameters

Name Description  Required
AccountId
  • The intended account identifier.
  • Type: Long
  • Default: None
  • Constraints: Must be a valid account ID, and accessible by logged in client.

  

Yes

FromDate
  • Starting date for account transactions query.
  • Type: String
  • Default: 01/01/1900 or minimum date
  • Constraints: Must be in dd/MM/yyyy format.

 

No

ToDate
  • Ending date for account transactions query.
  • Type: String
  • Default: System date
  • Constraints: Must be in dd/MM/yyyy format

 

No


Response Elements

Name Description 
Result
  • This operation returns 2D string array of Account Transactions upon success as listed order:

        0- Ticket/ Order

        1- Date/ Time

        2- Transaction Type
             - N : Which means New order
             - L : Which means liquidate order
             - SL : Which means Sell Limit / Stop loss
             - BL : Which means Buy Limit 
             - BS : Which means Buy Stop
             - SS : Which means sell step
             - TP : Which means  take profit
             - DP : Which means Deposit
             - Wd: Which means Withdrawal 
             - Aj :  Which means Adjustment
             - Ci :  Which means Credit In
             -Co : Which means Credit Out

        3- SymbolID

        4- Amount

        5- Buy/Sell

        6- Open DateTime

        7- OpenPrice/ SL( Stop loss value )

        8- Close Price/ TP (Take Profit value)

        9- Amount of (DP/ WD/ AJ/Ci/CO)

        10- Commission

        11- Interest

        12- Profit / loss value 

        13- Symbol Name 

        14 - Method

  • Otherwise an explicit error code is returned at the first array element. 
  • Type: 2D Array of String


Sample

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>GetAccountTransactions</title>

<script src="http://code.jquery.com/jquery-latest.js"></script>

</head>

<script >

    $(document).ready(function () {

        var urlStr = "http://5.10.64.199/vertexweb10/WebService.svc";

        jQuery.support.cors = true;

        $("#progress").ajaxStart(function () { $(this).css("display", "block"); });

        $("#progress").ajaxComplete(function () { $(this).css("display", "none"); });

        function onSuccessResult(response) {

            response = eval('(' + response + ')')

            if (response.UserId == -1 || response.UserId == -207) {

                $("#resultData").html("Invalid username or password");

            }

            else if (response.UserId == -231) {

                $("#resultData").html("You must have at least one account");

            }

            else if (response == null || response == "" || response.UserId < 0) {

                $("#resultData").html("Error while login.Please try later");

            }

            else {

                $("#resultData").html("SuccessResult ... UserId is :" + response.UserId);

            }

        }

        function onErrorResult(result) {

            alert('Service call faild : ' + result.status + ' ' + result.statusText);

        }

        $("#btnLogin").click(function () {

            $.ajax({

                type: 'Get',

                url: urlStr + "/BackofficeLogin",

                dataType: "jsonp",

                data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },

                success: onSuccessResult,

                error: onErrorResult

            });

        });

        $("#btnAction").click(function () {

            $.ajax({

                type: 'GET',

                url: urlStr + "/GetAccountTransactions",

                dataType: "jsonp",

                data: { "AccountId": $("#txtAccount").val(), "FromDate": $("#date1").val(), "ToDate": $("#date2").val() },

                success: function (dataResult) {

                    dataResult = eval('(' + dataResult + ')');

                    var resData;

                    for (var i = 0; i < dataResult.length - 1; i++) {

                        resData = resData + "Ticket:" + dataResult[i][0] + "  Date/Time:" + dataResult[i][1] + "   Type:" + dataResult[i][2] + "   SymbolID:" + dataResult[i][3] + "   Amount:" + dataResult[i][4] + "   BuySell:" + dataResult[i][5] + "   OpenTime:" + dataResult[i][6] + "   OpenPrice/SL:" + dataResult[i][7] + "   ClosePrice/TP:" + dataResult[i][8] + "   Amount(DP/WD/AJ):" + dataResult[i][9] + "   Commission:" + dataResult[i][10] + "   Interest:" + dataResult[i][11] + "   TransactionStatus:" + dataResult[i][12] + "   SymbolName:" + dataResult[i][13] + "<br/>";

                    }

                    $("#resultAction").html(resData);

                },

                error: onErrorResult

            });

        });

    });

</script>

<body>

<table border="1px">

<tbody>

<tr>

<td>

username: <input type="text" id="txtusername" value="support"/>

password: <input type="text" id="txtpassword" value="support"/>

<button id="btnLogin"> Login </button>

</td>

</tr>

<tr >

<td>

AccountId : <input type="text" id="txtAccount"  value ="12347298" />    FromDate : <input type="text" id="date1" value="25/08/2012"/>   ToDate : <input type="text" id="date2" value="26/09/2012" />     

<button id="btnAction"> GetAccountTransactions </button>

</td>

</tr>

</tbody>

</table>

<div id="resultData"> </div>

<div id="resultAction"> </div>

<div style="display:none" id="progress">Loading ... </div>

</body>

</html>

 

 


See Also


VertexFX Backoffice WCF Service Index

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions