Introduction

CredoEx provides powerful REST APIs to allow you to programmatically perform nearly all the actions you can perform on the web interface.

The base url of API v1.0 is https://credoex.com/xapi/v1.

Keep in mind all the requests use the application/json content type.

General

Authentication

Every CredoEx API request, except Generating an API key request, should be authenticated to be executed on behalf of an account. Authentication parameters will be passed through the headers of an API request. The authentication parameters are below.

key description
xapi-key An API key generated by Generating an API key
xapi-passphrase A passphrase for an additional layer of security that is sent along with a request. It should be the same as the passphrase passed in Generating an API key request
xapi-request-signature A request signature is a base64-encoded SHA-256 HMAC using the API secret on the string timestamp + method + requestPath + body ("+" = string concatenation). The timestamp is the same as xpi-request-timestamp. Here is how to generate a request signature
xapi-request-timestamp A UNIX timestamp in seconds. A request timestamp will be used for an additional verification of request along with the request signature.

Generate a request signature

A request signature is a base64-encoded SHA256 HMAC using an API secret on the string timestamp + method + requestPath + body ("+" = string concatenation). The timestamp is the same as xapi-request-timestamp. These code snippets show how to generate a request signature of the GET /xpi/v1/wallets request.

  
    const crypto = require('crypto');

    const timestamp = Math.floor(Date.now() / 1000).toString();
    const xapi_secret = '39536c2e-83c9-4e8e-a063-73f66325d0d9'; // replace your API secret
    const method = 'GET';
    const request_path = '/xapi/v1/wallets';
    const query_string = '';
    const body = '';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    console.log('timestamp ', timestamp);
    console.log('signature ', xapi_request_signature);
  
  
    require 'openssl'
    require 'base64'

    timestamp = Time.now.to_i
    xapi_secret = '39536c2e-83c9-4e8e-a063-73f66325d0d9' # replace your API secret
    method = 'GET'
    request_path = '/xapi/v1/wallets'
    query_string = ''
    body = ''

    request_descriptor = "#{timestamp}" + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    puts('timestamp - ', timestamp)
    puts('signature - ', xapi_request_signature)
  
  
    import time
    import hmac
    import hashlib
    import base64

    timestamp = str(int(time.time()))
    xapi_secret = '39536c2e-83c9-4e8e-a063-73f66325d0d9' # replace your API secret
    method = 'GET'
    request_path = '/xapi/v1/wallets'
    query_string = ''
    body = ''

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()

    print('timestamp - ', timestamp)
    print('signature - ', xapi_request_signature)
  
  
    $timestamp = (string)time();
    $xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c'; // replace your API secret
    $method = 'GET';
    $request_path = '/xapi/v1/wallets';
    $query_string = '';
    $body = '';

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    echo 'timestamp - '.$timestamp;
    echo 'signature - '.$xapi_request_signature;
  

Authorization with API key permissions

Permissions restrict the functionality of API keys. A set of permissions is configured by passing them to parameters in the body of the request when generating an API key. You can see an example of this usage in the Generating an API key documentation.

permissions type description
credoex_read boolean true to grant read permissions for an API key. This includes all GET endpoints of CredoEx
credoex_transfer boolean true to grant transfer permissions for an API key. Transfers including deposits and withdrawals need transfer permissions
credoex_trade boolean true to grant trade permissions for an API key. Order APIs need trade permissions

Pagination

CredoEx paginates results to make sure responses are easier to handle. These pages return results in batches rather than all at once. Pages are typically 50 results long. When no next_page_token is provided in the request, the first page of the results is returned. To retrieve the second page, you can pass the next_page_token from the first response to the second page's request query. You can access each next page in a similar manner.

