API H2H Integration

Complete documentation for automated system integration.

This documentation is for partners, resellers, and developers connecting their systems directly to TokoGue.

Base URL

https://api.tokogue.com/api

Format

JSON Request / Response

Overview

An overview of the H2H integration model for TokoGue.

Current access scheme

Use X-API-KEY for general API access and a JWT token for partner/member transactions.

Recommended integration model

Log in as a partner, sync the catalog, create an order, and monitor it until completion.

Authentication

The minimum headers required for requests to be accepted.

Public / catalog endpoint headers

Content-Type: application/json
Accept: application/json
X-API-KEY: YOUR_GLOBAL_API_KEY

Partner transaction endpoint headers

Content-Type: application/json
Accept: application/json
X-API-KEY: YOUR_GLOBAL_API_KEY
Authorization: Bearer YOUR_JWT_TOKEN

Integration Flow

The recommended technical flow for a stable partner integration.

1. Login

Log in to the partner account to obtain an active JWT token.

2. Config

Configure the IP whitelist and callback URL on the partner account.

3. Sync

Fetch games, products, the price list, and promotions.

4. Validation

Validate the game region or nickname when required.

5. Order

Send the automated transaction to the order endpoint.

6. Polling

Monitor the transaction until it reaches a final status.

Product Sync

Endpoints for retrieving the catalog and validating products.

GET/api/games

Retrieve the game list.

GET/api/games/{slug}

Retrieve game details and order products.

GET/api/price-list

Synchronize product prices.

GET/api/promo

Retrieve active promotions or flash sales.

POST/api/mlbb/check-region

Validate game input before creating an order.

Transactions

The primary endpoint for creating automated partner transactions.

POST/api/orders

Create an automated order from the partner system.

Check Status

Endpoints for monitoring transactions after an order is created.

GET/api/orders/{orderId}

Check order details by reference.

GET/api/transactions

Retrieve the partner account transaction history.

GET/api/transaction-summary

Retrieve the partner account transaction summary.

Partner Configuration

Endpoints for partner accounts and H2H settings.

POST/api/auth/login

Log in to the partner account and retrieve a JWT.

GET/api/auth/user

Validate the active login token.

GET/api/member/profile

View the member API key, IP whitelist, and callback URL.

PUT/api/member/api-config

Save the IP whitelist and callback URL.

POST/api/member/api-key/reset

Reset the member account API key.

Request Examples

Minimal examples commonly used for H2H integration.

Partner Login

curl -X POST "https://api.tokogue.com/api/auth/login" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_GLOBAL_API_KEY" \
  -d '{
    "email": "partner@tokogue.com",
    "password": "your-password"
  }'

Create Order

curl -X POST "https://api.tokogue.com/api/orders" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_GLOBAL_API_KEY" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "games": "mobile-legends",
    "id_games": "12345678",
    "server_games": "1234",
    "product": "86 Diamonds",
    "nominal": "86 Diamonds",
    "price": 22000,
    "payment_name": "Saldo",
    "payment_code": "SALDO"
  }'

Check Order Status

curl -X GET "https://api.tokogue.com/api/orders/INV-EXAMPLE-12345" \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_GLOBAL_API_KEY"

Important Notes

Notes to prevent incorrect assumptions during implementation.

The api_key, api_whitelist_ips, and callback_url fields are available on member accounts and can be saved through the backend.
In the current backend, the IP whitelist is not yet used for request validation, and the callback URL is not yet used to push status updates to partner endpoints.
The recommended pattern is JWT-based H2H: partner login, token storage, order submission, and status polling until completion.
If IP whitelist validation or outbound callbacks are added, this documentation can be extended without changing the core order flow.