Supported by CloudPay. Docs v2.0

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.

Endpoint

POST https://api.pancpay.org/payment/deposit/auto

Params


ParameterTypeDescriptionRequirement
api_idintegerAPI Id for MerchantYes
api_keystringAPI Key for MerchantYes
amountdecimalThe exact deposit amountYes
user_idintegerUser Id that started the processYes
usernamestringUsername that started the processYes
first_namestringFirst name of the depositorYes
last_namestringLast name of the depositorYes
external_transaction_idstringUnique ID submitted by the siteNo
currencystringCurrency code (default: TRY)No
langstringLanguage code (default: tr)No
return_url_successstringRedirect URL on successNo
return_url_failstringRedirect URL on failureNo
tcnostringIdentity number (Optional)No
emailstringEmail 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;
}