> ## Documentation Index
> Fetch the complete documentation index at: https://sdk.qfapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Token Notification

> Handle asynchronous notifications that confirm payment-token creation.

QFPay sends a Token Creation Notification after it creates a payment token through the Element SDK. Use this notification as the authoritative confirmation that a `token_id` is available for future use.

## Configure the notification URL

<Note>
  To enable Token Creation Notifications, email your notification URL, merchant ID, and store ID to [technical.support@qfpay.com](mailto:technical.support@qfpay.com).
</Note>

<Warning>
  The Token Creation Notification uses a dedicated endpoint. It is different from the standard payment notification endpoint.
</Warning>

## Notification fields

| Field               | Description                              |
| ------------------- | ---------------------------------------- |
| `userid`            | QFPay Store ID.                          |
| `notify_type`       | Notification type: `payment_token`.      |
| `event`             | One of `NEW`, `MATCH`, or `CONFLICT`.    |
| `tokenid`           | Generated payment-token ID.              |
| `token_expiry_date` | Token expiry date.                       |
| `cardcd`            | Masked card number.                      |
| `card_scheme`       | Card scheme, such as VISA or MASTERCARD. |
| `respcd`            | Response code. `0000` indicates success. |
| `respmsg`           | Response message.                        |
| `sysdtm`            | System timestamp.                        |
| `customer_id`       | Linked customer ID, if available.        |
| `token_reason`      | Reason for tokenisation.                 |
| `token_reference`   | Merchant token reference.                |

## Example

```json theme={null}
{
  "respmsg": "success",
  "card_scheme": "ECMC_DEBIT",
  "cardcd": "5200****1096",
  "tokenid": "tk_6a699aae75094caeb066f****988daa32de",
  "respcd": "0000",
  "token_expiry_date": "2024-04-30 00:00:00",
  "sysdtm": "2024-04-29 15:37:17",
  "notify_type": "payment_token",
  "event": "CONFLICT"
}
```

## Handling guidance

* Verify the notification according to your QFPay integration requirements.
* Persist the `tokenid` only after a successful notification.
* Make processing idempotent so duplicate deliveries do not create duplicate records.
* Return HTTP 200 after successful processing.

## Next steps

Use the confirmed `token_id` with the saved `customer_id` in [Recurring Payments](/integration/online-shop/integration-by-use-case/recurring-payments/recurring-overview) or another supported future-payment flow.
