Deposit Auto
This service allows merchants to obtain an eligible bank account and create a deposit transaction in a single API call. It combines the functionality of /get-available-bank and /deposit/direct into one endpoint, reducing total latency by 50%.
⚡ Performance Advantage
Instead of making 2 separate API calls (get-available-bank + deposit/direct), this endpoint handles everything in a single request, cutting integration latency in half.
Instead of making 2 separate API calls (get-available-bank + deposit/direct), this endpoint handles everything in a single request, cutting integration latency in half.
Endpoint
POST https://api.pancpay.org/payment/deposit/auto
Params
| Parameter | Type | Description | Requirement |
|---|---|---|---|
| api_id | integer | API Id for Merchant | Yes |
| api_key | string | API Key for Merchant | Yes |
| amount | decimal | The exact deposit amount | Yes |
| user_id | integer | User Id that started the process | Yes |
| username | string | Username that started the process | Yes |
| first_name | string | First name of the depositor | Yes |
| last_name | string | Last name of the depositor | Yes |
| external_transaction_id | string | Unique ID submitted by the site | No |
| currency | string | Currency code (default: TRY) | No |
| lang | string | Language code (default: tr) | No |
| return_url_success | string | Redirect URL on success | No |
| return_url_fail | string | Redirect URL on failure | No |
| tcno | string | Identity number (Optional) | No |
| string | Email address (Optional) | No |
Response
{
"code": 200,
"type": "success",
"message": "Your request has been received and deposit created.",
"bank_account": {
"bankName": "YAPI VE KREDİ BANKASI A.Ş.",
"accountName": "EXAMPLE DIŞ TİCARET LTD. ŞTİ.",
"iban": "TR910006701000000013708149"
},
"transaction_id": "TXN20260317183924WJZWB8",
"hash": "9eNhXm40VI1faX2eoqZFd7nncRYf3JLCo3be0eO923xFNAnaOF"
}
Example PHP Code
$parameters = [
'api_id' => 1,
'api_key' => 'x3dfjkasdo12332',
'amount' => 250.00,
'user_id' => 1205,
'username' => 'player_test',
'first_name' => 'John',
'last_name' => 'Doe',
'external_transaction_id' => 'unique-tx-123',
];
$url = 'https://api.pancpay.org/payment/deposit/auto';
$fields_string = http_build_query($parameters);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
$response = curl_exec($ch);
curl_close($ch);
$json = json_decode($response);
if ($json->code == 200) {
echo "Deposit created! Transaction ID: " . $json->transaction_id;
echo "Bank: " . $json->bank_account->bankName;
echo "IBAN: " . $json->bank_account->iban;
} else {
echo "Error: " . $json->message;
}