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

# Events and Deliveries

Understanding the difference between events and deliveries is important when working with webhooks.

## Events

A **Webhook Event** represents something that happened in the Nayax Energy Core system. Events are created once and contain:

* `id` - Unique identifier for the event
* `eventType` - The type of event (e.g., `ocpp.message`)
* `createdAt` - When the event occurred
* `payload` - The event data

Events are retained for **30 days** and can be viewed via the API.

## Deliveries

A **Webhook Delivery** represents an attempt to send an event to a specific endpoint. One event can have multiple deliveries if you have multiple webhook endpoints subscribed to the same event type.

Deliveries contain:

* `id` - Unique identifier for the delivery
* `eventId` - The event this delivery is for
* `eventType` - The type of event
* `payload` - The event data
* `status` - Current status: `success`, or `failed`
* `attempts` - Array of delivery attempts with timestamps and any errors

Deliveries are retained for **30 days**. This extended retention window ensures you have ample time to investigate failed deliveries and manually resend them if needed.

## Relationship

```
Event (ocpp.message)
├── Delivery → Endpoint A (success)
├── Delivery → Endpoint B (failed)
└── Delivery → Endpoint C (success)
```

This separation allows you to:

* See the original event data regardless of delivery status
* Track delivery attempts independently for each endpoint
* Resend failed deliveries without creating duplicate events

## Webhook Payload Structure

When Nayax Energy Core sends a webhook to your endpoint, the request body follows this structure:

```json theme={null}
{
  "id": "whevt_abc123",
  "type": "ocpp.message",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "data": {
    // Event-specific payload
  }
}
```

The following headers are included with each webhook request:

| Header                  | Description                                                                                                |
| ----------------------- | ---------------------------------------------------------------------------------------------------------- |
| `Content-Type`          | Always `application/json`                                                                                  |
| `X-Webhook-Delivery-Id` | The delivery ID                                                                                            |
| `X-Webhook-Timestamp`   | Unix timestamp when the request was signed                                                                 |
| `X-Webhook-Signature`   | Signature for validating the request (see [Validating Signatures](/guides/webhooks/validating-signatures)) |
