NAV
Shell HTTP JavaScript Node.JS PHP Ruby Python Java GO
  • Getting started
  • Authentication
  • REST APIs
  • WebSockets
  • Standards and Conventions
  • Errors and Rate Limits
  • Exchange Accounts

    In this section, you will get information on how to create/cancel orders or withdraw funds using the Private APIs of your exchange through Crypto APIs

    Create Account

    Sample Data

    
    curl -X POST \
      https://api.cryptoapis.io/v1/trading/exchange-accounts \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "exchangeId" : "BINANCE",
        "exchangeApiKey" : "xxxxxxxxxxxxxxxxxx",
        "exchangeSecret" : "xxxxxxxxxxxxxxxxxx",
        "exchangePassword" : "xxxxxxxxxxxxxxxxxx",
        "exchangeUid" : "xxxxxxxxxxxxxxxxxx"
    }'
    
    
    
    
    POST /v1/trading/exchange-accounts HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "exchangeId" : "BINANCE",
        "exchangeApiKey" : "xxxxxxxxxxxxxxxxxx",
        "exchangeSecret" : "xxxxxxxxxxxxxxxxxx",
        "exchangePassword" : "xxxxxxxxxxxxxxxxxx",
        "exchangeUid" : "xxxxxxxxxxxxxxxxxx"
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/exchange-accounts",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"exchangeId\" : \"BINANCE\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxxxxxxxxxx\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "POST",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/exchange-accounts",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
        exchangeId : 'BINANCE',
        exchangeApiKey : 'xxxxxxxxxxxxxxxxxx',
        exchangeSecret : 'xxxxxxxxxxxxxxxxxx',
        exchangePassword : 'xxxxxxxxxxxxxxxxxx',
        exchangeUid : 'xxxxxxxxxxxxxxxxxx'
    }));
    req.end();
    
    
    
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/exchange-accounts');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "exchangeId" : "BINANCE",
        "exchangeApiKey" : "xxxxxxxxxxxxxxxxxx",
        "exchangeSecret" : "xxxxxxxxxxxxxxxxxx",
        "exchangePassword" : "xxxxxxxxxxxxxxxxxx",
        "exchangeUid" : "xxxxxxxxxxxxxxxxxx"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/exchange-accounts")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"exchangeId\" : \"BINANCE\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxxxxxxxxxx\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"exchangeId\" : \"BINANCE\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxxxxxxxxxx\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("POST", "/v1/trading/exchange-accounts", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"exchangeId\" : \"BINANCE\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxxxxxxxxxx\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/exchange-accounts")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/exchange-accounts"
    
        payload := strings.NewReader("{\n\t\"exchangeId\" : \"BINANCE\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxxxxxxxxxx\"}\n}")
    
        req, _ := http.NewRequest("POST", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": {
            "accountId": "a6748fdf-5677-47a0-b9e4-739afd0b9e14",
            "exchangeId": "BINANCE",
            "exchangeApiKey": "xxxxxxxxxxxxxxxxxx"
        }
    }
    

    Create an account for Trading APIs

    HTTP Request

    POST /v1/trading/exchange-accounts

    Body/Query Parameters

    Variable Type Required Description
    exchangeId string Yes Exchange id supported in Trading APIs
    exchangeApiKey string Yes Your api key in the exchange, needed for validating calls to Private APIs
    exchangeSecret string No Exchange specific authentication part
    exchangePassword string No Exchange specific authentication part
    exchangeUid string No Exchange specific authentication part

    Output Variables

    Variable Type Required Description
    accountId string Yes Id of your account used for making calls to an exchange's Private APIs
    exchangeId string Yes Exchange id supported in Trading APIs
    exchangeApiKey string Yes Your api key in the exchange, needed for validating calls to Private APIs

    List All Accounts

    Sample Data

    
    curl -X GET \
      'https://api.cryptoapis.io/v1/trading/exchange-accounts' \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key'
    
    
    
    GET https://api.cryptoapis.io/v1/trading/exchange-accounts HTTP/1.1
    Host: https://api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    
    
    $.ajaxSetup({
      headers:{
        "Content-Type": "application/json" ,
        "X-API-Key": "my-api-key"
      }
    });
    
    $.get('https://api.cryptoapis.io/v1/trading/exchange-accounts').then(function(d) {console.log(d)});
    
    
    
    const https = require('https');
    
    var options = {
      "method": "GET",
      "hostname": "https://api.cryptoapis.io",
      "path": "/v1/trading/exchange-accounts",
      "headers": {
        'Content-Type': 'application/json',
        'X-API-Key': 'my-api-key'
      }
    };
    
    var request = https.request(options, function (response) {
      response.on("data", function (data) {
        console.log(data);
      });
    });
    
    request.end();
    
    
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/exchange-accounts');
    $request->setMethod(HTTP_METH_GET);
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    try {
      $response = $request->send();
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/exchange-accounts")
    http = Net::HTTP.new(url.host, url.port)
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    response = http.request(request)
    puts response.read_body
    
    
    
    import requests
    url = 'https://api.cryptoapis.io/v1/trading/exchange-accounts'
    headers = {
      'Content-Type' : 'application/json',
      'X-API-Key' : 'my-api-key'
    }
    response = requests.get(url, headers=headers)
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/exchange-accounts")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    import (
      "gopkg.in/resty.v0"
    )
    
    func main()
    {
        resp, err := resty.R().
          SetHeader("Content-Type", "application/json").
          SetHeader("X-API-Key", "my-api-key").
          Get("https://api.cryptoapis.io/v1/trading/exchange-accounts")
    }
    
    

    Response Body

    {
        "payload": [
            {
                "accountId": "068924dc-d66b-4319-baab-d96ab0550000",
                "exchangeId": "BINANCE",
                "exchangeApiKey": "xxxxxxxxxxxxxxxxxx"
            }
        ]
    }
    

    Show all your accounts for Trading APIs present in our system

    HTTP Request

    GET /v1/trading/exchange-accounts

    Output Variables

    Variable Type Required Description
    accountId string Yes Id of your account used for making calls to an exchange's Private APIs
    exchangeId string Yes Exchange id supported
    exchangeApiKey string Yes Your api key in the exchange, needed for validating calls to Private APIs

    Get Account

    Sample Data

    
    curl -X GET \
      'https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000' \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key'
    
    
    
    GET https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000 HTTP/1.1
    Host: https://api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    
    
    $.ajaxSetup({
      headers:{
        "Content-Type": "application/json" ,
        "X-API-Key": "my-api-key"
      }
    });
    
    $.get('https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000').then(function(d) {console.log(d)});
    
    
    
    const https = require('https');
    
    var options = {
      "method": "GET",
      "hostname": "https://api.cryptoapis.io",
      "path": "/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000",
      "headers": {
        'Content-Type': 'application/json',
        'X-API-Key': 'my-api-key'
      }
    };
    
    var request = https.request(options, function (response) {
      response.on("data", function (data) {
        console.log(data);
      });
    });
    
    request.end();
    
    
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000');
    $request->setMethod(HTTP_METH_GET);
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    try {
      $response = $request->send();
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000")
    http = Net::HTTP.new(url.host, url.port)
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    response = http.request(request)
    puts response.read_body
    
    
    
    import requests
    url = 'https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000'
    headers = {
      'Content-Type' : 'application/json',
      'X-API-Key' : 'my-api-key'
    }
    response = requests.get(url, headers=headers)
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    import (
      "gopkg.in/resty.v0"
    )
    
    func main()
    {
        resp, err := resty.R().
          SetHeader("Content-Type", "application/json").
          SetHeader("X-API-Key", "my-api-key").
          Get("https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000")
    }
    
    

    Response Body

    {
        "payload": {
            "accountId": "6bb54842-2d45-4554-9316-080000000000",
            "exchangeId": "BINANCE",
            "exchangeApiKey": "xxxxxxxxxxxxxxxxxx"
        }
    }
    

    Show account balance for a given exchange.

    HTTP Request

    GET /v1/trading/exchange-accounts/{accountId}

    URL Parameters

    Variable Type Description
    accountId string Id of your account used for making calls to an exchange's Private APIs

    Output Variables

    Variable Type Required Description
    accountId string Yes Id of your account used for making calls to an exchange's Private APIs
    exchangeId string Yes Exchange id supported in Trading APIs
    exchangeApiKey string Yes Your api key in the exchange, needed for validating calls to Private APIs

    Update Account

    Sample Data

    
    curl -X PUT \
      https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000 \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key' \
      -d '{
        "exchangeId" : "BITSTAMP",
        "exchangeApiKey" : "xxxxxxxxxx",
        "exchangeSecret" : "xxxxxxxxxx",
        "exchangePassword" : "xxxxxxxxxx",
        "exchangeUid" : ""
    }'
    
    
    
    
    PUT /v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000 HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    {
        "exchangeId" : "BITSTAMP",
        "exchangeApiKey" : "xxxxxxxxxx",
        "exchangeSecret" : "xxxxxxxxxx",
        "exchangePassword" : "xxxxxxxxxx",
        "exchangeUid" : "xxxxxxxxxx"
    }
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000",
      "method": "PUT",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
      "data": "{\n\t\"exchangeId\" : \"BITSTAMP\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxx\"}\n}"
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "PUT",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
        exchangeId: 'BITSTAMP',
        exchangeApiKey: 'xxxxxxxxxx',
        exchangeSecret: 'xxxxxxxxxx',
        exchangePassword: 'xxxxxxxxxx',
        exchangeUid: ''
    }));
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000');
    $request->setMethod(HTTP_METH_PUT);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    $request->setBody('{
        "exchangeId" : "BITSTAMP",
        "exchangeApiKey" : "xxxxxxxxxx",
        "exchangeSecret" : "xxxxxxxxxx",
        "exchangePassword" : "xxxxxxxxxx",
        "exchangeUid" : ""
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    request.body = "{\n\t\"exchangeId\" : \"BITSTAMP\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxx\"}\n}"
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    payload = "{\n\t\"exchangeId\" : \"BITSTAMP\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxx\"}\n}"
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("PUT", "/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\\n\t\"exchangeId\" : \"BITSTAMP\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxx\"}\n}");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000")
      .post(body)
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000"
    
        payload := strings.NewReader("{\n\t\"exchangeId\" : \"BITSTAMP\",\n\t\"exchangeApiKey\" : \"xxxxxxxxxx\",\n\t\"exchangeSecret\" : \"xxxxxxxxxx\",\n\t\"exchangePassword\" : \"xxxxxxxxxx\",\n\t\"exchangeUid\" : \"xxxxxxxxxx\"}\n}")
    
        req, _ := http.NewRequest("PUT", url, payload)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": {
            "accountId": "6bb54842-2d45-4554-9316-080000000000",
            "exchangeId": "BITSTAMP",
            "exchangeApiKey": "xxxxxxxxxxxxxxxxxxxxxx"
        }
    }
    

    Updates an account for Trading APIs

    HTTP Request

    PUT /v1/trading/exchange-accounts/{accountId}

    URL Parameters

    Variable Type Description
    accountId string Id of your account used for making calls to an exchange's Private APIs

    Body/Query Parameters

    Variable Type Required Description
    exchangeId string Yes Exchange id supported in Trading APIs
    exchangeApiKey string Yes Your api key in the exchange, needed for validating calls to Private APIs
    exchangeSecret string No Exchange specific authentication part
    exchangePassword string No Exchange specific authentication part
    exchangeUid string No Exchange specific authentication part

    Output Variables

    Variable Type Required Description
    accountId string Yes Id of your account used for making calls to an exchange's Private APIs
    exchangeId string Yes Exchange id supported in Trading APIs
    exchangeApiKey string Yes Your api key in the exchange, needed for validating calls to Private APIs

    Delete Account

    Sample Data

    
    curl -X DELETE \
      https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000 \
      -H 'Content-Type: application/json' \
      -H 'X-API-Key: my-api-key'
    
    
    
    
    DELETE /v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000 HTTP/1.1
    Host: api.cryptoapis.io
    Content-Type: application/json
    X-API-Key: my-api-key
    
    
    
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000",
      "method": "DELETE",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      },
      "processData": false,
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    
    
    var http = require("http");
    
    var options = {
      "method": "DELETE",
      "hostname": "api.cryptoapis.io",
      "path": "/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000",
      "headers": {
        "Content-Type": "application/json",
        "X-API-Key": "my-api-key"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
    
    
    
    
    &lt;?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000');
    $request->setMethod(HTTP_METH_DELETE);
    
    $request->setHeaders(array(
      'Content-Type' => 'application/json',
      'X-API-Key' => 'my-api-key'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    
    ?>
    
    
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["X-API-Key"] = 'my-api-key'
    
    response = http.request(request)
    puts response.read_body
    
    
    
    
    import http.client
    
    conn = http.client.HTTPConnection("https://api.cryptoapis.io")
    
    headers = {
      'Content-Type': "application/json",
      'X-API-Key': "my-api-key"
    }
    
    conn.request("DELETE", "/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000", "", headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    
    
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    Request request = new Request.Builder()
      .url("https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000")
      .delete()
      .addHeader("Content-Type", "application/json")
      .addHeader("X-API-Key", "my-api-key")
      .build();
    
    Response response = client.newCall(request).execute();
    
    
    
    
    package main
    
    import (
        "fmt"
        "strings"
        "net/http"
        "io/ioutil"
    )
    
    func main() {
    
        url := "https://api.cryptoapis.io/v1/trading/exchange-accounts/6bb54842-2d45-4554-9316-080000000000"
    
        req, _ := http.NewRequest("DELETE", url)
    
        req.Header.Add("Content-Type", "application/json")
        req.Header.Add("X-API-Key", "my-api-key")
    
        res, _ := http.DefaultClient.Do(req)
    
        defer res.Body.Close()
        body, _ := ioutil.ReadAll(res.Body)
    
        fmt.Println(res)
        fmt.Println(string(body))
    
    }
    
    

    Response Body

    {
        "payload": {
          "success": true
        }
    }
    

    Deletes an account for Trading APIs

    HTTP Request

    DELETE /v1/trading/exchange-accounts/{accountId}

    URL Parameters

    Variable Type Description
    accountId string Id of your account used for making calls to an exchange's Private APIs

    Output Variables

    Variable Type Required Description
    success string Yes Success status