Docs

Introduction

This API allows you to interact with Ethereum and all ERC20 tokens. If you ever looked for a possibility to automate token or ethereum payments this is the right place.
You still have no idea for real use cases? Let me give you some examples: Accept your own token as payment method for your shop, distribute airdrop tokens of your ICO, convert your site currency to a token that can be traded on exchanges and many more.
There are a lot of use cases which are not only limited to sending tokens but also receiving them. You could even create a secure wallet for your token which only the wallet owner has access to.

Postman

Postman is a great software to test APIs, it helped us a lot when developing this API. If you haven't installed it yet, you can download it here.

We have created a Postman collection that allows to import all functions and their settings, including descriptions in Postman. This way you can test all functions with the click of a button (just change the parameters before).

You can import the collection by clicking the button below:


Tutorials

We wrote a few step-by-step tutorials with example code in PHP that might help you to work with our solution. Currently there is one tutorial for every request type.
Address Requests: Create addresses
Transaction Requests: Send transactions
Info Requests: Get balances
IPN/Subscription Requests: Create IPNs/Subscriptions

API Requests

All Requests to our API are made in JSON format using HTTP POST. We will also return everything in JSON format. The Europe API endpoint is located at https://eu.api.tokengateway.io/{function}. We are currently working on providing an US based endpoint.

Parameters

API Key

You can get your personal API Key from your account dashboard. It is used by us to determine who is accessing the API and to count the requests by that account.

Ethereum Address

This is an ethereum address, which has 0x in front and 40 hexadecimal characters after it. CAUTION: If you send tokens, the receiving address must be ERC20 compatible. So please don't use an exchange address.

Contract Address

The contract address is the ethereum smart contract address of the ERC20 token you want to use. It has the same format as normal Ethereum addresses.

Amount

We want amounts to be in normal decimal format. If you want to send 2.5 ETH, use 2.5. If you want to send 1 million tokens, use 1000000. If you are not sure how many decimals a token has, you can use the getToken function.

Password

Whenever you create a new ethereum address, you need to specify a password for it. This password is used for all transactions you are doing with this address. We don't save this password, so please don't lose it.

Identifier

The identifier parameter allows to attach an unique string (Up to 32 characters) to a transaction. If the identifier has been used for a transaction in the last 30 days already, our API won't process the transaction. This prevents double sending of the same transaction in case you don't get a response from our API.

Security

Our API is very secure. The GETH client is not hosted on the same machine as the api. Also, its not using the standard port. It is protected with a few firewalls, too. But even if someone would get control over it, your funds would still be save. Like you can see above, every ethereum address needs a password for transactions. Without it, the funds can't be accessed. This means our system is as secure as your application. If you don't secure your system and don't store the passwords in a safe way, attackers may be able to steal funds from your addresses. (They still need your API Key however)

Fees

We are charging on pay-as-you-go basis if you use our API. You can see the exact pricing here. But there are also transaction fees, which go to the ethereum miners to include your transaction in a block. So please make sure there is always enough ethereum on the address you are sending tokens from. The exact fee which is used is determined by the average fee at that time.

getToken

Endpoints:
https://eu.api.tokengateway.io/getToken

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/getToken


Parameter Explanation Example
contractaddress Ethereum contract address of the ERC20 token 0x5b86a33f0c232fe909eb4602a9d039072869d915
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "name": "Bitfranken", "symbol": "BIFRA", "decimals": 2, "supply": 76507131570}

getLastBlockNumber

Endpoints:
https://eu.api.tokengateway.io/getLastBlockNumber

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/getLastBlockNumber


Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "blocknumber": 6496847}

getGasPrice

Endpoints:
https://eu.api.tokengateway.io/getGasPrice

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/getGasPrice


Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "gasprice": 3}

getExchangeRate

Endpoints:
https://eu.api.tokengateway.io/getExchangeRate


Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m
currency eur or usd eur

Example Request JSON:
{"apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m", "currency": "eur"}

Example Response JSON:
{"ok": true, "currency": "eur", "rate": 163.28}

getEthereumBalance

Endpoints:
https://eu.api.tokengateway.io/getEthereumBalance

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/getEthereumBalance


Parameter Explanation Example
ethereumaddress Ethereum address you want to get the balance of 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "balance": 0.456}

getTokenBalance

Endpoints:
https://eu.api.tokengateway.io/getTokenBalance

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/getTokenBalance


Parameter Explanation Example
contractaddress Ethereum contract address of the ERC20 token 0x5b86a33f0c232fe909eb4602a9d039072869d915
ethereumaddress Ethereum address you want to get the balance of 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "balance": 0.456}

getTransaction

Endpoints:
https://eu.api.tokengateway.io/getTransaction

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/getTransaction


Parameter Explanation Example
txid Transaction id of Ethereum or token transfer 0x8ab5543bc103bdd908681da501d03c2c495afd7fde5ed104935ba97b1550d65b
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"txid":"0x8ab5543bc103bdd908681da501d03c2c495 afd7fde5ed104935ba97b1550d65b", "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok":true,"erc20":true, "txid":"0x8ab5543bc103bdd908681da501d03c2c495 afd7fde5ed104935ba97b1550d65b","name": "Shopiblock","symbol":"SHB","blockhash": "0x7d9a4a19a27ba8df227284d888e79a1dfb8d4f8dfc 69cadab1635cb589f596e3","blocknumber":6432816, "txindex":29,"from":"0x8df9654c7d81c850fdd35d 93292b2fc60e666bf0","to":"0xbee9422f1b65687d0 cb923bbd1fc5ccb9307e861","contractaddress": "0x9e2b71e87d9304c4773674584eb9d0c838643568", "gasprice":9,"gas":90000,"amount":10, "confirmations":64083}

