文档中心 > API类目 > 五道口API

wdk.hm.label.print (标签平台打印标签)

标签平台打印标签

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
print_request LabelPrintRequest 必须 请求参数
  • └ biz_type
  • String
  • 必须
  • pos
  • 业务类型
  • └ merchant_code
  • String
  • 必须
  • HM
  • 商家编码
  • └ shop_code
  • String
  • 可选
  • 8028
  • 门店编码(门店业务传入)
  • └ warehouse_code
  • String
  • 可选
  • W21
  • 仓编码(大仓业务传入)
  • └ supplier_id
  • String
  • 可选
  • 1000000004166378
  • 供应商ID(供应商业务传入)
  • └ sku_code
  • String
  • 必须
  • 100234019
  • 商品编码
  • └ print_count
  • Number
  • 可选
  • 1
  • 打印数量
  • └ data
  • String
  • 必须
  • {}
  • 标签数据

响应参数

名称 类型 示例值 描述
result LabelHsfResult {} 返回结果对象
  • └ code
  • String
  • SUCCESS
  • 返回错误码
  • └ msg
  • String
  • 成功
  • 返回错误描述
  • └ is_success
  • Boolean
  • true
  • 是否成功
  • data
  • LabelPrintDTO
  • {}
  • 返回标签数据
  • └ template_code
  • String
  • test
  • 标签模板Code
  • └ template_name
  • String
  • 测试模板
  • 标签模板名称
  • └ business_rule_code
  • String
  • test
  • 标签规则Code
  • └ business_rule_name
  • String
  • 测试规则
  • 标签规则名称
  • └ pic_path
  • String
  • https://test.png
  • 标签图片url
  • terminal_render_regions
  • TerminalRenderRegion []
  • []
  • 终端渲染区域
  • └ key
  • String
  • weight
  • 终端渲染字段名
  • └ x
  • Number
  • 100
  • x坐标(相对图片左上角像素数)
  • └ y
  • Number
  • 100
  • y坐标(相对图片左上角像素数)
  • └ width
  • Number
  • 50
  • 区域宽度(像素数)
  • └ height
  • Number
  • 20
  • 区域高度(像素数)
  • └ font_size
  • Number
  • 15
  • 字号
  • └ font_family
  • String
  • 微软雅黑
  • 字体
  • └ font_color
  • String
  • 000000
  • 字体颜色

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
WdkHmLabelPrintRequest req = new WdkHmLabelPrintRequest();
WdkHmLabelPrintRequest.LabelPrintRequest obj1 = new WdkHmLabelPrintRequest.LabelPrintRequest();
obj1.setBizType("pos");
obj1.setMerchantCode("HM");
obj1.setShopCode("8028");
obj1.setWarehouseCode("W21");
obj1.setSupplierId("1000000004166378");
obj1.setSkuCode("100234019");
obj1.setPrintCount(1L);
obj1.setData("{}");
req.setPrintRequest(obj1);
WdkHmLabelPrintResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<wdk_hm_label_print_response>
    <result>
        <code>SUCCESS</code>
        <msg>成功</msg>
        <is_success>true</is_success>
        <data>
            <template_code>test</template_code>
            <template_name>测试模板</template_name>
            <business_rule_code>test</business_rule_code>
            <business_rule_name>测试规则</business_rule_name>
            <pic_path>https://test.png</pic_path>
            <terminal_render_regions>
                <terminal_render_region>
                    <key>weight</key>
                    <x>100</x>
                    <y>100</y>
                    <width>50</width>
                    <height>20</height>
                    <font_size>15</font_size>
                    <font_family>微软雅黑</font_family>
                    <font_color>000000</font_color>
                </terminal_render_region>
            </terminal_render_regions>
        </data>
    </result>
</wdk_hm_label_print_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

返回
顶部