Callbacks
After creating Deposit & Withdraw, we POST status updates in JSON format to an endpoint where you send us status updates. You can get information about the parameters sent below.
We may send you more than one callback for a transaction. For example, when a deposit is successful, a callback is sent to you regarding the "successful" status. However, in case of a systematic error, this transaction may turn into unsuccessful and a callback will be sent to you again.
To avoid this anomaly, please process each callback we send only once.
Callback operation
When you create a Deposit or Withdraw, we send you a callback with the unique transactionId we give you. There may be minor changes in some of the parameters we send to Deposit and Withdraw. Please be careful with it.
Deposit Callback Payload
- Name
hash- Type
- string
- Description
Signature created by us for callback verification
- Name
transactionId- Type
- string
- Description
The unique ID number we give you when creating a transaction
- Name
bankId- Type
- string
- Description
Relevant bank id value
- Name
bank- Type
- string
- Description
Name of the relevant bank
- Name
amount- Type
- number
- Description
Last amount. (the amount you will consider)
- Name
type- Type
- string
- Description
Transaction type (
deposit)
- Name
bankAccountName- Type
- string
- Description
Bank account name where the deposit was made
- Name
bankAccountIban- Type
- string
- Description
Bank account number where the deposit was made
- Name
status- Type
- string
- Description
Transaction status (
successfulorunsuccessful)
- Name
statusReason- Type
- string
- Description
Reason for failure if
statusfield isunsuccessful
- Name
name- Type
- string
- Description
The
namevalue you sent when creating the deposit transaction
- Name
userName- Type
- string
- Description
The
userNamevalue you sent when creating the deposit transaction
- Name
userId- Type
- string
- Description
The
userIdvalue you sent when creating the deposit transaction
- Name
processId- Type
- string
- Description
The
processIdvalue you sent when creating the deposit transaction
- Name
convertedName- Type
- string
- Description
A 'slugified' version of the
namevalue you sent when creating the deposit transaction
POST to your-callback-url
Body JSON Payload
{
"hash": "zzunnCrv6Sb38TU/dPYIl+9TKd8gT6iqrcxv+V32AFs=",
"transactionId": "6575078b9e6bb1554a50b7b1",
"bankId": "507f1f77bcf86cd799439011",
"amount": 500,
"userId": "987654",
"name": "Test User",
"userName": "testUserName",
"processId": "123456789",
"type": "deposit",
"convertedName": "testuser",
"bank": "Fake Bank",
"bankAccountName": "Fake Bank Account Name",
"bankAccountIban": "TR280006276256222621885935",
"status": "successful",
"statusReason": null
}
Withdraw Callback Payload
- Name
hash- Type
- string
- Description
Signature created by us for callback verification
- Name
transactionId- Type
- string
- Description
The unique ID number we give you when creating a transaction
- Name
bankId- Type
- string
- Description
Relevant bank id value
- Name
bank- Type
- string
- Description
Name of the relevant bank
- Name
amount- Type
- number
- Description
Last amount. (the amount you will consider)
- Name
type- Type
- string
- Description
Transaction type (
withdrawal)
- Name
accountName- Type
- string
- Description
The
accountNamevalue you sent when creating the withdraw transaction
- Name
iban- Type
- string
- Description
The
ibanvalue you sent when creating the withdraw transaction
- Name
status- Type
- string
- Description
Transaction status (
successfulorunsuccessful)
- Name
statusReason- Type
- string
- Description
Reason for failure if
statusfield isunsuccessful
- Name
name- Type
- string
- Description
The
namevalue you sent when creating the withdraw transaction
- Name
userName- Type
- string
- Description
The
userNamevalue you sent when creating the withdraw transaction
- Name
userId- Type
- string
- Description
The
userIdvalue you sent when creating the withdraw transaction
- Name
processId- Type
- string
- Description
The
processIdvalue you sent when creating the withdraw transaction
- Name
convertedName- Type
- string
- Description
A 'slugified' version of the
namevalue you sent when creating the withdraw transaction
POST to your-callback-url
Body JSON Payload
{
"hash": "zzunnCrv6Sb38TU/dPYIl+9TKd8gT6iqrcxv+V32AFs=",
"transactionId": "6575078b9e6bb1554a50b7b1",
"bankId": "507f1f77bcf86cd799439011",
"amount": 500,
"userId": "987654",
"name": "Test User",
"userName": "testUserName",
"processId": "123456789",
"type": "withdrawal",
"convertedName": "testuser",
"bank": "Fake Bank",
"accountName": "Test User",
"iban": "TR280006276256222621885935",
"status": "successful",
"statusReason": null
}
Hash Validation
Callback requests sent by us contain a 'hash' parameter. You can perform callback validation using this. Since it is the same method as creating Signature, you will not have any difficulties. Sample code and formulas are shared below.
Create Hash Validation
const apiSecret = "e59de9db1246eef0423a8c9045bdc5c9ea5729695cf792d065cac10373add831" //Replace it with your own API Secret.
const transactionId = "6575078b9e6bb1554a50b7b1" // transactionId taken from the callback value we sent to you
const bankId = "507f1f77bcf86cd799439011" // bankId taken from the callback value we sent to you
const amount = "500" // amount taken from the callback value we sent to you
const hash = `${transactionId}${bankId}${amount}`; // 6575078b9e6bb1554a50b7b1507f1f77bcf86cd799439011500
const sign = crypto.createHmac("sha256", apiSecret).update(hash).digest().toString("base64");
console.log(sign); // zzunnCrv6Sb38TU/dPYIl+9TKd8gT6iqrcxv+V32AFs=