Merchant Platform OpenAPI Documentation
Before You Start
Become a MiniGame Merchant
Ensure that you have completed the registration of the MiniGame merchant account and can log in to the merchant platform. If not, please complete the registration and login first.
Create a Channel
Create the corresponding channel based on the domain, template, and monetization strategy.
Obtain Access Keys
API Request Instructions
Request Frequency
Each merchant is limited to 10
requests per second. Excess requests will be rejected with:
Signature Mechanism
The OpenAPI service performs security verification on all API requests using a key-based signature mechanism. Details are as follows:
Key Acquisition
Refer to the "Obtain Access Keys" section above to retrieve the merchant's access keys.
Signature Rules
Parameter Concatenation
All API request parameters (including the header
timestamp in ts
)must be concatenated into a signable string (sign_string) following these rules:
Parameter Concatenation
URL query parameters (for GET requests: the ?key=value part)
POST/PUT request body parameters (e.g., application/json format)
ts timestamp in the HTTP Header (must be included in the signature)
Concatenation Format
Parameters are joined in the format key=value, with multiple parameters separated by &.
Sorting Rule
All parameters (including ts) must be sorted in ASCII ascending order (lexicographical order) and then concatenated in sequence.
Signature Generation
The concatenated string is prefixed with theaccess key
, then hashed using SHA256. The resulting string is the signature.
Example:
Response Description
Successful Response
A successful request to the OpenAPI service returns HTTP status code 200
, with the response body in JSON format.
Example:
Error Response
A successful request to the OpenAPI service returns a non-200
HTTP status code, with the response body in JSON format.
Parameter Details
Name | Description | Type | Required | Example | Notes |
---|---|---|---|---|---|
code | Integer error code | int | Yes | 429 | Not recommended for applications to handle OpenAPI errors using this field. |
reason | String error code | string | Yes | RATELIMIT | Recommended for applications to handle OpenAPI errors using this field. |
message | Error message | string | Yes | RATELIMIT | Not recommended for applications to handle OpenAPI errors using this field. |
Example:
Error Code Definitions
Error Code | Description | Notes |
---|---|---|
RATELIMIT | Request rate limit reached. | The current rate limit is 10 requests/second per merchant. Requests exceeding this limit may return a RATELIMIT error. Please plan your request frequency accordingly. |
UNAUTHORIZED | Unauthorized. | Please check: x-md-global-cid header contains the correct merchant ID; sign header contains a valid signature; |
SERVER_INTERNAL | Internal server error. | Contact platform administrators for assistance. |
MERCHANT_OPEN_API_INVALID | Merchant open-api unavailable. | Abnormal request. Contact platform administrators. |
MERCHANT_OPEN_API_CHANNEL_NOT_FOUND | Merchant channel does not exist. | Verify if the specified channel exists. |
MERCHANT_OPEN_API_CHANNEL_FORBIDDEN | Merchant channel access forbidden. | Confirm permissions for the target channel. |
MERCHANT_OPEN_API_GAME_NOT_FOUND | Game not found. | Verify if the specified game exists. |
API List
API Overview
Name | Description | Function |
---|---|---|
GetChannelGameLinks | Get game link list for a channel | Retrieves the list of game links for a specified channel based on the channel domain |
GetChannelGameDetail | Get game details for a channel | Retrieves detailed game information for a specified channel based on the channel domain |
GetChannelGameLinks
Retrieves the list of game links for a channel based on the channel domain.
Request Format
Request Headers
Name | Description | Type | Required | Example |
---|---|---|---|---|
sign | Signature | string | Yes | ca25acec11d7b89259f277b557c0841b9ae68391dd3e35bb3cda7f0c9a790e9e Example only. The actual value should be based on the actual request. |
ts | Unix timestamp (millisecond precision, 13-digit integer) | int | Yes | 1749193616816 Example only. The actual value should be based on the actual request |
x-md-global-cid | Merchant unique identifier | int | Yes | 205150566760842225 Example only. The actual value should be based on the actual request. |
Request Parameters
Name | Description | Type | Required | Example |
---|---|---|---|---|
domain | Channel domain | string | Yes | emu3lg.minigame.com Example only. The actual value should be based on the actual request. |
Response Parameters
Name | Description | Type | Required |
---|---|---|---|
links | List of channel game links | Structural array. Structure of each array element: { "app_id": "Game's app_id", "link": "Game URL within the channel" } | Yes |
Example:
Sample Code (javascript)
GetChannelGameDetail
Retrieve game details for a channel based on the channel domain and game ID (app_id).
Request Format
Request Headers
Name | Description | Type | Required | Example |
---|---|---|---|---|
sign | Signature | string | Yes | ca25acec11d7b89259f277b557c0841b9ae68391dd3e35bb3cda7f0c9a790e9e Example only. The actual value should be based on the actual request. |
ts | Unix timestamp (millisecond precision, 13-digit integer) | int | Yes | 1749193616816 Example only. The actual value should be based on the actual request. |
x-md-global-cid | Merchant unique identifier | int | Yes | 205150566760842225 Example only. The actual value should be based on the actual request. |
Request Parameters
Name | Description | Type | Required | Example |
---|---|---|---|---|
domain | Channel domain | string | Yes | emu3lg.minigame.com Example only. The actual value should be based on the actual request. |
id | Game id(app_id) | string | Yes | im-a-game Example only. The actual value should be based on the actual request. |
Response Parameters
Name | Description | Type | Required |
---|---|---|---|
id | Game id(app_id) | string | Yes |
detail | Game information structure: name,Game name type,Game type (see “Game Type Definitions” for enum values) how_to_play,How to play description,Game description icon,Game icon (see “Asset Structure Definition”) big_icon,Large game icon (see “Asset Structure Definition”) banner,Promotional banner image (see“Asset Structure Definition”) flash,Splash screen image (see “Asset Structure Definition”) link,In-channel game URL | structure | Yes |
Game Type Definitions
Enum Value | Description |
---|---|
1 | Casual |
2 | Adventure |
3 | Music |
4 | Simulation |
5 | Card |
6 | Board |
7 | Sports |
8 | Racing |
9 | Puzzle |
10 | Strategy |
11 | Action |
12 | Battle |
13 | Parkour |
14 | Shooting |
15 | Dress Up |
16 | Tower Defense |
17 | Synthesis |
18 | Break Through |
19 | Make Up |
20 | Casino |
21 | Education |
22 | Arcade |
23 | .io |
24 | Operate |
Asset Structure Definition
Field | Description |
---|---|
uri | Asset uri |
size | Material size width:Width (in pixels) height:Height (in pixels) |
Example:
Sample Code (JavaScript)
------------------------------------------------------ END ---------------------------------------------------------------------------