订单服务 API

订单服务API围绕订单业务数据提供服务,请先创建应用申请 auth_order(授权订单模块)scope并获取审批后再使用。

1、创建企业主帐号

请求

POST http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/bind?g_nonce=xxx

说明

创建授权客户,并将授权客户和企业主账号进行绑定。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串

body 参数

参数名 必选 类型 描述
channelCode 是 String 渠道编码
channelCustomerId 是 String 渠道客户编码
customerName 是 String 客户名称
branchName 是 String 分支名称
enterpriseName 是 String 企业主账号名称
passwordMobile 是 String 密保手机

示例

{   
    "channelCode": "xxx",
    "channelCustomerId": "xxx",
    "customerName": "xxx",
    "branchName": "xxx",
    "enterpriseName": "xxx",
    "passwordMobile": "xxx"   
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/bind?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": {
        "customerId": "客户ID,string",
        "channelCode": "渠道编码,string",
        "channelCustomerId": "渠道客户ID,string",
        "enterpriseGlobalId": "企业账号globalID,string",
        "enterpriseName": "企业主账号名称,string",
        "isDefault": "是否是默认客户,bool"
    }
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

2、创建工信客户

请求

POST http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/create?g_nonce=xxx

说明

创建企业主账号,包含:默认客户,工信客户,工信管理员与对应的普通云授权员工。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串

body 参数

参数名 必选 类型 描述
crmCustomerId 是 String CRM客户ID
customerName 是 String 客户名称
branchName 是 String 分支名称
address 否 String 地址

示例

{   
    "crmCustomerId": "xxx",
    "customerName": "xxx",
    "branchName": "xxx",
    "address": "xxx"  
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/create?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": {
        "enterpriseGlobalId": "企业账号globalID,string",
        "defaultType": "是否默认客户,bool",
        "members": [
            {
               "memberGlobalId":"员工globalID,string",
               "memberIdentity":"员工identity,string"
            }
        ]
    }
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

3、查询企业主账号

请求

GET http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/query?g_nonce=xxx&channelCode=xxx&channelCustomerId=xxx&defaultCustomer=xxx

说明

根据渠道编码和渠道客户编码查询企业主账号。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串
channelCode 是 String 渠道code
channelCustomerId 是 String 渠道客户ID
defaultCustomer 是 String 是否只查询默认客户,Y标识只查询默认客户,N标识查询所有客户

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/query?g_nonce=xxx&channelCode=xxx&channelCustomerId=xxx&defaultCustomer=Y")
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": [
        {
            "customerId": "授权平台客户id,string",
            "channelCode": "渠道编码,string",
            "channelCustomerId": "渠道客户编码,string",
            "enterpriseGlobalId": "企业主账号globalId,string",
            "enterpriseName": "企业主账号名称,string",
            "isDefault": "是否默认客户,bool"
        }
    ]
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

4、修改企业客户信息

请求

POST http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/update?g_nonce=xxx

说明

修改CRM企业客户对应的授权企业客户信息,包括客户名称和地址。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串

body 参数

参数名 必选 类型 描述
crmCustomerId 是 String CRM客户ID
customerName 是 String 客户名称
branchName 是 String 分支名称
address 否 String 地址

示例

