Online Payment Notifications Handling (IPN v2)
Notifications are sent via POST method using Content-Type application/json. Each notification must return a plaintext response OK
with HTTP status 200
.
Notification Structure
Field | Type | Description |
---|---|---|
type | Enum | Transmitted event, full list below |
notification_id | char(36) | Unique notification ID |
date | date (ISO 8601) | Date and time of notification sending in ISO 8601 format (e.g. 2025-05-20T16:36:07Z ) |
data | Object | Data transmitted in this event |
signature | string | Calculated signature, details below |
Signature Calculation
Signatures are generated by concatenating the values of the type
field, notification_id
, all received parameters (except signature) to the API in the order from the tables below, separating them with the separator |
and adding the key available in the Client Panel for the service at the end. Hashing must be done using sha256.
The basic string to be hashed should look like this:
type|notification_id|date|data_value1|data_value2|data_valueN|key
Values from the data
field should be added to the signature in the same order as they are listed in the documentation.
Example method of generating a signature for the following sample data:
type
= example:typenotification_id
= 0196bf93-aca4-7253-8a2d-0941a037f25bdate
= 2025-05-20T16:36:07Zdata
has fields:status
= transaction_paidamount
(object)amount.currency
= PLNamount.value
= 5.25
transaction_id
= 123123123123meta
= test
key
= keyFromPanel
Joining all elements correctly will look like this:
example:type|0196bf93-aca4-7253-8a2d-0941a037f25b|2025-05-20T16:36:07Z|transaction_paid|PLN|5.25|123123123123|test|keyFromPanel
If any field in the documentation informs us that it may not occur if e.g. it was not passed during payment initiation, we completely skip this element when generating the signature.
Looking at the example, let's assume that the meta
field may not occur and actually does not occur. In this case, the concatenation of elements will look like this:
example:type|0196bf93-aca4-7253-8a2d-0941a037f25b|2025-05-20T16:36:07Z|transaction_paid|PLN|5.25|123123123123|keyFromPanel
This prepared string is passed to the sha256 hashing function. SimPay sends the signature as a lower-case string.
Example of generating signature value in selected languages and SDK:
<?php
class SimPaySignatureValidator
{
public function isValid(): bool
{
$payload = json_decode(@file_get_contents('php://input'), true);
if (empty($payload)) {
return false;
}
$data = $this->flattenArray($payload);
$data[] = 'SERVICE_IPN_KEY';
$signature = hash('sha256', implode('|', $data));
return hash_equals($signature, $payload['signature']);
}
private function flattenArray(array $array): array
{
unset($array['signature']);
$return = [];
array_walk_recursive($array, function ($a) use (&$return) {
$return[] = $a;
});
return $return;
}
}
$validator = new SimPaySignatureValidator();
if(!$validator->isValid()) {
http_response_code(403);
echo 'INVALID_SIGNATURE';
die();
}
// rest of ipn
Available Global Data Types:
- TransactionStatusEnum - Enum(
transaction_new
,transaction_confirmed
,transaction_generated
,transaction_paid
,transaction_failed
,transaction_expired
,transaction_canceled
,transaction_refunded
) - RefundStatusEnum - Enum(
refund_new
,refund_pending
,refund_completed
,refund_rejected
,refund_failed
)
Available Values in type
Field:
transaction:status_changed
- transaction status change
Data in the data field:
Field | Type | Description | Example Value |
---|---|---|---|
id | UUID | Transaction ID sent after transaction generation | 00554475-7ebb-4f16-b30b-0ce21da1a03b |
payer_transaction_id | char(8) | Transaction ID shown to the payer | 4878R2PN |
service_id | char(8) | Service identifier | e65c7519 |
status | TransactionStatusEnum | Transaction status | transaction_paid |
amount | Object | Amount information object | |
amount.final_currency | ISO 4217 | Currency in which the payer made the payment | PLN |
amount.final_value | string (%.2f) | Final amount the payer paid (e.g. "0.30", "10.00", "12.37") | 8.47 |
amount.original_currency | ISO 4217 | Currency that was declared during payment initiation | EUR |
amount.original_value | string (%.2f) | Declared amount during payment initiation (e.g. "0.30", "10.00", "12.37") | 2.00 |
amount.commission_system | string (%.2f) or null | Commission amount taken by SimPay (e.g. "0.30", "10.00", "12.37") | 0.13 |
amount.commission_partner | string (%.2f) or null | Commission amount for the Partner (e.g. "0.30", "10.00", "12.37") | 0.13 |
amount.commission_currency | ISO 4217 or null | Currency in which commission was taken (PLN/EUR) | PLN |
control | string | Field sent only when passed during payment initiation | SHOP_ORDER_1 |
payment | Object | Field with payment information | |
payment.channel | string | Payment channel used by the payer | blik |
payment.type | string | Type/group of payment method | blik |
customer | Object | Payer information object | |
customer.country_code | ISO 3166-1 Alpha-2 or null | Buyer's country (e.g. "PL") | PLN |
paid_at | ISO 8601 or null (may not be sent when transaction is not paid) | Date and time of payment | 2025-05-26T15:10:24Z |
created_at | ISO 8601 | Date and time of transaction creation | 2025-05-26T15:09:59Z |
Example sent event (for ipn key = UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ
):
{
"type": "transaction:status_changed",
"notification_id": "0196fec6-7a61-7219-9458-bcc45237c252",
"date": "2025-05-23T22:12:22+02:00",
"data": {
"id": "dbc87423-b121-4ad4-977f-b63c3d3831e8",
"payer_transaction_id": "Q68KLAKN",
"service_id": "e65c7519",
"status": "transaction_failure",
"amount": {
"final_currency": "PLN",
"final_value": "8.00",
"original_currency": "PLN",
"original_value": "8.00",
"commission_system": "0.06",
"commission_partner": "7.94",
"commission_currency": "PLN"
},
"control": "3e63e31d-f08d-4942-a223-3bad2dce8096",
"payment": {
"channel": "blik",
"type": "blik"
},
"customer": {
"country_code": null
},
"created_at": "2024-08-10T15:41:50+02:00"
},
"signature": "095a7be5d77c4bab667dbd0f35d9b1cb0c9cec50d8af42842cc37a95b233925e"
}
transaction:refund_status_changed
- refund status change
Data in the data field:
Field | Type | Description | Example Value |
---|---|---|---|
id | UUID | SimPay refund ID | 0194837c-69df-71dd-adff-4b3058f3fb58 |
service_id | char(8) | Service identifier | e65c7519 |
status | RefundStatusEnum | Refund status | refund_completed |
amount | Object | Amount information object | |
amount.currency | ISO 4217 | Currency in which the refund was requested | PLN |
amount.value | string (%.2f) | Amount requested for refund | 8.47 |
amount.wallet_currency | ISO 4217 | Wallet currency from which funds were taken | EUR |
amount.wallet_value | string (%.2f) | Amount taken from wallet | 2.00 |
transaction | Object | Field with payment information | |
transaction.id | UUID | SimPay transaction ID | 00554475-7ebb-4f16-b30b-0ce21da1a03b |
transaction.payment_channel | string | Payment channel used by the payer | blik |
transaction.payment_type | string | Type/group of payment method | blik |
Example sent event (for ipn key = UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ
):
{
"type": "transaction_refund:status_changed",
"notification_id": "0196ff00-376d-7399-a457-d166c9adf073",
"date": "2025-05-23T23:15:26+02:00",
"data": {
"id": "0194837c-69df-71dd-adff-4b3058f3fb58",
"service_id": "e65c7519",
"status": "refund_completed",
"amount": {
"currency": "PLN",
"value": "1.00",
"wallet_currency": "PLN",
"wallet_value": "1.00"
},
"transaction": {
"id": "e568d9ba-a85a-444c-87c4-3b1e431428d1",
"payment_channel": "paysafecard",
"payment_type": "paysafe"
}
},
"signature": "835819c5720c74f01b8d10a58b2dc43185f05379ea26f25a15158061f3bce10c"
}
ipn:test
- test notification
This notification can be sent from the Client Panel.
Data in the data field:
Field | Type | Description | Example Value |
---|---|---|---|
service_id | char(8) | Service identifier | e65c7519 |
nonce | string | Random string | 01JVZCXGZ77DJTM08WMSX34ETQ |
Example sent event (for ipn key = UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ
):
{
"type": "ipn:test",
"notification_id": "0196fece-c3e7-71ba-ac8a-ac64056d7d6b",
"date": "2025-05-23T22:21:25+02:00",
"data": {
"service_id": "e65c7519",
"nonce": "01JVZCXGZ77DJTM08WMSX34ETQ"
},
"signature": "02df1a420def7e5de9b316d2bd1ef70796f50abc461561a85bb1243f0a08984d"
}