Firmaya yeni banka bağlantısı ekle
curl --request POST \
--url https://api.tahsil.dev/banks/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-company-id: <x-company-id>' \
--data '
{
"bankCode": "akbank",
"title": "Mavi Rota ana tahsilat hesabı"
}
'const options = {
method: 'POST',
headers: {
'x-company-id': '<x-company-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({bankCode: 'akbank', title: 'Mavi Rota ana tahsilat hesabı'})
};
fetch('https://api.tahsil.dev/banks/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tahsil.dev/banks/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankCode' => 'akbank',
'title' => 'Mavi Rota ana tahsilat hesabı'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-company-id: <x-company-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"result": {
"id": "<string>",
"companies": "<string>",
"status": true,
"bankCode": "akbank",
"subAccounts": [
{
"subAccountKey": "<string>",
"bankCode": "<string>",
"currency": "TRY",
"balance": 123,
"id": "<string>",
"providerAccountId": "<string>",
"customerNo": "<string>",
"accountNo": "<string>",
"iban": "<string>",
"accountType": "<string>",
"accountName": "<string>",
"branchId": "<unknown>",
"branchName": "<string>",
"blockedBalance": 123,
"availableBalance": 123,
"openingDate": "2023-11-07T05:31:56Z",
"lastTransactionDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"title": "Ana Akbank Bağlantısı",
"lastProviderSetupAt": "2023-11-07T05:31:56Z",
"lastProviderSyncAt": "2023-11-07T05:31:56Z",
"syncHealth": {
"lastAttemptAt": "2023-11-07T05:31:56Z",
"lastSuccessAt": "2023-11-07T05:31:56Z",
"lastErrorAt": "2023-11-07T05:31:56Z",
"lastErrorCode": "<string>",
"lastErrorMessage": "<string>",
"lastDurationMs": 1,
"lastResult": {
"fetched": 1,
"inserted": 1,
"duplicates": 1
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": false,
"code": "TRANSACTION_AMOUNT_RANGE_INVALID",
"message": "minAmount, maxAmount değerinden büyük olamaz."
}{
"status": false,
"code": "TRANSACTION_AMOUNT_RANGE_INVALID",
"message": "minAmount, maxAmount değerinden büyük olamaz."
}Firmaya yeni banka bağlantısı ekle
Bir firma aynı banka için birden fazla bağımsız bağlantı oluşturabilir. Para birimi ve fiziksel hesaplar provider setup sırasında keşfedilir ve subAccounts alanında döner. Demo ve production bağlantıları ayrı credential modları kullanır.
POST
/
banks
/
accounts
Firmaya yeni banka bağlantısı ekle
curl --request POST \
--url https://api.tahsil.dev/banks/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-company-id: <x-company-id>' \
--data '
{
"bankCode": "akbank",
"title": "Mavi Rota ana tahsilat hesabı"
}
'const options = {
method: 'POST',
headers: {
'x-company-id': '<x-company-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({bankCode: 'akbank', title: 'Mavi Rota ana tahsilat hesabı'})
};
fetch('https://api.tahsil.dev/banks/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tahsil.dev/banks/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankCode' => 'akbank',
'title' => 'Mavi Rota ana tahsilat hesabı'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-company-id: <x-company-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"result": {
"id": "<string>",
"companies": "<string>",
"status": true,
"bankCode": "akbank",
"subAccounts": [
{
"subAccountKey": "<string>",
"bankCode": "<string>",
"currency": "TRY",
"balance": 123,
"id": "<string>",
"providerAccountId": "<string>",
"customerNo": "<string>",
"accountNo": "<string>",
"iban": "<string>",
"accountType": "<string>",
"accountName": "<string>",
"branchId": "<unknown>",
"branchName": "<string>",
"blockedBalance": 123,
"availableBalance": 123,
"openingDate": "2023-11-07T05:31:56Z",
"lastTransactionDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"title": "Ana Akbank Bağlantısı",
"lastProviderSetupAt": "2023-11-07T05:31:56Z",
"lastProviderSyncAt": "2023-11-07T05:31:56Z",
"syncHealth": {
"lastAttemptAt": "2023-11-07T05:31:56Z",
"lastSuccessAt": "2023-11-07T05:31:56Z",
"lastErrorAt": "2023-11-07T05:31:56Z",
"lastErrorCode": "<string>",
"lastErrorMessage": "<string>",
"lastDurationMs": 1,
"lastResult": {
"fetched": 1,
"inserted": 1,
"duplicates": 1
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": false,
"code": "TRANSACTION_AMOUNT_RANGE_INVALID",
"message": "minAmount, maxAmount değerinden büyük olamaz."
}{
"status": false,
"code": "TRANSACTION_AMOUNT_RANGE_INVALID",
"message": "minAmount, maxAmount değerinden büyük olamaz."
}Yetkilendirmeler
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Başlıklar
Yazma işleminin hedef firma kimliği.
Gövde
application/json
Bu sayfa yararlı mıydı?
⌘I