文档中心 > API类目 > pos交易api

alibaba.pos.bill.get (pos线下交易小票打印接口)

pos线下交易小票打印接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
shop_id Number 必须 911 门店id
bill_print_request BillPrintRequest 必须 入参
  • └ biz_order_id
  • Number
  • 必须
  • 1100126525063028420
  • 订单id
  • └ machine_id
  • String
  • 可选
  • 67
  • pos机id
  • └ shop_id
  • String
  • 可选
  • 911
  • 门店id
  • └ merchant_code
  • String
  • 可选
  • 911123
  • 商家编码
  • └ source
  • String
  • 可选
  • pos
  • 请求来源
  • └ extra
  • String
  • 可选
  • {"key":"value"}
  • 扩展属性

响应参数

名称 类型 示例值 描述
result PosResult 返回结果
  • model
  • WdkBillPrintRespDto
  • 返回结果
  • └ pos_id
  • String
  • ""
  • POS ID
  • └ cashier_id
  • String
  • ""
  • 收银员ID
  • └ pay_type
  • Number
  • 0
  • 支付类型
  • └ print_time
  • Date
  • 打印时间,服务端处理时间
  • └ receive_fee
  • Number
  • 0
  • 现金支付时,收到的金额
  • └ change_fee
  • Number
  • 0
  • 现金支付时,找零金额
  • └ coupon_fee
  • Number
  • 0
  • 优惠券金额
  • └ member_promotion_fee
  • Number
  • 0
  • 会员优惠金额
  • └ promotion_fee
  • Number
  • 0
  • 除优惠券外的优惠金额
  • └ shop_id
  • String
  • ""
  • 门店id
  • └ biz_order_id
  • Number
  • 0
  • 订单号
  • └ create_time
  • Date
  • 创建时间
  • └ pay_time
  • Date
  • 支付完成时间
  • item_blocks
  • BillItemBlockDto []
  • 商品聚合块
  • └ title
  • String
  • ""
  • 组标题
  • item_dtos
  • BillItemDto []
  • 购买的商品
  • └ sub_order_id
  • String
  • ""
  • 子订单ID
  • └ item_id
  • String
  • ""
  • 商品id
  • └ title
  • String
  • ""
  • 商品标题
  • └ quantity
  • Number
  • 0
  • 购买数量
  • └ price
  • Number
  • 0
  • 价格
  • └ total_fee
  • Number
  • 0
  • 商品原总金额 price * quantity
  • └ is_zp
  • Boolean
  • false
  • 是否是赠品
  • └ is_hg
  • Boolean
  • false
  • 是否是换购商品
  • └ weight
  • String
  • ""
  • 重量
  • └ weight_str
  • String
  • ""
  • 重量string类型
  • └ is_weight
  • Boolean
  • false
  • 是否是称重商品
  • └ inv_unit
  • String
  • ""
  • 称重单位
  • └ bar_code
  • String
  • ""
  • 条码
  • └ sku_code
  • String
  • ""
  • sku编码
  • └ full_title
  • String
  • ""
  • 全额标题
  • └ promotion_price
  • Number
  • 0
  • (单品优惠)后的商品单价
  • └ total_discount_fee
  • Number
  • 0
  • 优惠后的商品总金额(包含优惠券,单品)
  • └ is_jg
  • Boolean
  • false
  • 是否是加工商品
  • └ extra
  • String
  • {}
  • 扩展信息
  • payment_channels
  • PaymentChannelDto []
  • 支付信息
  • └ channel_code
  • String
  • ""
  • 支付渠道编码
  • └ channel_name
  • String
  • ""
  • 支付渠道名称
  • └ total
  • Number
  • 0
  • 支付金额
  • alipay_promotions
  • PaymentPromotionDetailDto []
  • 支付优惠
  • └ channel_code
  • String
  • ""
  • 支付渠道编码
  • └ channel_name
  • String
  • ""
  • 支付渠道名称
  • └ total
  • Number
  • 0
  • 支付优惠金额
  • └ total_fee
  • Number
  • 0
  • 订单原始金额
  • └ actual_fee
  • Number
  • 0
  • 实付金额 actualFee = totalFee - totalPromotionFee
  • └ total_promotion_fee
  • Number
  • 0
  • 所有优惠
  • └ gift_card_payfee
  • Number
  • 0
  • 礼品卡支付信息
  • └ hebao_pay_fee
  • Number
  • 0
  • 盒包支付信息
  • └ extra
  • String
  • {}
  • 扩展信息
  • └ msg_code
  • String
  • ""
  • msgCode
  • └ msg_info
  • String
  • ""
  • msgInfo
  • └ is_success
  • Boolean
  • true
  • 是否成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaPosBillGetRequest req = new AlibabaPosBillGetRequest();
