العملاء›إنشاء عميل
إنشاء عميل
ينشئ سجلّ عميل — الملف التعريفي للعميل/الحساب الذي يُحجز عليه طلب العمل (أمر العمل)؛ استخدمه لاستيراد العملاء أو مزامنتهم من نظام CRM الخاص بك أو نموذج العملاء المحتملين في موقعك أو مسار الاستقبال لديك. يقع العنوان (street وcity وpostal_code وغيرها) والإحداثيات (latitude/longitude) داخل الكائن المتداخل `address`. يجب أن يكون service_area_id قيمة UUID لمنطقة خدمة صالحة تابعة لهذا النشاط التجاري.
المعاملات
Idempotency-Keystringheaderاختياري
Unique key making retries safe: a repeat send with the same key replays the original response (header Idempotent-Replayed: true) instead of re-running the operation. Reusing a key with a different body returns 422 IDEMPOTENCY_KEY_REUSE.
▾addressobjectbodyاختياري
العنوان البريدي والإحداثيات.
emailstringbodyاختياري
عنوان البريد الإلكتروني. اختياري، لكن يلزم توفير أحد الحقلين phone/email على الأقل.
full_namestringbodyمطلوب
الاسم الكامل للعميل. إلزامي؛ بحد أقصى 255 حرفًا.
phonestringbodyاختياري
رقم الهاتف. اختياري، لكن يلزم توفير أحد الحقلين phone/email على الأقل؛ من 10 إلى 20 حرفًا.
preferred_technician_idstringbodyاختياري
قيمة UUID للفنّي الذي يفضّله هذا العميل. يجب أن يكون تابعًا لهذا النشاط التجاري.
service_area_idstringbodyاختياري
قيمة UUID لمنطقة الخدمة الخاصة بهذا العميل. يجب أن تكون تابعة لهذا النشاط التجاري.
sms_opt_inbooleanbodyاختياري
SMS consent: set true ONLY when the customer explicitly agreed to receive
SMS (e.g. ticked a non-pre-checked consent box, or gave verbal/written
consent you keep a record of). SMS notifications are suppressed while false.
tierenumbodyاختياري
فئة الولاء. القيمة الافتراضية "regular" إذا أُغفلت.
uidstringbodyاختياري
مرجعك الخارجي لهذا العميل (المعرّف في نظامك الخاص). اختياري؛ بحد أقصى 32 حرفًا.
POST/v1/customers
curl -X POST "https://api.crisphive.com/v1/customers" \ -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", "phone": "+14155550142", "preferred_technician_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01", "service_area_id": "9b2f6c3e-1a4d-4f0a-8f2e-7c5d1b3a9e01", "sms_opt_in": true, "tier": "regular", "uid": "CRM-10293" }'
نص الطلب
{
"address": {
"city": ,
"country": ,
"formatted": ,
"latitude": ,
"line": ,
"line2": ,
"longitude": ,
"postal_code": ,
"state":
},
"email": ,
"full_name": ,
"phone": ,
"preferred_technician_id": ,
"service_area_id": ,
"sms_opt_in": ,
"tier": ,
"uid":
}
Bearer