Reset a paper trading account
curl --request POST \
--url https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset \
--header 'Content-Type: application/json' \
--header 'x-app-api-key: <api-key>' \
--data '
{
"balanceRaw": "<string>",
"balance": 1,
"reason": "<string>"
}
'import requests
url = "https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset"
payload = {
"balanceRaw": "<string>",
"balance": 1,
"reason": "<string>"
}
headers = {
"x-app-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-app-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({balanceRaw: '<string>', balance: 1, reason: '<string>'})
};
fetch('https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset', 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://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'balanceRaw' => '<string>',
'balance' => 1,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-app-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset"
payload := strings.NewReader("{\n \"balanceRaw\": \"<string>\",\n \"balance\": 1,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-app-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset")
.header("x-app-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"balanceRaw\": \"<string>\",\n \"balance\": 1,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-app-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"balanceRaw\": \"<string>\",\n \"balance\": 1,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"account": {
"id": "<string>",
"appId": "<string>",
"name": "<string>",
"externalId": "<string>",
"currency": "<string>",
"startingBalanceRaw": "<string>",
"startingBalance": 123,
"cashBalanceRaw": "<string>",
"cashBalance": 123,
"realizedPnlRaw": "<string>",
"realizedPnl": 123,
"kycStatus": "verified",
"kycVerified": true,
"createdAt": "<string>",
"updatedAt": "<string>"
},
"adjustment": {
"id": "<string>",
"accountId": "<string>",
"amountRaw": "<string>",
"amount": 123,
"previousCashBalanceRaw": "<string>",
"previousCashBalance": 123,
"newCashBalanceRaw": "<string>",
"newCashBalance": 123,
"reason": "<string>",
"createdAt": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Execution
Reset a paper trading account
POST
/
apps
/
{appId}
/
paper-trading
/
accounts
/
{accountId}
/
reset
Reset a paper trading account
curl --request POST \
--url https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset \
--header 'Content-Type: application/json' \
--header 'x-app-api-key: <api-key>' \
--data '
{
"balanceRaw": "<string>",
"balance": 1,
"reason": "<string>"
}
'import requests
url = "https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset"
payload = {
"balanceRaw": "<string>",
"balance": 1,
"reason": "<string>"
}
headers = {
"x-app-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-app-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({balanceRaw: '<string>', balance: 1, reason: '<string>'})
};
fetch('https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset', 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://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'balanceRaw' => '<string>',
'balance' => 1,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-app-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset"
payload := strings.NewReader("{\n \"balanceRaw\": \"<string>\",\n \"balance\": 1,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-app-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset")
.header("x-app-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"balanceRaw\": \"<string>\",\n \"balance\": 1,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/apps/{appId}/paper-trading/accounts/{accountId}/reset")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-app-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"balanceRaw\": \"<string>\",\n \"balance\": 1,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"account": {
"id": "<string>",
"appId": "<string>",
"name": "<string>",
"externalId": "<string>",
"currency": "<string>",
"startingBalanceRaw": "<string>",
"startingBalance": 123,
"cashBalanceRaw": "<string>",
"cashBalance": 123,
"realizedPnlRaw": "<string>",
"realizedPnl": 123,
"kycStatus": "verified",
"kycVerified": true,
"createdAt": "<string>",
"updatedAt": "<string>"
},
"adjustment": {
"id": "<string>",
"accountId": "<string>",
"amountRaw": "<string>",
"amount": 123,
"previousCashBalanceRaw": "<string>",
"previousCashBalance": 123,
"newCashBalanceRaw": "<string>",
"newCashBalance": 123,
"reason": "<string>",
"createdAt": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
App-scoped API key for programmatic app management.
Body
application/json
⌘I