Using this approach, the operator initiates a withdrawal request to Naga Games, asking to transfer credits from the player's wallet on Naga Games' system to their designated source account.

🚧

Read Me First!

An operator must generate X-Signature based on their input data before sending the request.
Please Refer ➡️ How to generate signature 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 ).

Please Refer ➡️ Data Order before Stringify & Hashing

/* JAVASCRIPT EXAMPLE */

// `nativeTransactionId` must be changed each withdraw time
const payload = {
  "nativeId": "safutest03",
  "brandCode": "srot",
  "groupCode": "dpae",
  "currencyCode": "THB",
  "amount": 10,
  "nativeTransactionId": "3b380261-d3d6-b086-9cbe-0f70fe730e00",
};

//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/withdraw
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 NameDescriptionData TypeStatus
nativeIdIdentifier of the player in Operator’s systemString (length: 255)Required
brandCodeAuto-generated code of the brand in Naga Games’s databaseString (length: 4)Required
groupCodeAuto-generated code of the group in Naga Games’s databaseString (length: 4)Required
currencyCodeCurrency code of the playerString (length: 3)Required
amountAmount of the transactionDecimal (20,4)Required
nativeTransactionIdThe unique identifier of the transaction on the operator systemString (length: 36)Required

Example

curl --location 'https://api.stg.game.topplatform.asia/operator/transfer/withdraw' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-signature: db00a764065de074e5e514404be81876f7c8f526853ecb1d4fc35abfcf1fefd7' \
--data '
{
  "nativeId": "safutest03",
  "brandCode": "srot",
  "groupCode": "dpae",
  "currencyCode": "THB",
  "amount": 1,
  "nativeTransactionId": "3b380261-d3d6-b086-9cbe-0f70fe730e12"
}
'

Response

Data Response:

Parameter NameDescriptionData type
transactionIdThe unique identifier of the transaction on the Naga Games system.String (length: 36)
nativeTransactionIdThe unique identifier of the transaction on the Operator system.String (length: 36)
updatedBalanceBalance of the player’s wallet after the transactionDecimal (20,2)

Example

Success Response Example (HTTP status code 200)

{
  "transactionId": "96903007-2c74-6953-8203-2419ec4a9f74",
  "updatedBalance": "9000",
  "nativeTransactionId": "d388a9ef-0052-4a81-b37f-6e50f46ebe31"
}

Failure Response Example (HTTP status code 400)

{
  "message": "Brand Not Found",
  "code": 1201,
  "timestamp": "2022-05-11T09:59:43.176Z"
}
Language
Click Try It! to start a request and see the response here!