批量同步接口

  • 接口:common/customers/v2/batch
  • Method:POST
  • 数据格式:JSON
  • 限流信息:30次每天
  • 多语言环境:在接口请求头中添加Key为locale,Value值为语言环境,目前支持的语言有zh_CN(中文)、en_US(英文)、ja_JP(日文)、zh_TW(繁体),请选取其中一种
  • 接口说明:该接口用作客户的批量同步,在整批数据中如果只有几条数据因为其他原因失败,那么只有这几条数据不会被处理,其他数据仍会被正常处理
  • 其他补充信息:单次数据量过大时候(超过200条)会全部转为异步处理,具体参考回调示例

参数:

请求参数

字段名称 字段类型 字段描述 是否必填 长度限制(字节)
bizId String 当前次接口同步的唯一标识 TRUE 36
timestamp long 当前次接口同步对应的时间戳 TRUE 13
data Array 当前次接口同步的数据集合 TRUE
data.code String 客户编码 TRUE 64
data.enabled_flag String 客户启用标志(Y/N,默认Y) FALSE 1
data.company_name String 公司名 FALSE 64
data.tax_number String 客户对应的唯一的纳税人识别号 FALSE 64
data.tax_address String 客户对应发票的开票地址 FALSE 64
data.phone String 客户对应的发票的开票联系电话 FALSE 64
data.bank_name String 客户唯一的开户银行名称 FALSE 64
data.account_number String 客户唯一的开户银行账号 FALSE 64
data.invoice_name String 商品开票名称 FALSE 64
data.description String 客户描述信息 FALSE 255
data.customer_name String 客户名称 TRUE 255
data.contact_person String 客户联系人 FALSE 64
data.contact_phone String 客户联系电话 FALSE 64
data.contact_address String 客户联系地址 FALSE 64
data.branch_code List 客户分公司权限(每次需传全量,为空时将置空) FALSE
column1-column10 String column字段信息 FALSE 255

返回参数

字段名称 字段类型 字段描述
bizId String 当前次接口同步的唯一标识
resCode Integer 响应状态码(见附录)
resMsg String 返回信息描述
created String 创建成功的条数
updated String 更新成功的条数
validatorErrors Array 字段强校验不合格的数据
dbErrors Array 数据持久化时出现错误的数据
warnings Array 字段弱校验不合格的数据,任会做同步处理

示例:

请求数据

{
  "bizId" : "3ec29478-daf8-467e-9640-9915e0aeac23",
  "timestamp" : 1592994599601,
  "data" : [ {
    "column1" : "自定义测试七",
    "city" : "city",
    "state" : "四川",
    "country" : "中国",
    "language" : "zh_CN",
    "code" : "test-customer7",
    "enabled_flag" : "Y",
    "customer_name" : "四川经济投资公司",
    "branch_code" : [ "B004" ],
    "contact_person" : "孙美美",
    "contact_phone" : "16756787678",
    "contact_address" : "西南大学"
  }, {
    "column1" : "自定义测试九",
    "city" : "city",
    "state" : "刚果",
    "country" : "中国",
    "language" : "zh_CN",
    "code" : "test-customer9",
    "enabled_flag" : "Y",
    "customer_name" : "刚果投资有限公司",
    "branch_code" : [ "B004" ],
    "contact_person" : "李么么",
    "contact_phone" : "16788887898",
    "contact_address" : "北京大学"
  } ]
}

返回数据

{
  "resCode" : 200000,
  "resMsg" : "success",
  "bizId" : "3ec29478-daf8-467e-9640-9915e0aeac23",
  "data" : {
    "validatorErrors" : [ ],
    "created" : "此次请求新建成功了0条数据",
    "warnings" : [ ],
    "dbErrors" : [ ],
    "updated" : "此次请求更新成功了2条数据"
  }
}

results matching ""

    No results matching ""