> 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.

# Create Premium

POST https://testgatewayapi.insurapps.net/api/offline/jobs/{jobId}/premiums
Content-Type: application/json

# Prim Teklifi Oluşturma API Dokümantasyonu

Bu dokümantasyon, offline iş akışı kapsamında prim teklifi oluşturma endpoint'inin teknik kullanım kılavuzudur. Endpoint aracılığıyla sigorta şirketi API kullanıcıları; prim bilgilerini çeşitli ödeme seçenekleriyle (peşin veya taksitli) iletebilir, teklif ve bilgilendirme belgelerini PDF olarak ekleyebilir.

***

## Endpoint Bilgisi

| Özellik           | Değer                                |
| ----------------- | ------------------------------------ |
| **HTTP Metodu**   | `POST`                               |
| **URL**           | `/api/offline/jobs/{jobId}/premiums` |
| **Content-Type**  | `application/json`                   |
| **Yetkilendirme** | `Authorization: Bearer {token}`      |

### Yetkilendirme Rolleri

Çağıranın aşağıdaki rollerden birine sahip olması gerekir:

| Rol                        | Erişim Kapsamı                   |
| -------------------------- | -------------------------------- |
| `InsuranceCompanyAPIUser`  | Sadece kendi işlerine erişebilir |
| `InsuranceCompanyAPIAdmin` | Şirketin tüm işlerine erişebilir |
| `Supervizor`               | Şirketin tüm işlerine erişebilir |

### Route Parametreleri

| Parametre | Tip       | Zorunlu | Açıklama                     |
| --------- | --------- | ------- | ---------------------------- |
| `jobId`   | `integer` | Evet    | İşin benzersiz tanımlayıcısı |

***

***

## İstek Modeli

### Ana İstek — `CreateOfferPremiumRequest`

| Alan                             | Tip                     | Zorunlu | Açıklama                           | Doğrulama Kuralları                                                                                                                                                                                                    |
| -------------------------------- | ----------------------- | ------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `InsuranceCompanyProposalNumber` | `string`                | Evet    | Sigorta şirketinin teklif numarası | Boş olamaz: `"Insurance company proposal number is required."`                                                                                                                                                         |
| `RenewalNumber`                  | `integer`               | Evet    | Yenileme numarası                  | Zorunlu: `"Renewal number is required."`  0'dan büyük veya eşit olmalı: `"Renewal number must be greater than or equal to 0."`                                                                                         |
| `ProductId`                      | `integer`               | Evet    | Ürün tanımlayıcısı                 | Zorunlu: `"Product ID is required."`                                                                                                                                                                                   |
| `Message`                        | `string`                | Hayır   | İsteğe bağlı mesaj                 | Maks. 500 karakter: `"Message cannot exceed 500 characters."`                                                                                                                                                          |
| `OfferPdf`                       | `PremiumFileRequest`    | Hayır   | Teklif PDF dosyası                 | Sağlanırsa `PremiumFileRequest` doğrulamaları uygulanır                                                                                                                                                                |
| `InformationPdf`                 | `PremiumFileRequest`    | Hayır   | Bilgi PDF dosyası                  | Sağlanırsa `PremiumFileRequest` doğrulamaları uygulanır                                                                                                                                                                |
| `Premiums`                       | `PremiumEntryRequest[]` | Evet    | Prim girişleri listesi             | Zorunlu: `"Premium list is required."`  Boş olamaz: `"Premium list cannot be empty."`  Tekrarsız olmalı: `"Duplicate premium entries are not allowed for the same installment, payment type, and installment option."` |

> **Benzersizlik Kuralı:** Aynı `IsInstallmentsEqual` + `PaymentOptionType` + `InstallmentNumber` kombinasyonuna sahip birden fazla prim girişi gönderilemez.

### Prim Girişi — `PremiumEntryRequest`