req.setShopId(911L);
AlibabaPosBillGetRequest.BillPrintRequest obj1 = new AlibabaPosBillGetRequest.BillPrintRequest();
obj1.setBizOrderId(1100126525063028420L);
obj1.setMachineId("67");
obj1.setShopId("911");
obj1.setMerchantCode("911123");
obj1.setSource("pos");
obj1.setExtra("{\"key\":\"value\"}");
req.setBillPrintRequest(obj1);
AlibabaPosBillGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_pos_bill_get_response>
    <result>
        <model>
            <pos_id>&quot;&quot;</pos_id>
            <cashier_id>&quot;&quot;</cashier_id>
            <pay_type>0</pay_type>
            <print_time></print_time>
            <receive_fee>0</receive_fee>
            <change_fee>0</change_fee>
            <coupon_fee>0</coupon_fee>
            <member_promotion_fee>0</member_promotion_fee>
            <promotion_fee>0</promotion_fee>
            <shop_id>&quot;&quot;</shop_id>
            <biz_order_id>0</biz_order_id>
            <create_time></create_time>
            <pay_time></pay_time>
            <item_blocks>
                <bill_item_block_dto>
                    <title>&quot;&quot;</title>
                    <item_dtos>
                        <bill_item_dto>
                            <sub_order_id>&quot;&quot;</sub_order_id>
                            <item_id>&quot;&quot;</item_id>
                            <title>&quot;&quot;</title>
                            <quantity>0</quantity>
                            <price>0</price>
                            <total_fee>0</total_fee>
                            <is_zp>false</is_zp>
                            <is_hg>false</is_hg>
                            <weight>&quot;&quot;</weight>
                            <weight_str>&quot;&quot;</weight_str>
                            <is_weight>false</is_weight>
                            <inv_unit>&quot;&quot;</inv_unit>
                            <bar_code>&quot;&quot;</bar_code>
                            <sku_code>&quot;&quot;</sku_code>
                            <full_title>&quot;&quot;</full_title>
                            <promotion_price>0</promotion_price>
                            <total_discount_fee>0</total_discount_fee>
                            <is_jg>false</is_jg>
                            <extra>{}</extra>
                        </bill_item_dto>
                    </item_dtos>
                </bill_item_block_dto>
            </item_blocks>
            <payment_channels>
                <payment_channel_dto>
                    <channel_code>&quot;&quot;</channel_code>
                    <channel_name>&quot;&quot;</channel_name>
                    <total>0</total>
                </payment_channel_dto>
            </payment_channels>
            <alipay_promotions>
                <payment_promotion_detail_dto>
                    <channel_code>&quot;&quot;</channel_code>
                    <channel_name>&quot;&quot;</channel_name>
                    <total>0</total>
                </payment_promotion_detail_dto>
            </alipay_promotions>
            <total_fee>0</total_fee>
            <actual_fee>0</actual_fee>
            <total_promotion_fee>0</total_promotion_fee>
            <gift_card_payfee>0</gift_card_payfee>
            <hebao_pay_fee>0</hebao_pay_fee>
            <extra>{}</extra>
        </model>
        <msg_code>&quot;&quot;</msg_code>
        <msg_info>&quot;&quot;</msg_info>
        <is_success>true</is_success>
    </result>
</alibaba_pos_bill_get_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

返回
顶部