# Preparation status

`GET https://ulawk.com/api/v1/sirketler/{sirket_id}/durum/`

Preparation stage of a newly added company: notices → gazette archive → profile. Poll every few minutes until `hazir`. Branch records report `sube` directly.

## Authentication

Two headers on every request: `X-API-Key` and `X-API-Secret`.

## Path parameters

- `sirket_id` (integer | string, required) — Company id (`id` from `/api/v1/sirketler/`).

## Response

### 200 — Preparation status.

- `sirket` (SirketOzet, zorunlu)
- `sirket.id` (integer | string, zorunlu) — Company id: numeric with a live key (e.g. 1234); a DENEME-… string with a sandbox key.
- `sirket.unvan` (string, null, zorunlu) — Registered name.
- `sirket.mudurluk` (string, null, zorunlu) — Registry office (e.g. İSTANBUL).
- `sirket.sicil_no` (string, null, zorunlu) — Trade registry number.
- `asama` (string, zorunlu) — ilanlar-cekiliyor → gazeteler-indiriliyor → profil-hazirlaniyor → hazir; sube for branches. Değerler: ilanlar-cekiliyor, gazeteler-indiriliyor, profil-hazirlaniyor, hazir, sube.
- `asama_adi` (string, zorunlu)
- `yuzde` (integer, zorunlu)
- `ilan_sayisi` (integer, zorunlu)
- `arsivdeki_gazete` (integer, zorunlu)
- `profil_hazir` (boolean, zorunlu)
- `guncelleme` (string (date-time), null, zorunlu)
- `profil` (string (uri), zorunlu)

```json
{
  "sirket": {
    "id": "DENEME-YAVAS",
    "unvan": "ÖRNEK DENEME YAVAŞ HAZIRLANAN TEKNOLOJİ ANONİM ŞİRKETİ",
    "mudurluk": "BURSA",
    "sicil_no": "DENEME-YAVAS"
  },
  "asama": "profil-hazirlaniyor",
  "asama_adi": "Profil hazırlanıyor",
  "yuzde": 60,
  "ilan_sayisi": 2,
  "arsivdeki_gazete": 0,
  "profil_hazir": false,
  "guncelleme": null,
  "profil": "https://ulawk.com/api/v1/sirketler/DENEME-YAVAS/"
}
```

### 404 — Not found or no access (`bulunamadi`).


```json
{
  "hata": "bulunamadi",
  "detay": "Şirket bulunamadı ya da erişim yetkiniz yok.",
  "hata_ayrinti": {
    "kod": "bulunamadi",
    "mesaj": "Şirket bulunamadı ya da erişim yetkiniz yok.",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": false,
    "tekrar_sn": null
  }
}
```

### 503 — The official source is unreachable right now (`kaynak_erisilemiyor`, taraf kaynak). Sandbox: DENEME-KAYNAK-KAPALI.

Retry-After: `300`

```json
{
  "hata": "kaynak_erisilemiyor",
  "detay": "Ticaret Sicili Gazetesi şu an yanıt vermiyor; kısa süre sonra yeniden deneyin. (Deneme ortamı benzetimi.)",
  "hata_ayrinti": {
    "kod": "kaynak_erisilemiyor",
    "mesaj": "Ticaret Sicili Gazetesi şu an yanıt vermiyor; kısa süre sonra yeniden deneyin. (Deneme ortamı benzetimi.)",
    "taraf": "kaynak",
    "kaynak": "ttsg",
    "tekrar_denenebilir": true,
    "tekrar_sn": 300
  }
}
```

### 401 — Missing or invalid key (`yetkisiz`).


```json
{
  "hata": "yetkisiz",
  "detay": "Geçerli X-API-Key başlığı gerekli (panel › API).",
  "hata_ayrinti": {
    "kod": "yetkisiz",
    "mesaj": "Geçerli X-API-Key başlığı gerekli (panel › API).",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": false,
    "tekrar_sn": null
  }
}
```

### 429 — Hourly rate limit exceeded (`hiz_siniri`); the Retry-After header gives the seconds until reset.

Retry-After: `2494`

```json
{
  "hata": "hiz_siniri",
  "detay": "Saatlik istek sınırı aşıldı (600). Bir sonraki saatte tekrar deneyin.",
  "hata_ayrinti": {
    "kod": "hiz_siniri",
    "mesaj": "Saatlik istek sınırı aşıldı (600). Bir sonraki saatte tekrar deneyin.",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": true,
    "tekrar_sn": 2494
  }
}
```

### 500 — Unexpected error (`ic_hata`, taraf ulawk); retry shortly.

Retry-After: `60`

```json
{
  "hata": "ic_hata",
  "detay": "Beklenmeyen bir hata oluştu; kısa süre sonra yeniden deneyin.",
  "hata_ayrinti": {
    "kod": "ic_hata",
    "mesaj": "Beklenmeyen bir hata oluştu; kısa süre sonra yeniden deneyin.",
    "taraf": "ulawk",
    "kaynak": null,
    "tekrar_denenebilir": true,
    "tekrar_sn": 60
  }
}
```

## Request

```bash
curl "https://ulawk.com/api/v1/sirketler/DENEME-YAVAS/durum/" \
  -H "X-API-Key: ulk_DENEME_ANAHTARINIZ" \
  -H "X-API-Secret: ulsk_DENEME_GIZLI_ANAHTARINIZ"
```