Here are code snippet examples of the external_transactions endpoint which shows how you can pass next_page_token to the request query.

  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/order_book`;
    const query_string = "next_page_token=SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDg3MzlhMDBmLTIzNTAtNGZjMC04MjJjLTgyOTU0MDQ4Njc2NmQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEJZAAEaG91cmEJZAALbWljcm9zZWNvbmRoAmIAAuwiYQZkAAZtaW51dGVhKGQABW1vbnRoYQhkAAZzZWNvbmRhGGQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYA8LhqI2UB.h4S_AcSLF2ePubuO7vRr_DNA9oSx0ZKKMs318rRdgvc";
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path + "?" + query_string,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/order_book"
    query_string = "next_page_token=SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDg3MzlhMDBmLTIzNTAtNGZjMC04MjJjLTgyOTU0MDQ4Njc2NmQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEJZAAEaG91cmEJZAALbWljcm9zZWNvbmRoAmIAAuwiYQZkAAZtaW51dGVhKGQABW1vbnRoYQhkAAZzZWNvbmRhGGQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYA8LhqI2UB.h4S_AcSLF2ePubuO7vRr_DNA9oSx0ZKKMs318rRdgvc"
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path + '?' + query_string, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = '/xapi/v1/currency_pairs/%s/order_book' % (currency_pair_code)
    query_string = "next_page_token=SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDg3MzlhMDBmLTIzNTAtNGZjMC04MjJjLTgyOTU0MDQ4Njc2NmQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEJZAAEaG91cmEJZAALbWljcm9zZWNvbmRoAmIAAuwiYQZkAAZtaW51dGVhKGQABW1vbnRoYQhkAAZzZWNvbmRhGGQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYA8LhqI2UB.h4S_AcSLF2ePubuO7vRr_DNA9oSx0ZKKMs318rRdgvc"
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(base_path + request_path + '?' + query_string, headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/order_book";
    $query_string = "next_page_token=SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDg3MzlhMDBmLTIzNTAtNGZjMC04MjJjLTgyOTU0MDQ4Njc2NmQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEJZAAEaG91cmEJZAALbWljcm9zZWNvbmRoAmIAAuwiYQZkAAZtaW51dGVhKGQABW1vbnRoYQhkAAZzZWNvbmRhGGQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYA8LhqI2UB.h4S_AcSLF2ePubuO7vRr_DNA9oSx0ZKKMs318rRdgvc";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path. "?" . $query_string, false, $context);

    print_r($result);
  

API Reference

Generate an API Key

You need an API key to sign any requests to CredoEx. Using this API, you can generate an API key which will be used for your future API requests to CredoEx.

Request

POST https://credoex.com/xapi/v1/xapi_keys

  • Headers:
    key description
    user-email The registered email of the CredoEx User Account
    user-password The registered password of the CredoEx User Account
  • Body:
    parameter type required description
    permissions array yes Permissions to access functionality of CredoEx
    passphrase string yes A passphrase for the API Key. You should pass it in future API requests with the API Key
  
    const request = require('request');

    // use the email and password of your CredoEx account
    const headers = {
      'Content-Type': 'application/json',
      'user-email': '[email protected]',
      'user-password': 'your password'
    };

    const body = JSON.stringify({
      permissions: {
        credoex_read: true,
        credoex_trade: true,
        credoex_transfer: true
      },
      passphrase: 'your passphrase' // set your passphrase
    });

    request({
      url: "https://credoex.com/xapi/v1/xapi_keys",
      method: "POST",
      headers: headers,
      body: body
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'rest-client'

    # use the email and password of your CredoEx account
    headers = {
      content_type: :json,
      'user-email': '[email protected]',
      'user-password': 'your password'
    }

    body = {
      permissions: {
        credoex_read: true,
        credoex_trade: true,
        credoex_transfer: true
      },
      passphrase: 'your passphrase' # set your passphrase
    }

    response = RestClient.post 'https://credoex.com/xapi/v1/xapi_keys', body.to_json, headers

    puts 'response', response.body
  
  
    import requests
    import json

    # use the email and password of your CredoEx account
    headers = {
      "Content-Type": "application/json",
      "user-email": "[email protected]",
      "user-password": "your password"
    }

    body = {
      "permissions": {
        "credoex_read": True,
        "credoex_trade": True,
        "credoex_transfer": True
      },
      "passphrase": "your passphrase" # set your passphrase
    }

    response = requests.post("https://credoex.com/xapi/v1/xapi_keys", data=json.dumps(body), headers=headers)

    print("response - ", response.text)
  
  
    $body = array(
      'permissions' => array(
        'credoex_read' => true,
        'credoex_trade' => true,
        'credoex_transfer' => true
      ),
      'passphrase' => "your passphrase" // set your passphrase
    );

    // use the email and password of your CredoEx account
    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "user-email: [email protected]\r\n" .
                       "user-password: your password\r\n",
          'method'  => "POST",
          'content' => json_encode($body)
        )
      )
    );

    $result = file_get_contents('https://credoex.com/xapi/v1/xapi_keys', false, $context);

    print_r($result);
  

Response

{ "secret": "bd9b8c19-c9fe-4456-a30a-78110ab948ac", "permissions": { "credoex_transfer": true, "credoex_trade": true, "credoex_read": true }, "id": "9aacf4c3-1a12-426e-aaaa-dceade0bcce2" }
field description
id An API key
secret An API secret of the API key, to be used for generating a request signature
permissions permissions granted to the functionality of the API keys

Read an API Key

Get the details of an existing API Key.

Request

GET https://credoex.com/xapi/v1/xapi_keys/<api-key>

An API key should be passed to the request URL.

  • Headers:
    key description
    user-email The registered email of the CredoEx User Account
    user-password The registered password of the CredoEx User Account
  • Body: No body parameter.
  
    const request = require('request');

    const base_path = 'https://credoex.com';
    const xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d'; // your API key
    const request_path = `/xapi/v1/xapi_keys/${xapi_key}`;

    // use the email and password of your CredoEx account
    const headers = {
      'Content-Type': 'application/json',
      'user-email': '[email protected]',
      'user-password': 'your password'
    };

    request({
      url: base_path + request_path,
      method: "GET",
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'rest-client'

    base_path = 'https://credoex.com'
    xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d' # your API key
    request_path = "/xapi/v1/xapi_keys/#{xapi_key}"

    # use the email and password of your CredoEx account
    headers = {
      content_type: :json,
      'user-email': '[email protected]',
      'user-password': 'your password'
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import requests
    import json

    base_path = 'https://credoex.com'
    xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d' # your api key
    request_path = '/xapi/v1/xapi_keys/%s' % (xapi_key)

    # use the email and password of your CredoEx account
    headers = {
      "Content-Type": "application/json",
      "user-email": "[email protected]",
      "user-password": "your password"
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $xapi_key = "b811f374-8df3-42f8-bde8-73b9e797758d"; // your api key
    $request_path = "/xapi/v1/xapi_keys/$xapi_key";

    // use the email and password of your CredoEx account
    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "user-email: [email protected]\r\n" .
                       "user-password: your password\r\n",
          'method'  => "GET"
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "secret": "bd9b8c19-c9fe-4456-a30a-78110ab948ac", "permissions": { "credoex_transfer": true, "credoex_trade": true, "credoex_read": true }, "id": "9aacf4c3-1a12-426e-aaaa-dceade0bcce2" }
field description
id An API key
secret An API secret of the API key, to be used for generating a request signature
permissions permissions granted to the API key

Update an API Key

Update permissions and the passphrase of your API key.

Request

PUT https://credoex.com/xapi/v1/xapi_keys/<api-key>

An API key should be passed to the request URL.

  • Headers:
    key description
    user-email The registered email of the CredoEx User Account
    user-password The registered password of the CredoEx User Account
  • Body:
    parameter type required description
    permissions array yes Permissions to access functionality of CredoEx
    passphrase string yes A passphrase for the API Key. You should pass it in future API requests with the API Key.
  
    const request = require('request');

    const base_path = 'https://credoex.com';
    const xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d'; // your API key
    const request_path = `/xapi/v1/xapi_keys/${xapi_key}`;

    // use the email and password of your CredoEx account
    const headers = {
      'Content-Type': 'application/json',
      'user-email': '[email protected]',
      'user-password': 'your password'
    };

    const body = JSON.stringify({
      permissions: {
        credoex_read: false,
        credoex_trade: true,
        credoex_transfer: true
      },
      passphrase: 'your passphrase'
    });

    request({
      url: base_path + request_path,
      method: "PUT",
      headers: headers,
      body: body
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'rest-client'

    base_path = 'https://credoex.com'
    xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d' # your API key
    request_path = "/xapi/v1/xapi_keys/#{xapi_key}"

    # use the email and password of your CredoEx account
    headers = {
      content_type: :json,
      'user-email': '[email protected]',
      'user-password': 'your password'
    }

    body = {
      permissions: {
        credoex_read: true,
        credoex_trade: true,
        credoex_transfer: true
      },
      passphrase: 'your passphrase' # set your passphrase
    }

    response = RestClient.put base_path + request_path, body.to_json, headers

    puts 'response', response.body
  
  
    import requests
    import json

    base_path = 'https://credoex.com'
    xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d' # your api key
    request_path = '/xapi/v1/xapi_keys/%s' % (xapi_key)

    # use the email and password of your CredoEx account
    headers = {
      "Content-Type": "application/json",
      "user-email": "[email protected]",
      "user-password": "your password"
    }

    body = {
      "permissions": {
        "credoex_read": True,
        "credoex_trade": True,
        "credoex_transfer": True
      },
      "passphrase": "your passphrase" # set your passphrase
    }

    response = requests.put(''.join([base_path, request_path]), data=json.dumps(body), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $xapi_key = "b811f374-8df3-42f8-bde8-73b9e797758d"; // your api key
    $request_path = "/xapi/v1/xapi_keys/$xapi_key";

    $body = array(
      'permissions' => array(
        'credoex_read' => true,
        'credoex_trade' => true,
        'credoex_transfer' => true
      ),
      'passphrase' => "your passphrase" // set your passphrase
    );

    // use the email and password of your CredoEx account
    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "user-email: [email protected]\r\n" .
                       "user-password: your password\r\n",
          'method'  => "PUT",
          'content' => json_encode($body)
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "secret": "bd9b8c19-c9fe-4456-a30a-78110ab948ac", "permissions": { "credoex_transfer": true, "credoex_trade": true, "credoex_read": true }, "id": "9aacf4c3-1a12-426e-aaaa-dceade0bcce2" }
field description
id An API key
secret An API secret of the API key, to be used for generating a request signature
permissions permissions granted to the API key

Delete an API Key

Delete an API key resource.

Request

DELETE https://credoex.com/xapi/v1/xapi_keys/<api-key>

An API key should be passed to the request URL.

  • Headers:
    key description
    user-email The registered email of the CredoEx User Account
    user-password The registered password of the CredoEx User Account
  • Body: No body parameter.
  
    const request = require('request');

    const base_path = 'https://credoex.com';
    const xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d'; // your API key
    const request_path = `/xapi/v1/xapi_keys/${xapi_key}`;

    // use the email and password of your CredoEx account
    const headers = {
      'Content-Type': 'application/json',
      'user-email': '[email protected]',
      'user-password': 'your password'
    };

    request({
      url: base_path + request_path,
      method: "DELETE",
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", response.statusCode);
    });
  
  
    require 'rest-client'

    base_path = 'https://credoex.com'
    xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d' # your API key
    request_path = "/xapi/v1/xapi_keys/#{xapi_key}"

    # use the email and password of your CredoEx account
    headers = {
      content_type: :json,
      'user-email': '[email protected]',
      'user-password': 'your password'
    }

    response = RestClient::Request.execute(method: :delete, url: base_path + request_path, headers: headers)
  
  
    import requests
    import json

    base_path = 'https://credoex.com'
    xapi_key = 'b811f374-8df3-42f8-bde8-73b9e797758d' # your api key
    request_path = '/xapi/v1/xapi_keys/%s' % (xapi_key)

    # use the email and password of your CredoEx account
    headers = {
      "Content-Type": "application/json",
      "user-email": "[email protected]",
      "user-password": "your password"
    }

    response = requests.delete(''.join([base_path, request_path]), headers=headers)

    print("response - ", response)
  
  
    $base_path = "https://credoex.com";
    $xapi_key = "b811f374-8df3-42f8-bde8-73b9e797758d"; // your api key
    $request_path = "/xapi/v1/xapi_keys/$xapi_key";

    // use the email and password of your CredoEx account
    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "user-email: [email protected]\r\n" .
                       "user-password: your password\r\n",
          'method'  => "DELETE"
        )
      )
    );

    file_get_contents($base_path . $request_path, false, $context);
  

Response

If the API key has been successfully deleted, the response's status code will be 204. If no API key was found the status code will be 404.

List currency pairs

Retrieve all tradable currency (asset) pairs.

API key Permission

The API key needs any of these permissions - credoex_read, credoex_trade, credoex_transfer.

Request

GET https://credoex.com/xapi/v1/currency_pairs

  • Headers: Like every API request to CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const request_path = '/xapi/v1/currency_pairs';
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    request_path = '/xapi/v1/currency_pairs'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    request_path = '/xapi/v1/currency_pairs'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $request_path = "/xapi/v1/currency_pairs";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "data": [ { "quote_precision": 18, "priority": 13, "market_rate": 6.8e-5, "is_traded": true, "is_admin_only": false, "id": "dc5c9c86-9bd1-4f41-bdb2-db3828a4de44", "display_size_precision": 8, "display_price_precision": 8, "code": "CREDO-ETH", "base_precision": 18 }, { "quote_precision": 2, "priority": 0, "market_rate": 0.07, "is_traded": true, "is_admin_only": false, "id": "21edc8e8-3179-4778-bd9e-9eb70221c982", "display_size_precision": 8, "display_price_precision": 2, "code": "CREDO-USD", "base_precision": 18 }, ... ] }
field description
id An id of the pair which is an internal identifier on CredoEx
is_trade Shows if the currency pair is tradable on CredoEx
is_admin_only Shows if the currency pair is only available for CredoEx internal administrators
code A unique code of the currency pair
base_precision Precision of the base currency
quote_precision Precision of the quote currency
display_size_precision Precision of the base currency when it's displayed
display_price_precision Precision of the quote currency when it's displayed
priority Priority defines the sort order of currency pairs
market_rate Market exchange rate. 1 of the base currency is exchanged for market_rate of the quote currency.

List currencies

Retrieve all the currencies you can use on CredoEx.

API key Permission

The API key needs any of these permissions - credoex_read, credoex_trade, or credoex_transfer.

Request

GET https://credoex.com/xapi/v1/currencies

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const request_path = '/xapi/v1/currencies';
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    request_path = '/xapi/v1/currencies'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    request_path = '/xapi/v1/currencies'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $request_path = "/xapi/v1/currencies";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "data": [ { "withdrawal_24hr_limit": 50.0, "type": "erc20", "priority": 14, "precision": 18, "per_withdrawal_limit": 50.0, "name": "Credo", "min_withdrawal_amount": 0.1, "id": "0ec6582a-46e2-42c1-be30-85128b218496", "confirmations_required": 50, "code": "CREDO" }, { "withdrawal_24hr_limit": 0.003, "type": "base_crypto", "priority": 13, "precision": 18, "per_withdrawal_limit": 0.003, "name": "Ethereum", "min_withdrawal_amount": 5.0e-6, "id": "3d23c3a8-19cf-4b0b-ae69-a329407400e3", "confirmations_required": 50, "code": "ETH" }, ... ] }
field description
id An id of the currency which is an internal identifier on CredoEx
type Type of the currency
code A unique code of the currency
name Name of the currency
precision Precision of the currency
priority Priority defines the sort order of the currency
withdrawal_24hr_limit The maximum withdrawal amount limit within 24 hours
per_withdrawal_limit The maximum amount limit per withdrawal
min_withdrawal_amount The minimum amount limit per withdrawal
confirmations_required Number of confirmations required for a transaction in the currency

List wallets

Retrieve all wallets from your account.

API key Permission

The API key needs the credoex_read permission.

Request

GET https://credoex.com/xapi/v1/wallets

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const request_path = '/xapi/v1/wallets';
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    request_path = '/xapi/v1/wallets'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    request_path = '/xapi/v1/wallets'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $request_path = "/xapi/v1/wallets";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "data": [ { "id": "3f64edae-bb28-4d79-8d65-d6fc98b5bee3", "currency_id": "4b22ca94-3f9e-4ad1-87bb-fd6bfab8f767", "balance_amount": 1 }, { "id": "73da4ab7-6bc8-4926-8f68-1e39ac1091ce", "currency_id": "52c833fb-705e-45da-a8d9-e00aff83e58f", "balance_amount": 0 }, ... ] }
field description
id A wallet id which is an internal identifier on CredoEx
currency_id An id of the currency of the wallet
balance_amount Balance amount of the wallet

Show a wallet

Get the details of a wallet for a specific currency. The currency-code should be passed to the request URL.

API key Permission

The API key needs the credoex_read permission.

Request

GET https://credoex.com/xapi/v1/wallets/<currency-code>

You should pass currency-code to the request URL, e.g. CREDO

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency = 'CREDO';
    const request_path = `/xapi/v1/wallets/${currency}`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency = 'CREDO'
    request_path = "/xapi/v1/wallets/#{currency}"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency = 'CREDO'
    request_path = '/xapi/v1/wallets/%s' % (currency)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency = "CREDO";
    $request_path = "/xapi/v1/wallets/$currency";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "id": "3f64edae-bb28-4d79-8d65-d6fc98b5bee3", "currency_id": "4b22ca94-3f9e-4ad1-87bb-fd6bfab8f767", "balance_amount": 0.9 }
field description
id A wallet id which is an internal identifier on CredoEx
currency_id An id of the currency of the wallet
balance_amount Balance amount of the wallet

List external transactions

Retrieve all external transactions of your CredoEx account.

API key Permission

The API key needs the credoex_transfer permission.

Request

GET https://credoex.com/xapi/v1/external_transactions

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const request_path = '/xapi/v1/external_transactions';
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    request_path = '/xapi/v1/external_transactions'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    request_path = '/xapi/v1/external_transactions'
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $request_path = "/xapi/v1/external_transactions";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "next_page_token": "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDc5MTY4MGM5LTI2N2QtNDdhZi1iNjg0LWM1MTg4MGE5MGY3OWQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEMZAAEaG91cmEAZAALbWljcm9zZWNvbmRoAmIAA61CYQZkAAZtaW51dGVhLmQABW1vbnRoYQZkAAZzZWNvbmRhNmQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYAyD8BFmUB.KMywQlOm7ZcpbdiKIgvJ_EP8cMKH5KCgDCNePJJSVZA", "data": [ { "type": "deposit", "tx_hash": "0xffaa533db20361579d6e822092a400f50ed8765ba0891f67a28c9cb301b1a1e2", "status": "confirmed", "inserted_at": "2018-07-25T06:37:30.647992Z", "id": "023e4949-74a2-42dc-8c23-d448b4a89028", "executed_at": null, "currency_id": "7686e877-252a-4b13-9da8-7458849b7efb", "confirmations_count": 0, "amount": 0.05 }, { "type": "deposit", "tx_hash": "0x06896d61e29a1566a7bd0e5cfb207ae249234602012d2331b5ebfe23e51e7784", "status": "confirmed", "inserted_at": "2018-07-25T06:21:30.576140Z", "id": "b37efb9a-c831-44be-9719-f248d634a0ac", "executed_at": null, "currency_id": "5ea41549-d6f8-4592-87f2-9c3b93c84653", "confirmations_count": 0, "amount": 1.0 }, ... ] }
field description
next_page_token Token for the next page. A basic usage of next_page_token can be found here
id An id of the transaction which is an internal identifier on CredoEx
type Type of the transaction. It should be deposit or withdrawal
tx_hash Hash of the transaction
currency_id An id of the currency which the transaction used
amount Amount of the transaction
confirmations_count Number of remaining confirmations
status Transaction status
inserted_at Datetime when the transaction is inserted
executed_at Datetime when the transaction is executed

Show an external transaction

Get the details of an external transaction by using a transaction-id. The transaction-id should be passed to the request URL.

API key Permission

The API key needs the credoex_transfer permission.

Request

GET https://credoex.com/xapi/v1/external_transactions/<transaction-id>

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const transaction_id = '023e4949-74a2-42dc-8c23-d448b4a89028';
    const request_path = `/xapi/v1/external_transactions/${transaction_id}`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    transaction_id = '023e4949-74a2-42dc-8c23-d448b4a89028'
    request_path = "/xapi/v1/external_transactions/#{transaction_id}"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    transaction_id = '023e4949-74a2-42dc-8c23-d448b4a89028'
    request_path = '/xapi/v1/external_transactions/%s' % (transaction_id)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $transaction_id = "023e4949-74a2-42dc-8c23-d448b4a89028";
    $request_path = "/xapi/v1/external_transactions/$transaction_id";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "type": "deposit", "tx_hash": "0xffaa533db20361579d6e822092a400f50ed8765ba0891f67a28c9cb301b1a1e2", "status": "confirmed", "inserted_at": "2018-07-25T06:37:30.647992Z", "id": "023e4949-74a2-42dc-8c23-d448b4a89028", "executed_at": null, "currency_id": "7686e877-252a-4b13-9da8-7458849b7efb", "confirmations_count": 0, "amount": 0.05 }
field description
id An id of the transaction which is an internal identifier on CredoEx
type Type of the transaction. It should be either deposit or withdrawal
tx_hash Hash of the transaction
currency_id An id of the currency which the transaction uses
amount Amount of the transaction
confirmations_count Number of remaining confirmations
status Transaction status
inserted_at Datetime when the transaction is inserted
executed_at Datetime when the transaction is executed

List orders

Retrieve all exchange orders you placed for a currency pair.

API key Permission

It needs the credoex_read permission.

Request

GET https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/orders

In the API request url, you need to include currency-pair-code, e.g. CREDO-ETH

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/orders`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/orders"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = '/xapi/v1/currency_pairs/%s/orders' % (currency_pair_code)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/orders";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "next_page_token": "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDE0Mjk3YTc1LTQ0OTYtNDFkMC05NzVjLTBjMTMxYTBmN2FmYmQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEDZAAEaG91cmETZAALbWljcm9zZWNvbmRoAmIADJ8pYQZkAAZtaW51dGVhImQABW1vbnRoYQVkAAZzZWNvbmRhJmQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYARwADFmUB.OtjQ79HDKkjoeuQgWRAC_SN0q5l3DIonkb5wfOrKtTU", "data": [ { "user_id": "07d099ba-3a7c-45e4-9732-1b4f8c6101ff", "status": "active", "remaining_amount": 1.0, "order_type": "buy_limit", "inserted_at": "2018-06-21T06:04:27.473784Z", "initial_amount": 1.0, "id": "2e888a0f-abce-45ff-9e7b-a72c901c35e5", "exchange_rate": 1.0e-8, "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663" }, { "user_id": "07d099ba-3a7c-45e4-9732-1b4f8c6101ff", "status": "executed", "remaining_amount": 0.0, "order_type": "buy_limit", "last_deal_rate": 7.911434680784908e-5, "inserted_at": "2018-06-12T06:55:04.467858Z", "initial_amount": 1.0, "id": "c849d967-72f8-468c-8881-55f4d0dbaa33", "exchange_rate": 7.912e-5, "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663" }, ... ] }
field description
next_page_token Token for the next page. A basic usage of next_page_token can be found here
id An id of the order which is an internal identifier on CredoEx
order_type Type of the order. It should be either sell_limit, sell_market, buy_limit, or buy_market
user_id An id of the user who placed the order
initial_amount Initial amount of the order
remaining_amount Remaining amount of the order
exchange_rate Desired exchange rate of the order
last_deal_rate Last exchange rate applied for the order
currency_pair_id An id of the currency pair
status The order status
inserted_at Datetime when the order is placed

