/get_wallet_statement_data

Gets statement information by date range for a specified wallet.

📘

NOTE

The current month is excluded from this endpoint. Neither start_month or end_monthshould be set to the current month when making requests.

end_month is optional - if none is specified only statements for start_month are provided.

Request

The request body at this endpoint is the statements JSON object.

The search_filters object and all of its nested keys are optional except start_month. They can be used to filter the statements of the wallet.

This endpoint allows for a range of months to be specified in the request (mm-yyyy).

Results are paginated; by default, the first 100 results are returned. You can also request up to 100 results per page ("per_page": 100)

The page and per_page keys can instead be specified in query parameters (e.g. by appending ?page=2&per_page=2 or ?per_page=100 to the end of the URL). If these keys are already specified in the request body, the request body keys take precedence. This allows a requester to fetch several pages using the same signatures if desired.

Authorization / Authentication

Apps using Access Token Authorization

Use a valid access token in an Authorization: Bearer request header.

See Authenticating with an Access Token for more details.

Apps using ECDSA Authentication

The auth signature header is required for this request. The user signature header is optional. If you choose to omit the user signature header, you'll also need to omit the user_handle from the Header object.

See the section on ECDSA Authentication for more detail about ECDSA signature generation.

Note - We recently renamed the field auth_handle to app_handle. For backward compatibility, auth_handle is still valid but has been removed from our documentation.

POST /0.2/get_wallet_statement_data HTTP/1.1
Host: sandbox.silamoney.com
Content-Type: application/json
// if using OAuth2
Authorization: Bearer [GENERATED JWT TOKEN HERE]
// if using ECDSA
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]

{
  "header": {
    "created": 1234567890, 
    "app_handle": "handle.silamoney.eth", 
    "user_handle":"user.silamoney.eth", 	
    "version": "0.2", 
    "crypto": "ETH", 
    "reference":  "<your unique id>"
  }, 
   "message": ”get_statement_data_msg”,
   "wallet_id": "wallet_uuid",
   "search_filters":{
       "start_month": "07-2022",
       "end_month": "08-2022",
       "page":1,
       "per_page":100
   }
}
const res = await sila.getWalletStatementData(
   userHandle,
   privateKey,
   wallet_Id,
   filters,
);
console.log(res.statusCode); // 200
console.log(res.data.reference); // Random reference number
console.log(res.data.status); // SUCCESS
console.log(res.data.success);
console.log(res.data.page);
console.log(res.data.returned_count);
console.log(res.data.total_count);
console.log(res.data.statements);
payload = {
            "wallet_id":"<wallet_id>",
            "search_filters": {
                "start_month": "07-2022",
                "end_month": "11-2022",
                "page": 1,
                "per_page": 100
            }
        }

User.get_wallet_statement_data(app, payload, eth_private_key)
       

### Success Response Object
{
    "success": true,
    "status": "SUCCESS",
    "page": 1,
    "returned_count": 1,
    "total_count": 100,
    "statements": [
        {
            "user_handle": "user",
            "date": "01-2021",
            "first_name": "First",
            "last_name": "Last",
            "wallet_id": "12345678-abcd-1234-abcd-1234567890aa",
            "beginning_balance": "$0.00",
            "ending_balance": "$100.00",
            "transactions": [
                {
                    "settled_date": "2022-01-08T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "credit",
                    "amount": "$200.00",
                },
                {
                    "settled_date": "2022-01-09T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "debit",
                    "amount": "-$100.00",
                }
            ]
        },
        {
            "user_handle": "user",
            "date": "02-2021",
            "first_name": "First",
            "last_name": "Last",
            "wallet_id": "12345678-abcd-1234-abcd-1234567890aa",
            "beginning_balance": "$100.00",
            "ending_balance": "$300.00",
            "transactions": [
                {
                    "settled_date": "2022-01-08T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "credit",
                    "amount": "$200.00",
                    "running_balance": "$400.00"
                },
                {
                    "settled_date": "2022-01-09T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "debit",
                    "amount": "-$100.00",
                    "running_balance": "$300.00",
                }
            ]
        },
        ...
    ]
}

### Success Response Object
{
    status: 'FAILURE'
}
//Load your informations
var filters = new StatementSearchFilters()
{
    StartMonth = "07-2022",
    EndMonth = "08-2022",
    Page = 1,
    PerPage = 100
};
var user = DefaultConfig.FirstUser;
var responseWallet = api.GetWallet(user.UserHandle, user.PrivateKey);
var parsedResponseWallet = (SingleWalletResponse)responseWallet.Data;

var response = api.GetWalletStatementData(user.UserHandle, parsedResponseWallet.Wallet.WalletId, filters);
var parsedResponse = (GetStatementResponse)response.Data;

// Success Response Object
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(parsedResponse.Success);
Console.WriteLine(parsedResponse.Status);
Console.WriteLine(parsedResponse.Page);
Console.WriteLine(parsedResponse.TotalCount);
Console.WriteLine(parsedResponse.ReturnedCount);
Console.WriteLine(parsedResponse.Statements.Count); //statements
Console.WriteLine(parsedResponse.ResponseTimeMs);
String userHandle="user_handle";
String userPrivateKey= "user_private_key";
String walletId="unique wallet id";
StatementSearchFilters searchFilters = new StatementSearchFilters();
searchFilters.setPage(1);
searchFilters.setPerPage(20);
searchFilters.setStartMonth("10-2022");
searchFilters.setEndMonth("11-2022");
ApiResponse response = api.getWalletStatementData(userHandle, userPrivateKey, walletId,searchFilters);

