Calculate Tax P&L from Tradebook

Calculates Tax P&L from Tradebook


Important Links

Run in PostmanRun in Postman   API GuideAPI Guide  


Request Body Example

{
    "sheets": [
        {
            "name": "Foreign Equity",
            "metadata": {
                "currency": "USD"
            },
            "blocks": [
                {
                    "name": "Tradebook",
                    "@entity": "table",
                    "header": [
                        [
                            "isin",
                            "symbol",
                            "quantity",
                            "date",
                            "price",
                            "transaction_type",
                            "transfer_expenses",
                            "corporate_action"
                        ]
                    ],
                    "rows": [
                        [
                            null,
                            "BHG",
                            1,
                            1643380439478,
                            2.59,
                            "SELL",
                            1,
                            null
                        ],
                        [
                            null,
                            "AAPL",
                            0.7644,
                            1643380387229,
                            164.29,
                            "SELL",
                            1,
                            null
                        ],
                        [
                            null,
                            "AAPL",
                            0.1,
                            1634751623480,
                            148.5,
                            "BUY",
                            0.99,
                            null
                        ],
                        [
                            null,
                            "AAPL",
                            0.6644,
                            1634147917942,
                            143.29,
                            "BUY",
                            0,
                            null
                        ],
                        [
                            null,
                            "BHG",
                            1,
                            1630598986512,
                            9.63,
                            "BUY",
                            0.05,
                            null
                        ],
                        [
                            null,
                            "STXS",
                            0.4347826,
                            1628536115398,
                            9.2,
                            "SELL",
                            3,
                            null
                        ],
                        [
                            null,
                            "AMZN",
                            0.00149749,
                            1628536054329,
                            3338.92,
                            "BUY",
                            2.99,
                            null
                        ],
                        [
                            null,
                            "BTBT",
                            2.55754475,
                            1628189423570,
                            15.77,
                            "SELL",
                            3,
                            null
                        ],
                        [
                            null,
                            "BTBT",
                            2.55754475,
                            1628189293460,
                            15.64,
                            "BUY",
                            2.99,
                            null
                        ],
                        [
                            null,
                            "STXS",
                            1.10987791,
                            1628017687633,
                            9.01,
                            "BUY",
                            2.99,
                            null
                        ],
                        [
                            null,
                            "COOL",
                            0.2,
                            1626457655107,
                            9.75,
                            "BUY",
                            2.99,
                            null
                        ]
                    ]
                },
                {
                    "name": "Metadata",
                    "@entity": "table",
                    "header": [
                        [
                            "isin",
                            "symbol",
                            "address",
                            "country",
                            "zip_code",
                            "52_week_high",
                            "closing_value"
                        ]
                    ],
                    "rows": [
                        [
                            null,
                            "AAPL",
                            "ONE APPLE PARK WAY, CUPERTINO, CA 95014",
                            "United States of America",
                            "95014",
                            52,
                            177.57000732421875
                        ],
                        [
                            null,
                            "AMZN",
                            "410 TERRY AVENUE NORTH, SEATTLE, WA 98109",
                            "United States of America",
                            "98109",
                            52,
                            3334.340087890625
                        ],
                        [
                            null,
                            "BHG",
                            "8000 NORMAN CENTER DRIVE, SUITE 1200, MINNEAPOLIS, MN 55437",
                            "United States of America",
                            "55437",
                            52,
                            3.440000057220459
                        ],
                        [
                            null,
                            "BTBT",
                            "136-20 38th Avenue Suite 9A-2 Flushing New York, NY 11354",
                            "China",
                            "11354",
                            52,
                            6.079999923706055
                        ],
                        [
                            null,
                            "COOL",
                            "251 LYTTON AVENUE, SUITE 200, PALO ALTO, CA 94301",
                            "United States of America",
                            "94301",
                            52,
                            9.800000190734863
                        ],
                        [
                            null,
                            "STXS",
                            "4320 FOREST PARK AVENUE, SUITE 100, ST.LOUIS, MO 63108",
                            "United States of America",
                            "63108",
                            52,
                            6.199999809265137
                        ],
                        [
                            null,
                            "AAPL",
                            "ONE APPLE PARK WAY, CUPERTINO, CA 95014",
                            "United States of America",
                            "95014",
                            52,
                            174.61
                        ],
                        [
                            null,
                            "AMZN",
                            "410 TERRY AVENUE NORTH, SEATTLE, WA 98109",
                            "United States of America",
                            "98109",
                            52,
                            3259.95
                        ],
                        [
                            null,
                            "BHG",
                            "8000 NORMAN CENTER DRIVE, SUITE 1200, MINNEAPOLIS, MN 55437",
                            "United States of America",
                            "55437",
                            52,
                            1.93
                        ],
                        [
                            null,
                            "BTBT",
                            "136-20 38th Avenue Suite 9A-2 Flushing New York, NY 11354",
                            "China",
                            "11354",
                            52,
                            3.6
                        ],
                        [
                            null,
                            "COOL",
                            "251 LYTTON AVENUE, SUITE 200, PALO ALTO, CA 94301",
                            "United States of America",
                            "94301",
                            52,
                            9.82
                        ],
                        [
                            null,
                            "STXS",
                            "4320 FOREST PARK AVENUE, SUITE 100, ST.LOUIS, MO 63108",
                            "United States of America",
                            "63108",
                            52,
                            3.73
                        ],
                        [
                            null,
                            "AAPL",
                            "ONE APPLE PARK WAY, CUPERTINO, CA 95014",
                            "United States of America",
                            "95014",
                            52,
                            174.61
                        ],
                        [
                            null,
                            "AMZN",
                            "410 TERRY AVENUE NORTH, SEATTLE, WA 98109",
                            "United States of America",
                            "98109",
                            52,
                            3259.95
                        ],
                        [
                            null,
                            "BHG",
                            "8000 NORMAN CENTER DRIVE, SUITE 1200, MINNEAPOLIS, MN 55437",
                            "United States of America",
                            "55437",
                            52,
                            1.93
                        ],
                        [
                            null,
                            "BTBT",
                            "136-20 38th Avenue Suite 9A-2 Flushing New York, NY 11354",
                            "China",
                            "11354",
                            52,
                            3.6
                        ],
                        [
                            null,
                            "COOL",
                            "251 LYTTON AVENUE, SUITE 200, PALO ALTO, CA 94301",
                            "United States of America",
                            "94301",
                            52,
                            9.82
                        ],
                        [
                            null,
                            "STXS",
                            "4320 FOREST PARK AVENUE, SUITE 100, ST.LOUIS, MO 63108",
                            "United States of America",
                            "63108",
                            52,
                            3.73
                        ]
                    ]
                }
            ]
        },
        {
            "name": "Foreign Mutual Funds",
            "metadata": {
                "currency": "USD"
            },
            "blocks": [
                {
                    "name": "Tradebook",
                    "@entity": "table",
                    "header": [
                        [
                            "isin",
                            "type",
                            "symbol",
                            "quantity",
                            "date",
                            "price",
                            "transaction_type",
                            "transfer_expenses",
                            "corporate_action"
                        ]
                    ],
                    "rows": [
                        [
                            null,
                            "Equity",
                            "Vanguard S&P 500 ETF",
                            50.0,
                            1599589800001,
                            6.0,
                            "BUY",
                            2.99,
                            null
                        ],
                        [
                            null,
                            "Equity",
                            "Vanguard S&P 500 ETF",
                            35.0,
                            1643804395000,
                            8.5,
                            "SELL",
                            2.99,
                            null
                        ],
                        [
                            null,
                            "Debt",
                            "Vanguard Short-Term Bond ETF",
                            35.0,
                            1599589800001,
                            6,
                            "BUY",
                            2.99,
                            null
                        ]
                    ]
                },
                {
                    "name": "Metadata",
                    "@entity": "table",
                    "header": [
                        [
                            "isin",
                            "symbol",
                            "address",
                            "country",
                            "zip_code",
                            "52_week_high",
                            "closing_value"
                        ]
                    ],
                    "rows": [
                        [
                            null,
                            "Vanguard Short-Term Bond ETF",
                            "ONE APPLE PARK WAY, CUPERTINO, CA 95014",
                            "United States of America",
                            "95014",
                            52,
                            177.57000732421875
                        ],
                        [
                            null,
                            "Vanguard S&P 500 ETF",
                            "ONE APPLE PARK WAY, CUPERTINO, CA 95014",
                            "United States of America",
                            "95014",
                            52,
                            177.57000732421875
                        ]
                    ]
                }
            ]
        },
        {
            "name": "ADR",
            "metadata": {
                "currency": "USD"
            },
            "blocks": [
                {
                    "name": "Tradebook",
                    "@entity": "table",
                    "header": [
                        [
                            "isin",
                            "symbol",
                            "quantity",
                            "date",
                            "price",
                            "transaction_type",
                            "transfer_expenses",
                            "corporate_action"
                        ]
                    ],
                    "rows": [
                        [
                            null,
                            "Infosys Ltd ADR",
                            50.0,
                            1599589800001,
                            6.0,
                            "BUY",
                            2.99,
                            null
                        ],
                        [
                            null,
                            "Infosys Ltd ADR",
                            15.0,
                            1599589800001,
                            7.9,
                            "SELL",
                            2.99,
                            null
                        ]
                    ]
                },                
                {
                    "name": "Metadata",
                    "@entity": "table",
                    "header": [
                        [
                            "isin",
                            "symbol",
                            "address",
                            "country",
                            "zip_code",
                            "52_week_high",
                            "closing_value"
                        ]
                    ],
                    "rows": [
                        [
                            null,
                            "Infosys Ltd ADR",
                            "ONE APPLE PARK WAY, CUPERTINO, CA 95014",
                            "United States of America",
                            "95014",
                            52,
                            177.57000732421875
                        ]
                    ]
                }
            ]
        },
        {
            "name": "Other Foreign Income",
            "metadata": {
                "currency": "USD"
            },
            "blocks": [
                {
                    "name": "Interest",
                    "@entity": "table",
                    "header": [
                        [
                            "description",
                            "date",
                            "amount",
                            "tds"
                        ]
                    ],
                    "rows": [
                        [
                            "Interest Q1",
                            1601447257000,
                            1.5,
                            0
                        ],
                        [
                            "Interest Q2",
                            1601447257000,
                            1.5,
                            0
                        ]
                    ]
                },
                {
                    "name": "Dividends",
                    "@entity": "table",
                    "header": [
                        [
                            "isin",
                            "symbol",
                            "quantity",
                            "date",
                            "dividend_amount",
                            "tds"
                        ]
                    ],
                    "rows": [
                        [
                            "INE428A01015",
                            "GOOGL",
                            10,
                            1601447257000,
                            4,
                            0
                        ]
                    ]
                }
            ]
        }
    ]
}
Language
Click Try It! to start a request and see the response here!