Deriv API
Migration guide/Statement

Statement

Account
Auth Required

Get account statement showing transactions. The loginid parameter removed, transfer-related fields removed, and action_type validation relaxed.

Quick comparison

AspectLegacyNewAction required
Endpoint
✅ Same
statementstatementNone
Auth Required
✅ Same
YesYesNone
loginid param
⚠️ Changed
SupportedRemovedRemove from requests
Transfer fields
⚠️ Changed
fees, from, toRemovedUpdate response handling
action_type validation
⚠️ Changed
EnumAny stringUpdate validation logic
Response fields
⚠️ Changed
OptionalRequiredSimplify null checks

Breaking changes

1. loginid parameter removed

What Changed: The loginid parameter used for multi-token authorization has been removed from the request.

Migration: Remove loginid from your request payloads. If you need multi-account support, authenticate with the specific account token instead.

2. app_id field removed from response

What Changed: The app_id field (application ID where contract was purchased) is no longer returned in transaction objects.

Migration: Remove any code that references transaction.app_id.

3. fees object removed from response

What Changed: The fees object containing transfer fee details (amount, currency, minimum, percentage) is no longer available.

Migration: If you need transfer fee information, use an alternative endpoint or calculate fees separately.

4. from and to objects removed from response

What Changed: The from and to objects containing transfer source/destination account login IDs are no longer available for transfer transactions.

Migration: Remove code that references transaction.from.loginid or transaction.to.loginid.

5. withdrawal_details field removed from response

What Changed: The withdrawal_details string containing additional withdrawal information (processing times, etc.) is no longer returned.

Migration: Remove code that references transaction.withdrawal_details.

6. action_type enum validation removed

What Changed: The action_type parameter no longer validates against a fixed enum. Legacy accepted: buy, sell, deposit, withdrawal, escrow, adjustment, virtual_credit, transfer. The new API accepts any string value.

Migration: Update any type-safe validation logic that depends on specific enum values.

7. Response fields now required

What Changed: The response now guarantees certain fields: statement.count, statement.transactions, and for each transaction: action_type, amount, balance_after, transaction_id, transaction_time.

Migration: You can simplify null checks for these fields as they are now always present.

Request structure

Legacy Request Example

1{
2  "statement": 1,
3  "action_type": "buy",
4  "description": 1,
5  "limit": 25,
6  "offset": 0,
7  "loginid": "CR123456"
8}

New Request Example

1{
2  "statement": 1,
3  "action_type": "buy",
4  "description": 1,
5  "limit": 25,
6  "offset": 0
7}

Note: The loginid parameter has been removed in v4. The action_type parameter now accepts any string value (no longer enum-validated).

Response structure

Legacy Response Example

1{
2  "statement": {
3    "count": 100,
4    "transactions": [
5      {
6        "action_type": "buy",
7        "amount": -10.50,
8        "app_id": 1234,
9        "balance_after": 989.50,
10        "contract_id": 123456789,
11        "longcode": "Win payout if...",
12        "transaction_id": 987654321,
13        "transaction_time": 1234567890
14      },
15      {
16        "action_type": "transfer",
17        "amount": 50.00,
18        "balance_after": 1039.50,
19        "fees": {
20          "amount": 0.5,
21          "currency": "USD",
22          "percentage": 1
23        },
24        "from": { "loginid": "CR111111" },
25        "to": { "loginid": "CR123456" },
26        "transaction_id": 987654322,
27        "transaction_time": 1234567900
28      }
29    ]
30  },
31  "msg_type": "statement"
32}

New Response Example

1{
2  "statement": {
3    "count": 100,
4    "transactions": [
5      {
6        "action_type": "buy",
7        "amount": -10.50,
8        "balance_after": 989.50,
9        "contract_id": 123456789,
10        "longcode": "Win payout if...",
11        "transaction_id": 987654321,
12        "transaction_time": 1234567890
13      },
14      {
15        "action_type": "transfer",
16        "amount": 50.00,
17        "balance_after": 1039.50,
18        "transaction_id": 987654322,
19        "transaction_time": 1234567900
20      }
21    ]
22  },
23  "msg_type": "statement"
24}

Note: The count field is still available and now required. Fields removed: app_id, fees, from, to, withdrawal_details.

Code examples

Legacy Implementation

1async function getStatement(loginid) {
2  const request = {
3    statement: 1,
4    description: 1,
5    limit: 25,
6    loginid: loginid // For multi-account
7  };
8
9  ws.send(JSON.stringify(request));
10
11  ws.onmessage = (event) => {
12    const response = JSON.parse(event.data);
13    if (response.msg_type === 'statement') {
14      console.log('Total:', response.statement.count);
15      response.statement.transactions.forEach(t => {
16        console.log(`${t.action_type}: ${t.amount}`);
17        // Transfer details available
18        if (t.fees) {
19          console.log('Fee:', t.fees.amount);
20        }
21        if (t.from && t.to) {
22          console.log(`From: ${t.from.loginid}`);
23          console.log(`To: ${t.to.loginid}`);
24        }
25      });
26    }
27  };
28}

New Implementation

1async function getStatement() {
2  // loginid parameter removed - authenticate 
3  // with specific account token instead
4  const request = {
5    statement: 1,
6    description: 1,
7    limit: 25
8  };
9
10  ws.send(JSON.stringify(request));
11
12  ws.onmessage = (event) => {
13    const response = JSON.parse(event.data);
14    if (response.msg_type === 'statement') {
15      // count is still available and required
16      console.log('Total:', response.statement.count);
17      response.statement.transactions.forEach(t => {
18        console.log(`${t.action_type}: ${t.amount}`);
19        // Transfer details (fees, from, to) 
20        // no longer available
21      });
22    }
23  };
24}