简要描述:

  • 新增客户

请求URL:

  • /api/v2/customers

请求方式:

  • POST

请求头:

请求参数:

字段名 是否必填 描述
refer_lead_id false 线索转客户时,线索的ID。
customer[approve_status] false 开启客户审批时为applying, 未开启为approved, 是否开启审批查看 GET /api/v2/permissions 接口里的customer_approve
customer[user_id] true 负责人id
customer[parent_id] false 上级客户id.
customer[name] true 客户名称
customer[note] false 备注
customer[status] false 跟进状态 值为/api/v2/field_maps/customer 返回值
customer[category] true 客户类型 值为 /api/v2/field_maps/customer 返回值
customer[source] true 客户来源 值为/api/v2/field_maps/customer 返回值
customer[industry] false 行业 值为/api/v2/field_maps/customer 返回值
customer[staff_size] false 员工人数
customer[want_department_id] true 所属部门
customer[address_attributes][detail_address] false 地址详情
customer[address_attributes][tel] false 电话
customer[address_attributes][url] false 这是 [url]
customer[address_attributes][country_id] false 国家id
customer[address_attributes][province_id] false 省id
customer[address_attributes][city_id] false 城市id
customer[address_attributes][district_id] false 区域id
customer[address_attributes][zip] false 邮编
customer[address_attributes][fax] false 传真
customer[address_attributes][qq] false qq
customer[address_attributes][wechat] false 微信
customer[address_attributes][wangwang] false wangwang
customer[address_attributes][phone] false 手机
customer[address_attributes][email] false 邮箱
customer[contacts_attributes][0][name] false 联系人姓名, 这里可以传多个联系人
customer[opportunities_attributes][0][title] false 商机标题, 这里可以传多个商机
customer[contacts_attributes][address_attributes][name] false 客户下联系人地址 这里可以传多个联系人
customer[labels][] false 客户标签 这里可以传多个标签
customer[custom_field_template_id] false 业务类型id
customer[assist_user_ids] false 协作人

请求参数json例子:

{
  "customer": {
    "name": "测试客111户3",
    "address_attributes": {
      "url": "www.baidu.com"
    },
    "contacts_attributes": [
      {
        "name": "211111122",
        "address_attributes": {
          "tel": "183",
          "wangwang": "222"
        }
      }
    ]
  }
}

返回示例:

正确时返回:


{
  "code": 0,
  "data": {
    "id": 18,
    "name": "贸易公司",
    "status": "7",
    "status_mapped": "初访",
    "note": "主营外贸销售,代理国外一线品牌",
    "category": "",
    "category_mapped": "",
    "source": "",
    "source_mapped": "",
    "industry": "",
    "industry_mapped": "",
    "staff_size": 0,
    "staff_size_display": "",
    "staff_size_mapped": "",
    "created_at": "2015-07-03 17:31",
    "updated_at": "2015-09-24 16:48",
    "is_own": true,
    "attachments": "暂无附件",
    "company_name": "",
    "text_asset_9320d8d7": "",
    "text_asset_22503a16": "",
    "numeric_asset_e2955b70": 123,
    "numeric_asset_8ea55cf0": 1.1,
    "is_has_policy_for_assist_user": true,
    "address": {
      "id": 1076,
      "country": {
        "id": 4,
        "name": "中国",
        "pinyin": null
      },
      "province": {},
      "city": {},
      "district": {},
      "tel": "010-64881989",
      "phone": "",
      "email": "zhaoning@web.com",
      "qq": "18888896",
      "fax": "",
      "wechat": "weixinsadfasw",
      "wangwang": "288888897",
      "zip": "100008",
      "url": "",
      "detail_address": "北京市朝阳区朝阳门外大街18号丰联广场A座第9层",
      "lat": 0,
      "lng": 0,
      "distance": "0m",
      "region_info": "中国",
      "off_distance": 0,
      "country_id": 0,
      "province_id": 0,
      "city_id": 0,
      "district_id": 0
    },
    "user": {
      "id": 2,
      "email": "wp@qq.com",
      "created_at": "2015-06-10T11:06:45.000+08:00",
      "name": "test",
      "organization_id": 1,
      "phone": "15921076830",
      "role_id": 0,
      "workflow_state": "organization_staff",
      "job": "",
      "tel": "",
      "gender": "male",
      "avatar_url": "http://192.168.10.99:3000/assets/male.jpg",
      "confirmed_phone_at": ""
    },
    "owned_department": {
      "id": 2,
      "name": "销售部"
    }
  }
}

错误时返回:


{
  "code": 100000,
  "message": "device参数错误",
  "error": "invalid_app_error"
}

返回参数说明:

暂无

备注:

文档更新时间: 2025-04-29 14:18   作者:陈胜海