Deriv API
Documentation
Options Trading (Legacy)

Options Trading (Legacy) REST

Read-only access to a migrated user's pre-upgrade options trading data — historical statement, legacy accounts, and platform upgrade status.

Overview

After a user's account has been upgraded from the legacy options platform, these endpoints surface their pre-upgrade transaction statement and account mapping so that the historical record remains available. All three are read-only, require an OAuth2 token with the tradescope, and are scoped to the calling user. While a user's migration is still pending or has failed, the statement and accounts endpoints return HTTP 409.

Typical Workflow

  1. Call GET /trading/v1/options/legacy/migration-statusto confirm the user's migration has reached complete. While the status is pending or failed, the other two endpoints return HTTP 409.
  2. List the user's pre-upgrade loginids and accounts via GET /trading/v1/options/legacy/accounts.
  3. Pull the pre-upgrade transaction history per loginid via GET /trading/v1/options/legacy/statement?loginid=..., paginating with limit and offset.
  4. For all live trading and account operations, continue to use the standard Options Trading endpoints — these legacy routes serve historical data only.

Available Endpoints

Authentication

All endpoints in this section require the Deriv-App-ID header and an Authorization: Bearer YOUR_AUTH_TOKEN header with the trade OAuth2 scope.

OAuth2 Scopes

EndpointScope
GET /trading/v1/options/legacy/migration-statustrade
GET /trading/v1/options/legacy/accountstrade
GET /trading/v1/options/legacy/statementtrade
1curl -X GET "https://api.derivws.com/trading/v1/options/legacy/migration-status" \
2  -H "Deriv-App-ID: YOUR_APP_ID" \
3  -H "Authorization: Bearer YOUR_OAUTH_TOKEN"

Response Status Codes

Standard HTTP status codes are returned. A 409 indicates the caller's migration is pending or has failed — this is specific to the legacy endpoints.

2xx Success
200 OK — Request successful. For migration-status, all known states (including pending, failed, not_applicable) are returned with 200.
4xx/5xx Errors
400 Bad Request — Bad input (e.g. malformed loginid)
401 Unauthorized — Invalid or missing authentication
404 Not Found — User or default account not found
409 Conflict — User migration is pending or has failed
422 Unprocessable Entity — Request validation error
500 Internal Server Error — Server-side error
503 Service Unavailable — Service temporarily unavailable

Error Response Format

All error responses follow a consistent structure with an errors array and metadata:

1{
2  "errors": [
3    {
4      "status": 409,
5      "code": "MigrationPending",
6      "message": "User migration is pending or has failed"
7    }
8  ],
9  "meta": {
10    "endpoint": "/trading/v1/options/legacy/statement",
11    "method": "GET",
12    "timing": 21
13  }
14}
Click to open live chat support. Get instant help from our support team.