Show an order

Get the details of an order by using order-id. The order-id should be passed to the request URL.

API key Permission

The API key needs the credoex_read permission.

Request

GET https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/orders/<order-id>

You should pass currency-pair-code and order-id to the request URL.

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const order_id = '2e888a0f-abce-45ff-9e7b-a72c901c35e5';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/orders/${order_id}`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    order_id = '2e888a0f-abce-45ff-9e7b-a72c901c35e5'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/orders/#{order_id}"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    order_id = '2e888a0f-abce-45ff-9e7b-a72c901c35e5'
    request_path = '/xapi/v1/currency_pairs/%s/orders/%s' % (currency_pair_code, order_id)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $order_id = "2e888a0f-abce-45ff-9e7b-a72c901c35e5";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/orders/$order_id";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "user_id": "07d099ba-3a7c-45e4-9732-1b4f8c6101ff", "status": "canceled", "remaining_amount": 1.0, "order_type": "buy_limit", "inserted_at": "2018-06-21T06:04:27.473784Z", "initial_amount": 1.0, "id": "2e888a0f-abce-45ff-9e7b-a72c901c35e5", "exchange_rate": 1.0e-8, "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663", "canceled_at": "2018-08-07T20:57:32.745113Z" }
field description
id An id of the order
order_type Type of the order. It should be either sell_limit, sell_market, buy_limit, or buy_market
user_id An id of the user who placed the order
initial_amount Initial amount of the order
remaining_amount Remaining amount of the order
exchange_rate Desired exchange rate of the order
currency_pair_id An id of the currency pair
status The order status
inserted_at Datetime when the order is placed

Place an order

Place a buy/sell order for an exchange market.

You can place a sell order with an initial amount below or equal to your account's balance of the base currency. You can place a market buy order with an initial amount below or equal to your account's balance of the quote currency. You can place a limit buy order with the amount multiplied by the exchange rate that is below or equal to your account's balance of the quote currency.

API key Permission

The API key needs the credoex_trade permission.

Request

POST https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/orders

In the API request url, you need to include currency-pair-code, e.g. CREDO-ETH

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body:
    parameter type required description
    order_type string yes order_type can be either buy_limit, sell_limit, buy_market, or sell_market
    initial_amount decimal yes Order size: the amount you want to buy or sell
    exchange_rate decimal no Limit price of the order. You should specify exchange_rate if order_type is buy_limit or sell_limit.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'POST';
    const currency_pair_code = 'CREDO-ETH';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/orders`;
    const query_string = '';
    const body = JSON.stringify({
      order_type: 'buy_limit',
      initial_amount: 1,
      exchange_rate: 0.00035
    });

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: body
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'POST'
    currency_pair_code = 'CREDO-ETH'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/orders"
    query_string = ''
    body = {
      order_type: 'sell_limit',
      initial_amount: 1,
      exchange_rate: 0.00035
    }.to_json

    # replace your API secret, API key, passphrase
    xapi_secret = '6ca618d4-f760-436f-be98-aa2daf65bc7f'
    xapi_key = '2cfeee21-ab7b-46af-a102-2862e7081f9d'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient.post base_path + request_path, body, headers

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests
    import json

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'POST'
    currency_pair_code = 'CREDO-ETH'
    request_path = '/xapi/v1/currency_pairs/%s/orders' % (currency_pair_code)
    query_string = ''
    body = json.dumps({
      'order_type': 'sell_limit',
      'initial_amount': 1,
      'exchange_rate': 0.00035
    })

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.post(''.join([base_path, request_path]), data=body, headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "POST";
    $currency_pair_code = "CREDO-ETH";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/orders";
    $query_string = "";
    $body = json_encode(array(
      'order_type' => 'sell_limit',
      'initial_amount' => 1,
      'exchange_rate' => 0.00035
    ));

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp . $method . $request_path . $query_string . $body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method,
          'content' => $body
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

If the balance is insufficient, it returns 424 error. If success, the response is:

{ "user_id": "f0cc6c97-17ff-4c02-bb62-e61aab930bd9", "status": "active", "remaining_amount": 0.001, "order_type": "sell_limit", "inserted_at": "2018-08-09T10:40:30.434359Z", "initial_amount": 0.001, "id": "e11596a9-7ad5-4c3a-8cc5-b8309c318220", "exchange_rate": 3.5e-4, "currency_pair_id": "dc5c9c86-9bd1-4f41-bdb2-db3828a4de44" }
field description
id An id of the new order
order_type Type of the order
user_id An id of the user who placed the order
initial_amount Initial amount of the order
remaining_amount Remaining amount of the order
exchange_rate If the order_type is buy_limit or sell_limit, the exchange rate of the order
currency_pair_id An id of the currency pair
status The order status
inserted_at Datetime when the order is placed

Cancel an order

Cancel an existing order by using an order-id. The order-id should be passed to the request url.

API key Permission

It needs credoex_trade permission.

Request

DELETE https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/orders/<order-id>

In the API request url, you need to include currency-pair-code and order-id.

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'DELETE';
    const currency_pair_code = 'CREDO-ETH';
    const order_id = "f7686712-98fa-4366-821c-44023aa1618a";
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/orders/${order_id}`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", response.statusCode);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'DELETE'
    currency_pair_code = 'CREDO-ETH'
    order_id = '7f6e9928-3227-4efc-85be-ce080cebe5fe'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/orders/#{order_id}"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '6ca618d4-f760-436f-be98-aa2daf65bc7f'
    xapi_key = '2cfeee21-ab7b-46af-a102-2862e7081f9d'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    RestClient::Request.execute(method: :delete, url: base_path + request_path, headers: headers)
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'DELETE'
    currency_pair_code = 'CREDO-ETH'
    order_id = '92f66bdf-bc67-48cf-8a82-49a9fff9a94f'
    request_path = '/xapi/v1/currency_pairs/%s/orders/%s' % (currency_pair_code, order_id)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.delete(''.join([base_path, request_path]), headers=headers)

    print("response - ", response)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "DELETE";
    $currency_pair_code = "CREDO-ETH";
    $order_id = "bc6660ce-be61-491a-927b-bc59628d7571";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/orders/$order_id";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp . $method . $request_path . $query_string . $body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method,
          'content' => $body
        )
      )
    );

    file_get_contents($base_path . $request_path, false, $context);
  

Response

If the order has been successfully canceled, the response's status code is 204. If the cancellation has failed, the status code will be 424.

List trades

Retrieve all exchange trades (deals) for a currency pair.

API key Permission

The API key needs the credoex_read permission.

Request

GET https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/deals

Include currency-pair-code in the API request url, e.g. CREDO-ETH.

  • Headers: Like every API request to CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/deals`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/deals"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = '/xapi/v1/currency_pairs/%s/deals' % (currency_pair_code)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/deals";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "next_page_token": "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDcwYjM3NjYwLTBlYmUtNDM5NS1hN2NkLTA3NWEwZjczZDk1N2QACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEPZAAEaG91cmEXZAALbWljcm9zZWNvbmRoAmIAC6iNYQZkAAZtaW51dGVhLGQABW1vbnRoYQVkAAZzZWNvbmRhA2QACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYAK_EEFmUB.A8b9W77NjA6L5kBEtDSNSIH8a1WoQFd6d-dv2Up1qwg", "data": [ { "quote_amount": 7.911434680784908e-5, "inserted_at": "2018-06-12T06:55:06.785964Z", "id": "b6ed6a90-47a1-45e8-84f0-efc86e05bf4a", "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663", "buyer_id": "07d099ba-3a7c-45e4-9732-1b4f8c6101ff", "base_amount": 1.0 }, { "seller_id": "07d099ba-3a7c-45e4-9732-1b4f8c6101ff", "quote_amount": 3.044180442622854e-4, "inserted_at": "2018-06-08T20:15:24.559592Z", "id": "f71a8bc2-88f9-4d67-83ed-d69fae55175b", "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663", "base_amount": 9.196399606953278 }, ... ] }
