Tokoku API Docs
Tokoku API Docs
Introduction
Welcome to the Tokoku API Documentation. Whether you are a developer looking to
integrate our services into your application, a business seeking to streamline operations, or
simply curious about what Tokoku can offer, this documentation will provide you with the
resources and information you need.
Getting Started
To begin using the Tokoku Open API, please follow these steps:
1. Get credentials: After your access request was approved, check your email and
obtain your API credentials.
2. Authentication: Learn how to authenticate your requests to the API securely.
3. Endpoints: Explore our API endpoints and discover what features and data you can
access.
4. Testing: Learn how to test our API in development server before using real data.
5. Troubleshooting: Learn how to fix common issues that may arise.
Please note that this documentation is subject to updates and improvements as we strive to
provide you with the best experience.
1. Get Credentials
Updated: Dec 14, 2023
To get your credentials, check your email after your access request has been approved. Your
credentials will consist of an API Key and a Secret Key. The credentials should look
something like this:
Do not share this key with anyone. Your credentials, including the API Key and Secret Key,
are vital components of your account's security. Sharing these credentials with anyone
poses a significant risk to the integrity and privacy of your data and account.
2. Authentication
Updated: Dec 14, 2023
Request Headers
To authenticate your request, your request headers must include the following headers.
Authorization Token
JSON Web Token generated based on header, payload, and signature.
For more info check https://jwt.io/
JSON Web Token consists of three parts separated by dots(.) which are:
header.payload.signature
For header part, please use X-Api-Key and Nonce only, and also the alg : “HS256”
Example :
itemku will provide you with API Key and API Secret
API Key : “YourApiKeyProvidedByItemku”
API Secret : “YourApiSecretProvidedByItemku”
key = 'YourApiSecretProvidedByItemku'
unsignedToken = encodeBase64Url(header) + '.' +
encodeBase64Url(payload)
signature = HMAC-SHA256(key, unsignedToken)
authToken = unsignedToken + '.' + signature
3. Endpoints
Updated: Dec 14, 2023
Get Order
Use this API to get a list of Orders from respective seller.
Endpoint
https://tokoku-gateway.itemku.com/api/order/list
Request Method
POST
Request Parameters
Order Status
REFUNDED Order has been canceled and the balance has been
refunded
Response Example for Get Order
{
"success": true,
"statusCode": "SUCCESS",
"message": "Success",
"data": [
{
"order_id": 454634,
"order_number": "OD00000454634",
"product_id": 235634,
"price": 10000,
"quantity": 2,
"order_income": 18000,
"game_name": "Mobile Legends",
"product_name": "Voucher 1000",
"status": "DELIVERED",
"required_information": "{\"player_id\":\"12345567\",\"zone_id\"
:\"1234\",\"username\":\"testing1\"}",
"using_delivery_info": true,
"delivery_info_field": [
{
"field_name": "Email",
"validation_pattern": "^[\w()-|'.+,#%^&*!$\/\\]+$",
},
{
"field_name": "Password",
"validation_pattern": "^[a-z\\d\\-_\\s]+$",
}
],
"delivery_info": [
"QWERTYUIOP",
"ASDFGHJKLK"
]
}
]
}
Error Code
Order Action
Use this API to deliver or reject an order. Make sure that you input the data correctly.
Endpoint
https://tokoku-gateway.itemku.com/api/order/action
Request Method
POST
Request Parameters
Delivery Info
Delivery info is the account data (username, password, etc) or voucher code for product to
be sent to buyer.
When delivering order, the delivery_info depends on the order data using_delivery_info and
delivery_info_field.
Example category:
Topup Mobile Legends, Topup
Garena Free Fire, etc
Case 1
{
"order_id": 454633,
"using_delivery_info": false,
"delivery_info_field": null
}
delivery_info: undefined
Case 2
{
"order_id": 454634,
"using_delivery_info": true,
"delivery_info_field": null
}
Case 3
{
"order_id": 454635,
"using_delivery_info": true,
"delivery_info_field": [
{
"field_name": "Email",
"validation_pattern": "^[\w()-|'.+,#%^&*!$\/\\]+$",
},
{
"field_name": "Password",
"validation_pattern": "^[a-z\\d\\-_\\s]+$",
}
]
}
delivery_info: [{"Email":"test@email.com","Password":"X12345"}]
Optional: You can use the validation_pattern for regex to make sure the input use the correct
format
Response Example for Order Action
{
"success": true,
"statusCode": "SUCCESS",
"message": "Success",
"data": [
{
"order_id": 454634,
"order_number": "OD00000454634",
"product_id": 235634,
"price": 10000,
"quantity": 2,
"order_income": 18000,
"game_name": "Mobile Legends",
"product_name": "Voucher 1000",
"status": "DELIVERED",
"required_information": "{\"player_id\":\"12345567\",\"zone_id\"
:\"1234\",\"username\":\"testing1\"}",
"using_delivery_info": true,
"delivery_info_field": [
{
"field_name": "Email",
"validation_pattern": "^[\w()-|'.+,#%^&*!$\/\\]+$",
},
{
"field_name": "Password",
"validation_pattern": "^[a-z\\d\\-_\\s]+$",
}
],
"delivery_info": [
"QWERTYUIOP",
"ASDFGHJKLK"
]
}
]
}
Error Code
● itemku will ignore all the payload responses from the callback, no expected return
result.
● If the seller callback API returns an error, itemku will not retry the process, seller
partners need to check order on API
https://tokoku-gateway.itemku.com/api/order/list for the order.
● Order Callback is not available in the sandbox environment.
Endpoint
{URL_PROVIDED_BY_SELLER}
Request Method
POST
Endpoint
https://sandbox-api-tokoku.itemku.com/dev/api/order/generate
Request Method
POST
Request Parameters
quantity Number Required The quantity of item for the created order
Category Parameter
Error Code
Environment
We offer two distinct environments for the Tokoku API:
The API Key you receive when requesting access through the Seller Dashboard at
https://tokoku.itemku.com/ is a production key. If you wish to access the testing
environment, you will need to register for a sandbox account with itemku. It's important to
note that sandbox accounts have a limited lifespan, typically expiring after a certain number
of months. Additionally, they come with a separate testing key.
Cannot reach the server Please make sure you’re accessing the server with the
registered IPs
HTTP 422 Input payload failed to pass validation, please check your
payload.
HTTP 5xx There's a problem with our server, please retry in a few
minutes.
Or if it’s sandbox, make sure it’s during our server uptime.
(Mon - Fri 6 AM - 9 PM WIB UTC +7)
Appendix
player_id
zone_id
Dead by Daylight Mobile
username
Dragon Nest 2 Evolution player_id
Dragon Nest 2 Evolution zone_id
Dragonheir: Silent Gods username
EA FC Mobile player_id
Echocalypse player_id
Echocalypse zone_id
Echocalypse username
Eggy Party player_id
Ensemble Stars Music player_id
Ensemble Stars Music username
Garena Free Fire player_id
Garena Free Fire MAX player_id
Garena Speed Drifters player_id
Garena Undawn player_id
player_id
Genshin Impact
zone_id
player_id
Girls' Connect: Idle RPG zone_id
username
player_id
GODDESS OF VICTORY: NIKKE zone_id
username
Growtopia player_id
Harry Potter: Magic Awakened player_id
Hay Day player_id
player_id
Heroes Evolved
zone_id
player_id
Honkai: Star Rail
zone_id
League of Legends: Wild Rift player_id
LifeAfter player_id
LifeAfter zone_id
Light of Thel New Era player_id
player_id
MARVEL SNAP
username
Metal Slug Awakening player_id
player_id
Mobile Legends
zone_id
player_id
Modern Strike Online
username
Nex Parabola player_id
Omlet Arcade user_id
Path to Nowhere player_id
Path to Nowhere username
Point Blank Beyond Limits player_id
PUBG Mobile Indonesia player_id
player_id
Ragnarok Eternal Love
zone_id
player_id
Ragnarok Origin Global username
zone_id
player_id
Revelation: New World
zone_id
username
Rhythm Hive player_id
player_id
Rise of Kingdoms
username
player_id
Seal M
zone_id
player_id
State of Survival: Zombie War zone_id
username
Stumble Guys user_id
player_id
The Return of Condor Heroes zone_id
username
player_id
Time Raiders zone_id
username
Valorant player_id
player_id
Yalla
username