开发平台

电话咨询 400-000-7749

1.网单流程图



2.新增在线订单


接口地址 http://host:port/pospal-api2/openapi/v1/orderOpenApi/addOnLineOrder
请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "payMethod": "Cash",
  • "customerNumber": "001",
  • "shippingFee":15.00,
  • "orderRemark": "addOnLineOrder",
  • "orderDateTime": "2021-07-03 15:31:54",
  • "contactAddress": "测试测试。。。。",
  • "contactName": "张三",
  • "contactTel": "1360097865",
  • "deliveryType": 1,
  • "dinnersNumber": 5,
  • "restaurantAreaName": "一楼",
  • "restaurantTableName": "11",
  • "reservationTime": "2018-01-12 12:30:00",
  • "items": [
  • {
  • "productUid": 102066793346170331,
  • "comment": "测试添加",
  • "quantity": 1.2,
  • "manualSellPrice":30.2
  • }
  • ]
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    payMethod String 支付方式:
    Cash,表示现金支付(如果是想在FUN官网网收银,建议选择该方式,收银的时候可以自由选择所有的支付方式)
    CustomerBalance,表示用会员余额支付,接口会根据customerNumber去扣除对应会员的余额(注意:orderSource 等于空时,才可用该方式,否则取消订单余额会有问题)
    Wxpay,表示微信支付
    Alipay,表示支付宝支付
    payCode_xxx,表示自定义支付(通过销售单据api的 queryMyPayMethod 接口获取)

    支付方式为Wxpay或Alipay或自定义支付时必须设置payOnLine=1
    如果已经付完款,且后续 需要 退款,反结账,请使用自定义支付,且orderSource = 'openApi'。
    customerNumber String 会员号,订单是哪个会员下的。
    如果payMethod= CustomerBalance,参数customerNumber不能为空
    shippingFee BigDecimal 运费
    orderRemark String 订单备注
    orderDateTime String 订单产生的时间,格式为yyyy-MM-dd HH:mm:ss
    contactAddress String 送货地址,联系地址
    contactName String 联系人姓名
    contactTel String 联系人电话
    items List 商品列表
    productUid Long 商品在FUN官网网系统的唯一标识
    comment String 针对商品条目的备注
    quantity BigDecimal 数量
    manualSellPrice BigDecimal 商品单价,如果为空,以银商品在FUN官网网系统的单价为准
    deliveryType Integer 配送类型,默认为0-外卖单。
    0外卖单;
    1店内单,自助单
    dinnersNumber Integer 就餐人数
    restaurantAreaName String 餐厅区域名,在FUN官网网后台要先设置好,参数值必须与设置好的对应
    restaurantTableName String 餐桌名称,桌号,在FUN官网网后台要先设置好,参数值必须与设置好的对应
    reservationTime String 到店时间,预约时间,格式为yyyy-MM-dd HH:mm:ss
    skipProductStockValidation Integer 是否允许0库存销售,设为1则允许0库存销售,目前只有微店用
    payOnLine Integer 是否已经完成线上付款。若线上已付款,则设置payOnLine=1 且payMethod 只能为Wxpay或Alipay 或自定义支付方式。否则,该参数不传
    orderSource String 为openApi时,商品单价按用户传值固定不变
    为空时,按网单下单正常逻辑来计算
    daySeq String 牌号,取餐号。当orderSource=openApi时,才生效,如果不传,不会默认生成。 当orderSource!=openApi时,后台会默认生成一个
    totalAmount BigDecimal 总金额,orderSource不为空时,totalAmount必填
    返回结果
  • {
  • "status": "success",
  • "messages": [],
  • "data": {
  • "orderNo": "20151207112323296104",
  • "orderCreateDateTime": "2015-12-04 10:05:01",
  • "customerNumber": "001"
  • }
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    data Json 实体信息
    orderNo String 订单序列号
    orderCreateDateTime String 下单时间
    customerNumber String 订单会员号

    3.取消在线订单


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

    4.在线订单发货


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

    5.完成在线订单(调用该接口前,要先调用4.在线订单发货)


    接口地址 http://localhost:8080/pospal-api2/openapi/v1/orderOpenApi/completeOrder
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "orderNo": "189098765432"
  • shouldAddTicket: true
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    shouldAddTicket Boolean 是否在FUN官网网收银系统生成流水单据
    返回结果
  • {
  • "status": "success",
  • "messages": []
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表

    6.根据单号查询订单


    接口地址 http://host:port/pospal-api2/openapi/v1/orderOpenApi/queryOrderByNo
    请求头
  • User-Agent: openApi
  • Content-Type: application/json; charset=utf-8
  • accept-encoding: gzip,deflate
  • time-stamp: 1437528688233
  • data-signature: BF706E6AC693BA3B1BABD32E6713431D
  • 请求方式 POST
    请求体
  • {
  • "appId": "abcdefghijklmn",
  • "orderNo": "189098765432"
  • }
  • 参数名 是否必须 类型 说明
    appId String Pospal配置的访问凭证
    orderNo String 订单号
    返回结果
    字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    data Json 订单实体数据
    payMethod String 支付方式:
    Cash,表示现金支付
    CustomerBalance,表示用会员余额支付,接口会根据
    customerNumber去扣除对应会员的余额
    customerNumber String 会员号,订单是哪个会员下的。
    如果payMethod=CustomerBalance,参数customerNumber不能为空
    shippingFee BigDecimal 运费
    orderRemark String 订单备注
    orderDateTime String 订单产生的时间,格式为yyyy-MM-dd HH:mm:ss
    contactAddress String 送货地址,联系地址
    contactName String 联系人姓名
    contactTel String 联系人电话
    totalAmount BigDecimal 总金额
    state Int 订单状态
    NULL = 0; //定单创建时的状态
    SYNCED = 1; //定单已同步到客户端的状态
    SHIPPED = 2; //定单已发货状态
    CANCELED = 3; //定单取消状态
    COMPLETED = 4; //定单结束状态
    COMPLETED = 5; //商家确认接收新订单
    COMPLETED = 8; //待厨打/下发配送订单
    daySeq String 牌号,取餐号
    deliveryType Integer 0或空为外卖:门店配送,商家自己送货上门
    1为自助点餐
    2为自提
    3为预约单
    4为平台配送,如美团配送,百度配送
    orderSource String 订单来源
    MEITUAN_WAIMAI 美团外卖
    ELEME_WAIMAI 饿了么
    ELEBE_WAIMAI 饿百
    ZIYING_MINIAPP FUN官网网小程序
    ZIYING_MIAOSHA 秒杀单
    ZIYING_KANJIA 砍价
    openApi 开放平台网单添加接口
    items List 商品列表
    productUid Long 商品在FUN官网网系统的唯一标识
    productName String 商品名称
    productBarcode String 商品条码
    eshopSellPrice BigDecimal 网店网店销售价
    productQuantity BigDecimal 数量
    productBuyPrice BigDecimal 商品进货价
    productSellPrice BigDecimal 商品销售价
    isCustomerDiscount Boolean 是否开启会员折扣
    customerDiscount BigDecimal 会员折扣率
    customerPrice BigDecimal 会员价
    comment String 针对商品条目的备注
    attrs List 商品属性(口味)
    productAttributeUid Long 商品属性唯一标识
    attributeName String 商品属性名称
    attributeValue String 商品属性价格

    7. 根据id查询订单


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

  • 8.分页查询订单


    接口地址 http://host:port/pospal-api2/openapi/v1/orderOpenApi/queryOrderPages
    请求头
  • 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": "LAST_RESULT_MAX_ID",
  • "parameterValue": "0"
  • }
  • }
  • 参数名 是否必须 类型 说明
    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":[{},{}]
  • }
  • 字段名 类型 说明
    status String 是否正确处理请求,返回success或error,不区分大小写
    messages String[] 处理结果的消息
    errorCode int 业务处理的错误代码,参见错误代码表
    data list 订单实体数据列表
    实体数据 Json
  • 字段参照6.根据单号查询订单

  •