Ana içeriğe geç

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

HeaderValue
AuthorizationBearer {{masked_jwt_5}}
Content-Typeapplication/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

AlanTipZorunluAçıklamaÖrnek
namestringMağaza adı"Mobildev HQ API"
codestringBenzersiz mağaza kodu"mobildev-mq-api"
addressstringTam adres bilgisi-
phonestringTelefon numarası"444 0 554"
cityIdintegerİl ID'si (81'den biri)34
districtIdintegerİlçe ID'si440
neighborhoodstringMahalle bilgisi"Esentepe Mahallesi"
latitudefloatEnlem (WGS84)40.91164357977882
longitudefloatBoylam (WGS84)29.192971025276425
postalCodestringPosta kodu""
statusstringDurum (active, inactive, closed)"active"

✅ Response — 200 OK

{
"storeKey": "ilt1sVDO"
}

Response Alanları

AlanTipAçıklama
storeKeystringOluş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
}
HTTPcodeEnumdescriptionNe Zaman Oluşur
4003004StoreNameEmptyStore name cannot be emptyname alanı boş gönderildi
4003001StoreCodeInvalidInvalid store codecode alanı boş gönderildi
4093003StoreCodeExistsA store with this code already existsGönderilen code, aynı şirkette zaten kayıtlı başka bir mağazada kullanılıyor
5003007StoreCreateErrorAn error occurred while creating the storeINSERT 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

  • code alanı 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 code alanı AppError enum'undaki uygulama-içi hata kodudur (Response.code); tüm hata gövdesi Response adlı bir alt obje içinde döner, en dışta ayrıca Success: false alanı bulunur.