EsPay API
Integration guide for starting credit card deposits and receiving transaction results via callback.
General Information
148.113.221.44 to receive our callback requests.Integration Flow
Start the transaction with /creditcard/deposit
Redirect the user to the url in the response
The result is sent to your callBackUrl
Verify the hash and return a response
Credit Card
Deposit transaction with credit card.
Request
Headers
[apikey]
application/json
Request Parameters
Transaction amount (format: 100.00)
100.00Username to be displayed in reports and transaction records.
userjohn1Player's first and last name
John DoeCardholder's Turkish ID number
12345678912Cardholder's email address
string@test.comCardholder's phone number
5555555555Cardholder's IP address
17.0.0.1ID to be sent back to you in the callback. Must be unique per transaction; a second transaction with the same transactionId is rejected.
API endpoint to which the transaction result will be sent. Must be a full URL starting with http:// or https://.
https://www.apidomain.com/endpointURL the user is redirected to after the payment result is shown. Must be a static link.
Optional additional information field.
Optional additional information field.
Optional additional information field.
Response Parameters
Whether the request was successful
URL to be shown to the user
Reason of the error, if any
x-apikey : [apikey]
Content-Type : application/json
{
"amount": 100.00,
"userName": "userjohn1",
"owner": "John Doe",
"identityNumber": "12345678912",
"email": "string@test.com",
"phone": "5555555555",
"ipAddress": "17.0.0.1",
"transactionId": "6ffeb400117b250d51bcb26d4b9318...",
"callBackUrl": "https://www.apidomain.com/endpoint",
"notificationUrl": "https://www.yourdomain.com",
"custom1": "f0b6696c68b09a01777...", // optional
"custom2": "96c68b09a01777...", // optional
"custom3": "a01777..." // optional
}{
"status": true,
"error": "error message" // null if there is no error
}Callback
Request sent to your endpoint with the result of the created transactions.
Request
Headers
application/json
Request Parameters
Transaction amount (format: 100.00)
100.00If the user pays a different amount after creating the transaction, the paid amount is sent in this field. For failed transactions (success: false) it is sent as 0.
150.00ID you sent when creating the transaction
The player's first and last name you sent in the owner field when creating the transaction. Not the userName (username) from the request; the owner value is sent exactly as received.
John DoeSecurity code hashed with MD5. See Hash Calculation
Whether the transaction was successful
Unique ID generated by our system for tracking transfer logs
Transaction type. Sent as deposit for deposit transactions.
depositSent empty.
Sent empty.
Content-Type : application/json
{
"amount": 100.00,
"receivedAmount": 150.00,
"transactionId": "14133b8059961712116501f3dc89f8f10a7b",
"userName": "John Doe",
"success": true,
"session": "5d6050f674a01a3d87c9aea6c535c7e5ee8cbd4aa75f14272b6ae42824ea75e9",
"hash": "f8486d095dd4ae12aea67c9d6a4b261b",
"custom1": "deposit",
"custom2": "",
"custom3": ""
}{
"session": "5d6050f674a01a3d87c9aea6c535c7e5ee8cbd4aa75f14272b6ae42824ea75e9",
"status": true,
"message": "your system message"
}Hash Calculation
To verify that the callback comes from us, calculate the hash with the rule below and compare it with the received hash. Do not add separators (dots etc.) between fields. The hash is sent as a 32-character lowercase hex string.
Successful transaction success: true
Failed transaction success: false
userName received in the callback, i.e. the owner value you sent when creating the transaction (exactly, including spaces and letter case). Non-ASCII characters are hashed as UTF-8. Use transactionId to match the transaction in your system; do not compare the callback userName with the player's username.receivedAmount is sent as 0, and the hash is calculated with the transaction's amount.Response Parameters
Whether the request was successful
The sessionId we sent to you
Message generated by your system
Error message. Sent only when success: false (failed callback). Example: "3DS Entered Wrong"