# Events

Every change worth knowing about is recorded as an event and sent to your webhook endpoints.

## The event object

| Field | Type | Description |
|---|---|---|
| `id` | string | Starts with `evt_`. Use it to deduplicate webhook deliveries. |
| `object` | string | Always `event`. |
| `type` | string | `payment.succeeded`, `payment.failed`, `payment.expired`, `payment.canceled`, `refund.succeeded`, `refund.pending`, `refund.failed`, `payout.created`, `payout.paid`, `payout.canceled`. A refund sends `refund.pending` when it is requested and `refund.succeeded` when K-LINK has processed it to the payer. |
| `livemode` | boolean | Test or live mode. |
| `created_at` | timestamp | When it happened. |
| `data.object` | object | The payment, refund or payout as it was at that moment. |

```json title="payment.succeeded"
{
  "id": "evt_2Bc4De6Fg8Hi0Jk2Lm4No6",
  "object": "event",
  "type": "payment.succeeded",
  "livemode": false,
  "created_at": "2026-11-27T10:01:12Z",
  "data": {
    "object": {
      "id": "pay_4Nq7xY2mKc8vTz1aB3dE9f",
      "object": "payment",
      "livemode": false,
      "status": "succeeded",
      "amount": 15200,
      "currency": "MMK",
      "method": "mmqr",
      "reference": "order-1001",
      "bank_reference": "KP7GQ2M9XW4T",
      "description": "Table 4",
      "checkout_url": "https://checkout.klinkpay.net/c/pay_4Nq7xY2mKc8vTz1aB3dE9f",
      "qr_payload": "00020101021226…6304A1B2",
      "redirect_url": null,
      "customer_phone": null,
      "return_url": "https://shop.example.com/orders/1001",
      "metadata": {
        "order_id": "1001"
      },
      "failure_reason": null,
      "expires_at": "2026-11-27T10:15:00Z",
      "succeeded_at": "2026-11-27T10:01:12Z",
      "created_at": "2026-11-27T10:00:00Z",
      "amount_refunded": 0,
      "fees": {
        "provider": 76,
        "klink": 152,
        "total": 228
      },
      "net": 14972,
      "payment_link": null
    }
  }
}
```

## Retrieve an event

```http
GET /v1/events/:id
```

Returns the event. Requires `events:read` on restricted keys.

```bash title="Request"
curl https://api.klinkpay.net/v1/events/evt_2Bc4De6Fg8Hi0Jk2Lm4No6 \
  -H "Authorization: Bearer kp_test_…"
```

## List events

```http
GET /v1/events
```

**Query**

| Field | Type | Description |
|---|---|---|
| `type` | string | Only events of this type, e.g. `payment.succeeded`. |
| `limit, starting_after, ending_before` |  | See [Pagination](/concepts/pagination.md). |

```bash title="Request"
curl https://api.klinkpay.net/v1/events?type=payment.succeeded&limit=10 \
  -H "Authorization: Bearer kp_test_…"
```

```json title="Response"
{
  "object": "list",
  "data": [
    {
      "id": "evt_2Bc4De6Fg8Hi0Jk2Lm4No6",
      "object": "event",
      "type": "payment.succeeded",
      "livemode": false,
      "created_at": "2026-11-27T10:01:12Z",
      "data": {
        "object": {
          "id": "pay_4Nq7xY2mKc8vTz1aB3dE9f",
          "object": "payment",
          "livemode": false,
          "status": "succeeded",
          "amount": 15200,
          "currency": "MMK",
          "method": "mmqr",
          "reference": "order-1001",
          "bank_reference": "KP7GQ2M9XW4T",
          "description": "Table 4",
          "checkout_url": "https://checkout.klinkpay.net/c/pay_4Nq7xY2mKc8vTz1aB3dE9f",
          "qr_payload": "00020101021226…6304A1B2",
          "redirect_url": null,
          "customer_phone": null,
          "return_url": "https://shop.example.com/orders/1001",
          "metadata": {
            "order_id": "1001"
          },
          "failure_reason": null,
          "expires_at": "2026-11-27T10:15:00Z",
          "succeeded_at": "2026-11-27T10:01:12Z",
          "created_at": "2026-11-27T10:00:00Z",
          "amount_refunded": 0,
          "fees": {
            "provider": 76,
            "klink": 152,
            "total": 228
          },
          "net": 14972,
          "payment_link": null
        }
      }
    }
  ],
  "has_more": false
}
```