field description
next_page_token Token for the next page. A description of next_page_token can be found here
id An id of the trade (deal) which is an internal identifier on CredoEx
seller_id An id of a user who sold assets in this trade
buyer_id An id of a user who bought assets in this trade
base_amount Amount of the base currency
quote_amount Amount of the quote currency
currency_pair_id An id of the currency pair
inserted_at Datetime of the trade (deal)

Show a trade

Get the details of a trade (deal) by using deal-id. The deal-id should be passed to the request URL.

API key Permission

The API key needs the credoex_read permission.

Request

GET https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/deals/<deal-id>

You should pass currency-pair-code and deal-id to the request URL.

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const deal_id = 'f71a8bc2-88f9-4d67-83ed-d69fae55175b';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/deals/${deal_id}`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    deal_id = 'f71a8bc2-88f9-4d67-83ed-d69fae55175b'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/deals/#{deal_id}"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    deal_id = 'f71a8bc2-88f9-4d67-83ed-d69fae55175b'
    request_path = '/xapi/v1/currency_pairs/%s/deals/%s' % (currency_pair_code, deal_id)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $deal_id = "f71a8bc2-88f9-4d67-83ed-d69fae55175b";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/deals/$deal_id";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "seller_id": "07d099ba-3a7c-45e4-9732-1b4f8c6101ff", "quote_amount": 3.044180442622854e-4, "inserted_at": "2018-06-08T20:15:24.559592Z", "id": "f71a8bc2-88f9-4d67-83ed-d69fae55175b", "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663", "base_amount": 9.196399606953278 }
field description
id An id of the trade (deal)
seller_id An id of a user who sold assets in this trade
buyer_id An id of a user who bought assets in this trade
base_amount Amount of the base currency
quote_amount Amount of the quote currency
currency_pair_id An id of the currency pair
inserted_at Datetime of the trade (deal)

Get order book

Retrieve all active orders for a currency pair.

API key Permission

The API key needs any of these permissions - credoex_read, credoex_trade, credoex_transfer.

Request

GET https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/order_book

Include currency-pair-code in the API request url, e.g. CREDO-ETH.

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/order_book`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/order_book"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = '/xapi/v1/currency_pairs/%s/order_book' % (currency_pair_code)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/order_book";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "next_page_token": "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDc4MzMwYjVjLWEyOTgtNDliNy1hYTA2LWQ4MzRhZGVlNzQxYWQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEKZAAEaG91cmEWZAALbWljcm9zZWNvbmRoAmIAAkAJYQZkAAZtaW51dGVhMmQABW1vbnRoYQRkAAZzZWNvbmRhDWQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYAWcgHFmUB.2Rm76iUbLP0GV220KxhJVn0xka7-0YHut6EQ-UoodcM", "data": [ { "status": "active", "remaining_amount": 0.16152187912118476, "order_type": "buy_limit", "last_deal_rate": 2.8074777372583885e-4, "inserted_at": "2018-08-07T17:54:04.482715Z", "initial_amount": 0.19396500390915228, "id": "d43c594d-f465-43e9-be12-f9a9fae3912b", "exchange_rate": 2.9394250907915107e-4, "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663" }, { "status": "active", "remaining_amount": 0.3144124672637361, "order_type": "buy_limit", "last_deal_rate": 2.635902060503669e-4, "inserted_at": "2018-08-07T04:05:34.012561Z", "initial_amount": 0.5821359811170934, "id": "c53dd5ca-a8dc-42a5-88b0-cc6d1634b867", "exchange_rate": 2.635902060503669e-4, "currency_pair_id": "f045757a-666e-478a-8d1d-4c18186a3663" }, ... ] }
field description
next_page_token Token for the next page. A description of next_page_token can be found here
id An id of the order which is an internal identifier on CredoEx
order_type Type of the order. It should be either sell_limit, sell_market, buy_limit, or buy_market
initial_amount Initial amount of the order
remaining_amount Remaining amount of the order
exchange_rate Desired exchange rate of the order
last_deal_rate Last exchange rate applied for the order
currency_pair_id An id of the currency pair
status The order status
inserted_at Datetime when the order is placed

