订单推送API V2
| 接口地址 | https://openapi{areaId}.pospal.cn/openinterface /orderOpenApi/addOnLineOrder |
||
|---|---|---|---|
| 请求头 |
|
||
| 请求方式 | POST | ||
| 请求体 |
|
||
| 参数名 | 是否必须 | 类型 | 说明 |
| appId | 是 | String | Pospal配置的访问凭证 |
| payMethod | 是 | String | 支付方式:
Cash,表示现金支付; Wxpay,表示微信支付 Alipay,表示支付宝支付 payCode_xxx,表示自定义支付(通过销售单据api的 queryMyPayMethod 接口获取) 支付方式为Wxpay或Alipay或自定义支付时必须设置payOnLine=1 如果已经付完款,且后续 需要 退款,反结账,请使用自定义支付,且orderSource = 'openApi'。 |
| customerNumber | 否 | String | 会员号,订单是哪个会员下的。 如果payMethod= CustomerBalance,参数customerNumber不能为空 |
| shippingFee | 否 | BigDecimal | 运费 |
| taxFee | 否 | BigDecimal | 税费 |
| serviceFee | 否 | BigDecimal | 服务费 |
| taxpayerId | 否 | String | 企业开票时,纳税人识别号==》税号 |
| orderRemark | 否 | String | 订单备注 |
| orderDateTime | 是 | String | 订单产生的时间,格式为yyyy-MM-dd HH:mm:ss |
| contactAddress | 是 | String | 送货地址,联系地址 |
| contactName | 是 | String | 联系人姓名 |
| contactTel | 是 | String | 联系人电话 |
| items | 是 | List | 商品列表 |
| productUid | 是 | Long | 商品在银豹系统的唯一标识 |
| comment | 是 | String | 针对商品条目的备注 |
| quantity | 是 | BigDecimal | 数量 |
| manualSellPrice | 否 | BigDecimal | 商品单价,如果为空,以银商品在银豹系统的单价为准 |
| deliveryType | 否 | Integer | 配送类型,默认为0-外卖单。 0外卖单; 1店内单,自助单 |
| dinnersNumber | 否 | Integer | 就餐人数 |
| restaurantAreaName | 否 | String | 餐厅区域名,在银豹后台要先设置好,参数值必须与设置好的对应 |
| restaurantTableName | 否 | String | 餐桌名称,桌号,在银豹后台要先设置好,参数值必须与设置好的对应 |
| 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 | String | 是否正确处理请求,返回success或error,不区分大小写 | |
| messages | String[] | 处理结果的消息 | |
| errorCode | int | 业务处理的错误代码,参见错误代码表 | |
| data | Json | 实体信息 | |
| orderNo | String | 订单序列号 | |
| orderCreateDateTime | String | 下单时间 | |
| customerNumber | String | 订单会员号 | |
| 接口地址 | https://openapi{areaId}.pospal.cn/openinterface /orderOpenApi/cancleOrder |
||
|---|---|---|---|
| 请求头 |
|
||
| 请求方式 | POST | ||
| 请求体 |
|
||
| 参数名 | 是否必须 | 类型 | 说明 |
| appId | 是 | String | Pospal配置的访问凭证 |
| 返回结果 |
|
||
| 字段名 | 类型 | 说明 | |
| status | String | 是否正确处理请求,返回success或error,不区分大小写 | |
| messages | String[] | 处理结果的消息 | |
| errorCode | int | 业务处理的错误代码,参见错误代码表 | |
| 接口地址 | https://openapi{areaId}.pospal.cn/openinterface /orderOpenApi/shipOrder |
||
|---|---|---|---|
| 请求头 |
|
||
| 请求方式 | POST | ||
| 请求体 |
|
||
| 参数名 | 是否必须 | 类型 | 说明 |
| appId | 是 | String | Pospal配置的访问凭证 |
| 返回结果 |
|
||
| 字段名 | 类型 | 说明 | |
| status | String | 是否正确处理请求,返回success或error,不区分大小写 | |
| messages | String[] | 处理结果的消息 | |
| errorCode | int | 业务处理的错误代码,参见错误代码表 | |
| 接口地址 | https://openapi{areaId}.pospal.cn/openinterface /orderOpenApi/completeOrder |
||
|---|---|---|---|
| 请求头 |
|
||
| 请求方式 | POST | ||
| 请求体 |
|
||
| 参数名 | 是否必须 | 类型 | 说明 |
| appId | 是 | String | Pospal配置的访问凭证 |
| shouldAddTicket | 否 | Boolean | 是否在银豹收银系统生成流水单据 |
| 返回结果 |
|
||
| 字段名 | 类型 | 说明 | |
| status | String | 是否正确处理请求,返回success或error,不区分大小写 | |
| messages | String[] | 处理结果的消息 | |
| errorCode | int | 业务处理的错误代码,参见错误代码表 | |
| 接口地址 | https://openapi{areaId}.pospal.cn/openinterface /orderOpenApi/queryOrderByNo |
||
|---|---|---|---|
| 请求头 |
|
||
| 请求方式 | POST | ||
| 请求体 |
|
||
| 参数名 | 是否必须 | 类型 | 说明 |
| 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 | 牌号,取餐号 | |
| items | List | 商品列表 | |
| productUid | Long | 商品在银豹系统的唯一标识 | |
| productName | String | 商品名称 | |
| productBarcode | String | 商品条码 | |
| eshopSellPrice | BigDecimal | 网店网店销售价 | |
| productQuantity | BigDecimal | 数量 | |
| productBuyPrice | BigDecimal | 商品进货价 | |
| productSellPrice | BigDecimal | 商品销售价 | |
| isCustomerDiscount | Boolean | 是否开启会员折扣 | |
| customerDiscount | BigDecimal | 会员折扣率 | |
| customerPrice | BigDecimal | 会员价 | |
| comment | String | 针对商品条目的备注 | |
| deliveryType | Integer | 0或空为外卖:门店配送,商家自己送货上门
1为自助点餐 2为自提 3为预约单 4为平台配送,如美团配送,百度配送 |
|
| 接口地址 | https://openapi{areaId}.pospal.cn/openinterface /orderOpenApi/queryOrderById |
||
|---|---|---|---|
| 请求头 |
|
||
| 请求方式 | POST | ||
| 请求体 |
|
||
| 参数名 | 是否必须 | 类型 | 说明 |
| appId | 是 | String | Pospal配置的访问凭证 |
| id | 是 | int | 订单id |
| 返回结果 |
| ||
| 字段名 | 类型 | 说明 | |
|
| |||
| 接口地址 | https://openapi{areaId}.pospal.cn/openinterface /orderOpenApi/queryOrderPages |
||
|---|---|---|---|
| 请求头 |
|
||
| 请求方式 | POST | ||
| 请求体 |
|
||
| 参数名 | 是否必须 | 类型 | 说明 |
| 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 | String | 是否正确处理请求,返回success或error,不区分大小写 | |
| messages | String[] | 处理结果的消息 | |
| errorCode | int | 业务处理的错误代码,参见错误代码表 | |
| data | list | 订单实体数据列表 | |
| 实体数据 | Json | 参照根据单号查询字段描述 | |