| Alan                        | Tip                                 | Zorunlu | Açıklama                                                     | Doğrulama Kuralları                                                                                                                                                                                    |
| --------------------------- | ----------------------------------- | ------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `PaymentOptionType`         | `integer`                           | Evet    | Ödeme seçeneği türü                                          | Zorunlu: `"PaymentOptionType is required."`  Geçerli enum değeri ([bknz.](https://docs.insurgateway.com/offline-constants#payment-type)) olmalı: `"PaymentOptionType must be a valid payment type."`   |
| `CurrencyType`              | `integer`                           | Evet    | Para birimi türü                                             | Zorunlu: `"CurrencyType is required."`  Geçerli enum değeri ([bknz.](https://docs.insurgateway.com/offline-constants#currency-type)) olmalı: `"CurrencyType must be a valid currency type."`           |
| `IsInstallmentsEqual`       | `boolean`                           | Evet    | Taksitler eşit tutarlı mı?                                   | —                                                                                                                                                                                                      |
| `FirstInstallmentRate`      | `integer`                           | Hayır   | İlk taksit oranı (%)                                         | 1–100 arasında olmalı *(sağlanırsa)*: `"FirstInstallmentRate must be between 1 and 100."`                                                                                                              |
| `InstallmentNumber`         | `integer`                           | Evet    | Taksit sayısı                                                | Zorunlu: `"InstallmentNumber is required."`  0'dan büyük olmalı: `"InstallmentNumber must be greater than 0."`                                                                                         |
| `GrossPremium`              | `decimal`                           | Evet    | Brüt prim tutarı                                             | Zorunlu: `"GrossPremium is required."`  0'dan büyük olmalı: `"GrossPremium must be greater than 0."`                                                                                                   |
| `GrossPremiumTL`            | `decimal`                           | Hayır   | Brüt prim TL karşılığı                                       | —                                                                                                                                                                                                      |
| `NetPremium`                | `decimal`                           | Evet    | Net prim tutarı                                              | Zorunlu: `"NetPremium is required."`  0'dan büyük olmalı: `"NetPremium must be greater than 0."`                                                                                                       |
| `Commission`                | `decimal`                           | Evet    | Komisyon tutarı                                              | Zorunlu: `"Commission is required."`  0'dan büyük veya eşit olmalı: `"Commission must be greater than or equal to 0."`                                                                                 |
| `CommissionTL`              | `decimal`                           | Hayır   | Komisyon TL karşılığı                                        | —                                                                                                                                                                                                      |
| `ExchangeRate`              | `decimal`                           | Hayır   | Döviz kuru                                                   | —                                                                                                                                                                                                      |
| `InstallmentExplanation`    | `string`                            | Hayır   | Taksit açıklama metni                                        | —                                                                                                                                                                                                      |
| `PremiumInstallmentDetails` | `PremiumInstallmentDetailRequest[]` | Koşullu | Taksit detayları (`InstallmentNumber > 1` olduğunda zorunlu) | Zorunlu: `"Premium installment details are required when InstallmentNumber is greater than 1."`  Boş olamaz: `"Premium installment details cannot be empty when InstallmentNumber is greater than 1."` |

### Taksit Detayı — `PremiumInstallmentDetailRequest`

| Alan                | Tip        | Zorunlu | Açıklama                    | Doğrulama Kuralları                                                                                                    |
| ------------------- | ---------- | ------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `InstallmentNumber` | `integer`  | Evet    | Toplam taksit sayısı        | Zorunlu: `"InstallmentNumber is required"`  0'dan büyük olmalı: `"InstallmentNumber must be greater than 0."`          |
| `InstallmentNo`     | `integer`  | Evet    | Taksit sıra numarası        | Zorunlu: `"InstallmentNo is required"`  0'dan büyük olmalı: `"InstallmentNo must be greater than 0."`                  |
| `PaymentAmount`     | `decimal`  | Evet    | Bu taksitin ödeme tutarı    | Zorunlu: `"PaymentAmount is required"`  0'dan büyük olmalı: `"PaymentAmount must be greater than 0."`                  |
| `Commission`        | `decimal`  | Evet    | Bu taksitin komisyon tutarı | Zorunlu: `"Commission is required."`  0'dan büyük veya eşit olmalı: `"Commission must be greater than or equal to 0."` |
| `PaymentDate`       | `datetime` | Evet    | Ödeme tarihi                | Zorunlu: `"PaymentDate is required"`  Boş olamaz: `"PaymentDate must not be empty."`                                   |

### PDF Dosyası — `PremiumFileRequest`

> Aşağıdaki alanlar yalnızca `OfferPdf` veya `InformationPdf` nesnesi gönderildiğinde zorunludur.

| Alan            | Tip      | Zorunlu | Açıklama                   | Doğrulama Kuralları                                                                                                                                                                                    |
| --------------- | -------- | ------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `FileName`      | `string` | Evet\*  | Dosya adı                  | Boş olamaz: `"FileName must not be empty."`  `.pdf` uzantısı olmalı: `"Only PDF files are allowed."`                                                                                                   |
| `ContentType`   | `string` | Evet\*  | MIME türü                  | Boş olamaz: `"ContentType must not be empty."`  `application/pdf` olmalı: `"ContentType must be 'application/pdf'."`                                                                                   |
| `Base64Content` | `string` | Evet\*  | Base64 kodlu dosya içeriği | Boş olamaz: `"Base64Content must not be empty."`  Geçerli Base64 olmalı: `"Base64Content must be a valid base64 encoded string."`  İçerik geçerli bir PDF olmalı: `"File content is not a valid PDF."` |

***

## Yanıt Formatı

### Başarılı Yanıt

**HTTP Durumu:** `201 Created`\
Yanıt gövdesi boştur.

### Hata Yanıtı

```json
{
    "Status": false,
    "Code": "Error.Code",
    "Message": "Error description",
    "Response": null
}

```

Doğrulama hatalarında `Response` alanı detayları içerir:

```json
{
    "Status": false,
    "Code": "Validation.General",
    "Message": "One or more validation errors occurred",
    "Response": [
        {
            "Field": "FieldName",
            "Message": "Error message description"
        }
    ]
}

```

***

## HTTP Durum Kodları

| Durum                       | Açıklama                                      |
| --------------------------- | --------------------------------------------- |
| `201 Created`               | Prim teklifi başarıyla oluşturuldu            |
| `400 Bad Request`           | Doğrulama hatası veya prim zaten mevcut       |
| `401 Unauthorized`          | Eksik, geçersiz veya süresi dolmuş token      |
| `403 Forbidden`             | Yetersiz yetki veya iş sahipliği reddedildi   |
| `404 Not Found`             | İş, teklif veya operation watch bulunamadı    |
| `500 Internal Server Error` | Platform servisi hatası veya beklenmeyen hata |

***

## Hata Kodları Referansı

| Kod                                     | HTTP Durumu | Mesaj                                                                                  |
| --------------------------------------- | ----------- | -------------------------------------------------------------------------------------- |
| `Validation.General`                    | 400         | One or more validation errors occurred                                                 |
| `OfflineUsers.InsuranceCompanyNotFound` | 403         | No valid insurance company assignment found in token.                                  |
| `OfflineUsers.UserIdentityNotResolved`  | 403         | User identity could not be resolved from token.                                        |
| `OfflineJobs.JobNotFound`               | 404         | No job found for the requested JobId.                                                  |
| `OfflineJobs.JobOwnershipDenied`        | 403         | You do not have permission to access this job.                                         |
| `JobState.ProposalNotFound`             | 404         | Proposal record not found for job \{jobId}.                                            |
| `JobState.OperationWatchNotFound`       | 404         | Operation Watch record not found for job \{jobId}.                                     |
| `JobState.PremiumAlreadyExists`         | 400         | Premium information already exists for job \{jobId}.                                   |
| `JobState.PlatformServiceFailure`       | 500         | Failed to write premium information to the platform service. Platform returned: \{msg} |
| `JobState.TransitionError`              | 500         | An unexpected error occurred during job state transition.                              |

***

Reference: https://docs.insurgateway.com/insurgateway-api/offline/create-premium

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://testgatewayapi.insurapps.net` (https://testgatewayapi.insurapps.net, default)
- `https://gatewayapi.insurapps.net` (https://gatewayapi.insurapps.net)

## Request

### Path parameters

- `jobId` (integer, required) — The unique identifier of the job to create a premium offer request for.

## Response

### 201

Created

## Errors

### 400 Bad Request Error

Bad Request

### 403 Forbidden Error

Forbidden

### 404 Not Found Error

Not Found

### 500 Internal Server Error

Internal Server Error

## Examples

**Request**

```json
{}
```

**Response**

```json
""
```

**SDK Code**

```python Offline_createPremium_example
import requests

url = "https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Offline_createPremium_example
const url = 'https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Offline_createPremium_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Offline_createPremium_example
require 'uri'
require 'net/http'

url = URI("https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java Offline_createPremium_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php Offline_createPremium_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Offline_createPremium_example
using RestSharp;

var client = new RestClient("https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Offline_createPremium_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://testgatewayapi.insurapps.net/api/offline/jobs/1/premiums")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```