#

Description
- Batch Create Orders
Request URL
- Test environment: see batch_create_order field in Obtain Server End API Configurations
- Production environment: see batch_create_order field in Obtain Server End API Configurations
Request Method
- Transmission protocol: HTTPS
- Request method: POST
- Parameters are transmitted in the body in JSON format (see request example)
- Add the following headers to the request: Content-Type: application/json;charset=utf-8
- Add the following headers to the request: Authentication header Authorization
Request Header [Authorization]
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| mg_id | Yes | string | Game ID |
| room_id | Yes | string | Room ID |
| orders | Yes | BatchCreateOrderEntry[] | Array of order data |
- BatchCreateOrderEntry
| Parameter | Required | Type | Description |
|---|---|---|---|
| out_order_id | Yes | string | Merchant-defined unique order ID (up to 64 characters) |
| cmd | Yes | string | Triggered action |
| from_uid | Yes | string | Paying user UID |
| from_nickname | No | string | Paying user nickname |
| from_avatar_url | No | string | Paying user avatar URL |
| to_uid | Yes | string | Target user UID |
| value | Yes | int32 | Associated game value |
| random | No | bool | Whether to select randomly (When to_uid is not in the player list, whether to trigger for a random player. Defaults to false if not provided.) true: Trigger for a random player, false: Execution fails |
| payload | No | object | Additional data (When the game client transparently transmits this parameter value to the app client, it needs to be transparently transmitted as is) |
Game cmd | value | payload Parameter Correspondence Table:
1.Deminers, Game ID=1472142640866779138
| cmd | value | cmd Additional Data (payload) | Description |
|---|---|---|---|
| change_hand | Specific price | Change hand, can be changed up to 1 time at the beginning of each round | |
| gift_cover_clouds | Example:{"count":1,"count_limit":20,"show_time":50} count:clouds count,default to 1 count_limit: limit of clouds,default to 20 show_time: clouds show time,default to 20 seconds |
Clouds | |
| gift_cover_big_chain | Example:{"show_time": 10} show_time:show time,default to 10 seconds |
Big chain | |
| gift_windy | Example:{"count":1} count: The number of clouds blown away, default to 1 |
Windy | |
| gift_discover_big_chain | Unlock the chain | ||
| gift_exchange_hands | Hand Swap | ||
| gift_add_card | Draw one card | ||
| gift_del_card | Discard one card | ||
| gift_give_remove_card | Give dismantle card | ||
| gift_give_throw_card | Give throwing mine cards | ||
| gift_next_bomb | Replace mines | ||
| gift_free_change_hand | Free change hands |
2.EightBall, Game ID=1739914495960793090
| cmd | value | cmd Additional Data (payload) | Description |
|---|---|---|---|
| gift_increase_friction | Example:"payload":{"count":5} | Lush Green Grass - Increase Friction | |
| gift_decrease_friction | Example:"payload":{"count":5} | Frozen Field - Decrease Friction | |
| gift_fake_black_8 | Example:"payload":{"count":5} | Disguise - Disguise a ball as the black 8-ball | |
| block_hole | Example:"payload":{"count":5} | Block the Hole - Block one pocket for one turn | |
| gift_increase_aimline | Example:"payload":{"count":5} | Far-Sighted - Extend the aiming line | |
| gift_decrease_aimline | Example:"payload":{"count":5} | Short-Sighted - Shorten the aiming line | |
| gift_enhance_cue_ball | Example:"payload":{"count":5} | Blazing Shield - Restore friction for one turn | |
| gift_wind_force | Example:"payload":{"count":5} | Harness the Wind - Apply wind field for one turn |
- Monster Elimination Game, Game ID=1664525565526667266
| cmd | value | cmd additional data (payload) | Description |
|---|---|---|---|
| gift_cover_clouds | Example:{"count":1,"count_limit":20,"show_time":50} count:clouds count,default to 1 count_limit: limit of clouds,default to 20 show_time: clouds show time,default to 20 seconds |
Drifting Clouds | |
| gift_cover_big_chain | Example:{"show_time": 10} show_time:show time,default to 10 seconds |
Big Chain | |
| gift_windy | Example:{"count":1} count: The number of clouds blown away, default to 1 |
Windy | |
| gift_discover_big_chain | Unlock | ||
| gift_exchange_boards | Exchange Boards | ||
| gift_add_chains | count: int32 Quantity count_limit: int32 Quantity Limit |
Add Small Chains | |
| gift_add_ice_blocks | count: int32 Quantity count_limit: in32 Quantity Limit |
Add Ice Blocks | |
| gift_eliminate_chains | count: int32 Quantity | Clear Chains | |
| gift_eliminate_ice_blocks | count: int32 Quantity | Clear Ice | |
| gift_clear_all_chains | One-Click Clear Chains | ||
| gift_clear_all_ice_blocks | One-Click Clear Ice | ||
| gift_annoying_monster | count: int32 Quantity count_limit: in32 Quantity Limit |
Annoying Monster | |
| gift_send_rockets | count: int32 Quantity count_limit: in32 Quantity Limit |
Send Rockets | |
| gift_send_bombs | count: int32 Quantity count_limit: in32 Quantity Limit |
Send bombs | |
| gift_send_rainbows | count: int32 Quantity count_limit: in32 Maximum quantity |
Send rainbows |
4.Monster Crush Boom Game ID=1689904909564116994
| cmd | value | cmd Additional Data (payload) | Description |
|---|---|---|---|
| gift_restore_health | Example:{"restore_health": 5} restore_health:Restore health points, default is 5 points |
Restore Health | |
| gift_increase_atk | Example:{"increase_atk": 1, "atk_bonus_duration": 1} increase_atk:Increase attack power, default is 1 point atk_bonus_duration:Duration in turns, default is 1 |
Increase Attack | |
| gift_increase_shield | Example:{"increase_shield": 1, "shield_duration": 1} increase_shield:Increase shield damage reduction, default is 1 point shield_duration:Duration in turns, default is 1 |
Increase Shield | |
| gift_extra_turn | Example:{"extra_turn": 1, "count_limit": 1} extra_turn:Number of extra turns, default is 1 count_limit:Storage limit for extra turns, default is 1 |
Extra Turn | |
| gift_respawn | Example:{"count": 1, "count_limit": 1} count:Quantity, default is 1 count_limit:Limit, default is 1 |
Respawn | |
| gift_battle_rainbows | Example:{"count": 1} count:Quantity, default is 1 |
Battle Rainbow |
5.LuckyMiner, Game ID=1947922061064572929
| cmd | value | cmd Additional Data (payload) | Description |
|---|---|---|---|
| gift_cheer_up | Example:{"count":1} count:Gift quantity, stacking increases bubble time and size |
Cheer Up - Creates a bubble avatar around the player (starting at 0.8x) lasting 3 seconds The player avatar becomes the center, attracting other bubble avatars, no gravity Stacking effects: 1.Bubble size: 10 becomes 0.9x, 100 becomes 1x, 1000 becomes 1.2x 2.Time extension |
|
| gift_nightmare | Nightmare - Visible area shrinks Gift sender avatar (demon frame) appears in the darkness, lasting 30 seconds Stacking effects: 1.Viewport continuously shrinks (has a minimum value) 2.Time extension |
||
| gift_exorcism_hook | Exorcism Hook - Hook ignores obstacles (passes through directly) Sender avatar (angel frame) on the hook, lasting 30 seconds Stacking effects: Time extension |
||
| gift_wild_swing | Wild Swing - Hook swing speed x5 Sender avatar (demon frame) on the hook, lasting 30 seconds Stacking effects: Time extension |
||
| gift_avert_danger | Avert Danger - All obstacles become ordinary treasure chests Sender avatar (angel frame) on ordinary treasure chests Stacking effects: Cannot stack |
||
| gift_riddler | Riddler - All items on the field become random items Sender avatar (demon frame) on random items Stacking effects: Cannot stack |
||
| gift_good_luck | Good Luck - All items on the field become premium treasure chests Sender avatar (angel frame) on premium treasure chests Stacking effects: Cannot stack |
||
| gift_annihilator | Annihilator - All items on the field become obstacles Sender avatar (demon frame) on obstacles Stacking effects: Cannot stack |
6.Monster Crush, Game ID=1664525565526667266
| cmd | value | cmd Additional Data (payload) | Description |
|---|---|---|---|
| gift_cover_clouds | Example:{"count":1} count:int32 Quantity count_limit: int32 Quantity limit show_time: int32 Display time |
Cover Clouds | |
| gift_cover_big_chain | Example:{"count":1} count:int32 Quantity show_time: int32 Display time |
Big Chain | |
| gift_windy | Example:{"count":1} count:int32 Number of clouds to blow away |
Windy | |
| gift_discover_big_chain | Unlock | ||
| gift_exchange_boards | Exchange Boards | ||
| gift_add_chains | Example:{"count":1} count:int32 Quantity count_limit: int32 Quantity limit |
Add Chains | |
| gift_add_ice_blocks | Example:{"count":1} count:int32 Quantity count_limit: int32 Quantity limit |
Add Ice Blocks | |
| gift_eliminate_chains | Example:{"count":1} count:int32 Quantity |
Remove Chains | |
| gift_eliminate_ice_blocks | Example:{"count":1} count:int32 Quantity |
Remove Ice Blocks | |
| gift_clear_all_chains | Clear All Chains | ||
| gift_clear_all_ice_blocks | Clear All Ice Blocks | ||
| gift_annoying_monster | Example:{"count":1} count:int32 Quantity count_limit: int32 Quantity limit |
Annoying Monster | |
| gift_send_rockets | Example:{"count":1} count:int32 Quantity count_limit: int32 Quantity limit |
Send Rockets | |
| gift_send_bombs | Example:{"count":1} count:int32 Quantity count_limit: int32 Quantity limit |
Send Bombs | |
| gift_send_rainbows | Example:{"count":1} count:int32 Quantity count_limit: int32 Quantity limit |
Send Rainbows |
7.Watermelon Merge, Game ID=1892865924243181570
| cmd | value | cmd Additional Data (payload) | Description |
|---|---|---|---|
| item_event_shake | Shake - Shakes the box | ||
| item_event_hammer | Example: {"fruitId":"1"} fruitId: Required for hammer prop: Target fruit ID. When a user clicks a fruit in the client, a request is initiated, and the server fills in this ID from the request |
Hammer - Clears a specified fruit Usage flow: Click the prop to enter the activated state - In the activated state, clicking a fruit triggers the prop, and the clicked fruit is eliminated - In the activated state, clicking the hammer cancels the activated state - In the activated state, clicking other areas keeps it in the activated state |
Request Example
{
"mg_id": "xxx",
"room_id": "xxx",
"orders": [
{
"out_order_id": "xxx",
"cmd": "gift_cover_big_chain",
"value": 1,
"from_uid": "15493",
"to_uid": "15444",
"payload": {}
},
{
"out_order_id": "xxx",
"cmd": "gift_cover_big_chain",
"value": 1,
"from_uid": "15493",
"to_uid": "15445",
"payload": {}
}
]
}
Return Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ret_code | Yes | int | Response code |
| ret_msg | Yes | string | Response information |
| data | Yes | AppServerCreateOrderResp | Response data |
- BatchCreateOrderResp
| Parameter | Required | Type | Description |
|---|---|---|---|
| orders | Yes | OrderEntry[] | Array of order data |
- OrderEntry
| Parameter | Required | Type | Description |
|---|---|---|---|
| out_order_id | Yes | string | Merchant order ID |
| order_id | Yes | string | SUD order ID |
Return Example
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"orders": [
{
"order_id": "xxx",
"out_order_id": "xxx"
},
{
"order_id": "xxx",
"out_order_id": "xxx"
}
]
}
}
业务错误码
| Error Code | Error Description | Solution |
|---|---|---|
| 10002 | Parameter error | Check the request parameters, modify them and send the request again |
| 70501 | Order ID already exists | Modify the merchant-defined order ID to ensure uniqueness and send the request again |