Documentation

Statement

AccountAuth Required

Get the account statement. The loginid parameter and transfer fields are removed, fewer action_type values are used, and app_id changed from an integer to a string.

Quick comparison

AspectLegacy APINew APIAction
EndpointstatementstatementNone
Auth RequiredYesYesNone
loginid parameterOptionalRemovedRemove from requests
action_type filter8 values4 valuesStop sending removed values
Transfer fieldsfees, from, to, withdrawal_detailsRemovedStop reading transfer fields
action_type in transactions9 values5 valuesHandle fewer values
app_id typeInteger or nullString or nullRead app_id as a string

Breaking changes

1. loginid parameter removed

In the Legacy API, loginid selected the account when you authorised several accounts. The New API does not accept it.

Required change: Remove loginid from your statement requests. Your token selects the account.

2. Fewer action_type filter values

The action_type filter in the request accepts buy, sell, deposit and withdrawal. It no longer accepts escrow, adjustment, virtual_credit or transfer.

Required change: Stop filtering by the values the New API no longer accepts.

3. Transfer fields removed

Transactions no longer include fees, from, to or withdrawal_details.

Required change: Stop reading these fields from statement transactions.

4. Fewer action_type values in transactions

The action_type of a returned transaction is buy, sell, deposit, withdrawal or adjustment. The New API no longer returns hold, release, virtual_credit or transfer.

Required change: Update code that handles the values the New API no longer returns.

5. app_id is now a string

Each transaction's app_id was an integer or null in the Legacy API. In the New API it is a string or null.

Required change: Read app_id as a string, and convert it if you compare it with a number.

Request structure

Legacy APIrequest example
{
  "statement": 1,
  "action_type": "transfer",
  "description": 1,
  "limit": 25,
  "loginid": "CR123456",
  "req_id": 1
}
New APIrequest example
{
  "statement": 1,
  "action_type": "deposit",
  "description": 1,
  "limit": 25,
  "req_id": 1
}

Response structure

Legacy APIresponse example
{
  "echo_req": {
    "statement": 1,
    "action_type": "transfer",
    "description": 1,
    "limit": 25,
    "loginid": "CR123456",
    "req_id": 1
  },
  "msg_type": "statement",
  "req_id": 1,
  "statement": {
    "count": 1,
    "transactions": [
      {
        "action_type": "transfer",
        "amount": -100,
        "app_id": 1089,
        "balance_after": 9900,
        "contract_id": null,
        "fees": {
          "amount": 1,
          "currency": "USD",
          "minimum": 0.1,
          "percentage": 1
        },
        "from": {
          "loginid": "CR123456"
        },
        "longcode": "Account transfer from CR123456 to CR654321",
        "reference_id": null,
        "to": {
          "loginid": "CR654321"
        },
        "transaction_id": 11542203587,
        "transaction_time": 1760000000
      }
    ]
  }
}
New APIresponse example
{
  "echo_req": {
    "statement": 1,
    "action_type": "deposit",
    "description": 1,
    "limit": 25,
    "req_id": 1
  },
  "msg_type": "statement",
  "req_id": 1,
  "statement": {
    "count": 1,
    "transactions": [
      {
        "action_type": "deposit",
        "amount": 100,
        "app_id": "1089",
        "balance_after": 10100,
        "contract_id": null,
        "longcode": "Deposit to CR123456",
        "reference_id": null,
        "transaction_id": 11542203588,
        "transaction_time": 1760000000
      }
    ]
  }
}

Code examples

function getStatement(loginId) {
  ws.send(JSON.stringify({ statement: 1, action_type: "transfer", description: 1, limit: 25, loginid: loginId }));

  ws.onmessage = (event) => {
    const response = JSON.parse(event.data);
    if (response.msg_type !== "statement") return;
    if (response.statement) {
      response.statement.transactions?.forEach((tx) => {
        console.log(tx.action_type, tx.amount, tx.from?.loginid, tx.to?.loginid);
      });
    }
  };
}
Click to open live chat support. Get instant help from our support team.