> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.insurgateway.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.insurgateway.com/_mcp/server.

# Push Notification API

InsurGateway, platforma yapacağı tüm bildirimleri tek bir endpoint üzerinden gönderir. Bildirim ayrımı `RequestObject.NotificationType` alanı ile yapılır.

## Endpointler

| Alan         | Değer               |
| ------------ | ------------------- |
| HTTP Method  | `POST`              |
| Path         | `/PushNotification` |
| Content-Type | `application/json`  |

InsurGateway, platform tarafından bildirilen Base URL'in sonuna `/PushNotification` ekleyerek tam URL'i oluşturur.

---

## Header'lar

```
Content-Type: application/json
x-api-key: <platform tarafından üretilen API key>
Authorization: <opsiyonel; platform tarafından bildirildiyse>
```

---

## Request Yapısı

```json
{
  "ReferanceNo": "string",
  "SubReferanceNo": "string",
  "RequestKeyValueSet": null,
  "RequestObject": {
    "NotificationType": 0,
    "Payload": "<serialize edilmiş JSON string>"
  }
}
```

| Alan                 | Tip         | Açıklama                                                                                       |
| -------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
| `ReferanceNo`        | string      | İş referans numarası. Aynı bildirim retry'da aynı değerle gönderilir; idempotency anahtarıdır. |
| `SubReferanceNo`     | string      | HTTP çağrısına özel \~30 karakterlik benzersiz alt referans (loglama).                         |
| `RequestKeyValueSet` | array\|null | Kullanılmaz.                                                                                   |
| `NotificationType`   | short       | Bildirim tipi: `0`, `1`, `2`, `3`, `4`, `6`, `7`. (`5` yoktur.)                                |
| `Payload`            | string      | İlgili tipin payload'ı JSON string olarak gönderilir; iki aşamalı parse gerektirir.            |

### NotificationType Değerleri

| Değer | İsim               | Doküman                                                                                    |
| ----- | ------------------ | ------------------------------------------------------------------------------------------ |
| `0`   | InsuranceCompany   | [../PushNotification/0-InsuranceCompany.md](../PushNotification/0-InsuranceCompany.md)     |
| `1`   | Proposal           | [../PushNotification/1-Proposal.md](../PushNotification/1-Proposal.md)                     |
| `2`   | Policy             | [../PushNotification/2-Policy.md](../PushNotification/2-Policy.md)                         |
| `3`   | OutgoingLogPayload | [../PushNotification/3-OutgoingLogPayload.md](../PushNotification/3-OutgoingLogPayload.md) |
| `4`   | IncomingLogPayload | [../PushNotification/4-IncomingLogPayload.md](../PushNotification/4-IncomingLogPayload.md) |
| `6`   | BulkPolicyTransfer | [../PushNotification/6-BulkPolicyTransfer.md](../PushNotification/6-BulkPolicyTransfer.md) |
| `7`   | AgentDisabled      | [../PushNotification/7-AgentDisabled.md](../PushNotification/7-AgentDisabled.md)           |

---

## Response Yapısı

Platformun döneceği cevap, HTTP `200 OK` ile aşağıdaki yapıda olmalıdır:

```json
{
  "ResultStatus": {
    "Status": "Success",
    "Explanation": null
  },
  "Result": null
}
```

| Alan                       | Açıklama                                                                                                                             |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ResultStatus.Status`      | `"Success"`, `"Error"`, `"InProgress"`, `"Info"`, `"Warning"`. Yalnızca `"Success"` başarılı kabul edilir; diğerleri retry tetikler. |
| `ResultStatus.Explanation` | Hata açıklaması; loglanır.                                                                                                           |
| `Result`                   | Bu serviste `null`.                                                                                                                  |

---

## HTTP Durum Kodları

| HTTP Kod                 | Cevap Gövdesi      | Sonuç  | Retry? |
| ------------------------ | ------------------ | ------ | ------ |
| `200`                    | `Status="Success"` | Başarı | Hayır  |
| `200`                    | `Status≠"Success"` | Hata   | Evet   |
| `3xx`/`4xx`/`5xx`        | —                  | Hata   | Evet   |
| Bağlantı kopması/timeout | —                  | Hata   | Evet   |

## Retry

**Bekleme süreleri:** 3 sn → 10 sn → 1 dk → 1 saat (≥4. retry)

**Maksimum retry sayıları (orijinal hariç):**

| `NotificationType`     | Maksimum Retry | Toplam Deneme |
| ---------------------- | -------------- | ------------- |
| `3` OutgoingLogPayload | 5              | 6             |
| `6` BulkPolicyTransfer | 5              | 6             |
| `7` AgentDisabled      | 5              | 6             |
| `4` IncomingLogPayload | 2              | 3             |
| `0`, `1`, `2`          | 10             | 11            |

Son retry'da HTTP başlığında `IsLastAttemptToReDelivery=true` gönderilir.