Using this method, an operator sends a create request to the Naga Games system to create a player. Then, the Naga Games system manages the player's balance from the operator to the Naga Games Wallet.
Read Me First!
An operator must generate X-Signature based on their input data before sending the request.
Refer ➡️ How to generate signature and data hash for Transfer mode?An operator must process the data in the same order ( data order and the number of data fields passed ) as specified by Naga Games to get the result from the API. Please make sure that the signature generated is valid before requesting, as different data will generate different signature and will result in error ( happens if any order or any data is missing or invalid during the signature generation process ).
Refer ➡️ Data Order before Stringify & Hashing
/* JAVASCRIPT EXAMPLE */ // Example for request data const payload = { "nativeId": "zdev293221", "brandCode": "srot", "groupCode": "dpae", "currencyCode": "THB" }; //To ensure accurate results when using this API. //The operator must create an instance of the generateSignatureExample() function. //Prior to employing the API, it is necessary to generate the signature using the newly implemented function since it provides a guaranteed output and response. const signature = generateSignatureExample(payload);
Request
API URL : {NagaGamesAPIDomain}/operator/transfer/create-player
HTTP Method : POST
Header Parameter:
- X-Signature (String) - Required
Must be generated from signing process with correct order of data fields & secretKey.
Body Parameters
- data (JSON)
Must contain all fields below.
Parameter Name | Description | Data type | Required |
---|---|---|---|
nativeId | Identifier of the player in Operator’s system | String (length: 255) | Yes |
brandCode | Unique code name of a brand | String (length: 4) | Yes |
groupCode | Unique code name of a group | String (length: 4) | Yes |
currencyCode | Currency code of the player | String (length: 4) | Yes |
- dataHash (String) - Required
The request data coming from Naga Games would be hashed using SHA-256 as a data checksum.
Example
curl --request POST \
--url https://api.stg.game.topplatform.asia/operator/transfer/create-player \
--header 'X-Signature: 24413fe765cfe50a19a0c275d3b3a1a87762c92c922251abb120f1bb7225399a' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"nativeId": "zdev293221",
"brandCode": "srot",
"groupCode": "dpae",
"currencyCode": "THB"
}
'
Response
Data Response:
Name | Description | Data type |
---|---|---|
id | Unique identifier of the record | String (length: 255) |
nativeId | Identifier of the player in Operator’s system | String (length: 255) |
created | Date and time when the player record was created | Date Time |
currencyCode | Currency code of the player | String (length: 4) |
groupCode | Auto-generated code of the group in Naga Games’s database | String (length: 4) |
brandCode | Auto-generated code of the brand in Naga Games’s database | String (length: 4) |
Example
Success Response Example (HTTP status code 200)
{
id: 'e1baa9cc-632f-4e7e-ad36-c2068da0b3e0',
nativeId: 'zdev293221',
created: '2022-02-25T10:50:12.505Z',
currencyCode: 'THB',
groupCode: 'dpae',
brandCode: 'srot'
}
Failure Response Example (HTTP status code 400)
//When the signature is invalid you get the following error
{
"message": "Invalid Signature",
"code": 1211,
"timestamp": "2022-05-12T08:09:08.317Z"
}
//When the player already exisits you the get following error
{
"message": "Player already exist",
"code": 1207,
"timestamp": "2023-05-11T04:40:51.423Z"
}