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.

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.

Months

Addresses which you create automatically expire after 1 month. Once an address expires it will be deleted from our system. To prevent the expiration of an address, you can renew the address at any time using the renewAddress function. There is also a months parameter in the newAddress function, which allows you to set the expiration time for every new address you create.

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

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

Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

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

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

getExchangeRate

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

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

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

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

getEthereumBalance

Endpoints:
https://eu.api.tokengateway.io/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

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}

listAddresses

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

Parameter Explanation Example
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m

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

Example Response JSON:
{"ok":true,"addresses":[{"ethaddress":"0xa1f36016221d48ce7f15cde7b826a4fbe09bacce","expiration":"2018-11-22 12:00:29"}]}

getTransaction

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

Parameter Explanation Example
txid Ethereum contract address of the ERC20 token 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}

newAddress

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

Parameter Explanation Example
password Password which is beeing used for transactions. DON'T LOSE IT padN39QkRA2hJ
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m
months (Optional) Amount of months after the address expires. Defaults to 1 if not provided. 3

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

Example Response JSON:
{"ok": true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "password": "padN39QkRA2hJ", "months": 3, "expiration": 2018-11-22 12:00:29}

renewAddress

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

Parameter Explanation Example
ethereumaddress Ethereum address you want to renew 0xa1f36016221d48ce7f15cde7b826a4fbe09bacce
apikey Your API Key q9PdaWuD4j6DK6vsUgehhL8pgarSrS9m
months (Optional) Amount of months you want to extend the expiration date. Defaults to 1 if not provided. 3

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

Example Response JSON:
{"ok": true, "ethereumaddress": "0xa1f36016221d48ce7f15cde7b826a4fbe09bacce", "months": 3, "expiration": 2018-11-22 12:00:29}

sendEthereum

Endpoints:
https://eu.api.tokengateway.io/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}

sendToken

Endpoints:
https://eu.api.tokengateway.io/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) Prevent double sending. Can be any string below 32 characters. CN562
gasprice (Optional) Gas Price in GWEI 5

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

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