/get_statements_data

Obtains historical monthly transaction statement information for all wallets for a specific app. Filtering by user_handle available.

📘

NOTE

This endpoint is intended to return a single month's worth of transactions. For multiple months of data, please call the endpoint for each month desired.

The current month is excluded from the endpoint. For the month parameter, please use any past month.

Request

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

Month is the only required key in the search_filters object.

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 was recently made optional if you would like to get transactions for all users. 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_statements_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", 
    "reference":  "<your unique id>"
  }, 
   "message": ”get_statements_data_msg”,
   "search_filters":{
       "month": "07-2022",
       "page":1,
       "per_page":100
   }
}
const res = await sila.getStatementsData(
   userHandle,
   privateKey,
   filters
  );

// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.success); // TRUE
console.log(res.data.status); // TRUE
console.log(res.data.page); // The number of page
console.log(res.data.returned_count);
console.log(res.data.statements);
payload = {
            "user_handle": "user.silamoney.eth",
            "search_filters": {
                "month": "07-2022",
                "page": 1,
                "per_page": 20,
               }
        }
User.get_statements_data(app, payload, eth_private_key)
## ***User private key is never transmitted over the network***

### Success Response Object
{
    "success": true,
    "status": "SUCCESS",
    "page": 1,
    "returned_count": 1,
    "total_count": 100,
    "statements": [
        {
            "user_handle": "user",
            "date": "01-2022",
            "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",
                    "running_balance": "$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",
                    "running_balance": "$100.00"
                }
            ]
        },
    ]
}

### Failure Response Object
{
    status: 'FAILURE'
}
//Load your informations
var filters = new StatementSearchFilters()
{
 Month = "07-2022",
 Page = 1,
 PerPage = 100
};
var user = DefaultConfig.FirstUser;
var response = api.GetStatementsData(user.UserHandle, 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";
StatementSearchFilters searchFilters = new StatementSearchFilters();
searchFilters.setPage(1);
searchFilters.setPerPage(20);
searchFilters.setMonth("10-2022");
ApiResponse response = api.getStatementsData(userHandle, userPrivateKey,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 Wallet statement 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();
$walletId = "<wallet_id>"

$StartMonth = "07-2022";
$EndMonth = "11-2022";
$Page = 1
$PerPage = 20

$filters->setStartMonth($StartMonth);
$filters->setEndMonth($EndMonth);
$filters->setPage($Page);
$filters->setPerPage($PerPage);

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

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

//Success Response Object
echo $response->getStatusCode(); // 200
$data = $response->getData();
echo $data->success; // TRUE
echo $data->status; // SUCCESS
echo $data->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;

//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.
search_filtersJSON objectAllows filtering results.
search_filters.monthstring / ISO‑8601 monthRequired. MM-YYYY
Only return statements created in specified month. Current month not valid.
search_filters.pageIntegerOptional.
Min Length 1
Default: 1
search_filters.
per_page
IntegerOptional.
Min 1
Max 100
Default per page 20

Response

HTTP/1.1 200 OK

 {
    "success": true,
    "status": "SUCCESS",
    "page": 1,
    "returned_count": 1,
    "total_count": 100,
    "statements": [
        {
            "user_handle": "user",
            "date": "01-2022",
            "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",
                    "running_balance": "$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",
                    "running_balance": "$100.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.