#

Description
- This callback API allows 【SUD】 to update the score of a specific user.
Request URL
- Split into a test environment and a production environment, and inform Sud to configure them separately.
- The production environment address will only take effect after formal deployment.
Request method
- HTTPS
- POST
- Parameters are in JSON format and included in the request body.
Signature Verification
- To ensure data integrity, the client's server needs to verify the callback content
using signature verification.
Body Parameters(More fields may be added, and the client needs to ensure the compatibility of new fields.)
Parameter |
Required |
Type |
Description |
order_id |
Yes |
string |
Unique order ID,the client's server should deduplicate based on this ID |
mg_id |
Yes |
string |
Game ID |
round_id |
Yes |
string |
Game round ID |
uid |
Yes |
string |
User UID |
score |
Yes |
int64 |
Number of score consumed or gained by the user |
type |
Yes |
int32 |
Operation type, 1: consume, 2: gain(Please note: when updating user credits, be sure to lock and update user credits, ensure not to deduct or add more user credits, and do idemidempower judgment according to order_id, if the user credits balance is insufficient, or the order id is repeated, you need to return the specified error code, see the error code definition!!) |
Request Example
{
"order_id": "xxx",
"mg_id": "xxx",
"round_id": "xxx",
"uid": "xxx",
"score": 100,
"type": 1
}
Response parameters
Parameter |
Required |
Type |
Description |
ret_code |
Yes |
int32 |
Error code: 0 for success, others for errors |
ret_msg |
Yes |
string |
Error message |
data |
Yes |
object |
Data |
Parameter |
Required |
Type |
Description |
score |
Yes |
int64 |
User score |
Special Error Code Definitions(Supports Future Additions)[9000-9999]
Error Code |
Error Message |
Description |
9000 |
insufficient balance |
User balance is insufficient |
9001 |
duplicate order id |
The order ID is duplicated |
Success Response Example
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"score": 1000000
}
}
Error Response Example
{
"ret_code": 1,
"ret_msg": "failure",
"data": {}
}
{
"ret_code": 9000,
"ret_msg": "duplicate order id",
"data": {}
}