POST /store — Mağaza Oluşturma
📋 Genel Bilgi
Yeni bir mağaza kaydı oluşturur. Mağaza bilgileri (ad, kod, adres, şehir/ilçe) gönderilir.
Base URL: {{url}}/store
Method: POST
Content-Type: application/json
🔐 Headers
| Header | Value |
|---|---|
| Authorization | Bearer {{masked_jwt_5}} |
| Content-Type | application/json |
📥 Request Body
{
"name": "Mobildev HQ API",
"code": "mobildev-mq-api",
"address": "Lapis Han, 25, Erdoğan Sokak, Esentepe Mahallesi, Kartal, İstanbul, Marmara Bölgesi, 34870, Türkiye",
"phone": "444 0 554",
"cityId": 34,
"districtId": 440,
"neighborhood": "Esentepe Mahallesi",
"latitude": 40.91164357977882,
"longitude": 29.192971025276425,
"postalCode": "",
"status": "active"
}
Parametreler
| Alan | Tip | Zorunlu | Açıklama | Örnek |
|---|---|---|---|---|
name | string | ✅ | Mağaza adı | "Mobildev HQ API" |
code | string | ✅ | Benzersiz mağaza kodu | "mobildev-mq-api" |
address | string | ✅ | Tam adres bilgisi | - |
phone | string | ❌ | Telefon numarası | "444 0 554" |
cityId | integer | ✅ | İl ID'si (81'den biri) | 34 |
districtId | integer | ✅ | İlçe ID'si | 440 |
neighborhood | string | ❌ | Mahalle bilgisi | "Esentepe Mahallesi" |
latitude | float | ✅ | Enlem (WGS84) | 40.91164357977882 |
longitude | float | ✅ | Boylam (WGS84) | 29.192971025276425 |
postalCode | string | ❌ | Posta kodu | "" |
status | string | ❌ | Durum (active, inactive, closed) | "active" |
✅ Response — 200 OK
{
"storeKey": "ilt1sVDO"
}
Response Alanları
| Alan | Tip | Açıklama |
|---|---|---|
storeKey | string | Oluşturulan mağaza benzersiz anahtarı (8 karakter) |
❌ Error Responses
Tüm hata yanıtları aşağıdaki formatta döner:
{
"Response": {
"code": 3005,
"description": "A store with this code already exists"
},
"Success": false
}
| HTTP | code | Enum | description | Ne Zaman Oluşur |
|---|---|---|---|---|
| 400 | 3004 | StoreNameEmpty | Store name cannot be empty | name alanı boş gönderildi |
| 400 | 3001 | StoreCodeInvalid | Invalid store code | code alanı boş gönderildi |
| 409 | 3003 | StoreCodeExists | A store with this code already exists | Gönderilen code, aynı şirkette zaten kayıtlı başka bir mağazada kullanılıyor |
| 500 | 3007 | StoreCreateError | An error occurred while creating the store | INSERT sorgusu veritabanı seviyesinde başarısız olduğunda fırlatılır |
Örnek — 400 Store Name Empty
{
"Response": {
"code": 3004,
"description": "Store name cannot be empty"
},
"Success": false
}
Örnek — 400 Store Code Empty/Invalid
{
"Response": {
"code": 3001,
"description": "Invalid store code"
},
"Success": false
}
Örnek — 409 Store Code Exists
{
"Response": {
"code": 3003,
"description": "A store with this code already exists"
},
"Success": false
}
Örnek — 500 Store Create Error
{
"Response": {
"code": 3007,
"description": "An error occurred while creating the store"
},
"Success": false
}
📝 Notlar
codealanı benzersiz olmalıdır. Aynı kod ile mağaza oluşturulamaz.status: active→ Mağaza aktif, işlem yapılabilir.status: inactive→ Mağaza pasif, işlem yapılamaz.status: closed→ Mağaza kapalı.- Koordinatlar WGS84 formatındadır (GPS).
- Hata response'larındaki
codealanıAppErrorenum'undaki uygulama-içi hata kodudur (Response.code); tüm hata gövdesiResponseadlı bir alt obje içinde döner, en dışta ayrıcaSuccess: falsealanı bulunur.