NAV Navigation
Java Shell PHP Go Python Ruby JavaScript

Tatum Middleware API v1.0.2

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

REST API documentation for Tatum Middleware. Tatum Middleware is a client to Tatum Blockchain API Core.

Base URLs:

Authentication

JWT helper Endpoint

Endpoint used to create valid JWT authorization bearer token from your API key.

generateJwt

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/util/v1/jwt/string/string")
  .header("accept", "application/json")
  .asString();
curl --request GET \
  --url http://localhost:6543/util/v1/jwt/string/string \
  --header 'accept: application/json'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/jwt/string/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/jwt/string/string"

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

	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = { 'accept': "application/json" }

conn.request("GET", "/util/v1/jwt/string/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/jwt/string/string")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/util/v1/jwt/string/string");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

GET util/v1/jwt/{key}/{secret}

Generate JWT token.

Generate valid JWT token from API Key. This token is used to authorize access to Tatum Blockchain API. JWT token is valid only for 30 minutes and it should be renewed ideally with every new request.

Parameters

Name In Type Required Description
key path string true API Key
secret path string true API Key secret

Example responses

500 Response

{
  "field": "payment.senderAccountId",
  "code": "payment.amount.notNull",
  "message": "Payment amount must be greater than 0.",
  "id": 1,
  "txId": "string",
  "data": {}
}

Responses

Status Meaning Description Schema
200 OK Valid JWT token None
404 Not Found Not found None
500 Internal Server Error Internal error Error

Settings Endpoint

Endpoint used to add / remove API keys.

addApiKey

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/settings/key")
  .header("content-type", "application/json;charset=UTF-8")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"apiKey\":\"7c21ed165e294db78b95f0f181086d6f\",\"id\":1,\"name\":\"My Admin Write key.\",\"readAccess\":true,\"secret\":\"123123aksjfn2q8onfkan823f\",\"writeAccess\":true}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/settings/key \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json;charset=UTF-8' \
  --data '{"apiKey":"7c21ed165e294db78b95f0f181086d6f","id":1,"name":"My Admin Write key.","readAccess":true,"secret":"123123aksjfn2q8onfkan823f","writeAccess":true}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/settings/key",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"apiKey\":\"7c21ed165e294db78b95f0f181086d6f\",\"id\":1,\"name\":\"My Admin Write key.\",\"readAccess\":true,\"secret\":\"123123aksjfn2q8onfkan823f\",\"writeAccess\":true}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json;charset=UTF-8"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/settings/key"

	payload := strings.NewReader("{\"apiKey\":\"7c21ed165e294db78b95f0f181086d6f\",\"id\":1,\"name\":\"My Admin Write key.\",\"readAccess\":true,\"secret\":\"123123aksjfn2q8onfkan823f\",\"writeAccess\":true}")

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

	req.Header.Add("content-type", "application/json;charset=UTF-8")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"apiKey\":\"7c21ed165e294db78b95f0f181086d6f\",\"id\":1,\"name\":\"My Admin Write key.\",\"readAccess\":true,\"secret\":\"123123aksjfn2q8onfkan823f\",\"writeAccess\":true}"

headers = {
    'content-type': "application/json;charset=UTF-8",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/settings/key", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/settings/key")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json;charset=UTF-8'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"apiKey\":\"7c21ed165e294db78b95f0f181086d6f\",\"id\":1,\"name\":\"My Admin Write key.\",\"readAccess\":true,\"secret\":\"123123aksjfn2q8onfkan823f\",\"writeAccess\":true}"

response = http.request(request)
puts response.read_body
var data = "{\"apiKey\":\"7c21ed165e294db78b95f0f181086d6f\",\"id\":1,\"name\":\"My Admin Write key.\",\"readAccess\":true,\"secret\":\"123123aksjfn2q8onfkan823f\",\"writeAccess\":true}";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/settings/key");
xhr.setRequestHeader("content-type", "application/json;charset=UTF-8");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/settings/key

Create new API key

Create new API key. It is possible to set read/write permissions. Read permission is always set. Read permission allows any non-modifying operation such as list accounts, transactions, but it is not possible to create transaction or activate account.

Body parameter

{
  "apiKey": "7c21ed165e294db78b95f0f181086d6f",
  "id": 1,
  "name": "My Admin Write key.",
  "readAccess": true,
  "secret": "123123aksjfn2q8onfkan823f",
  "writeAccess": true
}

Parameters

Name In Type Required Description
body body ApiKey true apiKey
» apiKey body string false API key.
» id body integer(int64) false ID of API key.
» name body string false Name of API key.
» readAccess body boolean false Whether this API key has read access. Should be true always for correct behavior.
» secret body string false API key secret.
» writeAccess body boolean false Whether this API key has write access.

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

removeApiKey

Code samples

HttpResponse<String> response = Unirest.delete("http://localhost:6543/api/v1/settings/key/string")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request DELETE \
  --url http://localhost:6543/api/v1/settings/key/string \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/settings/key/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/settings/key/string"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("DELETE", "/api/v1/settings/key/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/settings/key/string")

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

request = Net::HTTP::Delete.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "http://localhost:6543/api/v1/settings/key/string");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

DELETE api/v1/settings/key/{id}

Remove existing API key

Do not remove last used API key, otherwise you will not be able to use API.

Parameters

Name In Type Required Description
id path string true ID of API key

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
204 No Content No Content None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None

Customer Endpoint

Prerequisites:

Endpoint used to handle customer operations, like creating new one, update information about customer, enable/disable. Within Tatum API, customer represents client of your organization.

findAll

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/api/v1/customer")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .asString();
curl --request GET \
  --url http://localhost:6543/api/v1/customer \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/customer",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/customer"

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("GET", "/api/v1/customer", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/customer")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/api/v1/customer");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

GET api/v1/customer

List all customers

List of all customers. Please limit calls as much as possible, especially if you have more customers.

Example responses

200 Response

[
  {
    "customerCountry": "US",
    "enabled": true,
    "externalId": 651234,
    "id": 1,
    "providerCountry": "US"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Customer] false none none
» Customer Customer false none none
»» customerCountry string false none Country customer has to be compliant with
»» enabled boolean false none Indicates whether customer is enabled or not
»» externalId string false none Customer external ID
»» id integer(int64) false none Internal customer ID
»» providerCountry string false none Country service provider has to be compliant with

createCustomer

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/customer")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/customer \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"customerCountry":"US","externalId":123654,"providerCountry":"US"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/customer",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/customer"

	payload := strings.NewReader("{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/customer", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/customer")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "customerCountry": "US",
  "externalId": 123654,
  "providerCountry": "US"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/customer");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/customer

Create new customer

Create new customer. Customer represents customer within your organization, for who you want to create account. Every customer can have unlimited accounts. In order to create accounts and connect them to blockchain addresses, customer must be created.

Body parameter

{
  "customerCountry": "US",
  "externalId": 123654,
  "providerCountry": "US"
}

Parameters

Name In Type Required Description
body body CustomerRegistration true customer
» customerCountry body string false Country customer has to be compliant with
» externalId body string false Customer external ID. Use only anonymized identification you have in your system.
» providerCountry body string false Country service provider has to be compliant with

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK integer
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

getCustomerByExternalId

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/api/v1/customer/string")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .asString();
curl --request GET \
  --url http://localhost:6543/api/v1/customer/string \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/customer/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/customer/string"

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("GET", "/api/v1/customer/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/customer/string")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/api/v1/customer/string");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

GET api/v1/customer/{externalId}

Get customer details

Using anonymized external ID you can access customer detail information including internal ID. Internal ID is needed to call other customer related methods.

Parameters

Name In Type Required Description
externalId path string true Customer external ID

Example responses

200 Response

{
  "customerCountry": "US",
  "enabled": true,
  "externalId": 651234,
  "id": 1,
  "providerCountry": "US"
}

Responses

Status Meaning Description Schema
200 OK OK Customer
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None

updateCustomer

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/customer/string")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/customer/string \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"customerCountry":"US","externalId":123654,"providerCountry":"US"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/customer/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/customer/string"

	payload := strings.NewReader("{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/customer/string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/customer/string")

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

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"customerCountry\":\"US\",\"externalId\":123654,\"providerCountry\":\"US\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "customerCountry": "US",
  "externalId": 123654,
  "providerCountry": "US"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/customer/string");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/customer/{id}

Update customer

This method is helpful in case your primary system will change ID's or customer will change the country he/she is supposed to be in compliance with.

Body parameter

{
  "customerCountry": "US",
  "externalId": 123654,
  "providerCountry": "US"
}

Parameters

Name In Type Required Description
id path string true Customer internal ID
body body CustomerUpdate true customer
» customerCountry body string false Country customer has to be compliant with. If empty, it will not be updated.
» externalId body string false External customer ID. If empty, it will not be updated.
» providerCountry body string false Country service provider has to be compliant with. If empty, it will not be updated.

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

deactivateCustomer

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/customer/string/deactivate")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/customer/string/deactivate \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/customer/string/deactivate",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/customer/string/deactivate"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/customer/string/deactivate", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/customer/string/deactivate")

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

request = Net::HTTP::Put.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/customer/string/deactivate");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/customer/{id}/deactivate

Deactivate customer

Deactivate customer is not able to do any operation. Customer can be deactivated only when all their accounts are already deactivated.

Parameters

Name In Type Required Description
id path string true Customer internal ID

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

disableCustomer

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/customer/string/disable")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/customer/string/disable \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/customer/string/disable",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/customer/string/disable"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/customer/string/disable", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/customer/string/disable")

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

request = Net::HTTP::Put.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/customer/string/disable");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/customer/{id}/disable

Disable customer

Disabled customer cannot perform end-user operations, such as create new accounts or send payments. Available balance on all accounts is set to 0. Account balance will stay untouched.

Parameters

Name In Type Required Description
id path string true Customer internal ID

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

enableCustomer

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/customer/string/enable")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/customer/string/enable \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/customer/string/enable",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/customer/string/enable"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/customer/string/enable", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/customer/string/enable")

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

request = Net::HTTP::Put.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/customer/string/enable");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/customer/{id}/enable

Enable customer

Enabled customer can perform all operations. By default all customers are enabled.

Parameters

Name In Type Required Description
id path string true Customer internal ID

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

Bitcoin blockchain helper Endpoint

Prerequisites:

Operations with Bitcoin blockchain, such as wallet generation or sending transactions to blockchain. Tatum supports 2 chains - Mainnet, which is regular live chain, and Testnet3, which is test chain used for test purposes. Coins on test chain have no value and can be obtained from Faucet, e.g. https://coinfaucet.eu/en/btc-testnet/.
In order to start using Bitcoin blockchain, first we need to create a wallet. At Tatum, we support BIP44 HD wallets. It is very convenient, since we can generate 2^32-1 addresses from 1 mnemonic phrase. Mnemonic phrase consists of 12 special words in defined order, from which we can restore access to all addresses and private keys generated from it.
Each address is identified by 3 main values:

Tatum follows BIP44 specification and generates for Bitcoin wallet with derivation path m'/44'/0'/0'/0. More about BIP44 HD wallets can be found here - https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki.

generateBtcWallet

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/btc/wallet")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"chain\":\"BTC\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/btc/wallet \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"chain":"BTC"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/btc/wallet",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"chain\":\"BTC\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/btc/wallet"

	payload := strings.NewReader("{\"chain\":\"BTC\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"chain\":\"BTC\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/util/v1/btc/wallet", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/btc/wallet")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"chain\":\"BTC\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "chain": "BTC"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/btc/wallet");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

POST util/v1/btc/wallet

Generate wallet.

Generate wallet. This will create BIP44 HD wallet with predefined derivation path and returns mnemonic phrase and extended public and private key to be used for address generation.

Body parameter

{
  "chain": "BTC"
}

Parameters

Name In Type Required Description
body body WalletGenerateBtc true chain - BTC for Mainnet or TBTC for Testnet3

Example responses

200 Response

{
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "xpriv": "xprvA1srLWNaGEkhdSJg6cLTMAziUpQcefpu2ZnKH2PXGiXEPKTdVPHjLFp4aZSSqSsaLMNrWXoj6TsyyUqh18T1hbiQkC42aWjXB9HnpmmqrYr",
  "xpub": "xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid"
}

Responses

Status Meaning Description Schema
200 OK Object containing mnemonic, xpriv and xpub for generated wallet. Wallet
404 Not Found Not found None
500 Internal Server Error Internal error Error

calculateBtcAddress

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/util/v1/btc/wallet/xpub/BTC/string/0")
  .header("accept", "application/json")
  .asString();
curl --request GET \
  --url http://localhost:6543/util/v1/btc/wallet/xpub/BTC/string/0 \
  --header 'accept: application/json'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/btc/wallet/xpub/BTC/string/0",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/btc/wallet/xpub/BTC/string/0"

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

	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = { 'accept': "application/json" }

conn.request("GET", "/util/v1/btc/wallet/xpub/BTC/string/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/btc/wallet/xpub/BTC/string/0")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/util/v1/btc/wallet/xpub/BTC/string/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

GET util/v1/btc/wallet/xpub/{chain}/{xpub}/{i}

Calculate BTC address

Calculate address from extended public key on Testnet / Mainnet for given derivation path index.

Parameters

Name In Type Required Description
chain path string true chain - BTC for Mainnet or TBTC for Testnet3
xpub path string true xpub to generate address from
i path integer true derivation index of address

Enumerated Values

Parameter Value
chain BTC
chain TBTC

Example responses

200 Response

{
  "address": "mtQygZAEbmgBCPJNMYRjGxa4C3kgTNdmXM"
}

Responses

Status Meaning Description Schema
200 OK Generated address GeneratedAddress
404 Not Found Not found None
500 Internal Server Error Internal error Error

calculateBtcPrviKey

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/btc/wallet/xpriv")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"chain\":\"BTC\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":4}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/btc/wallet/xpriv \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"chain":"BTC","mnemonic":"urge pulp usage sister evidence arrest palm math please chief egg abuse","index":4}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/btc/wallet/xpriv",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"chain\":\"BTC\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":4}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/btc/wallet/xpriv"

	payload := strings.NewReader("{\"chain\":\"BTC\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":4}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"chain\":\"BTC\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":4}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/util/v1/btc/wallet/xpriv", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/btc/wallet/xpriv")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"chain\":\"BTC\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":4}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "chain": "BTC",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 4
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/btc/wallet/xpriv");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