Get trade book

Retrieve all trades for a currency pair.

API key Permission

The API key needs any of these permissions credoex_read, credoex_trade, credoex_transfer.

Request

GET https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/deal_book

Include currency-pair-code in the API request, e.g. CREDO-ETH.

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/deal_book`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/deal_book"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    request_path = '/xapi/v1/currency_pairs/%s/deal_book' % (currency_pair_code)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/deal_book";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "next_page_token": "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDJlNWYxMDUxLWQ0NmQtNGFhZS04ZTI1LTFjOGE2NTczYzI5ZWQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEJZAAEaG91cmEAZAALbWljcm9zZWNvbmRoAmIADfk9YQZkAAZtaW51dGVhFWQABW1vbnRoYQhkAAZzZWNvbmRhEWQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYAaC86HGUB.J5H1OPxB0iQ-7Db3CeJqxX9_fKx-kLcRY_6OqmKArV4", "data": [ { "quote_amount": 6.0598125e-5, "inserted_at": "2018-08-09T01:07:21.324786Z", "id": "5f52076f-ee0c-4403-9a60-638cfbf03452", "currency_pair_id": "dc5c9c86-9bd1-4f41-bdb2-db3828a4de44", "base_amount": 0.9975 }, { "quote_amount": 6.054825e-5, "inserted_at": "2018-08-09T01:07:20.980098Z", "id": "67c47059-6168-4e78-ad3d-040519eeb97f", "currency_pair_id": "dc5c9c86-9bd1-4f41-bdb2-db3828a4de44", "base_amount": 0.9975 }, ... ] }
field description
next_page_token Token for the next page. A basic description of next_page_token can be found here
id An id of the trade (deal) which is an internal identifier on CredoEx
base_amount Amount of the base currency
quote_amount Amount of the quote currency
currency_pair_id An id of the currency pair
inserted_at Datetime of the trade (deal)

List market snapshots

Get a list of market snapshots for a currency pair by an interval duration.

API key Permission

The API key needs any of these permissions - credoex_read, credoex_trade, or credoex_transfer permissions.

Request

GET https://credoex.com/xapi/v1/currency_pairs/<currency-pair-code>/market_shapshots/<unit>/<duration>

Include currency-pair-code and unit, duration in the API request URL. Available options for unit and duration are:

  • Duration 1, 3, 5, 15, 30, or 45 with minute unit
  • Duration 1, 2, 3, or 4 with hour unit
  • Duration 1 with day unit
  • Duration 1 with week unit
  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'GET';
    const currency_pair_code = 'CREDO-ETH';
    const unit = 'hour';
    const duration = 1;
    const request_path = `/xapi/v1/currency_pairs/${currency_pair_code}/market_shapshots/${unit}/${duration}`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    unit = 'hour'
    duration = 1
    request_path = "/xapi/v1/currency_pairs/#{currency_pair_code}/market_snapshots/#{unit}/#{duration}"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient::Request.execute(method: :get, url: base_path + request_path, headers: headers)

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'GET'
    currency_pair_code = 'CREDO-ETH'
    unit = 'hour'
    duration = 1
    request_path = '/xapi/v1/currency_pairs/%s/market_snapshots/%s/%d' % (currency_pair_code, unit, duration)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.get(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "GET";
    $currency_pair_code = "CREDO-ETH";
    $unit = "hour";
    $duration = 1;
    $request_path = "/xapi/v1/currency_pairs/$currency_pair_code/deal_book/$unit/$duration";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp.$method.$request_path.$query_string.$body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "next_page_token": "SFMyNTY.g3QAAAACZAAEZGF0YXQAAAADZAACaWRtAAAAJDAxNjZlZWIwLTJjNTItNDIwNS1hMzRmLWFkNzRkNWZhYTczZGQACXRpbWVzdGFtcHQAAAANZAAKX19zdHJ1Y3RfX2QAD0VsaXhpci5EYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEHZAAEaG91cmEAZAALbWljcm9zZWNvbmRoAmEAYQZkAAZtaW51dGVhAGQABW1vbnRoYQhkAAZzZWNvbmRhAGQACnN0ZF9vZmZzZXRhAGQACXRpbWVfem9uZW0AAAAHRXRjL1VUQ2QACnV0Y19vZmZzZXRhAGQABHllYXJiAAAH4mQACXpvbmVfYWJicm0AAAADVVRDZAAHdmVyc2lvbmEBZAAGc2lnbmVkbgYAuGhDHGUB.5IrhgY8nVid4CmiKhKsEwMk_zgNRjuzdZ6SYjO29Ueg", "data": [ { "volume": 83.12763395516343, "start_time": "2018-08-09T01:00:00.000000Z", "open": 6.038e-5, "low": 6.027e-5, "id": "63d2185e-dc7e-4f52-9ada-a1bd7cc46711", "high": 6.497e-5, "count": 22, "close": 6.497e-5 }, { "volume": 382.9011616931702, "start_time": "2018-08-09T00:00:00.000000Z", "open": 6.16e-5, "low": 6.003e-5, "id": "6f019ab5-bee2-47b4-a13d-9719bde7418d", "high": 6.522e-5, "count": 73, "close": 6.29616e-5 }, ... ] }
field description
next_page_token Token for the next page. A basic description of next_page_token can be found here
id An id of the snapshot
start_time Datetime of the snapshot
high High price of the snapshot
low Low price of the snapshot
open Open price of the snapshot
close Close price of the snapshot
count Number of trades within the snapshot's duration

Generate a deposit address

Generate a deposit address for a specific currency on your account. If your account already has an address for the currency, it will show the existing address.

API key Permission

It needs the credoex_transfer permission.

Request

POST https://credoex.com/xapi/v1/wallets/<currency-code>/deposit

In the API request url, you need to include currency-code, e.g. CREDO.

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body: No body parameter.
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'POST';
    const currency_code = 'CREDO';
    const request_path = `/xapi/v1/wallets/${currency_code}/deposit`;
    const query_string = '';
    const body = '';

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: null
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'POST'
    currency_code = 'CREDO'
    request_path = "/xapi/v1/wallets/#{currency_code}/deposit"
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '6ca618d4-f760-436f-be98-aa2daf65bc7f'
    xapi_key = '2cfeee21-ab7b-46af-a102-2862e7081f9d'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient.post base_path + request_path, body, headers

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests
    import json

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'POST'
    currency_code = 'CREDO'
    request_path = '/xapi/v1/wallets/%s/deposit' % (currency_code)
    query_string = ''
    body = ''

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.post(''.join([base_path, request_path]), headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "POST";
    $currency_code = "CREDO";
    $request_path = "/xapi/v1/wallets/$currency_code/deposit";
    $query_string = "";
    $body = "";

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp . $method . $request_path . $query_string . $body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

{ "id":"864be5a3-b9d7-49c8-806e-096b74287dc1", "balance_amount":0.0, "address":"0xb472b90f689a5a5106900cdc6bab3878e5519ae3" }
field description
id An id of the wallet address
balance_amount Balance amount of the address
address Wallet address for the currency

Withdraw funds

Withdraw funds from your wallet to an external address. CredoEx currently only supports withdrawing and depositing cryptocurrencies.

API key Permission

The API key needs the credoex_transfer permission.

Request

POST https://credoex.com/xapi/v1/wallets/<currency-code>/withdraw

Include currency-code in the API request URL, e.g. CREDO.

  • Headers: Like every API request of CredoEx, you need to pass authentication parameters to the headers.
  • Body:
    parameter type required description
    to_address string yes A wallet address where you want to withdraw funds to
    amount decimal yes Amount you want to withdraw
  
    const crypto = require('crypto');
    const request = require('request');

    const base_path = 'https://credoex.com';
    const timestamp = Math.floor(Date.now() / 1000).toString();
    const method = 'POST';
    const currency_code = 'CREDO';
    const request_path = `/xapi/v1/wallets/${currency_code}/withdraw`;
    const query_string = '';
    const body = JSON.stringify({
      to_address: '0x1b720c37395ccebcf3258c71544eea28abcf212d',
      amount: 1000
    });

    // replace your API secret, API key, passphrase
    const xapi_secret = '4977cee7-5ea4-42eb-b73b-f6277a5a598c';
    const xapi_key = '8aad9c4c-971c-4014-ad14-bd43fa810581';
    const passphrase = 'myPassphrase';

    const request_descriptor = timestamp + method + request_path + query_string + body;
    const xapi_request_signature = crypto.createHmac('sha256', xapi_secret).update(request_descriptor).digest('base64');

    const headers = {
      'Content-Type': 'application/json',
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    };

    request({
      url: base_path + request_path,
      method: method,
      headers: headers,
      body: body
    }, function (error, response, body) {
      console.log("response: ", body);
    });
  
  
    require 'openssl'
    require 'base64'
    require 'rest-client'

    base_path = 'https://credoex.com'
    timestamp = "#{Time.now.to_i}"
    method = 'POST'
    currency_code = 'CREDO'
    request_path = "/xapi/v1/wallets/#{currency_code}/withdraw"
    query_string = ''
    body = {
      to_address: '0x1b720c37395ccebcf3258c71544eea28abcf212d',
      amount: 1000
    }.to_json

    # replace your API secret, API key, passphrase
    xapi_secret = '6ca618d4-f760-436f-be98-aa2daf65bc7f'
    xapi_key = '2cfeee21-ab7b-46af-a102-2862e7081f9d'
    passphrase = 'myPassphrase'

    request_descriptor = timestamp + method + request_path + query_string + body
    xapi_request_signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), xapi_secret, request_descriptor)).strip()

    headers = {
      content_type: :json,
      'xapi-request-signature': xapi_request_signature,
      'xapi-request-timestamp': timestamp,
      'xapi-key': xapi_key,
      'xapi-passphrase': passphrase
    }

    response = RestClient.post base_path + request_path, body, headers

    puts 'response', response.body
  
  
    import time
    import hmac
    import hashlib
    import base64
    import requests
    import json

    base_path = 'https://credoex.com'
    timestamp = str(int(time.time()))
    method = 'POST'
    currency_code = 'CREDO'
    request_path = '/xapi/v1/wallets/%s/withdraw' % (currency_code)
    query_string = ''
    body = json.dumps({
      'to_address': '0x1b720c37395ccebcf3258c71544eea28abcf212d',
      'amount': 1000
    })

    # replace your API secret, API key, passphrase
    xapi_secret = '21aad490-0f88-4e37-aeca-553e23ef5ee0'
    xapi_key = '85d421c6-9f8f-47fc-a29b-de35b776ec81'
    passphrase = 'myPassphrase'

    request_descriptor = ''.join([timestamp, method, request_path, query_string, body])
    xapi_request_signature = base64.b64encode(hmac.new(xapi_secret.encode(), request_descriptor.encode(), hashlib.sha256).digest()).decode()


    headers = {
      "Content-Type": "application/json",
      "xapi-request-signature": xapi_request_signature,
      "xapi-request-timestamp": timestamp,
      "xapi-key": xapi_key,
      "xapi-passphrase": passphrase
    }

    response = requests.post(''.join([base_path, request_path]), data=body, headers=headers)

    print("response - ", response.text)
  
  
    $base_path = "https://credoex.com";
    $timestamp = (string)time();
    $method = "POST";
    $currency_code = "CREDO";
    $request_path = "/xapi/v1/wallets/$currency_code/withdraw";
    $query_string = "";
    $body = json_encode(array(
      'to_address' => '0x1b720c37395ccebcf3258c71544eea28abcf212d',
      'amount' => 1000
    ));

    // replace your API secret, API key, passphrase
    $xapi_secret = "21aad490-0f88-4e37-aeca-553e23ef5ee0";
    $xapi_key = "85d421c6-9f8f-47fc-a29b-de35b776ec81";
    $passphrase = "myPassphrase";

    $request_descriptor = $timestamp . $method . $request_path . $query_string . $body;
    $xapi_request_signature = base64_encode(hash_hmac('sha256', $request_descriptor, $xapi_secret, true));

    $context = stream_context_create(array(
        'http' => array(
          'header'  => "Content-Type: application/json\r\n" .
                       "xapi-request-signature: " . $xapi_request_signature . "\r\n" .
                       "xapi-request-timestamp: " . $timestamp . "\r\n" .
                       "xapi-key: " . $xapi_key . "\r\n" .
                       "xapi-passphrase: " . $passphrase . "\r\n",
          'method'  => $method,
          'content' => $body
        )
      )
    );

    $result = file_get_contents($base_path . $request_path, false, $context);

    print_r($result);
  

Response

If the withdrawal is failed, it returns 424 error. If success, the response is:

{ "type": "withdrawal", "tx_hash": "0x60c85acee3aa02ebcd89324260fc932caf3fef824f93aee252aab08819000d94", "status": "unconfirmed", "inserted_at": "2018-08-07T21:22:28.869799Z", "id": "2bff5a31-cd1c-44b0-992d-b414e4ce0d40", "executed_at": "2018-08-07T21:22:28.869675Z", "currency_id": "0ec6582a-46e2-42c1-be30-85128b218496", "confirmations_count": 0, "amount": 1.0 }
field description
id An id of the withdrawal transaction
type Type of transaction. It should be withdrawal
tx_hash Hash of the transaction
currency_id An id of the currency which the transaction uses
amount Amount of the transaction
confirmations_count Number of remaining confirmations
status Transaction status
inserted_at Datetime when the transaction is inserted
executed_at Datetime when the transaction is executed
NodeJS Ruby Python PHP