TCDX API V1
Tokocrypto APIs are designed to allow access to the features of the Tokocrypto platform, subject to you complying with the API Terms of Service. The end goal is to allow people access to our Tokocrypto feature.
Overview
Endpoint will be provided upon request
Authentication
Authentication is done using an API key and a secret. The authentication procedure is as follows:
Must attach HMAC SHA256 signatures in headers. this signature is a keyed HMAC SHA256 operation and output type as a hex. Use your secretKey as the key and stringify payload as the value.
These are encoded as HTTP headers named:
- X-TCDX-APIKEY
- X-TCDX-SIGNATURE
Example programing for authenticated Endpoint https://bit.ly/3amKd6N.
User API
Registration
Register new user and send user particulars for KYC level 1 screening.
Request Body:
{
"email" : "name@mail.com",
"id_number" : "1231231232323123123",
"id_type" : 0,
"name" : "user name",
"gender" : 1,
"nationality" : "ID",
"country" : "ID",
"date_of_birth" : "1999-12-31",
"place_of_birth" : "jakarta",
"phone_country_code" : "+62",
"phone_no" : "341567890",
"mobile_no" : "8123456789",
"zip_code" : "68322",
"address" : "Jalan no 28",
"province" : "ID-JI",
"occupation" : 4,
"proof_of_address" : "iVBORw0KGgoAAAANSUhEUgAAAA",
"id_photo" : "/9j/4AAQSkZJRgABAgAAAQABAAD",
"selfie_photo" : "/9j/4AAQSkZJRgABAgAAAQABAAD",
"gestures_photos" : [
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H"
],
"gestures_set" : 5,
"update_at" : "2020-03-04T03:37:11.000Z"
}
Response:
{
"success": true,
"message": "",
"user_id": "ace50048-759a-5de5-8e7a-3f7c64e6fb48"
}
HTTP Request
POST /users/v1/create
Body Parameter
Property | Description |
---|---|
email required |
String User email adrress. |
id_number required |
String User identification number. |
id_type required |
tinyInt User country refer to id_type json id. |
name required |
String User Fullname (maximum of 255 characters). |
gender required |
tinyInt User gender (0=female, 1=male). |
nationality required |
String list of nationality code based on ISO 3166-1 Alpha-2. |
country required |
String list of country code based on ISO 3166-1 Alpha-2. |
date_of_birth required |
String User date of birth. |
place_of_birth required |
String User place of birth. |
phone_country_code required |
String Country code based on ITU Dialing Codes. |
phone_no optional |
String User house phone number. |
mobile_no required |
String User mobile phone number. |
zip_code required |
String User zip_code. |
address required |
String User address (maximum of 255 characters). |
province required if country = ID |
String Province code based on ISO 3166-2:ID. |
occupation required |
tinyInt User occupation refer to occupation Json ID. |
proof_of_address required if nationality is not ID |
String User proof of address document (base64 encoded). |
id_photo required |
String User identity card image (base64 encoded). |
selfie_photo required |
String User selfie with identity card image (base64 encoded). |
gestures_photos required |
String Array of User liveness check photos (base64 encoded). |
gestures_set required |
tinyInt User gestures set used on liveness check |
update_at required |
String Timestamp user update request base on ISO 8601 Date. |
Response
Property | Description |
---|---|
user_id | String Registered user TCDX identifier. |
success | Boolean Registration status. |
message | String Registration error message, if any. |
Retrieve User
Retrieve user details and KYC status.
Response:
{
"success": true,
"message": "",
"data" : {
"user_id": "ace50048-759a-5de5-8e7a-3f7c64e6fb48",
"email": "name@mail.com",
"name": "user name",
"kyc_status": "rejected",
"accepted_at": null,
"rejected_at": "2020-03-04T03:37:11.000Z",
"reject_reason": "fail goverment check"
}
}
HTTP Request
GET /users/v1/item/:user_id
Path Parameters
Property | Description |
---|---|
user_id required |
String User TCDX identifier. |
Response
Property | Description |
---|---|
user_id | String User TCDX identifier. |
String User email adrress. |
|
name | String User Fullname (maximum of 255 characters). |
kyc_status | String User KYC status. |
accepted_at | String Timestamp when user KYC status is accepted. |
rejected_at | String Timestamp when user KYC status is rejected. |
reject reason | String KYC rejection reason |
success | Boolean Retrieval status whether user is found. |
message | String Retrieval Error Message, if any. |
Update User
Update user particulars.
Request Body:
{
"email" : "name@mail.com",
"id_number" : "1231231232323123123",
"id_type" : 1,
"name" : "user name",
"gender" : 1,
"nationality" : "SG",
"country" : "SG",
"date_of_birth" : "1999-12-31",
"place_of_birth" : "jakarta",
"phone_country_code" : "+65",
"phone_no" : "0341567890",
"mobile_no" : "8123456789",
"zip_code" : "68322",
"address" : "Jalan no 28",
"occupation" : 4,
"proof_of_address" : "iVBORw0KGgoAAAANSUhEUgAAAA",
"id_photo" : "/9j/4AAQSkZJRgABAgAAAQABAAD",
"selfie_photo" : "/9j/4AAQSkZJRgABAgAAAQABAAD",
"gestures_photos" : [
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H",
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1H"
],
"gestures_set" : 5,
"update_at" : "2020-03-04T03:37:11.000Z"
}
Response:
{
"success": true,
"message": "",
"user_id": "ace50048-759a-5de5-8e7a-3f7c64e6fb48"
}
HTTP Request
PATCH /users/v1/item/:user_id/detail
Path Parameters
Property | Description |
---|---|
user_id required |
String User TCDX identifier. |
Body Parameter
Property | Description |
---|---|
email required |
String User email adrress. |
id_number required |
String User identification number. |
id_type required |
tinyInt User country refer to id_type json id. |
name required |
String User Fullname (maximum of 255 characters). |
gender required |
tinyInt User gender (0=female, 1=male). |
nationality required |
String list of nationality code based on ISO 3166-1 Alpha-2. |
country required |
String list of country code based on ISO 3166-1 Alpha-2. |
date_of_birth required |
String User date of birth. |
place_of_birth required |
String User place of birth. |
phone_country_code required |
String Country code based on ITU Dialing Codes. |
phone_no optional |
String User house phone number. |
mobile_no required |
String User mobile phone number. |
zip_code required |
String User zip_code. |
address required |
String User address (maximum of 255 characters). |
province required if country = ID |
String Province code based on ISO 3166-2:ID. |
occupation required |
tinyInt User occupation refer to occupation Json ID. |
proof_of_address required if nationality is not ID |
String User proof of address document (base64 encoded). |
id_photo required |
String User identity card image (base64 encoded). |
selfie_photo required |
String User selfie with identity card image (base64 encoded). |
gestures_photos required |
String Array of User liveness check photos (base64 encoded). |
gestures_set required |
tinyInt User gestures set used on liveness check |
update_at required |
String Timestamp user update request base on ISO 8601 Date. |
Response
Property | Description |
---|---|
success | Boolean Update status. |
message | String Update error message, if any. |
user_id | String User TCDX identifier. |
KYC level 2 submission
Submit KYC level 2 documents for screening.
Request Body:
{
"bank_statement" : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCA",
"source_of_wealth" : "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
}
Response:
{
"user_id": "ace50048-759a-5de5-8e7a-3f7c64e6fb48",
"message": "",
"success": true
}
HTTP Request
POST /users/v1/premium-document/:user_id
Path Parameters
Property | Description |
---|---|
user_id required |
String User TCDX identifier. |
Body Parameters
Property | Description |
---|---|
bank_statement | String User bank statement document (base64 encoded). |
source_of_wealth | String User source of wealth document (base64 encoded). |
Response
Property | Description |
---|---|
user_id | String User TCDX identifier. |
success | Boolean Retrieval status whether user is found. |
message | String Retrieval Error Message, if any. |
Get list Json
Response /users/v1/itemList/id/occupation:
{
"success": true,
"data": {
0: "Pejabat Pemerintahan",
1: "PNS (termasuk pensiunan)",
2: "Pegawai Bank/BUMN/BUMD",
3: "Anggota Partai Politik",
4: "Karyawan swasta",
5: "Profesional dan konsultan",
6: "Guru dan dosen",
7: "Pengusaha",
8: "Pedagang",
9: "Petani dan nelayan",
10: "Pengrajin",
11: "Buruh",
12: "Ibu rumah tangga",
13: "Pelajar/mahasiswa",
14: "Pengurus yayasan/oraganisasi berbadan huukum lainnya",
15: "Pendeta/pastur/petinggi agama atau pimpinan organisasi keagamaan"
}
}
Response /users/v1/itemList/en/id_type:
{
"success": true,
"data": {
0: "Identity card",
1: "Male",
}
}
Response /users/v1/itemList/country:
{
"data": [
{
"Iso2": "BD",
"Name": "Bangladesh",
"Iso3": "BGD",
"Unicode": "bangladesh",
"Dial": "+880",
"Currency": "BDT",
"Capital": "Dhaka",
"Continent": "AS"
},
{
"Iso2": "BE",
"Name": "Belgium",
"Iso3": "BEL",
"Unicode": "belgium",
"Dial": "+32",
"Currency": "EUR",
"Capital": "Brussels",
"Continent": "EU"
},
{
"Iso2": "BF",
"Name": "Burkina Faso",
"Iso3": "BFA",
"Unicode": "burkina_faso",
"Dial": "+226",
"Currency": "XOF",
"Capital": "Ouagadougou",
"Continent": "AF"
},
{
"Iso2": "BG",
"Name": "Bulgaria",
"Iso3": "BGR",
"Unicode": "bulgaria",
"Dial": "+359",
"Currency": "BGN",
"Capital": "Sofia",
"Continent": "EU"
}
],
"message": "",
"success": true
}
Response /users/v1/itemList/province:
{
"data": {
"ID-AC": "Aceh",
"ID-BA": "Bali",
"ID-BB": "Bangka Belitung",
"ID-BT": "Banten",
"ID-BE": "Bengkulu",
"ID-GO": "Gorontalo",
"ID-JA": "Jambi",
"ID-JB": "Jawa Barat",
"ID-JT": "Jawa Tengah",
"ID-JI": "Jawa Timur",
"ID-KB": "Kalimantan Barat",
"ID-KS": "Kalimantan Selatan",
"ID-KT": "Kalimantan Tengah",
"ID-KI": "Kalimantan Timur",
"ID-KU": "Kalimantan Utara",
"ID-KR": "Kepulauan Riau",
"ID-LA": "Lampung",
"ID-MA": "Maluku",
"ID-MU": "Maluku Utara",
"ID-NB": "Nusa Tenggara Barat",
"ID-NT": "Nusa Tenggara Timur",
"ID-PA": "Papua",
"ID-PB": "Papua Barat",
"ID-RI": "Riau",
"ID-SR": "Sulawesi Barat",
"ID-SN": "Sulawesi Selatan",
"ID-ST": "Sulawesi Tengah",
"ID-SG": "Sulawesi Tenggara",
"ID-SA": "Sulawesi Utara",
"ID-SB": "Sumatra Barat",
"ID-SS": "Sumatra Selatan",
"ID-SU": "Sumatra Utara",
"ID-JK": "Jakarta Raya",
"ID-YO": "Yogyakarta"
},
"message": "",
"success": true
}
HTTP Request
GET /users/v1/itemList/{language}/{type a}
GET /users/v1/itemList/{type b}
language:
- id
- en
type a:
- id_type
- occupation
type b:
- country
- province
Json ID
id_type json id
id | id label | en label |
---|---|---|
0 | KTP | Identity card |
1 | Paspor | Passport |
occupation json id
id | id label | en label |
---|---|---|
0 | Pejabat Pemerintahan | Government Official |
1 | PNS (termasuk pensiunan) | Civil Servant (including retirees) |
2 | Pegawai Bank/BUMN/BUMD | Bank Employee/BUMN/BUMD |
3 | Anggota Partai Politik | Political Party Member |
4 | Karyawan swasta | Private Employee |
5 | Profesional dan konsultan | Professional and Consultant |
6 | Guru dan dosen | Teacher and Lecturer |
7 | Pengusaha | Entrepreneur |
8 | Pedagang | Trader (Merchant) |
9 | Petani dan nelayan | Farmers and Fishermen |
10 | Pengrajin | Craftsman |
11 | Buruh | Manual Labor |
12 | Ibu rumah tangga | Housewife |
13 | Pelajar/mahasiswa | Student |
14 | Pengurus yayasan/oraganisasi berbadan huukum lainnya | Foundation or legal entities administrator |
15 | Pendeta/pastur/petinggi agama atau pimpinan organisasi keagamaan | Priest/religious leader or religious organisation leader |
Example Image
Example photo identity card
We provide a sample identity card to test this endpoint.
Example selfie holding document
We provide a sample selfie holding document to test this endpoint.
Update webhook URL
Update webhook URL.
Request Body:
{
"new_webhook_url": "https://117.0.0.1:3000/test-webhook"
}
Response:
{
"success": true,
"message": "updated"
}
HTTP Request
POST /config/update-webhook
Body Parameters
Property | Description |
---|---|
new_webhook_url required |
String Configure new webhook url. |
Response
Property | Description |
---|---|
success | Boolean Retrieval status. |
message | String Retrieval Error Message, if any. |
Webhook User KYC Confirmation
After KYC screening is completed, Tokocrypto will trigger webhook notification to the registered URL with following request body
Field | Type | Description |
---|---|---|
user_id | String |
User TCDX identifier |
status | String |
KYC status with either of these parameter * Approved * Rejected * Pending |
level | 'String' | KYC level either 1 or 2 |
message | 'String' | KYC reject reason |
Transaction API
Conversion
Request Body:
{
"user_id": "3d956348-2ab0-5328-90f0-44bceab1528c",
"bid_symbol": "ETH",
"ask_symbol": "IDR",
"order_id": "1",
"bid_ask": 0,
"price": 50000,
"exec_quantity": 5,
"fee": 500,
"maker_or_taker": 0,
"status": 1,
"dateTime": 1583822628
}
Response:
{
"success": true,
"message": ""
}
HTTP Request
POST https://transaction/v1/:user_id/conversion
Body Parameter
Property | Description |
---|---|
bid_symbol required |
String Coin symbol for bid side. |
ask_symbol required |
String Coin symbol for ask side. |
order_id required |
String Order unique id. |
bid_ask required |
tinyInt Conversion side (0=bid, 1=ask). |
price required |
Double Total transaction price. |
exec_quantity required |
Double Total transaction amount. |
fee required |
Double Transaction fee received. |
maker_or_taker required |
tinyInt Transaction type refer to maker_or_taker json id. |
status required |
tinyInt Partial or full (0=partial, s1=full). |
dateTime required |
Integer Transaction datetime in epoch timestamp format. |
Response
Property | Description |
---|---|
success | Boolean Registration status. |
message | String Registration error message, if any. |
user_id required |
String User unique ID. |
Crypto Transaction
Request Body:
{
"user_id": "3d956348-2ab0-5328-90f0-44bceab1528c",
"symbol": "ETH",
"transaction_id": "asdas234243G",
"action": 0,
"origin": "test1",
"destination": "test2",
"amount": 1,3,
"dateTime": 1583822628
}
Response:
{
"success": true,
"message": ""
}
HTTP Request
POST https://transaction/v1/cryptoTransaction
Body Parameter
Property | Description |
---|---|
user_id required |
String User unique ID. |
symbol required |
String Coin symbol |
transaction_id required |
String Transaction unique id. |
action required |
tinyInt Action (0=deposit, 1=withdraw). |
origin |
String Transaction address originated from. |
destination required |
Double Transaction address destination. |
amount required |
Double Transaction amount. |
dateTime required |
Integer Transaction datetime in epoch timestamp format. |
Fiat Transaction
Request Body:
{
"user_id" : "3d956348-2ab0-5328-90f0-44bceab1528c",
"currency" : "IDR",
"transaction_id": "asdas234243G",
"action" : 1,
"origin_bank_code" : "009",
"origin_account_no": "124341241",
"origin_bank_code" : "014",
"origin_account_no": "2387419419",
"amount": 200000,
"dateTime": 1583822628
}
Response:
{
"success": true,
"message": ""
}
HTTP Request
POST https://transaction/v1/fiatTransaction
Body Parameter
Property | Description |
---|---|
user_id required |
String User unique ID. |
currency required |
String Currency |
transaction_id required |
String Transaction unique id. |
action required |
tinyInt Action refer to action json id. |
origin_bank_code required |
String origin bank code refer to https://flip.id/kode-bank. |
origin_account_no required |
String origin account number. |
destination_bank_code required |
String desination bank code refer to https://flip.id/kode-bank. |
destination_account_no required |
String desination account number. |
amount required |
Double Transaction amount. |
dateTime required |
Integer Transaction datetime in epoch timestamp format. |
Response
Property | Description |
---|---|
success | Boolean Update status. |
message | String Update error message, if any. |
Account API
Create Crypto Address
Request Body:
{
"symbol": "ETH",
"address": "test1",
"dateTime": 1583822628
}
Response:
{
"success": true,
"message": "",
"user_id": "3d956348-2ab0-5328-90f0-44bceab1528c"
}
HTTP Request
POST https://account/v1/:user_id/create-crypto-address
Body Parameter
Property | Description |
---|---|
symbol required |
String Currency symbol. |
address required |
String address . |
dateTime required |
Integer Transaction datetime in epoch timestamp format. |
Response
Property | Description |
---|---|
success | Boolean Update status. |
message | String Update error message, if any. |
user_id required |
String User unique ID. |
Update Crypto Address
Request Body:
{
"symbol": "ETH",
"address": "test1",
"dateTime": 1583822628
}
Response:
{
"success": true,
"message": "",
"user_id": "3d956348-2ab0-5328-90f0-44bceab1528c"
}
HTTP Request
PATCH https://account/v1/update-crypto-address
Body Parameter
Property | Description |
---|---|
symbol required |
String Currency symbol. |
address required |
String address . |
dateTime required |
Integer Transaction datetime in epoch timestamp format. |
Response
Property | Description |
---|---|
success | Boolean Update status. |
message | String Update error message, if any. |
user_id required |
String User unique ID. |
Errors
The Tokocrypto API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request – Please check your request |
401 | Unauthorized – Your Authorisation header is not present or it has already expired |
422 | Unprocessable Entity - The request body or paramater do not valid our requirement |
403 | Forbidden – You may have missed out the X-Api-Key in your request header |
500 | Internal Server Error – We had a problem with our server. Try again later. |
503 | Service Unavailable – We’re temporarily offline for maintenance. Please try again later. |