# Event: transaction_blik_level0:code_status_changed

The `transaction_blik_level0:code_status_changed` event is used to monitor the state of the 6-digit BLIK code itself. This is particularly useful when you want to update the user interface in your store in real-time (e.g., display an appropriate message when the code status changes).

## When Is This Event Sent?

This notification is sent **exclusively** for transactions initiated through channels supporting code entry on the merchant's page, namely:

* BLIK Level 0 (`blik-level0`)
* BLIK Recurrent Payments (`blik-recurrent`)


It will be triggered when the status of the BLIK code provided by the customer changes (e.g., the code is recognized as valid – `VALID`, or rejected/invalid).

## `data` Object Structure

When the `type` field in the main notification object has the value `transaction_blik_level0:code_status_changed`, the `data` object will contain the following information:

| Field | Type | Description | Example Value |
|  --- | --- | --- | --- |
| `ticket_status` | `string` | [BLIK code status](/payment/blik/level0) | `VALID` |
| `transaction` | `object` | Object with related transaction information |  |
| `transaction.id` | `UUID` | Transaction ID sent after generating the transaction | `70bc5ab3-4973-4275-a0eb-08e3f2ab54f2` |
| `transaction.payer_transaction_id` | `char(8)` | Transaction ID shown to the payer | `6PB8JKKN` |
| `transaction.service_id` | `char(8)` | Service identifier (in SimPay Flow - parent service ID) | `e65c7519` |
| `transaction.status` | `TransactionStatusEnum` | Current [related transaction status](/payment/statuses#statusGroup=Transaction+Statuses) | `transaction_paid` |
| `transaction.amount` | `object` | Amount information object |  |
| `transaction.amount.final_currency` | `ISO 4217` | Currency in which the payer made the payment | `PLN` |
| `transaction.amount.final_value` | `string` (%.2f) | Final amount paid by the payer | `360.00` |
| `transaction.amount.original_currency` | `ISO 4217` | Currency declared at payment initiation | `PLN` |
| `transaction.amount.original_value` | `string` (%.2f) | Amount declared at payment initiation | `360.00` |
| `transaction.amount.commission_system` | `string` (%.2f) or `null` | Commission amount charged by SimPay | `5.36` |
| `transaction.amount.commission_partner` | `string` (%.2f) or `null` | Commission amount for the Partner | `354.64` |
| `transaction.amount.commission_currency` | `ISO 4217` or `null` | Commission currency | `PLN` |
| `transaction.control` | `string` or `null` | Control field value from payment initiation (if absent - `null`) | `111122223333` |
| `flow` | `object` or absent | Only for [SimPay Flow](/simpay-flow/webhooks#payment-webhooks-ipn-in-simpay-flow) submerchants |  |
| `flow.submerchant_id` | `string` | Submerchant ID | `flsm_aaaabbbb` |
| `flow.submerchant_custom_id` | `string` | Submerchant `customId` | `user-123` |
| `flow.flow_service_id` | `string` | Flow service ID | `flow_aaaabbbb` |


Tip
Remember that this notification focuses on the **BLIK code** status (`ticket_status`). Although it also contains the current transaction status (`transaction.status`), for final goods delivery in your store we recommend relying on the main `transaction:status_changed` event, which appears after the final settlement of funds.

## Example JSON Payload

Below is a complete dump (payload) of the notification sent for the `transaction_blik_level0:code_status_changed` event.

*(The example signature was generated using the IPN key: **`UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ`**. You can use this key and the data below to test your validation algorithm).*

```json
{
  "type": "transaction_blik_level0:code_status_changed",
  "notification_id": "019736c4-50c3-7108-944c-11a0f9c12b72",
  "date": "2025-06-03T19:08:44+02:00",
  "data": {
    "ticket_status": "VALID",
    "transaction": {
      "id": "70bc5ab3-4973-4275-a0eb-08e3f2ab54f2",
      "payer_transaction_id": "6PB8JKKN",
      "service_id": "e65c7519",
      "status": "transaction_paid",
      "amount": {
        "final_currency": "PLN",
        "final_value": "360.00",
        "original_currency": "PLN",
        "original_value": "360.00",
        "commission_system": "5.36",
        "commission_partner": "354.64",
        "commission_currency": "PLN"
      },
      "control": "111122223333"
    }
  },
  "signature": "236197b1a75a8e1c33b0feea94cab753f4b0d7f5ffd044abeea36ea8b89566cc"
}
```

See signature calculation
1. Flatten all elements sequentially + `|` separation:


Our string will look like this:

```
transaction_blik_level0:code_status_changed|019736c4-50c3-7108-944c-11a0f9c12b72|2025-06-03T19:08:44+02:00|VALID|70bc5ab3-4973-4275-a0eb-08e3f2ab54f2|6PB8JKKN|e65c7519|transaction_paid|PLN|360.00|PLN|360.00|5.36|354.64|PLN|111122223333
```

1. Append the IPN key at the end of the string:
`...|UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ`
2. Calculate SHA256 from the above string and encode it in hex:


```php
<?php

$signature = hash('sha256', 'transaction_blik_level0:code_status_changed|019736c4-50c3-7108-944c-11a0f9c12b72|2025-06-03T19:08:44+02:00|VALID|70bc5ab3-4973-4275-a0eb-08e3f2ab54f2|6PB8JKKN|e65c7519|transaction_paid|PLN|360.00|PLN|360.00|5.36|354.64|PLN|111122223333|UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ');
```

1. Compare using a secure comparison function (e.g., `hash_equals` in PHP) the calculated signature with the one sent in the `signature` field of the notification. In this case, the hashing result will be `236197b1a75a8e1c33b0feea94cab753f4b0d7f5ffd044abeea36ea8b89566cc`.