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

alibaba.pos.items.subtotal (pos线下交易小计接口)

pos线下交易小计接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
shop_id Number 必须 123 门店Id
buyer_id Number 必须 0 买家id
subtotal_request SubtotalRequest 必须 请求入参
  • asset_list
  • AssetDto []
  • 可选
  • 购买商品信息
  • └ type
  • String
  • 可选
  • 1
  • 资产类型
  • └ code
  • String
  • 可选
  • 123
  • 码值
  • └ title
  • String
  • 可选
  • 123
  • 名称
  • └ status
  • String
  • 可选
  • 0
  • 状态
  • └ extra
  • String
  • 可选
  • ""
  • 扩展信息
  • └ source
  • String
  • 可选
  • hema
  • Pos请求来源
  • item_list
  • ItemParamDto []
  • 必须
  • 购买信息
  • └ item_id
  • Number
  • 可选
  • 123
  • 商品id
  • └ sku_id
  • Number
  • 可选
  • 234
  • sku对应id
  • └ buy_quantity
  • Number
  • 可选
  • 12
  • 购买商品数量
  • └ inv_quantity
  • String
  • 可选
  • 12
  • 商品重量
  • └ extra
  • String
  • 可选
  • ""
  • 扩展信息
  • └ extra
  • String
  • 可选
  • {}
  • 请求扩展信息
  • └ shop_id
  • String
  • 必须
  • 123
  • 门店Id
  • └ machine_id
  • String
  • 必须
  • 123
  • pos机Id
  • └ business_type
  • String
  • 必须
  • 1
  • 业务类型
  • └ merchant_code
  • String
  • 必须
  • hema
  • 商家编码
  • └ buyer_id
  • Number
  • 可选
  • 123
  • 买家Id

响应参数

