文档中心 > API类目 > 本地生活API

alibaba.alsc.crm.customer.create (创建顾客)

开放本地生活创建顾客功能

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param_customer_create_open_req CustomerCreateOpenReq 必须 创建顾客参数
  • └ address
  • String
  • 可选
  • 浙江省杭州市
  • 会员地址
  • └ birthday
  • Date
  • 可选
  • 2010-01-01 00:00:00
  • 生日
  • └ brand_id
  • String
  • 可选
  • 201903898665
  • 品牌ID 外部品牌id
  • └ channel
  • String
  • 必须
  • 2 表示pos
  • 渠道
  • └ customer_type
  • Number
  • 必须
  • 1
  • 顾客类型,1:会员,0:顾客
  • └ email
  • String
  • 可选
  • xxx@gmail.com
  • 邮箱
  • └ gender
  • String
  • 可选
  • 1
  • 性别 0女 1男
  • └ invoice
  • String
  • 可选
  • 口碑(杭州)电子商务有限公司
  • 发票
  • └ level_id
  • String
  • 可选
  • 1
  • 等级ID
  • └ mobile
  • String
  • 可选
  • 13411111111
  • 手机号
  • └ name
  • String
  • 可选
  • 王小二
  • 姓名
  • └ operator_id
  • String
  • 可选
  • 2019865534
  • 操作人ID
  • └ outer_id
  • String
  • 必须
  • 13411111111
  • 外部ID
  • └ outer_type
  • String
  • 必须
  • mobile
  • 外部ID类型
  • └ phone
  • String
  • 可选
  • 0571-87658765
  • 固定电话
  • └ remark
  • String
  • 可选
  • 老板的朋友
  • 备注
  • └ request_id
  • String
  • 必须
  • 234334534543234234
  • 请求ID,用于保障幂等性
  • └ shop_id
  • String
  • 可选
  • 2019093647836487563
  • 店铺ID
  • └ tag_id_list
  • String []
  • 可选
  • 爱吃辣
  • 标签列表
  • └ out_brand_id
  • String
  • 可选
  • 123
  • 外部品牌id
  • └ out_shop_id
  • String
  • 可选
  • 132
  • 外部门店id

响应参数

名称 类型 示例值 描述
result CommonResult 接口结果
  • └ result
  • String
  • 20193846534522344567
  • 顾客ID
  • └ result_code
  • String
  • 0
  • 返回结果码
  • └ result_desc
  • String
  • 处理成功
  • 返回结果简介
  • └ result_view
  • String
  • 处理成功
  • 返回结果描述
  • └ biz_success
  • Boolean
  • true
  • 调用是否成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAlscCrmCustomerCreateRequest req = new AlibabaAlscCrmCustomerCreateRequest();
AlibabaAlscCrmCustomerCreateRequest.CustomerCreateOpenReq obj1 = new AlibabaAlscCrmCustomerCreateRequest.CustomerCreateOpenReq();
obj1.setAddress("浙江省杭州市");
obj1.setBirthday(StringUtils.parseDateTime("2010-01-01 00:00:00"));
obj1.setBrandId("201903898665");
obj1.setChannel("2      表示pos");
obj1.setCustomerType(1L);
obj1.setEmail("xxx@gmail.com");
obj1.setGender("1");
obj1.setInvoice("口碑(杭州)电子商务有限公司");
obj1.setLevelId("1");
obj1.setMobile("13411111111");
obj1.setName("王小二");
obj1.setOperatorId("2019865534");
obj1.setOuterId("13411111111");
obj1.setOuterType("mobile");
obj1.setPhone("0571-87658765");
obj1.setRemark("老板的朋友");
obj1.setRequestId("234334534543234234");
obj1.setShopId("2019093647836487563");
obj1.setTagIdList("爱吃辣");
obj1.setOutBrandId("123");
obj1.setOutShopId("132");
req.setParamCustomerCreateOpenReq(obj1);
AlibabaAlscCrmCustomerCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_alsc_crm_customer_create_response>
    <result>
        <result>20193846534522344567</result>
        <result_code>0</result_code>
        <result_desc>处理成功</result_desc>
        <result_view>处理成功</result_view>
        <biz_success>true</biz_success>
    </result>
</alibaba_alsc_crm_customer_create_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部