POST util/v1/btc/wallet/xpriv

Calculate BTC private key

Calculate private key of address from mnemonic on Testnet / Mainnet for given derivation path index.

Body parameter

{
  "chain": "BTC",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 4
}

Parameters

Name In Type Required Description
body body XPrivBtc true none

Example responses

200 Response

{
  "key": "cTmS2jBWXgFaXZ2xG9jhn67TiyTshnMp3UedamzEhGm6BZV1vLgQ"
}

Responses

Status Meaning Description Schema
200 OK Generated private key PrivKey
404 Not Found Not found None
500 Internal Server Error Internal error Error

transferBtc

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/btc/withdrawal")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"currency\":\"TBTC\",\"amount\":\"0.02\",\"senderNote\":\"Sender note\",\"force\":false,\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/btc/withdrawal \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"senderAccountId":"7c21ed165e294db78b95f0f181086d6f","targetAddress":"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7","currency":"TBTC","amount":"0.02","senderNote":"Sender note","force":false,"mnemonic":"urge pulp usage sister evidence arrest palm math please chief egg abuse"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/btc/withdrawal",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"currency\":\"TBTC\",\"amount\":\"0.02\",\"senderNote\":\"Sender note\",\"force\":false,\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/btc/withdrawal"

	payload := strings.NewReader("{\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"currency\":\"TBTC\",\"amount\":\"0.02\",\"senderNote\":\"Sender note\",\"force\":false,\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"currency\":\"TBTC\",\"amount\":\"0.02\",\"senderNote\":\"Sender note\",\"force\":false,\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/util/v1/btc/withdrawal", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/btc/withdrawal")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"currency\":\"TBTC\",\"amount\":\"0.02\",\"senderNote\":\"Sender note\",\"force\":false,\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7",
  "currency": "TBTC",
  "amount": "0.02",
  "senderNote": "Sender note",
  "force": false,
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/btc/withdrawal");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST util/v1/btc/withdrawal

Send BTC / TBTC from address to address

Send BTC / TBTC from address to address. This will create Tatum internal withdrawal request with ID. If every system works as expected, withdrawal request is marked as complete and transaction id is assigned to it.

Body parameter

{
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7",
  "currency": "TBTC",
  "amount": "0.02",
  "senderNote": "Sender note",
  "force": false,
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse"
}

Parameters

Name In Type Required Description
body body WithdrawalBtc true none

Example responses

200 Response

{
  "txHash": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Responses

Status Meaning Description Schema
200 OK txHash of successful transaction TxHash
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
500 Internal Server Error Internal error Error

Ethereum blockchain helper Endpoint

Prerequisites:

Operations with Bitcoin blockchain, such as wallet generation or sending transactions to blockchain. Tatum supports 2 chains - Mainnet, which is regular live chain, and Ropsten, which is test chain used for test purposes. Coins on test chain have no value and can be obtained from Faucet, e.g. https://faucet.ropsten.be/.
In order to start using Ethereum blockchain, first we need to create a wallet. At Tatum, we support BIP44 HD wallets. It is very convenient, since we can generate 2^32-1 addresses from 1 mnemonic phrase. Mnemonic phrase consists of 12 special words in defined order, from which we can restore access to all accounts and private keys generated from it.
Each account is identified by 3 main values:

Tatum follows BIP44 specification and generates for Ethereum wallet with derivation path m'/44'/60'/0'/0. More about BIP44 HD wallets can be found here - https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki.

generateEthWallet

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/eth/wallet")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"chain\":\"ropsten\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/eth/wallet \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"chain":"ropsten"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/eth/wallet",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"chain\":\"ropsten\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/eth/wallet"

	payload := strings.NewReader("{\"chain\":\"ropsten\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"chain\":\"ropsten\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/util/v1/eth/wallet", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/eth/wallet")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"chain\":\"ropsten\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "chain": "ropsten"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/eth/wallet");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

POST util/v1/eth/wallet

Generate ETH wallet.

Generate wallet. This will create BIP44 HD wallet with predefined derivation path and returns mnemonic phrase and extended public and private key to be used for address generation.

Body parameter

{
  "chain": "ropsten"
}

Parameters

Name In Type Required Description
body body WalletGenerateEth true chain - 'mainnet' or 'ropsten'

Example responses

200 Response

{
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "xpriv": "xprvA1srLWNaGEkhdSJg6cLTMAziUpQcefpu2ZnKH2PXGiXEPKTdVPHjLFp4aZSSqSsaLMNrWXoj6TsyyUqh18T1hbiQkC42aWjXB9HnpmmqrYr",
  "xpub": "xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid"
}

Responses

Status Meaning Description Schema
200 OK Object containing mnemonic, xpriv and xpub for generated wallet. Wallet
404 Not Found Not found None
500 Internal Server Error Internal error Error

calculateEthAddress

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/util/v1/eth/wallet/xpub/string/0")
  .header("accept", "application/json")
  .asString();
curl --request GET \
  --url http://localhost:6543/util/v1/eth/wallet/xpub/string/0 \
  --header 'accept: application/json'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/eth/wallet/xpub/string/0",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/eth/wallet/xpub/string/0"

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

	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = { 'accept': "application/json" }

conn.request("GET", "/util/v1/eth/wallet/xpub/string/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/eth/wallet/xpub/string/0")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/util/v1/eth/wallet/xpub/string/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

GET util/v1/eth/wallet/xpub/{pub}/{i}

Calculate ETH address

Calculate address from xpub on Ropsten / Mainnet for given derivation path index.

Parameters

Name In Type Required Description
pub path string true xpub to generate address from
i path integer true derivation index of address

Example responses

200 Response

{
  "address": "mtQygZAEbmgBCPJNMYRjGxa4C3kgTNdmXM"
}

Responses

Status Meaning Description Schema
200 OK Generated address GeneratedAddress
404 Not Found Not found None
500 Internal Server Error Internal error Error

calculateEthPrivKey

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/eth/wallet/xpriv")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/eth/wallet/xpriv \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"chain":"ropsten","mnemonic":"urge pulp usage sister evidence arrest palm math please chief egg abuse","index":0}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/eth/wallet/xpriv",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/eth/wallet/xpriv"

	payload := strings.NewReader("{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/util/v1/eth/wallet/xpriv", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/eth/wallet/xpriv")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/eth/wallet/xpriv");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

POST util/v1/eth/wallet/xpriv

Calculate private key of ETH address

Calculate private key of address from mnemonic on Ropsten / Mainnet for given derivation path index.

Body parameter

{
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0
}

Parameters

Name In Type Required Description
body body XPrivEth true none

Example responses

200 Response

{
  "key": "cTmS2jBWXgFaXZ2xG9jhn67TiyTshnMp3UedamzEhGm6BZV1vLgQ"
}

Responses

Status Meaning Description Schema
200 OK Generated private key PrivKey
404 Not Found Not found None
500 Internal Server Error Internal error Error

transferEth

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/eth/transfer")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/eth/transfer \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"chain":"ropsten","mnemonic":"urge pulp usage sister evidence arrest palm math please chief egg abuse","index":0,"senderAccountId":"7c21ed165e294db78b95f0f181086d6f","targetAddress":"0x687422eEA2cB73B5d3e242bA5456b782919AFc85","amount":100000,"senderNote":"Sender note","force":false}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/eth/transfer",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/eth/transfer"

	payload := strings.NewReader("{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/util/v1/eth/transfer", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/eth/transfer")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  "amount": 100000,
  "senderNote": "Sender note",
  "force": false
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/eth/transfer");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST util/v1/eth/transfer

Send ETH / Ropsten ETH from account to account

Send ETH / Ropsten ETH from account to account. This will create Tatum internal withdrawal request with ID. If every system works as expected, withdrawal request is marked as complete and transaction id is assigned to it.

Body parameter

{
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  "amount": 100000,
  "senderNote": "Sender note",
  "force": false
}

Parameters

Name In Type Required Description
body body EthTransfer true none

Example responses

200 Response

{
  "txHash": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Responses

Status Meaning Description Schema
200 OK txHash of successful transaction TxHash
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
500 Internal Server Error Internal error Error

deployErc20

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/eth/erc20/deploy")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"payIndex\":0,\"customerId\":5,\"name\":\"My ERC20 Token\",\"symbol\":\"MT\",\"supply\":10000000,\"basePair\":\"BTC\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/eth/erc20/deploy \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"chain":"ropsten","mnemonic":"urge pulp usage sister evidence arrest palm math please chief egg abuse","index":0,"payIndex":0,"customerId":5,"name":"My ERC20 Token","symbol":"MT","supply":10000000,"basePair":"BTC"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/eth/erc20/deploy",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"payIndex\":0,\"customerId\":5,\"name\":\"My ERC20 Token\",\"symbol\":\"MT\",\"supply\":10000000,\"basePair\":\"BTC\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/eth/erc20/deploy"

	payload := strings.NewReader("{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"payIndex\":0,\"customerId\":5,\"name\":\"My ERC20 Token\",\"symbol\":\"MT\",\"supply\":10000000,\"basePair\":\"BTC\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"payIndex\":0,\"customerId\":5,\"name\":\"My ERC20 Token\",\"symbol\":\"MT\",\"supply\":10000000,\"basePair\":\"BTC\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/util/v1/eth/erc20/deploy", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/eth/erc20/deploy")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"chain\":\"ropsten\",\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"payIndex\":0,\"customerId\":5,\"name\":\"My ERC20 Token\",\"symbol\":\"MT\",\"supply\":10000000,\"basePair\":\"BTC\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "payIndex": 0,
  "customerId": 5,
  "name": "My ERC20 Token",
  "symbol": "MT",
  "supply": 10000000,
  "basePair": "BTC"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/eth/erc20/deploy");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST util/v1/eth/erc20/deploy

Deploy ETH / Ropsten ETH ERC20 Smart Contract.

Deploy ETH / Ropsten ETH ERC20 Smart Contract. Response could take quite a lot of time, average time of creation is 3-4 minutes. After deploying contract to blockchain, contract address will become available and must be stored within Tatum, otherwise it will not be possible to interact with it.

Body parameter

{
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "payIndex": 0,
  "customerId": 5,
  "name": "My ERC20 Token",
  "symbol": "MT",
  "supply": 10000000,
  "basePair": "BTC"
}

Parameters

Name In Type Required Description
body body Erc20Deploy true none

Example responses

200 Response

{
  "tx": "0x93feef50a0754d5b815964ec41a744b8b60fd83bac7657386b21cd8a7c38a3b1",
  "contractAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85"
}

Responses

Status Meaning Description Schema
200 OK information about ERC20 smart contract Erc20Token
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
500 Internal Server Error Internal error Error

transferErc20

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/eth/erc20/transfer")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"currency\":\"MY_SYMBOL\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false,\"tokenAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/eth/erc20/transfer \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"mnemonic":"urge pulp usage sister evidence arrest palm math please chief egg abuse","index":0,"senderAccountId":"7c21ed165e294db78b95f0f181086d6f","targetAddress":"0x687422eEA2cB73B5d3e242bA5456b782919AFc85","currency":"MY_SYMBOL","amount":100000,"senderNote":"Sender note","force":false,"tokenAddress":"0x687422eEA2cB73B5d3e242bA5456b782919AFc85"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/eth/erc20/transfer",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"currency\":\"MY_SYMBOL\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false,\"tokenAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/eth/erc20/transfer"

	payload := strings.NewReader("{\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"currency\":\"MY_SYMBOL\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false,\"tokenAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"currency\":\"MY_SYMBOL\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false,\"tokenAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/util/v1/eth/erc20/transfer", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/eth/erc20/transfer")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"mnemonic\":\"urge pulp usage sister evidence arrest palm math please chief egg abuse\",\"index\":0,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"targetAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\",\"currency\":\"MY_SYMBOL\",\"amount\":100000,\"senderNote\":\"Sender note\",\"force\":false,\"tokenAddress\":\"0x687422eEA2cB73B5d3e242bA5456b782919AFc85\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  "currency": "MY_SYMBOL",
  "amount": 100000,
  "senderNote": "Sender note",
  "force": false,
  "tokenAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/eth/erc20/transfer");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST util/v1/eth/erc20/transfer

Transfer ETH / Ropsten ETH ERC20

Transfer ETH / Ropsten ETH ERC20 Smart Contract Tokens from account to account. This will create Tatum internal withdrawal request with ID. If every system works as expected, withdrawal request is marked as complete and transaction id is assigned to it.

Body parameter

{
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  "currency": "MY_SYMBOL",
  "amount": 100000,
  "senderNote": "Sender note",
  "force": false,
  "tokenAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85"
}

Parameters

Name In Type Required Description
body body Erc20Transfer true none

Example responses

200 Response

{
  "txHash": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Responses

Status Meaning Description Schema
200 OK txHash of successful transaction TxHash
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
500 Internal Server Error Internal error Error

XRP blockchain helper Endpoint

Prerequisites:

Operations with XRP blockchain, such as account generation or sending transactions to blockchain. Tatum supports 2 chains - Mainnet, which is regular live chain, and Test chain, which is used for test purposes. Coins on test chain have no value and can be obtained from Faucet, e.g. https://developers.ripple.com/xrp-test-net-faucet.html.
In order to start using XRP blockchain, first we need to create and XRP account. In XRP, same account is used for Mainnet and Test chain. In order to have account activated, it must be credited with 20 XRP. Because of this obstacle, it is common to use 1 account for all customers and distinguish them via Destination tags. At Tatum, when we create deposit address for account, we generate deposit tag for the same account.

generateXrpWallet

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/xrp/wallet")
  .header("accept", "application/json")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/xrp/wallet \
  --header 'accept: application/json'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/xrp/wallet",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/xrp/wallet"

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

	req.Header.Add("accept", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = { 'accept': "application/json" }

conn.request("POST", "/util/v1/xrp/wallet", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/xrp/wallet")

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

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/xrp/wallet");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);

POST util/v1/xrp/wallet

Generate XRP account.

Generate XRP account. 1 common XRP account is used for all customer accounts within Tatum and are distinguished by tag. We can generate as many accounts as we want, but as soon as one is used for address generation, this one will be used for generation of DestinationTag.

Example responses

200 Response

{
  "secret": "snSFTHdvSYQKKkYntvEt8cnmZuPJB",
  "address": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV"
}

Responses

Status Meaning Description Schema
200 OK Object containing address and secret for generated account. XrpWallet
404 Not Found Not found None
500 Internal Server Error Internal error Error

transferXrp

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/util/v1/xrp/transfer")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"chain\":\"XRP\",\"account\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"secret\":\"snSFTHdvSYQKKkYntvEt8cnmZuPJB\",\"senderAccountId\":\"35ab5ea8e48c4b179cadea653c6d732e\",\"targetAddress\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"destinationTag\":12355,\"amount\":10000,\"senderNote\":\"Sender note\",\"force\":false}")
  .asString();
curl --request POST \
  --url http://localhost:6543/util/v1/xrp/transfer \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"chain":"XRP","account":"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV","secret":"snSFTHdvSYQKKkYntvEt8cnmZuPJB","senderAccountId":"35ab5ea8e48c4b179cadea653c6d732e","targetAddress":"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV","destinationTag":12355,"amount":10000,"senderNote":"Sender note","force":false}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/util/v1/xrp/transfer",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"chain\":\"XRP\",\"account\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"secret\":\"snSFTHdvSYQKKkYntvEt8cnmZuPJB\",\"senderAccountId\":\"35ab5ea8e48c4b179cadea653c6d732e\",\"targetAddress\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"destinationTag\":12355,\"amount\":10000,\"senderNote\":\"Sender note\",\"force\":false}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/util/v1/xrp/transfer"

	payload := strings.NewReader("{\"chain\":\"XRP\",\"account\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"secret\":\"snSFTHdvSYQKKkYntvEt8cnmZuPJB\",\"senderAccountId\":\"35ab5ea8e48c4b179cadea653c6d732e\",\"targetAddress\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"destinationTag\":12355,\"amount\":10000,\"senderNote\":\"Sender note\",\"force\":false}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"chain\":\"XRP\",\"account\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"secret\":\"snSFTHdvSYQKKkYntvEt8cnmZuPJB\",\"senderAccountId\":\"35ab5ea8e48c4b179cadea653c6d732e\",\"targetAddress\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"destinationTag\":12355,\"amount\":10000,\"senderNote\":\"Sender note\",\"force\":false}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/util/v1/xrp/transfer", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/util/v1/xrp/transfer")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"chain\":\"XRP\",\"account\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"secret\":\"snSFTHdvSYQKKkYntvEt8cnmZuPJB\",\"senderAccountId\":\"35ab5ea8e48c4b179cadea653c6d732e\",\"targetAddress\":\"rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV\",\"destinationTag\":12355,\"amount\":10000,\"senderNote\":\"Sender note\",\"force\":false}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "chain": "XRP",
  "account": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV",
  "secret": "snSFTHdvSYQKKkYntvEt8cnmZuPJB",
  "senderAccountId": "35ab5ea8e48c4b179cadea653c6d732e",
  "targetAddress": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV",
  "destinationTag": 12355,
  "amount": 10000,
  "senderNote": "Sender note",
  "force": false
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/util/v1/xrp/transfer");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST util/v1/xrp/transfer

Send XRP / TXRP from account to account

Send XRP / TXRP from account to account. This will create Tatum internal withdrawal request with ID. If every system works as expected, withdrawal request is marked as complete and transaction id is assigned to it.

Body parameter

{
  "chain": "XRP",
  "account": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV",
  "secret": "snSFTHdvSYQKKkYntvEt8cnmZuPJB",
  "senderAccountId": "35ab5ea8e48c4b179cadea653c6d732e",
  "targetAddress": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV",
  "destinationTag": 12355,
  "amount": 10000,
  "senderNote": "Sender note",
  "force": false
}

Parameters

Name In Type Required Description
body body XrpTransfer true none

Example responses

200 Response

{
  "txHash": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Responses

Status Meaning Description Schema
200 OK txHash of successful transaction TxHash
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
500 Internal Server Error Internal error Error

Account Endpoint

Prerequisites:

Endpoint to handle operations on Tatum accounts, list accounts belonging to defined customer, generate blockchain addresses and link them to accounts.
There are 2 main concepts within Tatum:

createAccount

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/account")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"compliant\":false,\"currency\":\"BTC\",\"customerId\":1}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/account \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"compliant":false,"currency":"BTC","customerId":1}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"compliant\":false,\"currency\":\"BTC\",\"customerId\":1}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account"

	payload := strings.NewReader("{\"compliant\":false,\"currency\":\"BTC\",\"customerId\":1}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"compliant\":false,\"currency\":\"BTC\",\"customerId\":1}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/account", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"compliant\":false,\"currency\":\"BTC\",\"customerId\":1}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "compliant": false,
  "currency": "BTC",
  "customerId": 1
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/account");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/account

Create new account

Creates new account for the customer. This will create account on Tatum's private ledger. It will not create any blockchain address, so customer is unable to receive funds from outside of Tatum. It is possible to create account for every supported crypto currency as well as any ERC20 token created within Tatum instance and Tatum virtual currencies.

Body parameter

{
  "compliant": false,
  "currency": "BTC",
  "customerId": 1
}

Parameters

Name In Type Required Description
body body CreateAccount true account
» compliant body boolean false Enable compliant checks. If this is enabled, it is impossible to create account if compliant check fails.
» currency body string false Account currency
» customerId body integer(int64) false Internal customer ID

Enumerated Values

Parameter Value
» currency BTC
» currency ETH
» currency TBTC
» currency TETH
» currency XRP
» currency TXRP
» currency VC_<VIRTUAL_CURRENCY>
» currency <ERC20_CURRENCY>

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK string
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

getAccountByPublicId

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/api/v1/account/detail/string")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .asString();
curl --request GET \
  --url http://localhost:6543/api/v1/account/detail/string \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/detail/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/detail/string"

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("GET", "/api/v1/account/detail/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/detail/string")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/api/v1/account/detail/string");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

GET api/v1/account/detail/{id}

Get account by ID

Get account by ID. Display all information regarding given account.

Parameters

Name In Type Required Description
id path string true Account ID

Example responses

200 Response

{
  "balance": {
    "accountBalance": 0,
    "availableBalance": 0
  },
  "created": 1546410660486,
  "currency": "BTC",
  "frozen": false,
  "publicId": "7c21ed165e294db78b95f0f181086d6f"
}

Responses

Status Meaning Description Schema
200 OK OK Account
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None

getQRCode

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/api/v1/account/qr/BTC/string")
  .header("accept", "image/png")
  .header("authorization", "x-client-secret")
  .asString();
curl --request GET \
  --url http://localhost:6543/api/v1/account/qr/BTC/string \
  --header 'accept: image/png' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/qr/BTC/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: image/png",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/qr/BTC/string"

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

	req.Header.Add("accept", "image/png")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "image/png",
    'authorization': "x-client-secret"
    }

conn.request("GET", "/api/v1/account/qr/BTC/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/qr/BTC/string")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'image/png'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/api/v1/account/qr/BTC/string");
xhr.setRequestHeader("accept", "image/png");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

GET api/v1/account/qr/{currency}/{address}

Generate QR code

Creates QR code for given currency and address.

Parameters

Name In Type Required Description
address path string true Blockchain address
currency path string true Digital asset

Enumerated Values

Parameter Value
currency BTC
currency TBTC
currency ETH
currency TETH

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK string
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None

getAccountsByCustomerId

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/api/v1/account/string")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .asString();
curl --request GET \
  --url http://localhost:6543/api/v1/account/string \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string"

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("GET", "/api/v1/account/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/api/v1/account/string");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

GET api/v1/account/{customerId}

List all customer accounts

List all accounts associated with the customer.

Parameters

Name In Type Required Description
customerId path string true Internal customer ID

Example responses

200 Response

[
  {
    "balance": {
      "accountBalance": 0,
      "availableBalance": 0
    },
    "created": 1546410660486,
    "currency": "BTC",
    "frozen": false,
    "publicId": "7c21ed165e294db78b95f0f181086d6f"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Account] false none none
» Account Account false none none
»» balance AccountBalance false none none
»»» accountBalance number false none Account balance represents all assets on the account, available and blocked.
»»» availableBalance number false none Available balance on the account represents account balance minus blocked amount on the account. If the account is frozen or customer is disabled, the available balance will be 0. Available balance should be user do determine how much can customer send or withdraw from the account.
»» created integer(int64) false none Time in UTC millis of account creation.
»» currency string false none Account currency.
»» frozen boolean false none Indicates whether account is frozen or not.
»» publicId string false none Account ID.

Enumerated Values

Property Value
currency BTC
currency ETH
currency TBTC
currency TETH
currency XRP
currency TXRP
currency VC_<VIRTUAL_CURRENCY>
currency <ERC20_CURRENCY>

getAllDepositAddresses

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/api/v1/account/string/address")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .asString();
curl --request GET \
  --url http://localhost:6543/api/v1/account/string/address \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string/address",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string/address"

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("GET", "/api/v1/account/string/address", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string/address")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/api/v1/account/string/address");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

GET api/v1/account/{id}/address

Get all deposit addresses for account

Get all deposit addresses generated for account. It is possible to deposit funds from another blockchain address to any of associated addresses.

Parameters

Name In Type Required Description
id path string true Account ID

Example responses

200 Response

[
  {
    "address": "7c21ed165e294db78b95f0f181086d6f",
    "derivationKey": "7c21ed165e294db78b95f0f181086d6f",
    "xpub": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Address] false none none
» Address Address false none none
»» address string false none Blockchain address.
»» derivationKey integer(int32) false none Derivation key index for given address.
»» xpub string false none Extended public key to derive address from. In case of XRP, this is account address, since address is defined as DestinationTag, which is address field.

generateDepositAddress

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/account/string/address/string")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/account/string/address/string \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string/address/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string/address/string"

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/account/string/address/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string/address/string")

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

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/account/string/address/string");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/account/{id}/address/{xpub}

Create new deposit address

Create new deposit address for account. This method associate public blockchain's ledger address with account of Tatum's private ledger. Depending on currency of account, this method will either generate public address for Bitcoin or Ethereum, or DestinationTag in case of XRP.

Parameters

Name In Type Required Description
id path string true Account ID
index query string false

Derivation path index for concrete address. If not present, last used index for given xpub + 1 is used. We recommend not to pass this value manually, since when some of hte indexes are skipped, it is not possible to use them lately to generate address from it.

xpub path string true

Extended public key to derive address from. There can be only 1 across all accounts and all accounts are generated from it. In case of XRP, this is Account address for which there will be generated DestinationTags. 0 indexed address is not used and is used for internal purposes (in case of BTC to ask for change for each blockchain transaction).

Example responses

200 Response

{
  "address": "7c21ed165e294db78b95f0f181086d6f",
  "derivationKey": "7c21ed165e294db78b95f0f181086d6f",
  "xpub": "string"
}

Responses

Status Meaning Description Schema
200 OK OK Address
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

getAccountBalance

Code samples

HttpResponse<String> response = Unirest.get("http://localhost:6543/api/v1/account/string/balance")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .asString();
curl --request GET \
  --url http://localhost:6543/api/v1/account/string/balance \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string/balance",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string/balance"

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("GET", "/api/v1/account/string/balance", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string/balance")

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

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://localhost:6543/api/v1/account/string/balance");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

GET api/v1/account/{id}/balance

Get account balance

Get balance for the account.

Parameters

Name In Type Required Description
id path string true Account ID

Example responses

200 Response

{
  "accountBalance": 0,
  "availableBalance": 0
}

Responses

Status Meaning Description Schema
200 OK OK AccountBalance
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None

blockAmount

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/account/string/block")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"amount\":0}")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/account/string/block \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"amount":0}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string/block",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"amount\":0}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string/block"

	payload := strings.NewReader("{\"amount\":0}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"amount\":0}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/account/string/block", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string/block")

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

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"amount\":0}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "amount": 0
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/account/string/block");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/account/{id}/block

Blocked amount affects account available balance and does not allow to go with balance under the blocked amount.

Body parameter

{
  "amount": 0
}

Parameters

Name In Type Required Description
id path string true Account ID
body body BlockAmount true amount
» amount body number false Amount to be blocked on account.

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

deactivateAccount

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/account/string/deactivate")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/account/string/deactivate \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string/deactivate",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string/deactivate"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/account/string/deactivate", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string/deactivate")

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

request = Net::HTTP::Put.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/account/string/deactivate");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/account/{id}/deactivate

Deactivate account

Deactivate account. Only accounts with non-zero balance can be deactivated.

Parameters

Name In Type Required Description
id path string true Account ID

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

freezeAccount

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/account/string/freeze")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/account/string/freeze \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string/freeze",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string/freeze"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/account/string/freeze", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string/freeze")

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

request = Net::HTTP::Put.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/account/string/freeze");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/account/{id}/freeze

Freeze account

Freeze account will disable all outgoing payments. Deposits on account will remain available.

Parameters

Name In Type Required Description
id path string true Account ID

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

unfreezeAccount

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/account/string/unfreeze")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/account/string/unfreeze \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/account/string/unfreeze",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/account/string/unfreeze"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/account/string/unfreeze", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/account/string/unfreeze")

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

request = Net::HTTP::Put.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/account/string/unfreeze");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/account/{id}/unfreeze

Unfreeze account

Unfreeze previously frozen account. Unfreezing non-frozen account will do no harm to the account.

Parameters

Name In Type Required Description
id path string true Account ID

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

Virtual Currency Endpoint

Prerequisites:

Register and use Tatum private's virtual currencies. You can create your own virtual currency and distribute it amongst your customers.

mintCurrency

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/virtualCurrency/mint")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/virtualCurrency/mint \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"accountId":"7c21ed165e294db78b95f0f181086d6f","amount":0}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/virtualCurrency/mint",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/virtualCurrency/mint"

	payload := strings.NewReader("{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/virtualCurrency/mint", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/virtualCurrency/mint")

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

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "accountId": "7c21ed165e294db78b95f0f181086d6f",
  "amount": 0
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/virtualCurrency/mint");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/virtualCurrency/mint

Create new supply of virtual currency

Create new supply of virtual currency linked with given accountId. Method increases total supply of currency.

Body parameter

{
  "accountId": "7c21ed165e294db78b95f0f181086d6f",
  "amount": 0
}

Parameters

Name In Type Required Description
body body VirtualCurrencyOperation true virtualCurrency
» accountId body string false Virtual currency account.
» amount body number false Amount of virtual currency to operate within this operation.

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

revokeCurrency

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/virtualCurrency/revoke")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/virtualCurrency/revoke \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"accountId":"7c21ed165e294db78b95f0f181086d6f","amount":0}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/virtualCurrency/revoke",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/virtualCurrency/revoke"

	payload := strings.NewReader("{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/virtualCurrency/revoke", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/virtualCurrency/revoke")

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

request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"accountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"amount\":0}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "accountId": "7c21ed165e294db78b95f0f181086d6f",
  "amount": 0
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/virtualCurrency/revoke");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/virtualCurrency/revoke

Destroy supply of virtual currency

Destroy supply of virtual currency linked with given accountId. Method decreases total supply of currency.

Body parameter

{
  "accountId": "7c21ed165e294db78b95f0f181086d6f",
  "amount": 0
}

Parameters

Name In Type Required Description
body body VirtualCurrencyOperation true virtualCurrency
» accountId body string false Virtual currency account.
» amount body number false Amount of virtual currency to operate within this operation.

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

createCurrency

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/virtualCurrency/string")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"basePair\":\"BTC\",\"erc20\":true,\"name\":\"VIRTUAL\",\"supply\":1000000}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/virtualCurrency/string \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"basePair":"BTC","erc20":true,"name":"VIRTUAL","supply":1000000}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/virtualCurrency/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"basePair\":\"BTC\",\"erc20\":true,\"name\":\"VIRTUAL\",\"supply\":1000000}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/virtualCurrency/string"

	payload := strings.NewReader("{\"basePair\":\"BTC\",\"erc20\":true,\"name\":\"VIRTUAL\",\"supply\":1000000}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"basePair\":\"BTC\",\"erc20\":true,\"name\":\"VIRTUAL\",\"supply\":1000000}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/virtualCurrency/string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/virtualCurrency/string")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"basePair\":\"BTC\",\"erc20\":true,\"name\":\"VIRTUAL\",\"supply\":1000000}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "basePair": "BTC",
  "erc20": true,
  "name": "VIRTUAL",
  "supply": 1000000
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/virtualCurrency/string");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/virtualCurrency/{id}

Create new virtual currency

Create new virtual currency with given supply stored in account. This will create Tatum internal virtual currency. Tatum virtual currency act as any other asset within Tatum. For creation of ERC20 token, see ERC20 Endpoint.

Body parameter

{
  "basePair": "BTC",
  "erc20": true,
  "name": "VIRTUAL",
  "supply": 1000000
}

Parameters

Name In Type Required Description
id path string true Customer internal ID
body body VirtualCurrency true virtualCurrency
» basePair body string false Base pair for virtual currency. Transaction value will be calculated according to this base pair.
» erc20 body boolean false If it is ERC20 token on Ethereum blockchain or virtual currency of Tatum platform.
» name body string false Virtual currency name. Must be prefixed with 'VC_'.
» supply body number false Supply of virtual currency.

Enumerated Values

Parameter Value
» basePair BTC
» basePair ETH
» basePair USD
» basePair CZK
» basePair EUR

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK string
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

Payment Endpoint

Prerequisites:

Endpoint used to create and list transactions within Tatum private's ledger.

sendPayment

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/payment")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"amount\":0,\"anonymous\":false,\"compliant\":false,\"paymentId\":9625,\"recipientAccountId\":\"7c69db525e294db78b95f0f181124d6f\",\"recipientNote\":\"Private note\",\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/payment \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"amount":0,"anonymous":false,"compliant":false,"paymentId":9625,"recipientAccountId":"7c69db525e294db78b95f0f181124d6f","recipientNote":"Private note","senderAccountId":"7c21ed165e294db78b95f0f181086d6f","senderNote":"Sender note"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/payment",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"amount\":0,\"anonymous\":false,\"compliant\":false,\"paymentId\":9625,\"recipientAccountId\":\"7c69db525e294db78b95f0f181124d6f\",\"recipientNote\":\"Private note\",\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/payment"

	payload := strings.NewReader("{\"amount\":0,\"anonymous\":false,\"compliant\":false,\"paymentId\":9625,\"recipientAccountId\":\"7c69db525e294db78b95f0f181124d6f\",\"recipientNote\":\"Private note\",\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"amount\":0,\"anonymous\":false,\"compliant\":false,\"paymentId\":9625,\"recipientAccountId\":\"7c69db525e294db78b95f0f181124d6f\",\"recipientNote\":\"Private note\",\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\"}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/payment", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/payment")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"amount\":0,\"anonymous\":false,\"compliant\":false,\"paymentId\":9625,\"recipientAccountId\":\"7c69db525e294db78b95f0f181124d6f\",\"recipientNote\":\"Private note\",\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "amount": 0,
  "anonymous": false,
  "compliant": false,
  "paymentId": 9625,
  "recipientAccountId": "7c69db525e294db78b95f0f181124d6f",
  "recipientNote": "Private note",
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "senderNote": "Sender note"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/payment");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/payment

Send payment

Send payment within the Tatum's ledger. All assets are settled instantly. This method is used only for transferring assets between Tatum's accounts and will not send any funds to blockchain addresses.

Body parameter

{
  "amount": 0,
  "anonymous": false,
  "compliant": false,
  "paymentId": 9625,
  "recipientAccountId": "7c69db525e294db78b95f0f181124d6f",
  "recipientNote": "Private note",
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "senderNote": "Sender note"
}

Parameters

Name In Type Required Description
body body Payment true payment
» amount body number false Amount to be sent
» anonymous body boolean false Anonymous payment does not show sender account to recipient, default is false
» compliant body boolean false Enable compliant checks. Payment will not be processed, if compliant check fails.
» paymentId body string false Payment ID, External identifier of the payment, which can be used to pair payments within Tatum accounts.
» recipientAccountId body string false Internal recipient account ID within Tatum platform
» recipientNote body string false Note visible to both, sender and recipient
» senderAccountId body string false Internal sender account ID within Tatum platform
» senderNote body string false Note visible to sender

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK string
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

getTransactionsByAccountId

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/payment/account/string")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/payment/account/string \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"account":"7c69db525e294db78b95f0f181124d6f","counterAccount":"7c21ed165e294db78b95f0f181086d6f","from":1546411085054,"limit":500,"opType":"PAYMENT","paymentId":65426,"to":1546416085054}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/payment/account/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/payment/account/string"

	payload := strings.NewReader("{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/payment/account/string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/payment/account/string")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "account": "7c69db525e294db78b95f0f181124d6f",
  "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
  "from": 1546411085054,
  "limit": 500,
  "opType": "PAYMENT",
  "paymentId": 65426,
  "to": 1546416085054
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/payment/account/string");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/payment/account/{id}

Find payments for account.

Find payments for account identified by given id.

Body parameter

{
  "account": "7c69db525e294db78b95f0f181124d6f",
  "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
  "from": 1546411085054,
  "limit": 500,
  "opType": "PAYMENT",
  "paymentId": 65426,
  "to": 1546416085054
}

Parameters

Name In Type Required Description
id path string true Account ID
body body TransactionFilter true filter
» account body string false Source account - source of transaction(s)
» counterAccount body string false Counter account - transaction(s) destination account
» from body string(date) false Starting date to search for payments from, default NULL means search all history
» limit body integer(int32) false Maximum number of payments in the result, default 500
» opType body string false Type of operation
» paymentId body string false Payment ID defined in payment order by sender
» to body string(date) false Date until to search for payments, default NULL means search until now

Enumerated Values

Parameter Value
» opType PAYMENT
» opType WITHDRAWAL
» opType FAILED
» opType DEPOSIT

Example responses

200 Response

[
  {
    "account": "7c69db525e294db78b95f0f181124d6f",
    "amount": 0.1,
    "anonymous": false,
    "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
    "currency": "BTC",
    "date": 1546411001267,
    "id": 9876812,
    "marketValues": [
      {
        "date": 1546411001267,
        "pair": "BTC",
        "source": "CMC, https://coinmarketcap.com",
        "value": 1235.56
      }
    ],
    "operationType": "PAYMENT",
    "paymentId": 65426,
    "recipientNote": "Private note",
    "reference": 1561683216,
    "senderNote": "Sender note",
    "transactionType": "CREDIT_PAYMENT"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Transaction] false none none
» Transaction Transaction false none none
»» account string false none Source account - source of transaction(s)
»» amount number false none Amount in account's currency
»» anonymous boolean false none Whether payment is anonymous. If true, counter account owner does not see source account.
»» counterAccount string false none Counter account - transaction(s) destination account
»» currency string false none Payment currency
»» date integer(int64) false none Payment datetime in UTC millis
»» id integer(int64) false none Internal payment ID
»» marketValues [MarketValue] false none List of market values of given transaction with all supported base pairs.
»»» MarketValue MarketValue false none none
»»»» date integer(int64) false none Date of validity of rate.
»»»» pair string false none Base pair.
»»»» source string false none Source of base pair.
»»»» value number false none Value of transaction in given base pair.
»»» operationType string false none Type of operation
»»» paymentId string false none Payment ID defined in payment order by sender
»»» recipientNote string false none Note visible for both sender and recipient
»»» reference string false none Payment internal reference - unique identifier within Tatum ledger. In order of failure, use this value to search for problems.
»»» senderNote string false none Note visible for sender
»»» transactionType string false none Type of payment

Enumerated Values

Property Value
pair BTC
pair ETH
pair USD
pair CZK
pair EUR
operationType PAYMENT
operationType WITHDRAWAL
operationType FAILED
operationType DEPOSIT
transactionType FAILED
transactionType DEBIT_PAYMENT
transactionType CREDIT_PAYMENT
transactionType CREDIT_DEPOSIT
transactionType DEBIT_WITHDRAWAL
transactionType CANCEL_WITHDRAWAL

getTransactionsByCustomerId

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/payment/customer/string")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/payment/customer/string \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"account":"7c69db525e294db78b95f0f181124d6f","counterAccount":"7c21ed165e294db78b95f0f181086d6f","from":1546411085054,"limit":500,"opType":"PAYMENT","paymentId":65426,"to":1546416085054}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/payment/customer/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/payment/customer/string"

	payload := strings.NewReader("{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/payment/customer/string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/payment/customer/string")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"account\":\"7c69db525e294db78b95f0f181124d6f\",\"counterAccount\":\"7c21ed165e294db78b95f0f181086d6f\",\"from\":1546411085054,\"limit\":500,\"opType\":\"PAYMENT\",\"paymentId\":65426,\"to\":1546416085054}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "account": "7c69db525e294db78b95f0f181124d6f",
  "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
  "from": 1546411085054,
  "limit": 500,
  "opType": "PAYMENT",
  "paymentId": 65426,
  "to": 1546416085054
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/payment/customer/string");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/payment/customer/{id}

Find payments for customer across all accounts.

Find payments for all accounts of customer identified by given id.

Body parameter

{
  "account": "7c69db525e294db78b95f0f181124d6f",
  "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
  "from": 1546411085054,
  "limit": 500,
  "opType": "PAYMENT",
  "paymentId": 65426,
  "to": 1546416085054
}

Parameters

Name In Type Required Description
id path string true Internal customer ID
body body TransactionFilter true filter
» account body string false Source account - source of transaction(s)
» counterAccount body string false Counter account - transaction(s) destination account
» from body string(date) false Starting date to search for payments from, default NULL means search all history
» limit body integer(int32) false Maximum number of payments in the result, default 500
» opType body string false Type of operation
» paymentId body string false Payment ID defined in payment order by sender
» to body string(date) false Date until to search for payments, default NULL means search until now

Enumerated Values

Parameter Value
» opType PAYMENT
» opType WITHDRAWAL
» opType FAILED
» opType DEPOSIT

Example responses

200 Response

[
  {
    "account": "7c69db525e294db78b95f0f181124d6f",
    "amount": 0.1,
    "anonymous": false,
    "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
    "currency": "BTC",
    "date": 1546411001267,
    "id": 9876812,
    "marketValues": [
      {
        "date": 1546411001267,
        "pair": "BTC",
        "source": "CMC, https://coinmarketcap.com",
        "value": 1235.56
      }
    ],
    "operationType": "PAYMENT",
    "paymentId": 65426,
    "recipientNote": "Private note",
    "reference": 1561683216,
    "senderNote": "Sender note",
    "transactionType": "CREDIT_PAYMENT"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Transaction] false none none
» Transaction Transaction false none none
»» account string false none Source account - source of transaction(s)
»» amount number false none Amount in account's currency
»» anonymous boolean false none Whether payment is anonymous. If true, counter account owner does not see source account.
»» counterAccount string false none Counter account - transaction(s) destination account
»» currency string false none Payment currency
»» date integer(int64) false none Payment datetime in UTC millis
»» id integer(int64) false none Internal payment ID
»» marketValues [MarketValue] false none List of market values of given transaction with all supported base pairs.
»»» MarketValue MarketValue false none none
»»»» date integer(int64) false none Date of validity of rate.
»»»» pair string false none Base pair.
»»»» source string false none Source of base pair.
»»»» value number false none Value of transaction in given base pair.
»»» operationType string false none Type of operation
»»» paymentId string false none Payment ID defined in payment order by sender
»»» recipientNote string false none Note visible for both sender and recipient
»»» reference string false none Payment internal reference - unique identifier within Tatum ledger. In order of failure, use this value to search for problems.
»»» senderNote string false none Note visible for sender
»»» transactionType string false none Type of payment

Enumerated Values

Property Value
pair BTC
pair ETH
pair USD
pair CZK
pair EUR
operationType PAYMENT
operationType WITHDRAWAL
operationType FAILED
operationType DEPOSIT
transactionType FAILED
transactionType DEBIT_PAYMENT
transactionType CREDIT_PAYMENT
transactionType CREDIT_DEPOSIT
transactionType DEBIT_WITHDRAWAL
transactionType CANCEL_WITHDRAWAL

Withdrawal Endpoint

Prerequisites:

Endpoint used to cancel / complete withdrawals from Tatum to supported blockchains made by your customers.

broadcast

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/withdrawal/broadcast")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"currency\":\"BTC\",\"testnet\":false,\"withdrawalId\":\"12345\",\"txData\":\"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/withdrawal/broadcast \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"currency":"BTC","testnet":false,"withdrawalId":"12345","txData":"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/withdrawal/broadcast",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"currency\":\"BTC\",\"testnet\":false,\"withdrawalId\":\"12345\",\"txData\":\"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/withdrawal/broadcast"

	payload := strings.NewReader("{\"currency\":\"BTC\",\"testnet\":false,\"withdrawalId\":\"12345\",\"txData\":\"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"currency\":\"BTC\",\"testnet\":false,\"withdrawalId\":\"12345\",\"txData\":\"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/withdrawal/broadcast", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/withdrawal/broadcast")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"currency\":\"BTC\",\"testnet\":false,\"withdrawalId\":\"12345\",\"txData\":\"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "currency": "BTC",
  "testnet": false,
  "withdrawalId": "12345",
  "txData": "62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/withdrawal/broadcast");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/withdrawal/broadcast

Broadcast signed transaction and complete withdrawal

Broadcast signed raw transaction end complete withdrawal associated with it. When broadcast succeeded but it is impossible to complete withdrawal, transaction id of transaction is returned and withdrawal must be completed manually.

Body parameter

{
  "currency": "BTC",
  "testnet": false,
  "withdrawalId": "12345",
  "txData": "62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"
}

Parameters

Name In Type Required Description
body body Broadcast true broadcast
» currency body string false Currency of signed transaction to be broadcast
» testnet body boolean false Whether we use testnet or mainnet chain.
» withdrawalId body integer false Withdrawal ID to be completed by transaction broadcast
» txData body string false Raw signed transaction to be published to network.

Enumerated Values

Parameter Value
» currency BTC
» currency ETH
» currency TBTC
» currency TETH
» currency XRP
» currency TXRP
» currency <ERC20_CURRENCY>

Example responses

200 Response

"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"

Responses

Status Meaning Description Schema
200 OK OK BroadcastResponse
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

checkWithdrawal

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/withdrawal/hint")
  .header("content-type", "application/json")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .body("{\"amount\":0.001,\"currency\":\"BTC\",\"fee\":0.0005,\"force\":false,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\",\"sourceAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/withdrawal/hint \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"amount":0.001,"currency":"BTC","fee":0.0005,"force":false,"senderAccountId":"7c21ed165e294db78b95f0f181086d6f","senderNote":"Sender note","sourceAddress":"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7","targetAddress":"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/withdrawal/hint",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"amount\":0.001,\"currency\":\"BTC\",\"fee\":0.0005,\"force\":false,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\",\"sourceAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/withdrawal/hint"

	payload := strings.NewReader("{\"amount\":0.001,\"currency\":\"BTC\",\"fee\":0.0005,\"force\":false,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\",\"sourceAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"amount\":0.001,\"currency\":\"BTC\",\"fee\":0.0005,\"force\":false,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\",\"sourceAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\"}"

headers = {
    'content-type': "application/json",
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/withdrawal/hint", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/withdrawal/hint")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'
request.body = "{\"amount\":0.001,\"currency\":\"BTC\",\"fee\":0.0005,\"force\":false,\"senderAccountId\":\"7c21ed165e294db78b95f0f181086d6f\",\"senderNote\":\"Sender note\",\"sourceAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\",\"targetAddress\":\"mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "amount": 0.001,
  "currency": "BTC",
  "fee": 0.0005,
  "force": false,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "senderNote": "Sender note",
  "sourceAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7",
  "targetAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/withdrawal/hint");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/withdrawal/hint

Check withdrawal

Check available accounts with enough balance to withdraw desired amount. With Ethereum blockchain, it is possible to withdraw as a 1 transaction only amount, which is available on any of the registered accounts. E.g. we have 3 accounts with balances 0.2 ETH, 0.3 ETH and 0.4 ETH, so maximal available amount to withdraw at 1 transaction is 0.4 ETH. If we want to withdraw more, it must be split into multiple transactions. Only for Ethereum based accounts.

Body parameter

{
  "amount": 0.001,
  "currency": "BTC",
  "fee": 0.0005,
  "force": false,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "senderNote": "Sender note",
  "sourceAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7",
  "targetAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7"
}

Parameters

Name In Type Required Description
body body Withdrawal true withdrawal
» amount body number false Amount to be withdrawn to blockchain.
» currency body string false Withdrawal currency
» fee body number false Fee to be submitted as a transaction fee to blockchain. If not present, it is set automatically to 0.0005 for BTC.
» force body boolean false Force withdrawal, even if it is non-compliant
» senderAccountId body string false Sender account ID
» senderNote body string false Note visible to owner of withdrawing account
» sourceAddress body string false Blockchain address to send assets from. Used only for ETH-based accounts. See Ethereum blockchain helper Endpoint.
» targetAddress body string false Blockchain address to send assets

Enumerated Values

Parameter Value
» currency BTC
» currency ETH
» currency TBTC
» currency TETH
» currency XRP
» currency TXRP
» currency <ERC20_CURRENCY>

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK OK WithdrawalHint
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

cancelWithdrawal

Code samples

HttpResponse<String> response = Unirest.delete("http://localhost:6543/api/v1/withdrawal/string")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request DELETE \
  --url http://localhost:6543/api/v1/withdrawal/string \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/withdrawal/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/withdrawal/string"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("DELETE", "/api/v1/withdrawal/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/withdrawal/string")

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

request = Net::HTTP::Delete.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "http://localhost:6543/api/v1/withdrawal/string");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

DELETE api/v1/withdrawal/{id}

Cancel withdrawal

This method is helpful if you need to cancel withdrawal in case of blockchain transaction failed or is not yet processed. This does not cancel already broadcast blockchain transaction, only Tatum internal withdrawal request.

Parameters

Name In Type Required Description
id path string true ID of created withdrawal

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
204 No Content No Content None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None

completeWithdrawal

Code samples

HttpResponse<String> response = Unirest.put("http://localhost:6543/api/v1/withdrawal/string/string")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request PUT \
  --url http://localhost:6543/api/v1/withdrawal/string/string \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/withdrawal/string/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/withdrawal/string/string"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("PUT", "/api/v1/withdrawal/string/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/withdrawal/string/string")

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

request = Net::HTTP::Put.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://localhost:6543/api/v1/withdrawal/string/string");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

PUT api/v1/withdrawal/{id}/{txId}

Complete withdrawal

Invoke complete withdrawal as soon as blockchain transaction ID is available. Otherwise withdrawal will be processed automatically in next block and all other withdrawals will be pending unless the last one is processed and marked as compelted..

Parameters

Name In Type Required Description
id path string true ID of created withdrawal
txId path string true Blockchain transaction ID of created withdrawal

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

ERC20 Endpoint

Prerequisites:

Erc 20 Token Endpoint is used to create new ERC20 token in Ethereum blockchain and register it within Tatum. Then you will be able to send and receive created ERC20 tokens as you would with Ethereum or any other crypto asset.

createErc20Currency

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/erc20/string")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .header("authorization", "x-client-secret")
  .body("{\"basePair\":\"BTC\",\"chain\":\"TETH\",\"index\":0,\"name\":\"VIRTUAL\",\"supply\":1000000,\"symbol\":\"VIRTUAL\",\"xpub\":\"string\"}")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/erc20/string \
  --header 'accept: application/json' \
  --header 'authorization: x-client-secret' \
  --header 'content-type: application/json' \
  --data '{"basePair":"BTC","chain":"TETH","index":0,"name":"VIRTUAL","supply":1000000,"symbol":"VIRTUAL","xpub":"string"}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/erc20/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"basePair\":\"BTC\",\"chain\":\"TETH\",\"index\":0,\"name\":\"VIRTUAL\",\"supply\":1000000,\"symbol\":\"VIRTUAL\",\"xpub\":\"string\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: x-client-secret",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/erc20/string"

	payload := strings.NewReader("{\"basePair\":\"BTC\",\"chain\":\"TETH\",\"index\":0,\"name\":\"VIRTUAL\",\"supply\":1000000,\"symbol\":\"VIRTUAL\",\"xpub\":\"string\"}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

payload = "{\"basePair\":\"BTC\",\"chain\":\"TETH\",\"index\":0,\"name\":\"VIRTUAL\",\"supply\":1000000,\"symbol\":\"VIRTUAL\",\"xpub\":\"string\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/erc20/string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/erc20/string")

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

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["authorization"] = 'x-client-secret'
request.body = "{\"basePair\":\"BTC\",\"chain\":\"TETH\",\"index\":0,\"name\":\"VIRTUAL\",\"supply\":1000000,\"symbol\":\"VIRTUAL\",\"xpub\":\"string\"}"

response = http.request(request)
puts response.read_body
var data = JSON.stringify({
  "basePair": "BTC",
  "chain": "TETH",
  "index": 0,
  "name": "VIRTUAL",
  "supply": 1000000,
  "symbol": "VIRTUAL",
  "xpub": "string"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/erc20/string");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/erc20/{id}

Create new ERC20 token

Create new ERC20 token with given supply on Ethereum blockchain. Whole supply of newly created ERC20 token is stored in customer's newly created account. Then it is possible to create new Tatum accounts with ERC20 token name as account's currency.

Body parameter

{
  "basePair": "BTC",
  "chain": "TETH",
  "index": 0,
  "name": "VIRTUAL",
  "supply": 1000000,
  "symbol": "VIRTUAL",
  "xpub": "string"
}

Parameters

Name In Type Required Description
id path string true Customer internal ID
body body Erc20 true erc20
» basePair body string false Base pair for ERC20 token. Transaction value will be calculated according to this base pair.
» chain body string false Chain for ERC20 token. Ethereum mainnet or Ropsten testnet are available.
» index body integer(int32) false Derivation index for xpub to generate concrete deposit address.
» name body string false ERC20 token name.
» supply body number false Supply of ERC20 token.
» symbol body string false ERC20 token symbol.
» xpub body string false Extended public key (xpub), from which deposit ERC20 address will be generated.

Enumerated Values

Parameter Value
» basePair BTC
» basePair ETH
» basePair USD
» basePair CZK
» basePair EUR
» chain ETH
» chain TETH

Example responses

200 Response

{
  "accountId": "string",
  "data": "string",
  "gasLimit": 18976523,
  "gasPrice": 1
}

Responses

Status Meaning Description Schema
200 OK OK Erc20Response
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

storeErc20ContractAddress

Code samples

HttpResponse<String> response = Unirest.post("http://localhost:6543/api/v1/erc20/string/string")
  .header("accept", "*/*")
  .header("authorization", "x-client-secret")
  .asString();
curl --request POST \
  --url http://localhost:6543/api/v1/erc20/string/string \
  --header 'accept: */*' \
  --header 'authorization: x-client-secret'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "6543",
  CURLOPT_URL => "http://localhost:6543/api/v1/erc20/string/string",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "accept: */*",
    "authorization: x-client-secret"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "http://localhost:6543/api/v1/erc20/string/string"

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

	req.Header.Add("accept", "*/*")
	req.Header.Add("authorization", "x-client-secret")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("localhost:6543")

headers = {
    'accept': "*/*",
    'authorization': "x-client-secret"
    }

conn.request("POST", "/api/v1/erc20/string/string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("http://localhost:6543/api/v1/erc20/string/string")

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

request = Net::HTTP::Post.new(url)
request["accept"] = '*/*'
request["authorization"] = 'x-client-secret'

response = http.request(request)
puts response.read_body
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://localhost:6543/api/v1/erc20/string/string");
xhr.setRequestHeader("accept", "*/*");
xhr.setRequestHeader("authorization", "x-client-secret");

xhr.send(data);

POST api/v1/erc20/{symbol}/{address}

Set ERC20 token contract address

Set contract address of ERC20 token. This must be done in order to communicate with ERC20 smart contract. After creating and deploying ERC20 token to Ethereum blockchain, smart contract address is generated and must be set within Tatum. Otherwise Tatum platform will not be able to detect incoming deposits of ERC20 and do withdrawals from Tatum accounts to other blockchain addresses.

Parameters

Name In Type Required Description
address path string true ERC20 contract address
symbol path string true ERC20 symbol name.

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Invalid Error
401 Unauthorized Unauthorized None
404 Not Found Not Found None
500 Internal Server Error Internal error Error

Schemas

AccountBalance

{
  "accountBalance": 0,
  "availableBalance": 0
}

AccountBalance

Properties

Name Type Required Restrictions Description
accountBalance number false none Account balance represents all assets on the account, available and blocked.
availableBalance number false none Available balance on the account represents account balance minus blocked amount on the account. If the account is frozen or customer is disabled, the available balance will be 0. Available balance should be user do determine how much can customer send or withdraw from the account.

Account

{
  "balance": {
    "accountBalance": 0,
    "availableBalance": 0
  },
  "created": 1546410660486,
  "currency": "BTC",
  "frozen": false,
  "publicId": "7c21ed165e294db78b95f0f181086d6f"
}

Account

Properties

Name Type Required Restrictions Description
balance AccountBalance false none none
created integer(int64) false none Time in UTC millis of account creation.
currency string false none Account currency.
frozen boolean false none Indicates whether account is frozen or not.
publicId string false none Account ID.

Enumerated Values

Property Value
currency BTC
currency ETH
currency TBTC
currency TETH
currency XRP
currency TXRP
currency VC_<VIRTUAL_CURRENCY>
currency <ERC20_CURRENCY>

Address

{
  "address": "7c21ed165e294db78b95f0f181086d6f",
  "derivationKey": "7c21ed165e294db78b95f0f181086d6f",
  "xpub": "string"
}

Address

Properties

Name Type Required Restrictions Description
address string false none Blockchain address.
derivationKey integer(int32) false none Derivation key index for given address.
xpub string false none Extended public key to derive address from. In case of XRP, this is account address, since address is defined as DestinationTag, which is address field.

ApiKey

{
  "apiKey": "7c21ed165e294db78b95f0f181086d6f",
  "id": 1,
  "name": "My Admin Write key.",
  "readAccess": true,
  "secret": "123123aksjfn2q8onfkan823f",
  "writeAccess": true
}

ApiKey

Properties

Name Type Required Restrictions Description
apiKey string false none API key.
id integer(int64) false none ID of API key.
name string false none Name of API key.
readAccess boolean false none Whether this API key has read access. Should be true always for correct behavior.
secret string false none API key secret.
writeAccess boolean false none Whether this API key has write access.

BlockAmount

{
  "amount": 0
}

BlockAmount

Properties

Name Type Required Restrictions Description
amount number false none Amount to be blocked on account.

CreateAccount

{
  "compliant": false,
  "currency": "BTC",
  "customerId": 1
}

CreateAccount

Properties

Name Type Required Restrictions Description
compliant boolean false none Enable compliant checks. If this is enabled, it is impossible to create account if compliant check fails.
currency string false none Account currency
customerId integer(int64) false none Internal customer ID

Enumerated Values

Property Value
currency BTC
currency ETH
currency TBTC
currency TETH
currency XRP
currency TXRP
currency VC_<VIRTUAL_CURRENCY>
currency <ERC20_CURRENCY>

Customer

{
  "customerCountry": "US",
  "enabled": true,
  "externalId": 651234,
  "id": 1,
  "providerCountry": "US"
}

Customer

Properties

Name Type Required Restrictions Description
customerCountry string false none Country customer has to be compliant with
enabled boolean false none Indicates whether customer is enabled or not
externalId string false none Customer external ID
id integer(int64) false none Internal customer ID
providerCountry string false none Country service provider has to be compliant with

CustomerRegistration

{
  "customerCountry": "US",
  "externalId": 123654,
  "providerCountry": "US"
}

CustomerRegistration

Properties

Name Type Required Restrictions Description
customerCountry string false none Country customer has to be compliant with
externalId string false none Customer external ID. Use only anonymized identification you have in your system.
providerCountry string false none Country service provider has to be compliant with

CustomerUpdate

{
  "customerCountry": "US",
  "externalId": 123654,
  "providerCountry": "US"
}

CustomerUpdate

Properties

Name Type Required Restrictions Description
customerCountry string false none Country customer has to be compliant with. If empty, it will not be updated.
externalId string false none External customer ID. If empty, it will not be updated.
providerCountry string false none Country service provider has to be compliant with. If empty, it will not be updated.

Erc20

{
  "basePair": "BTC",
  "chain": "TETH",
  "index": 0,
  "name": "VIRTUAL",
  "supply": 1000000,
  "symbol": "VIRTUAL",
  "xpub": "string"
}

Erc20

Properties

Name Type Required Restrictions Description
basePair string false none Base pair for ERC20 token. Transaction value will be calculated according to this base pair.
chain string false none Chain for ERC20 token. Ethereum mainnet or Ropsten testnet are available.
index integer(int32) false none Derivation index for xpub to generate concrete deposit address.
name string false none ERC20 token name.
supply number false none Supply of ERC20 token.
symbol string false none ERC20 token symbol.
xpub string false none Extended public key (xpub), from which deposit ERC20 address will be generated.

Enumerated Values

Property Value
basePair BTC
basePair ETH
basePair USD
basePair CZK
basePair EUR
chain ETH
chain TETH

Erc20Response

{
  "accountId": "string",
  "data": "string",
  "gasLimit": 18976523,
  "gasPrice": 1
}

Erc20Response

Properties

Name Type Required Restrictions Description
accountId string false none Account ID with type of currency like created ERC20 token symbol. Supply of ERC20 token will be credited as soon as ERC20 token is sent to Ethereum blockchain.
data string false none ERC20 token to be send as a Ethereum transaction payload.
gasLimit number false none Estimated gas limit for creating ERC20 token.
gasPrice number false none Gas price for creating ERC20 token.

MarketValue

{
  "date": 1546411001267,
  "pair": "BTC",
  "source": "CMC, https://coinmarketcap.com",
  "value": 1235.56
}

MarketValue

Properties

Name Type Required Restrictions Description
date integer(int64) false none Date of validity of rate.
pair string false none Base pair.
source string false none Source of base pair.
value number false none Value of transaction in given base pair.

Enumerated Values

Property Value
pair BTC
pair ETH
pair USD
pair CZK
pair EUR

Payment

{
  "amount": 0,
  "anonymous": false,
  "compliant": false,
  "paymentId": 9625,
  "recipientAccountId": "7c69db525e294db78b95f0f181124d6f",
  "recipientNote": "Private note",
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "senderNote": "Sender note"
}

Payment

Properties

Name Type Required Restrictions Description
amount number false none Amount to be sent
anonymous boolean false none Anonymous payment does not show sender account to recipient, default is false
compliant boolean false none Enable compliant checks. Payment will not be processed, if compliant check fails.
paymentId string false none Payment ID, External identifier of the payment, which can be used to pair payments within Tatum accounts.
recipientAccountId string false none Internal recipient account ID within Tatum platform
recipientNote string false none Note visible to both, sender and recipient
senderAccountId string false none Internal sender account ID within Tatum platform
senderNote string false none Note visible to sender

Transaction

{
  "account": "7c69db525e294db78b95f0f181124d6f",
  "amount": 0.1,
  "anonymous": false,
  "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
  "currency": "BTC",
  "date": 1546411001267,
  "id": 9876812,
  "marketValues": [
    {
      "date": 1546411001267,
      "pair": "BTC",
      "source": "CMC, https://coinmarketcap.com",
      "value": 1235.56
    }
  ],
  "operationType": "PAYMENT",
  "paymentId": 65426,
  "recipientNote": "Private note",
  "reference": 1561683216,
  "senderNote": "Sender note",
  "transactionType": "CREDIT_PAYMENT"
}

Transaction

Properties

Name Type Required Restrictions Description
account string false none Source account - source of transaction(s)
amount number false none Amount in account's currency
anonymous boolean false none Whether payment is anonymous. If true, counter account owner does not see source account.
counterAccount string false none Counter account - transaction(s) destination account
currency string false none Payment currency
date integer(int64) false none Payment datetime in UTC millis
id integer(int64) false none Internal payment ID
marketValues [MarketValue] false none List of market values of given transaction with all supported base pairs.
operationType string false none Type of operation
paymentId string false none Payment ID defined in payment order by sender
recipientNote string false none Note visible for both sender and recipient
reference string false none Payment internal reference - unique identifier within Tatum ledger. In order of failure, use this value to search for problems.
senderNote string false none Note visible for sender
transactionType string false none Type of payment

Enumerated Values

Property Value
operationType PAYMENT
operationType WITHDRAWAL
operationType FAILED
operationType DEPOSIT
transactionType FAILED
transactionType DEBIT_PAYMENT
transactionType CREDIT_PAYMENT
transactionType CREDIT_DEPOSIT
transactionType DEBIT_WITHDRAWAL
transactionType CANCEL_WITHDRAWAL

TransactionFilter

{
  "account": "7c69db525e294db78b95f0f181124d6f",
  "counterAccount": "7c21ed165e294db78b95f0f181086d6f",
  "from": 1546411085054,
  "limit": 500,
  "opType": "PAYMENT",
  "paymentId": 65426,
  "to": 1546416085054
}

TransactionFilter

Properties

Name Type Required Restrictions Description
account string false none Source account - source of transaction(s)
counterAccount string false none Counter account - transaction(s) destination account
from string(date) false none Starting date to search for payments from, default NULL means search all history
limit integer(int32) false none Maximum number of payments in the result, default 500
opType string false none Type of operation
paymentId string false none Payment ID defined in payment order by sender
to string(date) false none Date until to search for payments, default NULL means search until now

Enumerated Values

Property Value
opType PAYMENT
opType WITHDRAWAL
opType FAILED
opType DEPOSIT

VirtualCurrency

{
  "basePair": "BTC",
  "erc20": true,
  "name": "VIRTUAL",
  "supply": 1000000
}

VirtualCurrency

Properties

Name Type Required Restrictions Description
basePair string false none Base pair for virtual currency. Transaction value will be calculated according to this base pair.
erc20 boolean false none If it is ERC20 token on Ethereum blockchain or virtual currency of Tatum platform.
name string false none Virtual currency name. Must be prefixed with 'VC_'.
supply number false none Supply of virtual currency.

Enumerated Values

Property Value
basePair BTC
basePair ETH
basePair USD
basePair CZK
basePair EUR

VirtualCurrencyOperation

{
  "accountId": "7c21ed165e294db78b95f0f181086d6f",
  "amount": 0
}

VirtualCurrencyOperation

Properties

Name Type Required Restrictions Description
accountId string false none Virtual currency account.
amount number false none Amount of virtual currency to operate within this operation.

BroadcastResponse

"62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"

Transaction ID of broadcast transaction

Properties

Name Type Required Restrictions Description
anonymous string false none Transaction ID of broadcast transaction

Broadcast

{
  "currency": "BTC",
  "testnet": false,
  "withdrawalId": "12345",
  "txData": "62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D"
}

Broadcast

Properties

Name Type Required Restrictions Description
currency string false none Currency of signed transaction to be broadcast
testnet boolean false none Whether we use testnet or mainnet chain.
withdrawalId integer false none Withdrawal ID to be completed by transaction broadcast
txData string false none Raw signed transaction to be published to network.

Enumerated Values

Property Value
currency BTC
currency ETH
currency TBTC
currency TETH
currency XRP
currency TXRP
currency <ERC20_CURRENCY>

Withdrawal

{
  "amount": 0.001,
  "currency": "BTC",
  "fee": 0.0005,
  "force": false,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "senderNote": "Sender note",
  "sourceAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7",
  "targetAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7"
}

Withdrawal

Properties

Name Type Required Restrictions Description
amount number false none Amount to be withdrawn to blockchain.
currency string false none Withdrawal currency
fee number false none Fee to be submitted as a transaction fee to blockchain. If not present, it is set automatically to 0.0005 for BTC.
force boolean false none Force withdrawal, even if it is non-compliant
senderAccountId string false none Sender account ID
senderNote string false none Note visible to owner of withdrawing account
sourceAddress string false none Blockchain address to send assets from. Used only for ETH-based accounts. See Ethereum blockchain helper Endpoint.
targetAddress string false none Blockchain address to send assets

Enumerated Values

Property Value
currency BTC
currency ETH
currency TBTC
currency TETH
currency XRP
currency TXRP
currency <ERC20_CURRENCY>

WithdrawalHint

{
  "addresses": [
    {
      "address": "7c21ed165e294db78b95f0f181086d6f",
      "derivationKey": "7c21ed165e294db78b95f0f181086d6f",
      "xpub": "string"
    }
  ],
  "amounts": [
    0
  ]
}

WithdrawalHint

Properties

Name Type Required Restrictions Description
addresses [Address] false none Addresses, from which withdrawal can be processed.
amounts [number] false none Balance for each address.

WithdrawalResponse

{
  "addresses": [
    {
      "address": "7c21ed165e294db78b95f0f181086d6f",
      "derivationKey": "7c21ed165e294db78b95f0f181086d6f",
      "xpub": "string"
    }
  ],
  "amounts": [
    0
  ],
  "id": 5432,
  "vin": [
    "string"
  ],
  "vinIndex": [
    0
  ]
}

WithdrawalResponse

Properties

Name Type Required Restrictions Description
addresses [Address] false none Addresses, from which withdrawal will be processed.
amounts [number] false none Amounts for each of unprocessed transaction outputs, that can be used for withdrawal.
id integer(int64) false none ID of withdrawal
vin [string] false none Last used unprocessed transaction outputs, that can be used.
vinIndex [integer] false none none

WalletGenerateBtc

{
  "chain": "BTC"
}

Properties

Name Type Required Restrictions Description
chain string null none Chain to generate address.

Enumerated Values

Property Value
chain BTC
chain TBTC

GeneratedAddress

{
  "address": "mtQygZAEbmgBCPJNMYRjGxa4C3kgTNdmXM"
}

Properties

Name Type Required Restrictions Description
address string null none Generated address.

PrivKey

{
  "key": "cTmS2jBWXgFaXZ2xG9jhn67TiyTshnMp3UedamzEhGm6BZV1vLgQ"
}

Properties

Name Type Required Restrictions Description
key string null none Generated private key.

TxHash

{
  "txHash": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Properties

Name Type Required Restrictions Description
txHash string null none txHash of successful transaction.

XPrivBtc

{
  "chain": "BTC",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 4
}

Properties

Name Type Required Restrictions Description
chain string true none chain - BTC for Mainnet or TBTC for Testnet3
mnemonic string true none mnemonic to generate private key from
index integer true none derivation index of private key

Enumerated Values

Property Value
chain BTC
chain TBTC

WithdrawalBtc

{
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "mpTwPdF8up9kidgcAStriUPwRdnE9MRAg7",
  "currency": "TBTC",
  "amount": "0.02",
  "senderNote": "Sender note",
  "force": false,
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse"
}

Properties

Name Type Required Restrictions Description
senderAccountId string true none Sender account ID
targetAddress string true none Blockchain address to send assets
currency string true none Withdrawal currency
amount number true none Amount to be sent in btc
senderNote string false none Note visible to owner of withdrawing account
force boolean false none Force withdrawal, even if it is non-compliant
mnemonic string true none private key of address to send funds from

Enumerated Values

Property Value
currency BTC
currency TBTC

XrpWallet

{
  "secret": "snSFTHdvSYQKKkYntvEt8cnmZuPJB",
  "address": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV"
}

Properties

Name Type Required Restrictions Description
secret string null none generated secret for account
address string null none generated account address

Wallet

{
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "xpriv": "xprvA1srLWNaGEkhdSJg6cLTMAziUpQcefpu2ZnKH2PXGiXEPKTdVPHjLFp4aZSSqSsaLMNrWXoj6TsyyUqh18T1hbiQkC42aWjXB9HnpmmqrYr",
  "xpub": "xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid"
}

Properties

Name Type Required Restrictions Description
mnemonic string null none generated mnemonic for wallet
xpriv string null none generated xpriv for wallet with derivation path according to BIP44
xpub string null none generated xpub for wallet with derivation path according to BIP44

WalletGenerateEth

{
  "chain": "ropsten"
}

Properties

Name Type Required Restrictions Description
chain string null none chain - 'mainnet' or 'ropsten'

Enumerated Values

Property Value
chain mainnet
chain ropsten

Erc20Token

{
  "tx": "0x93feef50a0754d5b815964ec41a744b8b60fd83bac7657386b21cd8a7c38a3b1",
  "contractAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85"
}

Properties

Name Type Required Restrictions Description
tx string null none tx hash of deployment of smart contract
contractAddress string null none address of generated smart contract

XPrivEth

{
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0
}

Properties

Name Type Required Restrictions Description
chain string true none chain - 'mainnet' or 'ropsten'
mnemonic string true none mnemonic to generate private key from
index integer true none derivation index of private key

Enumerated Values

Property Value
chain mainnet
chain ropsten

EthTransfer

{
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  "amount": 100000,
  "senderNote": "Sender note",
  "force": false
}

Properties

Name Type Required Restrictions Description
chain string true none chain - 'mainnet' or 'ropsten'
mnemonic string true none mnemonic to generate private key of sender
index integer true none derivation index of sender address of sender
senderAccountId string true none Sender account ID
targetAddress string true none Blockchain address to send assets
amount integer true none Amount to be sent in wei
senderNote string false none Note visible to owner of withdrawing account
force boolean false none Force payment, even if it is non-compliant

Enumerated Values

Property Value
chain mainnet
chain ropsten

XrpTransfer

{
  "chain": "XRP",
  "account": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV",
  "secret": "snSFTHdvSYQKKkYntvEt8cnmZuPJB",
  "senderAccountId": "35ab5ea8e48c4b179cadea653c6d732e",
  "targetAddress": "rPRxSZzTFd6Yez3UMxFUPJvnhUhjewpjfV",
  "destinationTag": 12355,
  "amount": 10000,
  "senderNote": "Sender note",
  "force": false
}

Properties

Name Type Required Restrictions Description
chain string true none chain - 'XRP' or 'TXRP'
account string true none XRP account address. Must be the one used for generating deposit tags.
secret string true none Secret for account
senderAccountId string true none Sender account ID
targetAddress string true none Blockchain address to send assets
destinationTag integer false none Destination tag of recipient account, if any.
amount integer true none Amount to be sent, in XRP.
senderNote string false none Note visible to owner of withdrawing account.
force boolean false none Force payment, even if it is non-compliant.

Enumerated Values

Property Value
chain XRP
chain TXRP

Erc20Transfer

{
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "senderAccountId": "7c21ed165e294db78b95f0f181086d6f",
  "targetAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
  "currency": "MY_SYMBOL",
  "amount": 100000,
  "senderNote": "Sender note",
  "force": false,
  "tokenAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85"
}

Properties

Name Type Required Restrictions Description
mnemonic string true none mnemonic to generate private key of holder of ERC20 token
index integer true none derivation index of sender address of holder of ERC20 token
senderAccountId string true none Sender account ID
targetAddress string true none Blockchain address to send ERC20 token to
currency string true none ERC20 symbol
amount integer true none Amount to be sent in wei
senderNote string false none Note visible to owner of withdrawing account
force boolean false none Force payment, even if it is non-compliant
tokenAddress string true none address of ERC20 token

Erc20Deploy

{
  "chain": "ropsten",
  "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
  "index": 0,
  "payIndex": 0,
  "customerId": 5,
  "name": "My ERC20 Token",
  "symbol": "MT",
  "supply": 10000000,
  "basePair": "BTC"
}

Properties

Name Type Required Restrictions Description
chain string true none chain - 'mainnet' or 'ropsten'
mnemonic string true none mnemonic to generate private key of deployer of ERC20
index integer true none derivation index of deployer address of ERC20
payIndex integer true none derivation index of address to pay for deployment of ERC20
customerId integer true none ID of customer to create ERC20 for
name string true none name of the ERC20 token
symbol string true none symbol of the ERC20 token
supply integer true none max supply of ERC20 token
basePair string true none Base pair for ERC20 token. 1 token will be equal to 1 unit of base pair. Transaction value will be calculated according to this base pair.

Enumerated Values

Property Value
chain mainnet
chain ropsten
basePair BTC
basePair ETH
basePair USD
basePair CZK
basePair EUR

Error

{
  "field": "payment.senderAccountId",
  "code": "payment.amount.notNull",
  "message": "Payment amount must be greater than 0.",
  "id": 1,
  "txId": "string",
  "data": {}
}

Properties

Name Type Required Restrictions Description
field string false none Define field in request object, if any, which fails validation or raises error.
code string true none Unique error code which identifies error.
message string true none Description of the error.
id number false none Optional id of failed request object, e.g. id of withdrawal from Tatum ledger in case of failure.
txId string false none Optional transaction id of blockchain transaction in case of failure.
data object false none Additional data specific to blockchain or error code.