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

alibaba.alsc.crm.open.customer.save (保存和更新顾客)

用来保存顾客,如果已经存在的话,则更新顾客

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param_customer_save_open_req CustomerSaveOpenReq 可选 入参
  • └ birthday
  • Date
  • 可选
  • 2010-01-01 00:00:00
  • 生日
  • └ brand_id
  • String
  • 必须
  • 244323
  • saas品牌id
  • └ channel
  • String
  • 必须
  • 2
  • 渠道 crm_back(1, "CRM后台"), pos(2, "POS"), mobile_shop(3, "个人中心"), wechat(4, "微信"), alipay(5, "支付宝"),所有pos端传2
  • └ gender
  • Number
  • 可选
  • 1
  • 性别 0女 1男,2其他
  • └ mobile
  • String
  • 可选
  • 18651822226
  • 手机号
  • └ name
  • String
  • 可选
  • 刘德华
  • 姓名
  • └ operator_id
  • String
  • 必须
  • 2392313
  • 操作人
  • └ outer_id
  • String
  • 可选
  • 2088328921390232323
  • 外部id
  • └ outer_type
  • String
  • 可选
  • alipay
  • 外部类型: wechat:微信openId alipay:支付宝
  • └ remark
  • String
  • 可选
  • 备注
  • 备注
  • └ request_id
  • String
  • 必须
  • 13239a4388b382c48d3
  • 请求幂等id
  • └ shop_id
  • String
  • 必须
  • 239923231
  • saas门店id

响应参数

名称 类型 示例值 描述
result CommonResult 接口结果
  • └ biz_success
  • Boolean
  • true
  • 是否成功
  • └ result
  • String
  • true
  • 结果,顾客id
  • └ result_code
  • String
  • 0
  • 结果码
  • └ result_desc
  • String
  • 成功
  • 结果详情
  • └ result_view
  • String
  • 成功
  • 结果显示

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAlscCrmOpenCustomerSaveRequest req = new AlibabaAlscCrmOpenCustomerSaveRequest();
AlibabaAlscCrmOpenCustomerSaveRequest.CustomerSaveOpenReq obj1 = new AlibabaAlscCrmOpenCustomerSaveRequest.CustomerSaveOpenReq();
obj1.setBirthday(StringUtils.parseDateTime("2010-01-01 00:00:00"));
obj1.setBrandId("244323");
obj1.setChannel("2");
obj1.setGender(1L);
obj1.setMobile("18651822226");
obj1.setName("刘德华");
obj1.setOperatorId("2392313");
obj1.setOuterId("2088328921390232323");
obj1.setOuterType("alipay");
obj1.setRemark("备注");
obj1.setRequestId("13239a4388b382c48d3");
obj1.setShopId("239923231");
req.setParamCustomerSaveOpenReq(obj1);
AlibabaAlscCrmOpenCustomerSaveResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_alsc_crm_open_customer_save_response>
    <result>
        <biz_success>true</biz_success>
        <result>true</result>
        <result_code>0</result_code>
        <result_desc>成功</result_desc>
        <result_view>成功</result_view>
    </result>
</alibaba_alsc_crm_open_customer_save_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

返回
顶部