AZA-ZPayA-ZPay bank-transfer API

Withdrawals

Create a withdrawal after your site has validated the player request and reserved or deducted the player balance.

Request

POST /v1/withdrawals
Content-Type: application/json
X-Api-Key: pk_live_xxx
X-Timestamp: 1778940000
X-Signature: ...
{
  "amount": "250.00",
  "currency": "TRY",
  "externalReference": "casino-withdrawal-2042",
  "customer": {
    "id": "player-42",
    "username": "turbo_player",
    "fullName": "Ada Yilmaz"
  },
  "withdrawalAccount": {
    "bankName": "Garanti",
    "accountHolderName": "Player Name",
    "iban": "TR640006200027700006789011"
  }
}
Send a withdrawal request
const payload = {
amount: '250.00',
currency: 'TRY',
externalReference: 'casino-withdrawal-2042',
customer: { id: 'player-42', username: 'turbo_player', fullName: 'Ada Yilmaz' },
withdrawalAccount: { bankName: 'Garanti', accountHolderName: 'Player Name', iban: 'TR640006200027700006789011' },
};
const path = '/v1/withdrawals';
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 || 'Withdrawal failed');
return result.transaction.id;
<?php
$payload = [
  'amount' => '250.00',
  'currency' => 'TRY',
  'externalReference' => 'casino-withdrawal-2042',
  'customer' => ['id' => 'player-42', 'username' => 'turbo_player', 'fullName' => 'Ada Yilmaz'],
  'withdrawalAccount' => ['bankName' => 'Garanti', 'accountHolderName' => 'Player Name', 'iban' => 'TR640006200027700006789011'],
];
$path = '/v1/withdrawals';
$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);
$transactionId = $result['transaction']['id'];

Response

Withdrawals enter A-ZPay approval immediately. There is no hosted player page.

{
  "transaction": {
    "id": "txn_...",
    "type": "withdrawal",
    "status": "waiting_confirmation",
    "amountCents": 25000,
    "playerAmountCents": 22500,
    "commissionCents": 2500,
    "balanceImpactCents": -25000
  }
}

Settlement

  • deduct_from_amount: the payout amount is reduced by commission.
  • fee_on_top: the payout amount remains the requested amount and partner balance impact includes the extra fee.

Before approval, A-ZPay records which enabled bank account processed the payout. The selected account is stored on the transaction and a withdrawal ledger entry deducts the player payout from that bank account’s running balance.

If the withdrawal amount is outside the platform-wide min/max configured by A-ZPay admins, the API returns 400 and no operator queue item is created. Validate the requested amount before sending it to A-ZPay.

Your site should treat withdrawal.approved as payout success and withdrawal.rejected as payout failure/refund.