Deposits
Create a deposit when a player chooses A-ZPay/manual bank transfer in your cashier.
Request
POST /v1/deposits
Content-Type: application/json
X-Api-Key: pk_live_xxx
X-Timestamp: 1778940000
X-Signature: ...
{
"amount": "100.00",
"currency": "TRY",
"externalReference": "casino-deposit-1001",
"redirectUrl": "https://casino.example/cashier/deposits/1001",
"customer": {
"id": "player-42",
"username": "turbo_player",
"fullName": "Ada Yilmaz",
"email": "player@example.com"
}
}
Send a deposit request
const payload = {
amount: '100.00',
currency: 'TRY',
externalReference: 'casino-deposit-1001',
redirectUrl: 'https://casino.example/cashier/deposits/1001',
customer: { id: 'player-42', username: 'turbo_player', fullName: 'Ada Yilmaz', email: 'player@example.com' },
};
const path = '/v1/deposits';
const body = JSON.stringify(payload);
const response = await fetch('https://api.azpay.example' + path, {
method: 'POST',
headers: signAZPayRequest('POST', path, body),
body,
});
const result = await response.json();
if (!response.ok) throw new Error(result.error || 'Deposit failed');
return result.transaction.hostedUrl;<?php
$payload = [
'amount' => '100.00',
'currency' => 'TRY',
'externalReference' => 'casino-deposit-1001',
'redirectUrl' => 'https://casino.example/cashier/deposits/1001',
'customer' => ['id' => 'player-42', 'username' => 'turbo_player', 'fullName' => 'Ada Yilmaz', 'email' => 'player@example.com'],
];
$path = '/v1/deposits';
$body = json_encode($payload, JSON_UNESCAPED_SLASHES);
$ch = curl_init('https://api.azpay.example' . $path);
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_HTTPHEADER => signAZPayRequest('POST', $path, $body), CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true]);
$result = json_decode(curl_exec($ch), true);
$hostedUrl = $result['transaction']['hostedUrl'];redirectUrl is required. After the player clicks Transferi gönderdim on the Turkish hosted page, A-ZPay redirects the player back to this URL with azpayTransactionId, azpayStatus, and externalReference query parameters.
Response
{
"transaction": {
"id": "txn_...",
"type": "deposit",
"status": "waiting_payment",
"amountCents": 10000,
"requestedAmountCents": 10000,
"actualAmountCents": null,
"commissionCents": 1000,
"netAmountCents": 9000,
"playerAmountCents": 9000,
"balanceImpactCents": 9000,
"externalReference": "casino-deposit-1001",
"referenceCode": "BP-A1B2C3D4",
"redirectUrl": "https://casino.example/cashier/deposits/1001",
"hostedUrl": "https://pay.example/pay/txn_..."
}
}
Partner implementation notes
- Redirect the player to
hostedUrlimmediately after creation. - If the deposit amount is outside the platform-wide min/max configured by A-ZPay admins, the API returns
400and no hosted payment page is created. Show the allowed-range error in the cashier before the player transfers funds. - Do not credit the player after the browser redirect alone.
- Credit the player only after a verified
deposit.approvedwebhook. - The actual bank transfer can differ from the requested
amount. UseactualAmountCentsfor the received gross amount andplayerAmountCentsfor the credited balance. - Credit
playerAmountCents, not the original requestedamountCents.
Deposit statuses
waiting_payment: deposit created; customer has not clicked the transfer-sent button.waiting_confirmation: customer clicked the button; A-ZPay operator must approve or reject.approved: operator confirmed funds; webhook sent.rejected: operator rejected; webhook sent.