Skip to main content

Event Reference

Complete reference for all webhook event types and parameters.

Event Parameters​

After verifying the signature and decoding the data, you'll receive the actual event parameters.

info

If any parameter is empty, it will not be included in the URL-encoded string.


Common Parameters​

Present in all events:

ParameterDescriptionExample
typeTransaction type:
• MK - Payment
• HO - Deposit
• FX - Currency exchange
• MM - Other
MK
accountYour account number (event subject)EVP0000000000001
statement_idUnique statement ID (critical for idempotency)123456789
transfer_idInternal transfer identifier99999999
created_atTransfer creation timestamp1448615390

Direction Indicator​

ParameterDescriptionExample
creditDirection:
• 1 - Incoming funds
• 0 - Outgoing funds
• Not provided for currency exchange
1

Payment Parameters​

Used in payment transactions (type=MK):

ParameterDescriptionExample
amountTransaction amount (always positive, decimal with dot)29.99
currencyCurrency code (ISO 4217)EUR
detailsPayment description/purposePayment for invoice #123

Currency Exchange Parameters​

Used in currency exchange transactions (type=FX):

ParameterDescriptionExample
from_amountOutgoing funds amount10.00
from_currencySource currencyEUR
to_amountIncoming funds amount34.54
to_currencyTarget currencyUSD

Beneficiary Information​

Present in outgoing transactions:

ParameterDescriptionExample
beneficiary_nameRecipient's nameJohn Smith
beneficiary_codeRecipient's personal/company code38001010000
beneficiary_accountRecipient's account numberLT001100000111100000

Payer Information​

Present in incoming transactions:

ParameterDescriptionExample
payer_nameSender's nameJohn Smith
payer_codeSender's personal/company code38001010000
payer_accountSender's account numberLT001100000111100000

Reference Fields​

Additional reference information:

ParameterDescriptionExample
reference_numberPayment reference numberAB12345
reference_to_beneficiaryReference for recipientINV-2023-001
reference_to_payerReference for senderORDER-456

Event Types​

Regular Payments​

Incoming and outgoing payments between accounts.

Incoming Payment Example:

type=MK
credit=1
account=EVP0000000000001
amount=100.00
currency=EUR
payer_account=EVP0000000000002
payer_name=John Doe
details=Invoice payment
transfer_id=12345678
statement_id=123456789

Outgoing Payment Example:

type=MK
credit=0
account=EVP0000000000001
amount=50.00
currency=EUR
beneficiary_account=LT001100000111100000
beneficiary_name=Jane Smith
details=Supplier payment
transfer_id=12345679
statement_id=123456790

Key Fields:

  • type = MK (payment)
  • credit = 1 (incoming) or 0 (outgoing)
  • amount + currency = transaction value
  • payer_* fields for incoming payments
  • beneficiary_* fields for outgoing payments

Processing Examples​

E-commerce Order Processing​

if ($params['type'] === 'MK' && $params['credit'] === '1') {
// Incoming payment
$orderId = extractOrderId($params['details']);
$amount = $params['amount'];
$currency = $params['currency'];

// Update order
updateOrderStatus($orderId, 'paid', $amount, $currency);
sendConfirmationEmail($orderId);

// Log for accounting
logTransaction($params['statement_id'], $orderId, $amount);
}

Subscription Management​

if ($params['type'] === 'MK' && $params['credit'] === '1') {
// Check if subscription payment
if (strpos($params['details'], 'Subscription') !== false) {
$userId = extractUserId($params['reference_number']);
extendSubscription($userId, $params['amount']);
notifyUser($userId, 'subscription_renewed');
}
}

Multi-Currency Handling​

switch ($params['type']) {
case 'MK':
// Regular payment
$amount = $params['amount'];
$currency = $params['currency'];
processPayment($amount, $currency);
break;

case 'FX':
// Currency exchange
$fromAmount = $params['from_amount'];
$fromCurrency = $params['from_currency'];
$toAmount = $params['to_amount'];
$toCurrency = $params['to_currency'];

logExchange($fromAmount, $fromCurrency, $toAmount, $toCurrency);
break;
}

Balance Monitoring​

if ($params['credit'] === '0') {
// Outgoing payment - check balance
$currentBalance = getAccountBalance($params['account']);

if ($currentBalance < LOW_BALANCE_THRESHOLD) {
notifyAdmin("Low balance alert: {$currentBalance} {$params['currency']}");
}
}

Parameter Validation​

Required Fields​

Always validate critical parameters:

$required = ['type', 'account', 'statement_id', 'transfer_id'];

foreach ($required as $field) {
if (!isset($params[$field]) || empty($params[$field])) {
error_log("Missing required field: {$field}");
http_response_code(400);
exit;
}
}

Amount Validation​

if (isset($params['amount'])) {
// Validate format
if (!preg_match('/^\d+\.\d{2}$/', $params['amount'])) {
error_log("Invalid amount format: {$params['amount']}");
http_response_code(400);
exit;
}

// Validate currency
$validCurrencies = ['EUR', 'USD', 'GBP', 'PLN', 'BGN', 'RON'];
if (!in_array($params['currency'], $validCurrencies)) {
error_log("Invalid currency: {$params['currency']}");
http_response_code(400);
exit;
}
}

Next Steps​

Support​