Elven Docs
English
English
  • Getting Started
  • System Configuration
    • Getting started with Elven
    • Project and Entities
      • Choose an Accounting Start Date
    • Inviting team members
    • Viewing activity logs
  • Financial Configuration
    • Configure Chart of Accounts
    • Configure Journal types
    • Configure Auxiliary Accounting
    • Setting Account Opening Balance
  • ACOUNT MANAGEMENT
    • Importing account balances
    • Importing transactions
      • Importing derivatives transactions
    • Verifying account balances
    • Counterparty Accounts Management
      • Managing counterparties
      • Automated counterparty identification
  • Transactions management
    • Transactions overview
  • Bookkeeping
    • Accounting with transaction data
      • Tagging of transactions
      • Rule based tagging
    • Accounting with business data
      • Importing business data using API
      • Importing business data with CSV file
      • Automated bookkeeping of business data
  • ASSETS AND VALUATIONS
    • Assets management
      • Add tokens via smart contract
      • Customising price feeds for assets
    • Fair value of Crypto assets and adjustments
    • Currency exchange (FX) PnL adjustment
    • Derivatives unrealized PnL adjustment
    • Broker business inventory management
  • RECONCILIATION
    • Transaction Reconciliation
  • REPORTS
    • Trial balance
    • Account Balance sheet
    • Financial statements
    • Crypto assets disclosure form
    • Dashboard
  • OpenAPI
    • Obtaining API Authorization
    • Import Business Data
    • Create Account
    • Query Account
    • Create Source
    • Query Source
    • Import Transfer
    • Import Trade
    • Import Gain/Loss
    • Import Account Balances
    • Import Price
    • Query Platform
    • Query Currency
    • Timezone
Powered by GitBook
On this page
  • API Overview
  • Request Headers
  • Request Parameters
  • Response Parameters
  • Notes

Was this helpful?

  1. OpenAPI

Import Trade

PreviousImport TransferNextImport Gain/Loss

Last updated 5 months ago

Was this helpful?

API Overview

This API enables the batch import of trade records into the system, supporting the import of multiple data entries in a single request.

  • Request Method:POST

  • Request URL:https://openapi.elven.com/open/v3/transaction/trade

Request Headers

Parameter Name
Type
Required
Description

elven-api-key

String

Yes

The API key assigned to you

elven-api-sign

String

Yes

Request signature, used to verify the legitimacy of the request

elven-api-timestamp

String

Yes

Request timestamp, in milliseconds

Request Parameters

Body Parameters (JSON Format)

Parameter Name
Type
Required
Description

entityAccountId

String

Yes

The primary key of the account.

sourceId

String

Yes

The primary key of the source.

timezone

String

No

list

Array

Yes

Transaction record list, containing multiple transaction objects, with a maximum of 1000 records supported per request.

Elements in the List

Parameter Name
Type
Required
Description

datetime

String

Yes

Transaction time in the format YYYY-MM-DD HH:mm:ss

tradeID

String

No

Transaction hash or unique identifier.

type

String

Yes

Transaction type.

positionSide

String

No

Future position direction (valid values: LONG/SHORT). Required only when type is FUTURE_OPEN or FUTURE_CLOSE.

baseAsset

String

Yes

Name of the base asset (maximum 200 characters).

baseAmount

Number

Yes

Amount of the base asset.

counterAsset

String

Yes

Name of the counter asset (case-sensitive).

counterAmount

Number

Yes

Amount of the counter asset.

feeAsset

String

No

Name of the fee asset.

feeAmount

Number

No

Amount of the fee.

memo

String

No

Additional information or notes for the transaction.

Type Parameter Description

Transaction Type
Description

FUTURE_OPEN

Open Position

FUTURE_CLOSE

Close Position

OPTION_BUY

Option Purchase

OPTION_SELL

Option Sale

OPTION_EXERCISE

Option Exercise

SPOT_BUY

Spot Purchase

SPOT_SELL

Spot Sale

FOREIGN_EXCHANGE

Foreign Exchange

SWAP

Swap


PositionSide Parameter Description

Type
Is positionSide required?

FUTURE_OPEN

Required

FUTURE_CLOSE

Required

Other Types

Must be left empty

Example Request

{
    "entityAccountId": "QfgBd6vH2ptevhqZjNTn06MiJOFUXGcD",
    "sourceId": "RHFjsy6UIgM1rdxvefXVsJy8L3NOhBmQ",
    "timezone": "UTC",
    "list": [
        {
            "datetime": "2023-11-01 11:13:00",
            "tradeID": "12341",
            "type": "FUTURE_OPEN",
            "positionSide": "LONG",
            "baseAsset": "Binance-ETHUSDT-PERP1",
            "baseAmount": 0.0081,
            "counterAsset": "USDT",
            "counterAmount": 16.793,
            "feeAsset": "USDT",
            "feeAmount": 0.01,
            "memo": ""
        },
        {
            "datetime": "2023-11-01 11:13:00",
            "tradeID": "12342",
            "type": "FUTURE_CLOSE",
            "positionSide": "LONG",
            "baseAsset": "Binance-ETHUSDT-PERP1",
            "baseAmount": 1.0081,
            "counterAsset": "USDT",
            "counterAmount": 17.793,
            "feeAsset": "USDT",
            "feeAmount": 1.01,
            "memo": ""
        }
    ]
}

Response Parameters

Parameter Name
Type
Description

success

String

Request status (e.g., success).

data

Boolean

Request result (e.g., true indicates success).

Example Response

{
    "status": "success",
    "data": true
}

Notes

  • Asynchronous Processing: This API only imports the transaction data into a pre-processing database. The system processes the data asynchronously, and the imported transactions will appear in the user's transaction list after processing is complete.

  • Record Limit: Each request supports importing up to 1000 transaction records. For larger datasets, split them into multiple requests.

  • Data Integrity: Ensure the transaction data is complete and accurate to avoid import errors.

  • Datetime Format: The datetime field must strictly follow the format YYYY-MM-DD HH:mm:ss. Parsing errors may occur if the format is incorrect.

Time Zone: If left empty, it will default to the entity’s time zone.

View Details
View Details