// Success Response
System.out.println(response.getStatusCode()); // 200
GetStatementsResponse parsedResponse = (GetStatementsResponse) response.getData();
System.out.println(parsedResponse.getReference()); // Random reference number
System.out.println(parsedResponse.getSuccess());
System.out.println(parsedResponse.getStatus()); // SUCCESS
System.out.println(parsedResponse.getMessage());
System.out.println(parsedResponse.getResponseTimeMs());
System.out.println(parsedResponse.getPage());
System.out.println(parsedResponse.getReturnedCount());
System.out.println(parsedResponse.getTotalCount());

List<Statement> statements = parsedResponse.getStatements(); // Statements
Statement statement = statements.get(0);
// Statement fields
System.out.println(statement.getUserHandle());
System.out.println(statement.getDate());
System.out.println(statement.getFirstName());
System.out.println(statement.getLastName());
System.out.println(statement.getWalletId());
System.out.println(statement.getBeginningBalance());
System.out.println(statement.getEndingBalance());

TransactionEntity transaction = statement.getTransactions().get(0);
// Transaction fields
System.out.println(transaction.getSettledDate());
System.out.println(transaction.getDescription());
System.out.println(transaction.getCategory());
System.out.println(transaction.getAmount());
System.out.println(transaction.getCategory());
System.out.println(transaction.getRunningBalance());
System.out.println(transaction.getDescriptor());
<?php
// Get statements data

use Silamoney\Client\Domain\SearchFilters;

// Load your information
$userHandle = 'user.silamoney.eth';
$userPrivateKey = 'xxxxxxxxxxx';
## ***User private key is never transmitted over the network***
$filters = new SearchFilters();

$Month = "07-2022";
$Page = 1
$PerPage = 20

$filters->setMonth($Month); // Optional
$filters->setPage($Page); // Optional
$filters->setPerPage($PerPage); // Optional

// Call the api
$response = $client->getStatementsData($userHandle, $userPrivateKey, $filters);

// or without $userHandle
$response = $client->getStatementsData(null, $userPrivateKey, $filters);

//Success Response Object
echo $response->getStatusCode(); // 200
$data = $response->getData();
echo $data->success; // TRUE
echo $data->status; // SUCCESS
echo $data->page; // The current page
echo $data->returned_count;
echo $data->total_count;
$statements = $data->statements; 
echo $statements[0]->user_handle; 
echo $statements[0]->date;
echo $statements[0]->first_name;
echo $statements[0]->last_name;
echo $statements[0]->wallet_id;
echo $statements[0]->beginning_balance;
echo $statements[0]->ending_balance;
$transactions = $statements[0]->transactions;
echo $transactions[0]->settled_date;
echo $transactions[0]->description;
echo $transactions[0]->category;
echo $transactions[0]->amount;
echo $transactions[0]->running_balance;


//status "FAILURE"
echo $response->getStatusCode();
$data = $response->getData();
echo $data->success; // FALSE
echo $data->status; // FAILURE



KeyTypeDescription
headerJSON objectRequired
Requires these keys in JSON format: created, app_handle.
user_handle is optional. See the /check_handle endpoint for the complete list of fields in this object.
wallet_idStringRequired
Wallet UUID. Can be found by calling /get_statements_data, /get_wallet, or /get_wallets.
search_filtersJSON objectAllows filtering results.
search_filters.pageIntegerOptional. Min Length 1 Default: 1
search_filters.
per_page
IntegerOptional. Min 1
Max 100
Default per page 20
search_filters.
start_month
String / ISO‑8601 monthRequired.
Returns statements created on or after the specified month. If no end_month is specified, only returns statements for one month specified in this parameter.

Must be prior to the current month.
search_filters.
end_month
String /
ISO‑8601 month
Optional.
Only return statements created before or on the specified month.

The end_month must be prior to the current month.

Response

The response will include:

  • User first name
  • Surname
  • Handle
  • Wallet uuid
  • Transaction details (date/time, transaction description, debit/credit category, dollar amount)
  • Starting balance
  • Running balance at the transaction level
  • Ending balance

Response will be paginated based on parameters set in the Request.

HTTP/1.1 200 OK
{
    "success": true,
    "status": "SUCCESS",
    "page": 1,
    "returned_count": 1,
    "total_count": 100,
    "statements": [
        {
            "user_handle": "user",
            "date": "01-2021",
            "first_name": "First",
            "last_name": "Last",
            "wallet_id": "12345678-abcd-1234-abcd-1234567890aa",
            "beginning_balance": "$0.00",
            "ending_balance": "$100.00",
            "transactions": [
                {
                    "settled_date": "2022-01-08T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "credit",
                    "amount": "$200.00",
                },
                {
                    "settled_date": "2022-01-09T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "debit",
                    "amount": "-$100.00",
                }
            ]
        },
        {
            "user_handle": "user",
            "date": "02-2021",
            "first_name": "First",
            "last_name": "Last",
            "wallet_id": "12345678-abcd-1234-abcd-1234567890aa",
            "beginning_balance": "$100.00",
            "ending_balance": "$300.00",
            "transactions": [
                {
                    "settled_date": "2022-01-08T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "credit",
                    "amount": "$200.00",
                    "running_balance": "$400.00"
                },
                {
                    "settled_date": "2022-01-09T17:45:59.716909Z", // Timestamp of the settled ledger event, in UTC
                    "description": "Transaction description",
                    "category": "debit",
                    "amount": "-$100.00",
                    "running_balance": "$300.00",
                }
            ]
        },
        ...
    ]
}
Status CodeSuccess AttributeDescription
200trueAble to return statements information.
400falseBad request format - check validation_details for more information.
403falseBad/absent signature header.
500falseServer-side issue; please reach out to Sila support.