listAddresses

Endpoints:
https://eu.api.tokengateway.io/listAddresses

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/listAddresses


Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok":true,"addresses":[{"ethaddress":"0xa1f36016221d48ce7f15cde7b826a4fbe09bacce"}]}

subscribeAddress Beta

Endpoints:
https://eu.api.tokengateway.io/subscribeAddress


Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m
ethereumaddress The address you want to watch 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
contractaddress (Optional) Contractaddress of the Token you want to watch (Will watch ethereum by default) 0x5b86a33f0c232fe909eb4602a9d039072869d915
url The URL you want to receive notifications on. The script on the url should run below 10 seconds, otherwise the notification will fail! https://yoururl.com/ipnreceiver.php

Example Request JSON:
{"apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m","ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "url": "https://yoururl.com/ipnreceiver.php"}

Example Response JSON:
{"ok":true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "url": "https://yoururl.com/ipnreceiver.php"}

UnsubscribeAddress Beta

Endpoints:
https://eu.api.tokengateway.io/unsubscribeAddress


Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m
ethereumaddress The address you are watching 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
contractaddress (Optional) Contractaddress of the Token you are watching (Will watch ethereum by default) 0x5b86a33f0c232fe909eb4602a9d039072869d915
url The URL you receive notifications on https://yoururl.com/ipnreceiver.php

Example Request JSON:
{"apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m","ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "url": "https://yoururl.com/ipnreceiver.php"}

Example Response JSON:
{"ok":true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "url": "https://yoururl.com/ipnreceiver.php", "deleted": true}

listSubscribedAddresses Beta

Endpoints:
https://eu.api.tokengateway.io/listSubscribedAddresses


Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok":true,"ipns":[{"ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "url": "https://yoururl.com/ipnreceiver.php"}]}

newAddress

Endpoints:
https://eu.api.tokengateway.io/newAddress

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/newAddress


Parameter Explanation Example
password Password which is beeing used for transactions. DON'T LOSE IT padN39QkRA2hJ
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"password": "padN39QkRA2hJ", "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "password": "padN39QkRA2hJ"}

deleteAddress

Endpoints:
https://eu.api.tokengateway.io/deleteAddress

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/deleteAddress


Parameter Explanation Example
ethereumaddress Ethereum address you want to renew 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m
password The Password of the ethereum address padN39QkRA2hJ

Example Request JSON:
{"ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m", "password": "padN39QkRA2hJ"}

Example Response JSON:
{"ok": true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "deleted": true}

sendEthereum

Endpoints:
https://eu.api.tokengateway.io/sendEthereum

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/sendEthereum


Parameter Explanation Example
from Ethereum address you want to send from 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
to Ethereum address you want to send to 0xef4943d727e34280a2efa0b3352dfd61f508ee48
password Password of the ETH address you want to send from padN39QkRA2hJ
amount Amount of ETH you want to send 0.05
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"from": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "to": "0xef4943d727e34280a2efa0b3352dfd61f508ee48", "password": "padN39QkRA2hJ", "amount": 0.05, "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "txid": "0xcff06775098019d18f7bab6a350c18e86f89399d b63cbce5269104e6c9a79499", "from": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "to": "0xef4943d727e34280a2efa0b3352dfd61f508ee48", "amount": 0.05}

clearAddress

Endpoints:
https://eu.api.tokengateway.io/clearAddress

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/clearAddress


Parameter Explanation Example
ethereumaddress Ethereum address you want to clear 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
newaddress Ethereum address you want to send all Ethereum to 0xef4943d727e34280a2efa0b3352dfd61f508ee48
password Password of the ETH address you want to send from padN39QkRA2hJ
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

Example Request JSON:
{"ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "newaddress": "0xef4943d727e34280a2efa0b3352dfd61f508ee48", "password": "padN39QkRA2hJ", "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "txid": "0xcff06775098019d18f7bab6a350c18e86f89399d b63cbce5269104e6c9a79499", "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "newaddress": "0xef4943d727e34280a2efa0b3352dfd61f508ee48", "amount: 0.00980226, "gas": 0.000063, "total": 0.00986526}

sendToken

Endpoints:
https://eu.api.tokengateway.io/sendToken

Endpoints Rinkeby Testnet:
https://eu.api.tokengateway.io/rinkeby/sendToken
Parameter Explanation Example
contractaddress Ethereum contract address of the ERC20 token 0x5b86a33f0c232fe909eb4602a9d039072869d915
from Ethereum address you want to send from 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
to Ethereum address you want to send to 0xef4943d727e34280a2efa0b3352dfd61f508ee48
password Password of the ETH address you want to send from padN39QkRA2hJ
amount Amount of tokens you want to send 0.05
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m
identifier (Optional) Prevents double sending. Can be any string below 32 characters. CN562
gasprice (Optional) Gas Price in GWEI 5
gas (Optional) gas limit 90000

Example Request JSON:
{"contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "from": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "to": "0xef4943d727e34280a2efa0b3352dfd61f508ee48", "password": "padN39QkRA2hJ", "amount": 0.05, "gasprice": 5, "gas": 90000, "apikey": "q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m"}

Example Response JSON:
{"ok": true, "txid": "0xcff06775098019d18f7bab6a350c18e86f89399d b63cbce5269104e6c9a79499", "contractaddress": "0x5b86a33f0c232fe909eb4602a9d039072869d915", "from": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "to": "0xef4943d727e34280a2efa0b3352dfd61f508ee48", "amount": 0.05}