crisphive
العملاءإنشاء عميل

إنشاء عميل

يضيف سجلّ عميل جديد إلى النشاط التجاري الحالي. يقع العنوان (street وcity وpostal_code وغيرها) والإحداثيات (latitude/longitude) داخل الكائن المتداخل `address`. يجب أن يكون service_area_id قيمة UUID لمنطقة خدمة صالحة تابعة لهذا النشاط التجاري.

المعاملات

addressobjectbodyاختياري
العنوان البريدي والإحداثيات.
citystringbodyاختياري
countrystringbodyاختياري
formattedstringbodyاختياري
latitudenumberbodyاختياري
linestringbodyاختياري
line2stringbodyاختياري
longitudenumberbodyاختياري
postal_codestringbodyاختياري
statestringbodyاختياري
emailstringbodyاختياري
عنوان البريد الإلكتروني. اختياري، لكن يلزم توفير أحد الحقلين phone/email على الأقل.
full_namestringbodyمطلوب
الاسم الكامل للعميل. إلزامي؛ بحد أقصى 255 حرفًا.
phonestringbodyاختياري
رقم الهاتف. اختياري، لكن يلزم توفير أحد الحقلين phone/email على الأقل؛ من 10 إلى 20 حرفًا.
preferred_technician_idstringbodyاختياري
قيمة UUID للفنّي الذي يفضّله هذا العميل. يجب أن يكون تابعًا لهذا النشاط التجاري.
service_area_idstringbodyاختياري
قيمة UUID لمنطقة الخدمة الخاصة بهذا العميل. يجب أن تكون تابعة لهذا النشاط التجاري.
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",
  "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": ,
"tier": ,
"uid":
}

الاستجابات