Ana içeriğe geç

Müşteri Detaylarını Güncelle

Müşteri detaylarını günceller.

Endpoint

PUT /api/v1/customers/\{uuid\}/details
PATCH /api/v1/customers/\{uuid\}/details

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • customer.details.update - Tüm müşteri detaylarını güncelleme
  • customer.details.update.own - Sadece kendi müşteri detaylarını güncelleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet
Content-Typeapplication/jsonEvet

Path Parameters

ParametreTipZorunluAçıklama
uuidstringEvetMüşteri UUID'si

Request Body

ParametreTipZorunluAçıklama
annual_revenuenumberHayırYıllık gelir
annual_revenue_currencystringHayırYıllık gelir para birimi
employee_countintegerHayırÇalışan sayısı
industrystringHayırSektör
websitestringHayırWeb sitesi
addressstringHayırAdres
is_activebooleanHayırAktif durumu

Example Request

{
"annual_revenue": 2000000,
"annual_revenue_currency": "USD",
"employee_count": 100,
"industry": "Technology",
"website": "https://example.com"
}

Response

Success Response (200 OK)

{
"id": 1,
"customer_id": 1,
"annual_revenue": 2000000,
"annual_revenue_currency": "USD",
"annual_revenue_converted": 60000000,
"annual_revenue_currency_converted": "TRY",
"employee_count": 100,
"industry": "Technology",
"website": "https://example.com",
"is_active": true,
"updated_at": "2025-11-20T12:00:00.000000Z"
}

Error Responses

404 Not Found

{
"message": "Customer not found"
}

403 Forbidden

{
"message": "Forbidden"
}

Code Examples

cURL

curl -X PATCH https://api.example.com/api/v1/customers/550e8400-e29b-41d4-a716-446655440000/details \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"annual_revenue": 2000000,
"annual_revenue_currency": "USD",
"employee_count": 100
}'

Notes

  • Müşteri detayı yoksa otomatik olarak oluşturulur
  • Yıllık gelir kullanıcının para birimi tercihine göre dönüştürülür
  • PUT tüm alanları günceller, PATCH sadece gönderilen alanları günceller