Documentación de API Bank2B-ICG
La integración con ICG te permitirá realizar pagos interbancarios y conocer el estado de los mismos.
YOUR_API_KEY — this text should be replaced with your API key
{Examples for PHP 5.,7.,8.x:}
TRANSFERENCIAS DE DINERO
Ejemplo 1. Transferencia de dinero mediante 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 }.
Ejemplo 2. Transferencia de dinero por número de cuenta.
$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 }.
Ejemplo 3. Transferencia de dinero mediante número de tarjeta de crédito.
$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 }.
CÓDIGOS QR
Ejemplo 1. Analizar código QR de 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 }.
Ejemplo 2. Transacción POS con código QR.
$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+
Ejemplo 1. Transacción rápida.
$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 }.
Ejemplo 2. Lista de transacciones 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 }.
Ejemplo 3. Controlar código 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 }.