العملاءتحديث عميل

تحديث عميل

يستبدل الحقول القابلة للتعديل في سجلّ العميل — مناسب للمزامنة الثنائية الاتجاه مع نظام CRM (ادفع التغييرات من نظام السجلّ لديك). مرّر service_area_id="" لإزالة منطقة الخدمة. تقع حقول العنوان (بما فيها latitude/longitude) داخل الكائن المتداخل `address`.

المعاملات

idstringpathمطلوب
معرّف العميل (UUID)
addressobjectbodyاختياري
العنوان البريدي والإحداثيات.
citystringbodyاختياري
City / locality. Max 100 chars.
countrystringbodyاختياري
Country (free-form or ISO code). Max 100 chars.
formattedstringbodyاختياري
Human-readable single-line address; when set it wins over the discrete parts for display. Max 500 chars.
latitudenumberbodyاختياري
Geographic latitude in decimal degrees (-90..90). Omit if unknown.
linestringbodyاختياري
Street address, line 1 (e.g. "123 Main St"). Max 255 chars.
line2stringbodyاختياري
Street address, line 2 (apartment, suite, unit). Max 255 chars.
longitudenumberbodyاختياري
Geographic longitude in decimal degrees (-180..180). Omit if unknown.
postal_codestringbodyاختياري
Postal / ZIP code. Max 32 chars.
statestringbodyاختياري
State / province / region. Max 100 chars.
emailstringbodyاختياري
عنوان البريد الإلكتروني.
full_namestringbodyمطلوب
الاسم الكامل للعميل. إلزامي؛ بحد أقصى 255 حرفًا.
notesstringbodyاختياري
ملاحظات داخلية حرّة عن العميل؛ بحد أقصى 4000 حرف.
phonestringbodyاختياري
رقم الهاتف. من 10 إلى 20 حرفًا.
preferred_technician_idstringbodyاختياري
قيمة UUID للفنّي الذي يفضّله هذا العميل. يجب أن يكون تابعًا لهذا النشاط التجاري.
service_area_idstringbodyاختياري
قيمة UUID لمنطقة الخدمة الخاصة بهذا العميل. يجب أن تكون تابعة لهذا النشاط التجاري.
sms_opt_inbooleanbodyاختياري
SMS consent, tri-state: omit/null = leave unchanged; true = grant (only when the customer explicitly consented — the original consent timestamp is preserved); false = revoke (opt-out, stops SMS immediately).
statusenumbodyاختياري
حالة دورة الحياة.
tierenumbodyاختياري
فئة الولاء.
uidstringbodyاختياري
مرجعك الخارجي لهذا العميل. اختياري؛ بحد أقصى 32 حرفًا.
PUT/v1/customers/{id}
curl -X PUT "https://api.crisphive.com/v1/customers/9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01" \
  -H "Authorization: Bearer chsk_test_4eC8xQ9mZ2pL7Ka0rT" \
  -H "Content-Type: application/json" \
  -d '{
  "address": {
    "city": "San Francisco",
    "country": "US",
    "formatted": "123 Market Street, San Francisco, CA 94103",
    "latitude": 1,
    "line": "123 Market Street",
    "line2": "Suite 200",
    "longitude": 1,
    "postal_code": "94103",
    "state": "CA"
  },
  "email": "jane.doe@example.com",
  "full_name": "Jane Cooper",
  "notes": "Please call on arrival.",
  "phone": "+14155550142",
  "preferred_technician_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
  "service_area_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01",
  "sms_opt_in": true,
  "status": "active",
  "tier": "regular",
  "uid": "CRM-10293"
}'
نص الطلب
{
"address": {
"city": ,
"country": ,
"formatted": ,
"latitude": ,
"line": ,
"line2": ,
"longitude": ,
"postal_code": ,
"state":
},
"email": ,
"full_name": ,
"notes": ,
"phone": ,
"preferred_technician_id": ,
"service_area_id": ,
"sms_opt_in": ,
"status": ,
"tier": ,
"uid":
}

الاستجابات