Documentation de lAPI Bank2B-ICG

Lintégration avec ICG vous permettra deffectuer des paiements interbancaires et de connaître leur statut.

YOUR_API_KEY — ce texte doit être remplacé par votre clé API
{Examples for PHP 5.,7.,8.x:}

TRANSFERTS DARGENT

Exemple 1. Transfert dargent par IBAN.


$data = <<<JSON
{
  "amount": 138.25,
  "context": {
    "language": "ar"
  },
  "date": "2018-11-01",
  "iban": "TR860001200983700010260854",
  "nameSurname": "Name Surname",
  "paymentType": "S",
  "senderAccount": {
    "branchCode": 0,
    "number": 0,
    "numberDetail": "string",
    "suffix": 0
  },
  "transactionDesc": "string"
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.

Exemple 2. Transfert dargent par numéro de compte.


$data = <<<JSON
{
  "amount": 15000,
  "context": {
    "language": "ar"
  },
  "currencyCode": "TRY",
  "date": "2018-11-01",
  "explanation": "string",
  "otherBankInfo": {
    "accountNumber": "null",
    "address": "null",
    "cityCode": "null",
    "cityName": "null",
    "nameSurname": "null",
    "tcknVkn": "null"
  },
  "receiptIbanVisible": true,
  "register": true,
  "subTranCode": "null",
  "subTranId": "null",
  "transferReason": "D"
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.

Exemple 3. Transfert dargent par numéro de carte de crédit.


$data = <<<JSON
{
  "amount": 1000,
  "context": {
    "language": "ar"
  },
  "currencyCode": "null",
  "date": "2018-11-01",
  "explanation": "string",
  "receiver": {
    "bankCode": 0,
    "creditCardNumber": "string",
    "otherBankInfo": {
      "nameSurname": "string"
    }
  },
  "register": true,
  "registrationName": "kart eft"
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.

CODES QR

Exemple 1. Analyser le code QR Pos.


$data = <<<JSON
{
  "context": {
    "language": "ar"
  },
  "qrData": "9999992103221553327b37f1cd44016a54869a58d535dc5f8E38"
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.

Exemple 2. Transaction par code QR Pos.


$data = <<<JSON
{
  "cardHolderName": "adı soyadı",
  "cardNumber": "1234 56** **** 2594",
  "cardType": 1,
  "context": {
    "language": "ar"
  },
  "qrData": "9999992103221553327b37f1cd44016a54869a58d535dc5f8E38",
  "transactionType": 1
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.

SWIFT+

Exemple 1. Transaction rapide.


$data = <<<JSON
{
  "amount": 10,
  "beneficiaryAccountNumber": 32523423,
  "beneficiaryAddress": "a",
  "beneficiaryBankBranchCode": "AAIPC",
  "beneficiaryBankCode": "ABNA",
  "beneficiaryBankCountryCode": "AE",
  "beneficiaryCountryCode": "string",
  "beneficiaryInfo": "string",
  "beneficiaryName": "a",
  "beneficiaryNumber": 0,
  "beneficiaryPhoneNumber": "string",
  "blockageSequenceNumber": 0,
  "branchCode": 0,
  "channelCode": "string",
  "context": {
    "language": "ar"
  },
  "currencyCode": "USD",
  "customerNumber": 0,
  "destinationAccountIsIBAN": false,
  "exchangeRateReservationNumber": 0,
  "expenseAccountBranchCode": 0,
  "expenseAccountNumber": 0,
  "expenseAccountSuffix": 0,
  "expenseAmount": 0,
  "expenseOwner": "OUR",
  "explanation": "kaydetme denemesi",
  "intermediaryBankSwiftBankCode": "string",
  "intermediaryBankSwiftBranchCode": "string",
  "intermediaryBankSwiftCountryCode": "string",
  "invoiceDocID": [
    0
  ],
  "proformaInvoiceDocID": [
    0
  ],
  "projectNumberKFD": 0,
  "remittanceType": "S",
  "senderAccount": {
    "branchCode": 0,
    "number": 0,
    "numberDetail": "string",
    "suffix": 0
  },
  "tranCode": "ToAccountSWIFT",
  "userCode": "string",
  "workflowNumber": 0
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.

Exemple 2. Liste des transactions Swift.


$data = <<<JSON
{
  "amountEnd": 0,
  "amountStart": 0,
  "context": {
    "language": "ar"
  },
  "currencyCode": "string",
  "dateEnd": "2021-11-10",
  "dateStart": "2021-09-10",
  "messageKind": 65,
  "status": "B"
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.

Exemple 3. Contrôlez le code Swift.


$data = <<<JSON
{
  "context": {
    "language": "ar"
  },
  "swiftCode": "BTFHTRISXXX"
}
JSON;

$post = array(
'data' => $data,
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://demo.sorbi.ai/userapi/icgv1/YOUR_API_KEY/');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
print_r($result);
var_dump($result);

// The response returns a JSON array with values ​​status=OK and answer={ JSON with data about the operation }.