Skip to main content
POST
/
it
/
calculator
/
pnl
/
crypto
Submit P&L Job
curl --request POST \
  --url https://test-api.sandbox.co.in/it/calculator/pnl/crypto \
  --header 'Authorization: <authorization>' \
  --header 'x-accept-type: <x-accept-type>' \
  --header 'x-api-key: <x-api-key>'
import requests

url = "https://test-api.sandbox.co.in/it/calculator/pnl/crypto"

headers = {
"x-accept-type": "<x-accept-type>",
"x-api-key": "<x-api-key>",
"Authorization": "<authorization>"
}

response = requests.post(url, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'x-accept-type': '<x-accept-type>',
'x-api-key': '<x-api-key>',
Authorization: '<authorization>'
}
};

fetch('https://test-api.sandbox.co.in/it/calculator/pnl/crypto', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://test-api.sandbox.co.in/it/calculator/pnl/crypto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-accept-type: <x-accept-type>",
"x-api-key: <x-api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://test-api.sandbox.co.in/it/calculator/pnl/crypto"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("x-accept-type", "<x-accept-type>")
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Authorization", "<authorization>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://test-api.sandbox.co.in/it/calculator/pnl/crypto")
.header("x-accept-type", "<x-accept-type>")
.header("x-api-key", "<x-api-key>")
.header("Authorization", "<authorization>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://test-api.sandbox.co.in/it/calculator/pnl/crypto")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-accept-type"] = '<x-accept-type>'
request["x-api-key"] = '<x-api-key>'
request["Authorization"] = '<authorization>'

response = http.request(request)
puts response.read_body

Headers

x-accept-type
string
required
x-api-key
string
required

Your API key used to authenticate and authorize the request.

x-api-version
string

Indicates the version of the API you want to use. Ensures backward-compatible behavior.

Authorization
string
required

Token for user-level authorization.

Query Parameters

from
integer
required

Start timestamp (inclusive) for the P&L calculation period, expressed as Unix epoch time in milliseconds.

to
number
required

End timestamp (inclusive) for the P&L calculation period, expressed as Unix epoch time in milliseconds.

input
string
default:tradebook
required

Type of input file

output
enum<string>
required

Type of output file. Allowed values: tradewise_pnl or scripwise_pnl.

Available options:
tradewise_pnl