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.
If any parameter is empty, it will not be included in the URL-encoded string.
Common Parameters​
Present in all events:
| Parameter | Description | Example |
|---|---|---|
type | Transaction type: • MK - Payment• HO - Deposit• FX - Currency exchange• MM - Other | MK |
account | Your account number (event subject) | EVP0000000000001 |
statement_id | Unique statement ID (critical for idempotency) | 123456789 |
transfer_id | Internal transfer identifier | 99999999 |
created_at | Transfer creation timestamp | 1448615390 |
Direction Indicator​
| Parameter | Description | Example |
|---|---|---|
credit | Direction: • 1 - Incoming funds• 0 - Outgoing funds• Not provided for currency exchange | 1 |
Payment Parameters​
Used in payment transactions (type=MK):
| Parameter | Description | Example |
|---|---|---|
amount | Transaction amount (always positive, decimal with dot) | 29.99 |
currency | Currency code (ISO 4217) | EUR |
details | Payment description/purpose | Payment for invoice #123 |
Currency Exchange Parameters​
Used in currency exchange transactions (type=FX):
| Parameter | Description | Example |
|---|---|---|
from_amount | Outgoing funds amount | 10.00 |
from_currency | Source currency | EUR |
to_amount | Incoming funds amount | 34.54 |
to_currency | Target currency | USD |
Beneficiary Information​
Present in outgoing transactions:
| Parameter | Description | Example |
|---|---|---|
beneficiary_name | Recipient's name | John Smith |
beneficiary_code | Recipient's personal/company code | 38001010000 |
beneficiary_account | Recipient's account number | LT001100000111100000 |
Payer Information​
Present in incoming transactions:
| Parameter | Description | Example |
|---|---|---|
payer_name | Sender's name | John Smith |
payer_code | Sender's personal/company code | 38001010000 |
payer_account | Sender's account number | LT001100000111100000 |
Reference Fields​
Additional reference information:
| Parameter | Description | Example |
|---|---|---|
reference_number | Payment reference number | AB12345 |
reference_to_beneficiary | Reference for recipient | INV-2023-001 |
reference_to_payer | Reference for sender | ORDER-456 |
Event Types​
- Payments (MK)
- Deposits (HO)
- Currency Exchange (FX)
- Other (MM)
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) or0(outgoing)amount+currency= transaction valuepayer_*fields for incoming paymentsbeneficiary_*fields for outgoing payments
Account Deposits​
Deposits and balance increases.
Example:
type=HO
credit=1
account=EVP0000000000001
amount=500.00
currency=EUR
details=Account deposit
transfer_id=12345680
statement_id=123456791
Key Fields:
type=HO(deposit)credit=1(always incoming)amount+currency= deposit valuedetails= description
Currency Conversions​
Exchange transactions between currencies.
Example:
type=FX
account=EVP0000000000001
from_amount=100.00
from_currency=EUR
to_amount=115.50
to_currency=USD
transfer_id=12345681
statement_id=123456792
Key Fields:
type=FX(exchange)- No
creditfield (not incoming/outgoing) from_amount+from_currency= sourceto_amount+to_currency= result- Exchange rate =
to_amount/from_amount
Currency exchange events do not include the credit parameter.
Other Transactions​
Various other account activities and special transactions.
Example:
type=MM
account=EVP0000000000001
details=Account maintenance fee
transfer_id=12345682
statement_id=123456793
Key Fields:
type=MM(other/miscellaneous)- May include various parameters depending on transaction type
- Check
detailsfield for transaction description
Processing Examples​
- PHP
- Python
- Node.js
- Java
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']}");
}
}
E-commerce Order Processing​
if params['type'][0] == 'MK' and params['credit'][0] == '1':
# Incoming payment
order_id = extract_order_id(params['details'][0])
amount = params['amount'][0]
currency = params['currency'][0]
# Update order
update_order_status(order_id, 'paid', amount, currency)
send_confirmation_email(order_id)
# Log for accounting
log_transaction(params['statement_id'][0], order_id, amount)
Subscription Management​
if params['type'][0] == 'MK' and params['credit'][0] == '1':
# Check if subscription payment
if 'Subscription' in params['details'][0]:
user_id = extract_user_id(params.get('reference_number', [''])[0])
extend_subscription(user_id, params['amount'][0])
notify_user(user_id, 'subscription_renewed')
Multi-Currency Handling​
event_type = params['type'][0]
if event_type == 'MK':
# Regular payment
amount = params['amount'][0]
currency = params['currency'][0]
process_payment(amount, currency)
elif event_type == 'FX':
# Currency exchange
from_amount = params['from_amount'][0]
from_currency = params['from_currency'][0]
to_amount = params['to_amount'][0]
to_currency = params['to_currency'][0]
log_exchange(from_amount, from_currency, to_amount, to_currency)
Balance Monitoring​
if params.get('credit', [''])[0] == '0':
# Outgoing payment - check balance
account = params['account'][0]
current_balance = get_account_balance(account)
if current_balance < LOW_BALANCE_THRESHOLD:
notify_admin(f"Low balance alert: {current_balance} {params['currency'][0]}")
E-commerce Order Processing​
if (params.type === 'MK' && params.credit === '1') {
// Incoming payment
const orderId = extractOrderId(params.details);
const amount = params.amount;
const currency = params.currency;
// Update order
await updateOrderStatus(orderId, 'paid', amount, currency);
await sendConfirmationEmail(orderId);
// Log for accounting
await logTransaction(params.statement_id, orderId, amount);
}
Subscription Management​
if (params.type === 'MK' && params.credit === '1') {
// Check if subscription payment
if (params.details.includes('Subscription')) {
const userId = extractUserId(params.reference_number);
await extendSubscription(userId, params.amount);
await notifyUser(userId, 'subscription_renewed');
}
}
Multi-Currency Handling​
switch (params.type) {
case 'MK':
// Regular payment
const amount = params.amount;
const currency = params.currency;
await processPayment(amount, currency);
break;
case 'FX':
// Currency exchange
const fromAmount = params.from_amount;
const fromCurrency = params.from_currency;
const toAmount = params.to_amount;
const toCurrency = params.to_currency;
await logExchange(fromAmount, fromCurrency, toAmount, toCurrency);
break;
}
Balance Monitoring​
if (params.credit === '0') {
// Outgoing payment - check balance
const currentBalance = await getAccountBalance(params.account);
if (currentBalance < LOW_BALANCE_THRESHOLD) {
await notifyAdmin(`Low balance alert: ${currentBalance} ${params.currency}`);
}
}
E-commerce Order Processing​
if ("MK".equals(params.get("type")) && "1".equals(params.get("credit"))) {
// Incoming payment
String orderId = extractOrderId(params.get("details"));
String amount = params.get("amount");
String currency = params.get("currency");
// Update order
updateOrderStatus(orderId, "paid", amount, currency);
sendConfirmationEmail(orderId);
// Log for accounting
logTransaction(params.get("statement_id"), orderId, amount);
}
Subscription Management​
if ("MK".equals(params.get("type")) && "1".equals(params.get("credit"))) {
// Check if subscription payment
if (params.get("details").contains("Subscription")) {
String userId = extractUserId(params.get("reference_number"));
extendSubscription(userId, params.get("amount"));
notifyUser(userId, "subscription_renewed");
}
}
Multi-Currency Handling​
String type = params.get("type");
switch (type) {
case "MK":
// Regular payment
String amount = params.get("amount");
String currency = params.get("currency");
processPayment(amount, currency);
break;
case "FX":
// Currency exchange
String fromAmount = params.get("from_amount");
String fromCurrency = params.get("from_currency");
String toAmount = params.get("to_amount");
String toCurrency = params.get("to_currency");
logExchange(fromAmount, fromCurrency, toAmount, toCurrency);
break;
}
Balance Monitoring​
if ("0".equals(params.get("credit"))) {
// Outgoing payment - check balance
double currentBalance = getAccountBalance(params.get("account"));
if (currentBalance < LOW_BALANCE_THRESHOLD) {
notifyAdmin("Low balance alert: " + currentBalance + " " + params.get("currency"));
}
}
Parameter Validation​
Required Fields​
Always validate critical parameters:
- PHP
- Python
- Node.js
- Java
$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;
}
}
required = ['type', 'account', 'statement_id', 'transfer_id']
for field in required:
if field not in params or not params[field]:
print(f"Missing required field: {field}")
return 'Bad Request', 400
const required = ['type', 'account', 'statement_id', 'transfer_id'];
for (const field of required) {
if (!params[field]) {
console.error(`Missing required field: ${field}`);
res.status(400).send('Bad Request');
return;
}
}
String[] required = {"type", "account", "statement_id", "transfer_id"};
for (String field : required) {
if (!params.containsKey(field) || params.get(field).isEmpty()) {
System.err.println("Missing required field: " + field);
response.setStatus(400);
return;
}
}
Amount Validation​
- PHP
- Python
- Node.js
- Java
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;
}
}
import re
if 'amount' in params:
# Validate format
if not re.match(r'^\d+\.\d{2}$', params['amount'][0]):
print(f"Invalid amount format: {params['amount'][0]}")
return 'Bad Request', 400
# Validate currency
valid_currencies = ['EUR', 'USD', 'GBP', 'PLN', 'BGN', 'RON']
if params['currency'][0] not in valid_currencies:
print(f"Invalid currency: {params['currency'][0]}")
return 'Bad Request', 400
if (params.amount) {
// Validate format
if (!/^\d+\.\d{2}$/.test(params.amount)) {
console.error(`Invalid amount format: ${params.amount}`);
res.status(400).send('Bad Request');
return;
}
// Validate currency
const validCurrencies = ['EUR', 'USD', 'GBP', 'PLN', 'BGN', 'RON'];
if (!validCurrencies.includes(params.currency)) {
console.error(`Invalid currency: ${params.currency}`);
res.status(400).send('Bad Request');
return;
}
}
if (params.containsKey("amount")) {
// Validate format
if (!params.get("amount").matches("^\\d+\\.\\d{2}$")) {
System.err.println("Invalid amount format: " + params.get("amount"));
response.setStatus(400);
return;
}
// Validate currency
List<String> validCurrencies = Arrays.asList("EUR", "USD", "GBP", "PLN", "BGN", "RON");
if (!validCurrencies.contains(params.get("currency"))) {
System.err.println("Invalid currency: " + params.get("currency"));
response.setStatus(400);
return;
}
}
Next Steps​
- Implementation Guide → - Learn how to implement webhooks
- Webhooks Overview → - Return to main documentation
Support​
- 📧 Email: support@paysera.com
- 📞 Phone: Contact Information