开发平台

电话咨询 400-000-7749

1. 查询支付方式代码


接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryAllPayMethod
请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn"
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    返回结果
  • {
  • "status": "success",
  • "messages": [],
  • "data": [
  • {
  • "code": "payCode_1",
  • "name": "现金"
  • }
  • {
  • "code": "payCode_2",
  • "name": "储值卡"
  • }
  • ]
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    data List 实体信息
    code String 支付方式代码
    name String 支付方式名称

    2. 根据单据序列号查询


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryTicketBySn
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "sn":"201511121549168880001"
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    sn String 单据序列号
    返回结果
  • {
  • "status": "success",
  • "messages": [],
  • "data":{
  • "cashierUid": 832101480292933201,
  • "customerUid": 6666,
  • "sn": "201511121602084680006",
  • "datetime": "2015-11-12 16:02:12",
  • "totalAmount": 72,
  • "totalProfit": 42,
  • "discount": 100,
  • "externalOrderNo": "2017121521001004460219576817",
  • "remark": "收银测试",
  • "rounding": 0,
  • "ticketType": "SELL",
  • "invalid": 0,
  • "webOrderNo": "21061518100850239104",
  • "payments": [
  • {
  • "code": "payCode_1",
  • "amount": 9.42
  • },
  • ],
  • "pointUsage":{
  • "customerUid": 6666,
  • "point": 80.00,
  • "money": 8.00,
  • "exchangeType": 1
  • },
  • "items":[
  • {
  • "name": "冰摩卡",
  • "buyPrice": 10,
  • "sellPrice": 24,
  • "customerPrice": 22,
  • "quantity": 1,
  • "discount": 100,
  • "customerDiscount": 100,
  • "totalAmount": 24,
  • "totalProfit": 14,
  • "isCustomerDiscount": 1,
  • "productUid": 379659791803681560,
  • "ticketitemattributes": [
  • {
  • "attributeName": "加粮",
  • "attributeValue": "一匙"
  • }
  • ],
  • "saleGuiderList": [
  • {
  • "guiderUid": 340630600558146350,
  • "guiderJobNumber": "2002"
  • "guiderName": "林肉肉"
  • }
  • ]
  • }
  • ]
  • }
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    data Json 单据实体信息
    cashierUid Long 收银员唯一标识
    customerUid Long 会员唯一标识 为0表示收银时没选择会员
    sn String 单据序列号
    datetime String 单据产生的时间,格式为yyyy-MM-dd HH:mm:ss
    totalAmount BigDecima 单据实收总额
    totalProfit BigDecima 单据总利润
    discount BigDecima 单据折扣
    externalOrderNo String 第三方平台支付单号
    remark String 备注
    rounding BigDecima 抹零数额,比如3.1元收别人3元,0.1就是被抹零数额
    ticketType String 单据类型:SELL销售单据, SELL_RETURN退货单据。不区分大小写
    invalid Int 值为1时表示单据已作废(反结账)
    webOrderNo String 网单号(直接在pos端收银,不会有值。只有通过外卖平台,小程序,或者订单推送接口 的网单才有)
    payments List 多种支付方式
    code String 支付方式代码
    amount BigDecimal 支付金额
    pointUsage Json 积分使用明细 上面的demo表示 80积分抵现8元
    customerUid long 会员uid
    point BigDecimal 积分
    money BigDecimal 金额
    exchangeType int 积分使用类型 1:积分抵现 2:积分兑换
    items List 单据条目实体
    name String 单据条目商品名称
    buyPrice BigDecimal 单据条目商品进货价
    sellPrice BigDecimal 单据条目商品销售价
    customerPrice BigDecimal 单据条目商品会员价
    quantity BigDecimal 单据条目销售的商品数量,如3.5箱
    discount BigDecimal 单据条目所打的折扣
    customerDiscount BigDecimal 单据条目所打的会员折扣
    totalAmount BigDecimal 单据条目总价
    totalProfit BigDecimal 单据条目总利润
    isCustomerDiscount int 数据为1时表求享受了会员折扣
    productUid Long 单据条目所对应的商品唯一标识
    ticketitemattributes List 单据条目属性、备注实体
    attributeName String 属性名称,即口味选项,如加糖、加水、加冰
    attributeValue String 属性值,即口味价格
    saleGuiderList List 导购员信息
    guiderUid Long 导购员uid
    guiderJobNumber String 导购员工号
    guiderName String 导购员名字
    ticketStoreAppIdOrAccount String 会员所在消费门店的appId或账号
  • 当前接口该字段不会有值。
  • 只有 5. 分页查询会员单据,该字段才有值。

    3. 根据单据uid查询


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryTicketByUid
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "uid": 8008010001
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    uid Long 单据uid
    返回结果
  • 字段参照2. 根据单据序列号查询
  • 字段名 类型 说明
  • 字段参照2. 根据单据序列号查询

  • 4. 分页查询所有单据


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryTicketPages
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "startTime": "2015-11-12 01:59:59",
  • "endTime": "2015-11-12 23:59:59",
  • "postBackParameter":{
  • "parameterType": "abcd",从返回结果中直接取出
  • "parameterValue": "abcd"
  • }
  • }
    参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    startTime String 格式为yyyy-MM-dd HH:mm:ss
    endTime String 格式为yyyy-MM-dd HH:mm:ss
    endTime - startTime<=1天
    postBackParameter Json 查询首页时可以不传,之后的内容从返回结果中取出
    parameterType String 从返回结果中取出
    parameterValue String 从返回结果中取出
    返回结果
  • {
  • "status": "success",
  • "messages": [],
  • "data":{
  • "postBackParameter": {
  • "parameterType": "abcd", 从返回结果中直接取出
  • "parameterValue":"abcd"
  • }
  • "result": [
  • {
  • "cashierUid": 832101480292933201,
  • "customerUid": 0,
  • "sn": "201511121602084680006",
  • "datetime": "2015-11-12 16:02:12",
  • "totalAmount": 72,
  • "totalProfit": 42,
  • "discount": 100,
  • "externalOrderNo": "2017121521001004460219576817",
  • "remark": "收银测试",
  • "rounding": 0,
  • "ticketType": "SELL",
  • ""invalid": 0,
  • "payments": [
  • {
  • "code": "payCode_1",
  • "amount": 9.42
  • }
  • ]
  • "items": [
  • {
  • "name": "冰摩卡",
  • "buyPrice": 10,
  • "sellPrice": 24,
  • "customerPrice": 22,
  • "quantity": 1,
  • "discount": 100,
  • "customerDiscount": 100,
  • "totalAmount": 24,
  • "totalProfit": 14,
  • "isCustomerDiscount": 1,
  • "productUid":379659791803681560,
  • ticketitemattributes": [
  • {
  • "attributeName":"加粮",
  • "attributeValue":"一匙"
  • }
  • ]
  • }
  • ]
  • }
  • ]
  • "pageSize": 100
  • }
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    pageSize Int 本次查询预期从库存取出记录数,如果结果集的长度小于pageSize,不需要进行下一页查询
    postBackParameter Json 分页查询回传到服务器的参数结构从第二页开始必须回传,如果没传,每次查询都是第一页
    parameterType String 从返回结果中直接取出用于回传,不能变其值
    parameterValue String 从返回结果中直接取出用于回传,不能变其值
    result List 单据实体信息,字段信息参照2. 根据单据序列号查询

    5. 分页查询会员单据


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryCustomerHistoryTicketsByUid
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "startTime": "2015-11-12 01:59:59",
  • "endTime": "2015-11-12 23:59:59",
  • "customerUid": "886263699231969848",
  • "queryAllStoreConsume": 1,
  • "postBackParameter":{
  • "parameterType": "LAST_RESULT_MIN_ID",
  • "parameterValue": "3764404"
  • }
  • }
    参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    startTime String 格式为yyyy-MM-dd HH:mm:ss
    endTime String 格式为yyyy-MM-dd HH:mm:ss
    customerUid String 会员在FUN官网网系统的唯一标识
    queryAllStoreConsume int 是否查询会员在所有门店的消费记录
    1:是,0:否,默认0
    postBackParameter Json 查询首页时可以不传,之后的内容从返回结果中取出
    parameterType String 从返回结果中取出
    parameterValue String 从返回结果中取出
    返回结果
  • {
  • "status": "success",
  • "messages": [],
  • "data":{
  • "postBackParameter": {
  • "parameterType": "LAST_RESULT_MIN_ID",
  • "parameterValue":"3764404"
  • },
  • "result": [
  • {
  • "cashierUid": 832101480292933201,
  • "customerUid": 0,
  • "sn": "201511121602084680006",
  • "datetime": "2015-11-12 16:02:12",
  • "totalAmount": 72,
  • "totalProfit": 42,
  • "discount": 100,
  • "externalOrderNo": "2017121521001004460219576817",
  • "rounding": 0,
  • "ticketType": "SELL",
  • ""invalid": 0,
  • "payments": [
  • {
  • "code": "payCode_1",
  • "amount": 9.42
  • }
  • ],
  • "items": [
  • {
  • "name": "冰摩卡",
  • "buyPrice": 10,
  • "sellPrice": 24,
  • "customerPrice": 22,
  • "quantity": 1,
  • "discount": 100,
  • "customerDiscount": 100,
  • "totalAmount": 24,
  • "totalProfit": 14,
  • "isCustomerDiscount": 1,
  • "productUid":379659791803681560,
  • ticketitemattributes": [
  • {
  • "attributeName":"加粮",
  • "attributeValue":"一匙"
  • }
  • ]
  • }
  • ],
  • "ticketStoreAppIdOrAccount": "87EB2C555BBF382E7F6C7B275B0C502A"
  • }
  • ],
  • "pageSize": 100
  • }
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    pageSize Int 本次查询预期从库存取出记录数,如果结果集的长度小于pageSize,不需要进行下一页查询
    postBackParameter Json 分页查询回传到服务器的参数结构从第二页开始必须回传,如果没传,每次查询都是第一页
    parameterType String 从返回结果中直接取出用于回传,不能变其值
    parameterValue String 从返回结果中直接取出用于回传,不能变其值
    result List 单据实体信息,字段信息参照2. 根据单据序列号查询

    6. 根据销售单据uid查询对应的退货单据


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryRefunTicketBySellTicketUid
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "sellTcketUid": 8008010001
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    sellTcketUid Long 销售单据uid
    返回结果
  • 字段参照2. 根据单据序列号查询

  • 7. 根据销售单据sn查询对应的退货单据


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryRefunTicketBySellTicketSn
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "sellTcketSn": "20170509154301968000"
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    sellTcketSn String 销售单据sn
    返回结果
  • 字段参照2. 根据单据序列号查询

  • 8.根据退货单据uid查询对应的销售单据


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/querySellTicketByRefunTicketUid
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "refunTcketUid": 1508919704366308111
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    refunTcketUid long 退贷单据uid
    返回结果
  • 字段参照2. 根据单据序列号查询

  • 9.根据退货单据sn查询对应的销售单据


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/querySellTicketByRefunTicketSn
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "refunTcketSn": "201710251621443620002"
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    refunTcketSn String 退贷单据sn
    返回结果
  • 字段参照2. 根据单据序列号查询

  • 10.根据网单号查询对应的销售单据


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryTicketByOrderNo
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "orderNo": "20170509154301968000"
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    orderNo String 网单号
    返回结果
  • 字段参照2. 根据单据序列号查询

  • 11. 查询我的支付方式代码


    接口地址 http://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryMyPayMethod
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn"
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    返回结果
  • {
  • "status": "success",
  • "messages": [],
  • "data": [
  • {
  • "code": "payCode_1",
  • "name": "现金"
  • }
  • {
  • "code": "payCode_2",
  • "name": "储值卡"
  • }
  • ]
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    data List 实体信息
    code String 支付方式代码
    name String 支付方式名称