名称 类型 示例值 描述
result PosResult 结果 结果
  • model
  • SubtotalRespDto
  • 结果对象
  • 结果对象
  • └ actual_fee
  • Number
  • 100
  • 应付金额
  • └ coupon_fee
  • Number
  • 10
  • 优惠券抵扣金额
  • └ process_fee
  • Number
  • 10
  • 加工费用
  • items
  • BuyItemDto []
  • 商品信息
  • └ out_sku_id
  • String
  • "11"
  • 商品编码
  • └ bar_code
  • String
  • "11"
  • 商品条码
  • └ shop_id
  • String
  • "11"
  • 门店Id
  • └ is_weight
  • Boolean
  • true
  • 是否称重
  • └ title
  • String
  • "111"
  • 全称
  • └ short_name
  • String
  • "111"
  • 简称
  • └ pic_url
  • String
  • "111"
  • 主图
  • └ price
  • Number
  • 0
  • 单价
  • └ promotion_price
  • Number
  • 0
  • 优惠价
  • └ total_fee
  • Number
  • 0
  • 总价
  • └ item_weight
  • String
  • "111"
  • 单品重量
  • └ inv_unit
  • String
  • "111"
  • 库存单位
  • └ sale_unit
  • String
  • "111"
  • 销售单位
  • └ item_id
  • Number
  • 0
  • itemId
  • └ sku_id
  • Number
  • 0
  • skuId
  • └ buy_quantity
  • Number
  • 0
  • 销售单位数量
  • └ inv_quantity
  • String
  • "111"
  • 库存单位数量
  • └ extra
  • String
  • "111"
  • 商品扩展信息
  • assets
  • AssetDto []
  • 资产信息
  • └ type
  • String
  • "111"
  • 资产类型
  • └ code_val
  • String
  • "1111"
  • 资产编码
  • └ title
  • String
  • "1111"
  • 资产名称
  • └ status
  • String
  • "1111"
  • 资产状态
  • └ extra
  • String
  • "1111"
  • 资产扩展信息
  • └ extra
  • String
  • {}
  • 扩展信息
  • └ promotion_fee
  • Number
  • 0
  • 优惠金额
  • └ total_fee
  • Number
  • 0
  • 总价
  • └ promotion_tool_fee
  • String
  • promotionToolFee
  • └ msg_code
  • String
  • "1111"
  • msgCode
  • └ msg_info
  • String
  • "11111"
  • msgInfo
  • └ is_success
  • Boolean
  • false
  • success

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaPosItemsSubtotalRequest req = new AlibabaPosItemsSubtotalRequest();
req.setShopId(123L);
req.setBuyerId(0L);
AlibabaPosItemsSubtotalRequest.SubtotalRequest obj1 = new AlibabaPosItemsSubtotalRequest.SubtotalRequest();
List<AlibabaPosItemsSubtotalRequest.AssetDto> list3 = new ArrayList<AlibabaPosItemsSubtotalRequest.AssetDto>();
AlibabaPosItemsSubtotalRequest.AssetDto obj4 = new AlibabaPosItemsSubtotalRequest.AssetDto();
list3.add(obj4);
obj4.setType("1");
obj4.setCode("123");
obj4.setTitle("123");
obj4.setStatus("0");
obj4.setExtra("\"\"");
obj1.setAssetList(list3);
obj1.setSource("hema");
List<AlibabaPosItemsSubtotalRequest.ItemParamDto> list6 = new ArrayList<AlibabaPosItemsSubtotalRequest.ItemParamDto>();
AlibabaPosItemsSubtotalRequest.ItemParamDto obj7 = new AlibabaPosItemsSubtotalRequest.ItemParamDto();
list6.add(obj7);
obj7.setItemId(123L);
obj7.setSkuId(234L);
obj7.setBuyQuantity(12L);
obj7.setInvQuantity("12");
obj7.setExtra("\"\"");
obj1.setItemList(list6);
obj1.setExtra("{}");
obj1.setShopId("123");
obj1.setMachineId("123");
obj1.setBusinessType("1");
obj1.setMerchantCode("hema");
obj1.setBuyerId(123L);
req.setSubtotalRequest(obj1);
AlibabaPosItemsSubtotalResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_pos_items_subtotal_response>
    <result>
        <model>
            <actual_fee>100</actual_fee>
            <coupon_fee>10</coupon_fee>
            <process_fee>10</process_fee>
            <items>
                <buy_item_dto>
                    <out_sku_id>&quot;11&quot;</out_sku_id>
                    <bar_code>&quot;11&quot;</bar_code>
                    <shop_id>&quot;11&quot;</shop_id>
                    <is_weight>true</is_weight>
                    <title>&quot;111&quot;</title>
                    <short_name>&quot;111&quot;</short_name>
                    <pic_url>&quot;111&quot;</pic_url>
                    <price>0</price>
                    <promotion_price>0</promotion_price>
                    <total_fee>0</total_fee>
                    <item_weight>&quot;111&quot;</item_weight>
                    <inv_unit>&quot;111&quot;</inv_unit>
                    <sale_unit>&quot;111&quot;</sale_unit>
                    <item_id>0</item_id>
                    <sku_id>0</sku_id>
                    <buy_quantity>0</buy_quantity>
                    <inv_quantity>&quot;111&quot;</inv_quantity>
                    <extra>&quot;111&quot;</extra>
                </buy_item_dto>
            </items>
            <assets>
                <asset_dto>
                    <type>&quot;111&quot;</type>
                    <code_val>&quot;1111&quot;</code_val>
                    <title>&quot;1111&quot;</title>
                    <status>&quot;1111&quot;</status>
                    <extra>&quot;1111&quot;</extra>
                </asset_dto>
            </assets>
            <extra>{}</extra>
            <promotion_fee>0</promotion_fee>
            <total_fee>0</total_fee>
            <promotion_tool_fee></promotion_tool_fee>
        </model>
        <msg_code>&quot;1111&quot;</msg_code>
        <msg_info>&quot;11111&quot;</msg_info>
        <is_success>false</is_success>
    </result>
</alibaba_pos_items_subtotal_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

返回
顶部