> **Description:** Detailed guide on implementing and managing webhooks in the QR API, including payload formats, event types, security considerations, and real-time notification handling.

# QR API webhooks

You can receive instant notifications about important events.
To set up the basic webhook infrastructure, you need to register your webhook URL,
as described in the [Webhooks API guide](https://developer.vippsmobilepay.com/docs/APIs/webhooks-api/api-guide.md).
We'll send the real-time notifications about subscription events to the URL you specify.

The QR solution currently has one webhook event that you can subscribe to.

## User checked in event

The central part of the [Merchant Callback QR](https://developer.vippsmobilepay.com/docs/APIs/qr-api/api-guide/merchant-callback.md) flow is the callback that will be sent to the merchant when a customer scans the QR.
To receive these callbacks, the merchant needs to register a subscription to the `user.checked-in.v1` webhook event.

There can be a maximum of one webhook registration for each sales unit. In addition to that, there can also be a registered partner webhook.
For more about these limits, see [webhook limits](https://developer.vippsmobilepay.com/docs/APIs/webhooks-api/api-guide.md#webhook-limits).

When the QR is scanned and there is both a partner webhook and a sales unit webhook, then the sales unit webhook will be used.

Here is the payload for the `user.checked-in.v1` event:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `customerToken` | Base64 string | A reference to the customer. Should be used when initiating a payment through the ePayment API. Token is valid for 15 minutes. |
| `merchantQrId` | string | The ID of the QR code that has been scanned which is defined by the merchant when the QR was created. |
| `msn` | string | Merchant serial number. A unique ID of the sales unit to which the scanned QR belongs. |
| `initiatedAt` | UTC Timestamp in ISO 8601 format | The timestamp of when the customer scanned the QR. |

Example of `user.checked-in.v1` payload:

````json
{
    "customerToken": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
    "merchantQrId": "d8b7d76d-49aa-48b8-90c6-38779372c163",
    "msn": "12345",
    "initiatedAt": "2023-10-06T10:45:40.3061965Z"
}
````

> **Full site overview:** For every page in this documentation, read [https://developer.vippsmobilepay.com/llms.txt](https://developer.vippsmobilepay.com/llms.txt).