{   
    "crmCustomerId": "xxx",
    "customerName": "xxx",
    "branchName": "xxx",
    "address": "xxx"  
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/enterprise/user/update?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "code": 0,
    "message": "success"
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

5、批量创建基本授权订单

请求

POST http://apigate.noijoi.cn/order/api/order/v1/licenseOrder/batchOrder?appKey=xxx&g_nonce=xxx

说明

一次性创建多个基本授权订单进行处理。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
appKey 是 String 接入方的appKey
g_nonce 是 String 防重放随机串

body 参数

参数名 必选 类型 描述
channelCode 是 String 渠道编码
channelOrderId 是 String 客户订单编号
syncMode 是 String 订单处理模式(sync/async)
orderList 是 对象数组 订单集合
订单报文
参数名 必选 类型 描述
sequence 是 Integer 订单次序
customerId 是 String 授权平台客户id
crmCustomerId 是 String crm客户编号
customerName 是 String 渠道客户名称
channelCustomerId 是 String 渠道客户编号
adminName 是 String 管理员姓名
adminAccount 是 String 管理员账号
adminEmail 是 String 管理员邮箱
adminCellNumber 是 String 管理员手机号
passwordMobile 是 String 购买人手机号
address 是 String 客户地址
customerType 是 String 客户类型 个人:personal 企业:company
branchCode 是 String 分支编码
branchName 是 String 分支名称
enterpriseGlobalId 是 String 企业主账号globalId
srcLicenseOrderId 否 String 原授权订单号(该字段用来标识退单要删除的订单中的产品,如果该值为空,将删除该客户下所有订单中指定的产品,为了防止删除产品有误,该值无特殊情况,请填写;注意:当授权类型为云授权时,该字段必填。)
licenseType 是 String 授权类型:normal_unrecover_usbkey(‘单机不可补锁’), normal_recover_usbkey(‘单机可补锁’),normal_unrecover_lan_usbkey(‘网络不可补锁’),normal_recover_lan_usbkey(‘网络可补锁’),identity_usbkey(‘单机身份锁’),identity_lan_usbkey(‘网络身份锁’),softkey(‘单机证书’),lan_softkey(‘网络证书’),product_entity(‘产品实体’),cloud_account(‘云账号’),cloud_customer(‘企业云账号授权’),cloud_personal(‘个人云账号授权’),lk_product_usbkey(‘产品锁’),lk_auth_usbkey(‘登录锁’)
orderType 是 String 授权订单类型:new_buy(‘新购’), delete_asset(‘撤销资产’), delete_product(‘撤销产品’)
assets 是 对象数组 资产集合
资产报文
参数名 必选 类型 描述
assetNos 是 String 数组 资产编号
assetExtendList 否 对象数组 资产扩展属性集合
limitStartDate 否 Long 资产限制开始时间
limitEndDate 否 Long 资产限制结束时间
borrowedUsbKey 否 Boolean 借出锁标识(true/false)
transferedAssetNum 否 Boolean 转移资产编号标识(true/false)
products 否 对象数组 产品集合,该字段仅在授权订单类型为delete_asset时可置空
merchandises 否 对象数组 商品集合
资产扩展属性报文
参数名 必选 类型 描述
extendCode 否 String 特征码
extendValue 否 String 特征值
产品报文
参数名 必选 类型 描述
crmProductId 是 String CRM产品实例标识
parentCrmProductId 是 String CRM产品实例标识
productUri 是 String 产品ID:gmsPid或appKey
productName 是 String 产品名称
gmsPid 否 String 产品标识
appKey 否 String 产品标识
productType 是 String 产品类型
limitStartDate 否 Long 产品生效时间
limitEndDate 否 Long 产品失效时间
limitConcurrent 是 Integer 并发节点数
limitTimeDuration 是 Long 累计使用时长
strictMatchWhenDelete 是 Boolean 删除产品的时候,是否精确匹配,匹配时间和节点数,true:精确匹配,false:按照产品助记符匹配,默认值:false
trial 是 Integer 是否试用 0:否 1:是
trialEndDate 是 Integer 试用失效时间
passwords 否 String 数组 锁中许可的密码
timeUnit 是 String 时间单位
timeUnitQuantity 是 Integer 单位数量
timeDurationExpression 是 String 时间表达式 y-m-d
srcLicenseOrderId 否 String 原授权订单号,新购时填写,表示:该产品从其他订单下转移而来
productFeatures 是 对象数组 产品特征集合
产品特征报文
参数名 必选 类型 描述
featureCode 是 String 功能点编码
featureName 是 String 功能点名称
featureValue 是 String 功能点值
featureValueType 是 String 功能点值类型
trial 是 Integer 是否试用 0 非试用 1试用
trialEndDate 是 Date 试用结束时间
商品报文
参数名 必选 类型 描述
crmProductId 是 String CRM产品包实例Id
parentCrmProductId 是 String CRM父产品包实例Id
merchandiseNum 是 String 产品包编号
merchandiseName 是 String 产品包名称
parentMerchandiseNum 是 String 父产品包编号
timeDurationExpression 是 String 商品时间表达式
children 否 对象数组 下层商品集合
licenseOrderProductList 是 对象数组 商品包含的产品集合

示例

{
    "channelCode": "string,渠道编码",
    "channelOrderId": "string,客户订单编号",
    "syncMode": "string,订单处理模式(sync/async)",
    "orderList": [
        {
            "sequence": "int,订单次序",
            "customerId": "授权平台客户id",
            "crmCustomerId": "crm客户编号",
            "customerName": "string,渠道客户名称",
            "channelCustomerId": "string,渠道客户编号",
            "adminName": "string,管理员姓名",
            "adminAccount": "string,管理员账号",
            "adminEmail": "string,管理员邮箱",
            "adminCellNumber": "string,管理员手机号",
            "passwordMobile": "string,购买人手机号",
            "address": "string,客户地址",
            "customerType": "string,客户类型 个人:personal 企业:company",
            "branchCode": "string,分支编码",
            "branchName": "string,分支名称",
            "enterpriseGlobalId": "string,企业主账号globalId",
            "licenseType": "string,授权类型:normal_unrecover_usbkey('单机不可补锁'), normal_recover_usbkey('单机可补锁'),normal_unrecover_lan_usbkey('网络不可补锁'),normal_recover_lan_usbkey('网络可补锁'),identity_usbkey('单机身份锁'),identity_lan_usbkey('网络身份锁'),softkey('单机证书'),lan_softkey('网络证书'),product_entity('产品实体'),cloud_account('云账号'),cloud_customer('企业云账号授权'),cloud_personal('个人云账号授权'),lk_product_usbkey('产品锁'),lk_auth_usbkey('登录锁')",
            "orderType": "string,授权订单类型:new_buy('新购'), delete_asset('撤销资产'), delete_product('撤销产品')",
            "assets": [
                {
                    "assetNos": [
                        "资产编号1",
                        "资产编号2"
                    ],
                    "assetExtendList": [
                        {
                            "extendCode": "string,特征码",
                            "extendValue": "string,特征值"
                        }
                    ],
                    "limitStartDate": "long,资产限制开始时间",
                    "limitEndDate": "long,资产限制结束时间",
                    "borrowedUsbKey": "boolean, 借出锁标识(true/false)",
                    "transferedAssetNum": "boolean, 转移资产编号标识(true/false)",
                    "products": [
                        {
                            "crmProductId": "string,CRM产品实例标识",
                            "parentCrmProductId": "string,资产实例标识",
                            "productUri": "string,单产品ID:gmsPid或appKey",
                            "productName": "string,单产品名",
                            "gmsPid": "string,gmsPid",
                            "appKey": "string,appKey",
                            "productType": "string,产品类型",
                            "limitStartDate": "long,产品生效时间,可以为空",
                            "limitEndDate": "long,产品失效时间,可以为空",
                            "limitConcurrent": "int,并发节点数",
                            "limitTimeDuration": "long,累计使用时长",
                            "trial": "int:是否试用 0:否 1:是",
                            "trialEndDate": "int:试用失效时间",
                            "passwords": [
                                "string,锁中许可的密码"
                            ],
                            "timeUnit": "string,时间单位",
                            "timeUnitQuantity": "int,单位数量",
                            "timeDurationExpression": "string,时间表达式 y-m-d,建议传时间长度",
                            "srcLicenseOrderId": "原授权订单号, 新购时填写, 标识: 该产品从其他订单下转移而来. 如果没有转换需求, 该字段请不要填写",
                            "productFeatures": [
                                {
                                    "featureCode": "string,功能点编码",
                                    "featureName": "string,功能点名称",
                                    "featureValue": "string,功能点值",
                                    "featureValueType": "string,功能点值类型",
                                    "trial": "int,是否试用 0 非试用 1试用",
                                    "trialEndDate": "Date,试用结束时间"
                                }
                            ]
                        }
                    ],
                    "merchandises": [
                        {
                            "crmProductId": "string,CRM产品包实例Id",
                            "parentCrmProductId": "string,CRM父产品包实例Id",
                            "merchandiseNum": "string,产品包编号",
                            "merchandiseName": "string,产品包名称",
                            "parentMerchandiseNum": "string,父产品包编号",
                            "timeDurationExpression": "string,商品时间表达式",
                            "children": [
                                {
                                    "crmProductId": "string,CRM产品包实例Id",
                                    "parentCrmProductId": "string,CRM父产品包实例Id",
                                    "merchandiseNum": "string,产品包编号",
                                    "merchandiseName": "string,产品包名称",
                                    "parentMerchandiseNum": "string,父产品包编号",
                                    "timeDurationExpression": "string,商品时间表达式",
                                    "children": null,
                                    "licenseOrderProductList": [
                                        {
                                            "crmProductId": "string,CRM产品实例标识",
                                            "parentCrmProductId": "string,资产实例标识",
                                            "productUri": "string,单产品ID:gmsPid或appKey",
                                            "productName": "string,单产品名",
                                            "gmsPid": "string,gmsPid",
                                            "appKey": "string,appKey",
                                            "productType": "string,产品类型",
                                            "limitStartDate": "long,产品生效时间,可以为空",
                                            "limitEndDate": "long,产品失效时间,可以为空",
                                            "limitConcurrent": "int,并发节点数",
                                            "limitTimeDuration": "long,累计使用时长",
                                            "trial": "int:是否试用 0:否 1:是",
                                            "trialEndDate": "int:试用失效时间",
                                            "passwords": [
                                                "string,锁中许可的密码"
                                            ],
                                            "timeUnit": "string,时间单位",
                                            "timeUnitQuantity": "int,单位数量",
                                            "timeDurationExpression": "string,时间表达式 y-m-d,建议传时间长度",
                                            "srcLicenseOrderId": "原授权订单号, 新购时填写, 标识: 该产品从其他订单下转移而来. 如果没有转换需求, 该字段请不要填写",
                                            "productFeatures": [
                                                {
                                                    "featureCode": "string,功能点编码",
                                                    "featureName": "string,功能点名称",
                                                    "featureValue": "string,功能点值",
                                                    "featureValueType": "string,功能点值类型",
                                                    "trial": "int,是否试用 0 非试用 1试用",
                                                    "trialEndDate": "Date,试用结束时间"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "sequence": "int,订单次序",
            "customerName": "string,渠道客户名称",
            "channelCustomerId": "string,渠道客户编号",
            "adminName": "string,管理员姓名",
            "adminAccount": "string,管理员账号",
            "adminEmail": "string,管理员邮箱",
            "adminCellNumber": "string,管理员手机号",
            "customerType": "string,客户类型 个人:personal 企业:company",
            "branchCode": "string,分支编码",
            "branchName": "string,分支名称",
            "enterpriseGlobalId": "string,企业主账号globalId",
            "srcLicenseOrderId": "string, 原授权订单号(该字段用来标识退单要删除的订单中的产品, 如果该值为空, 将删除该客户下所有订单中指定的产品, 为了防止删除产品有误, 该值无特殊情况, 请填写;  注意: 当授权类型为云授权时, 该字段必填.)",
            "licenseType": "string,授权类型:normal_unrecover_usbkey('单机不可补锁'), normal_recover_usbkey('单机可补锁'),normal_unrecover_lan_usbkey('网络不可补锁'),normal_recover_lan_usbkey('网络可补锁'),identity_usbkey('单机身份锁'),identity_lan_usbkey('网络身份锁'),softkey('单机证书'),lan_softkey('网络证书'),product_entity('产品实体'),cloud_account('云账号'),cloud_customer('企业云账号授权'),cloud_personal('个人云账号授权'),lk_product_usbkey('产品锁'),lk_auth_usbkey('登录锁')",
            "orderType": "delete_asset",
            "assets": [
                {
                    "assetNos": [
                        "资产编号1",
                        "资产编号2"
                    ]
                }
            ]
        },
        {
            "sequence": "int,订单次序",
            "customerName": "string,渠道客户名称",
            "channelCustomerId": "string,渠道客户编号",
            "adminName": "string,管理员姓名",
            "adminAccount": "string,管理员账号",
            "adminEmail": "string,管理员邮箱",
            "adminCellNumber": "string,管理员手机号",
            "customerType": "string,客户类型 个人:personal 企业:company",
            "branchCode": "string,分支编码",
            "branchName": "string,分支名称",
            "enterpriseGlobalId": "string,企业主账号globalId",
            "licenseType": "string,授权类型:normal_unrecover_usbkey('单机不可补锁'), normal_recover_usbkey('单机可补锁'),normal_unrecover_lan_usbkey('网络不可补锁'),normal_recover_lan_usbkey('网络可补锁'),identity_usbkey('单机身份锁'),identity_lan_usbkey('网络身份锁'),softkey('单机证书'),lan_softkey('网络证书'),product_entity('产品实体'),cloud_account('云账号'),cloud_customer('企业云账号授权'),cloud_personal('个人云账号授权'),lk_product_usbkey('产品锁'),lk_auth_usbkey('登录锁')",
            "orderType": "delete_product",
            "srcLicenseOrderId": "string, 原授权订单号(该字段用来标识退单要删除的订单中的产品, 如果该值为空, 将删除该客户下所有订单中指定的产品, 为了防止删除产品有误, 该值无特殊情况, 请填写)",
            "assets": [
                {
                    "assetNos": [
                        "资产编号1",
                        "资产编号2"
                    ],
                    "limitStartDate": "long,资产限制开始时间",
                    "limitEndDate": "long,资产限制结束时间",
                    "products": [
                        {
                            "crmProductId": "string,CRM产品实例标识",
                            "productUri": "单产品ID:gmsPid或appKey",
                            "limitStartDate": "long,产品生效时间,可以为空, 当开启严格删除模式后, 将匹配该值",
                            "limitEndDate": "long,产品失效时间,可以为空, 当开启严格删除模式后, 将匹配该值",
                            "limitConcurrent": "int,并发节点数, 当开启严格删除模式后, 将匹配该值",
                            "strictMatchWhenDelete": "boolean, 删除产品的时候, 是否精确匹配, 匹配时间和节点数, true: 精确匹配, false: 按照产品助记符匹配, 默认值: false"
                        }
                    ]
                }
            ]
        }
    ]
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/licenseOrder/batchOrder?appKey=xxx&g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": [
        {
            "sequence": "序号,int",
            "licenseOrderId": "授权订单id,string",
            "customerId": "授权客户id,string"
        },
        {
            "sequence": "序号,int",
            "licenseOrderId": "授权订单id,string",
            "customerId": "授权客户id,string"
        }
    ]
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

6、批量禁用实体锁

请求

POST http://apigate.noijoi.cn/order/api/order/v1/asset/lock?g_nonce=xxx

说明

批量禁用实体锁,只能禁用可补锁和大客户锁。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串

body 参数

参数名 必选 类型 描述
assetNums 是 String 数组 待操作的锁号数组
operatorIdentity 是 String 操作者身份标识(姓名、手机号、邮箱均可)

示例

{
    "assetNums": [
        "锁号,string",
        "锁号,string"
    ],
    "operatorIdentity": "操作者身份标识(姓名、手机号、邮箱均可),string"
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/asset/lock?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "message": "success",
    "code": 0,
    "data": [
        {
            "assetNum": "锁号1",
            "status": "int,1:禁用成功 2:锁不存在 3:禁用失败  4: 锁类型不正确"
        },
        {
            "assetNum": "锁号2",
            "status": "int,1:禁用成功 2:锁不存在 3:禁用失败  4: 锁类型不正确"
        }
    ]
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

7、批量启用实体锁

请求

POST http://apigate.noijoi.cn/order/api/order/v1/asset/unlock?g_nonce=xxx

说明

批量启用实体锁,只能启用可补锁和大客户锁。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串

body 参数

参数名 必选 类型 描述
assetNums 是 String 数组 待操作的锁号数组
operatorIdentity 是 String 操作者身份标识(姓名、手机号、邮箱均可)

示例

{
    "assetNums": [
        "锁号,string",
        "锁号,string"
    ],
    "operatorIdentity": "操作者身份标识(姓名、手机号、邮箱均可),string"
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/asset/unlock?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "message": "success",
    "code": 0,
    "data": [
        {
            "assetNum": "锁号1",
            "status": "int,1:禁用成功 2:锁不存在 3:禁用失败  4: 锁类型不正确"
        },
        {
            "assetNum": "锁号2",
            "status": "int,1:禁用成功 2:锁不存在 3:禁用失败  4: 锁类型不正确"
        }
    ]
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

8、查询企业虚拟资产

请求

GET http://apigate.noijoi.cn/order/api/order/v1/asset/{enterpriseGlobalId}/list?g_nonce=xxx&extendCode=xxx

说明

根据企业主账号查询企业下企业云账号授权对应的资产。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

path 参数

参数名 必选 类型 描述
enterpriseGlobalId 是 String 企业主账号GlobalID

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串
extendCode 否 String 要查询的扩展属性编码

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/asset/{enterpriseGlobalId}/list?g_nonce=xxx&extendCode=xxx")
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": [
        {
            "id": "string,资产id,唯一标识",
            "licenseType": "string,授权类型",
            "assetNum": "string,资产编号",
            "grantable": "boolean,是否为授权对象",
            "customerId": "string,客户id",
            "keyShellNumber": "string,资产编号数字部分",
            "keyChipType": "int,锁芯片类型,1:4代锁 2:5代锁",
            "locked": "boolean,是否锁定",
            "freezing": "boolean,是否冻结,目前只有证书授权有用",
            "createTime": "long,创建时间",
            "updateTime": "long,更新时间",
            "limitStartTime": "long,资产生效时间,可以为空,大客户锁有用",
            "limitEndTime": "long,资产失效时间,可以为空",
            "assignStatus": {
                "id": "string,资产id",
                "assignStatus": "string,分配状态,大客户锁有用",
                "assignMemberId": "string,分配员工id",
                "createTime": "string,资产分配时间",
                "updateTime": null
            },
            "assetLimits": null,
            "assetExtends": [
                {
                    "extendCode": "string, 资产扩展项key, 工信新品:gxxp",
                    "extendValue": "string, 资产扩展项value,工信新品:gxxp"
                }
            ],
            "borrowedUsbKey": "boolean,是否为借出锁"
        }
    ]
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

9、获取资产编号

请求

POST http://apigate.noijoi.cn/order/api/order/v1/shellnums?g_nonce=xxx

说明

批量获取多个资产编号对应的数字串,单个数字串长度为10,譬如:8000000001,首位代表分区标识,目前8表示国内,6表示新加坡,剩余9位自增。

header 参数

参数名 必选 类型 描述
Authorization 是 String Bearer app_access_token. 注:该 access_token 是应用级别
Content-Type 是 String application/json

query 参数

参数名 必选 类型 描述
g_nonce 是 String 防重放随机串

body 参数

参数名 必选 类型 描述
size 是 Integer 需要获取的资产编号数量

示例

{
    "size": "需要获取的资产编号数量,int"
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("http://apigate.noijoi.cn/order/api/order/v1/shellnums?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();

成功返回结果

{
    "message": "success",
    "code": 0,
    "data": [
        "string,资产编号数字部分",
        "string,资产编号数字部分",
        "string,资产编号数字部分",
        "string,资产编号数字部分"
    ]
}

异常返回结果

{"code":"13004","message":"具体的参数校验异常信息","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}