接口地址 |
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": 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": "一匙"
}
]
}
]
}
}
|
字段名 |
类型 |
说明 |
status |
String |
是否正确处理请求,返回success或error,不区分大小写 |
messages |
String[] |
处理结果的消息 |
errorCode |
int |
业务处理的错误代码,参见错误代码表 |
data |
Json |
单据实体信息 |
cashierUid |
Long |
收银员唯一标识 |
customerUid |
Long |
会员唯一标识 |
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时表示单据已作废 |
payments |
List |
多种支付方式 |
code |
String |
支付方式代码 |
amount |
BigDecimal |
支付金额 |
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 |
属性值,即口味价格 |
ticketStoreAppIdOrAccount |
String |
所在消费门店的appId或账号 |
接口地址 |
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.3.1 |
接口地址 |
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
endTime - startTime<=1天 |
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 |
单据实体信息,字段信息参照5.根据销售单据uid、sn、orderNo查询对应的销售-退货单据 |
请求头 |
User-Agent: openApi
Content-Type: application/json; charset=utf-8
accept-encoding: gzip,deflate
time-stamp: 1437528688233
data-signature: BF706E6AC693BA3B1BABD32E6713431D
|
请求方式 |
POST |
根据销售单据uid接口地址 |
https://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryRefunTicketBySellTicketUid |
根据销售单据uid请求体 |
{
"appId": "abcdefghijklmn",
"sellTcketUid": 66663989680866397
}
|
|
根据销售单据sn接口地址 |
https://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryRefunTicketBySellTicketSn |
根据销售单据sn请求体 |
{
"appId": "abcdefghijklmn",
"sellTcketSn": "20170509154301968000"
}
|
|
根据退货单据uid接口地址 |
https://host:port/pospal-api2/openapi/v1/ticketOpenApi/querySellTicketByRefunTicketUid |
根据退货单据uid请求体 |
{
"appId": "abcdefghijklmn",
"refunTcketUid": 1508919704366308111
}
|
|
根据退货单据Sn接口地址 |
https://host:port/pospal-api2/openapi/v1/ticketOpenApi/querySellTicketByRefunTicketSn |
根据退货单据Sn请求体 |
{
"appId": "abcdefghijklmn",
"refunTcketSn": "201710251621443620002"
}
|
|
根据网单号接口地址 |
https://host:port/pospal-api2/openapi/v1/ticketOpenApi/queryTicketByOrderNo |
根据网单号请求体 |
{
"appId": "abcdefghijklmn",
"orderNo": "20170509154301968000"
}
|
参数名 |
是否必须 |
类型 |
说明 |
appId
| 是
| String
| Pospal配置的访问凭证 |
sellTcketSn
| 是--根据销售单据Sn
| String
| 销售单据序列号 |
sellTcketUid
| 是--根据销售单据uid
| Long
| 销售单据唯一值 |
orderNo
| 是—网单号
| String
| 网单序列号—>唯一值 |
返回结果 |
{
"status": "success",
"messages": [],
"data":{
"cashierUid": 832101480292933201,
"customerUid": 0,
"sn": "201705091518217950003",
"datetime": "2017-05-09 15:18:21",
"totalAmount": 250,
"totalProfit": 225,
"discount": 100,
"rounding": 0,
"ticketType": "SELL_RETURN",
"invalid": 0,
"remark": "",
"items": [
{
"name": "api1",
"buyPrice": 25,
"sellPrice": 250,
"customerPrice": 0,
"quantity": 1,
"discount": 100,
"customerDiscount": 100,
"totalAmount": 250,
"totalProfit": 225,
"isCustomerDiscount": 1,
"productUid": 127984014338793015,
"ticketitemattributes": []
}
],
"payments": [
{
"code": "payCode_1",
"amount": 250
}
]
}
}
|
字段名 |
类型 |
说明 |
status |
String |
是否正确处理请求,返回success或error,不区分大小写 |
messages |
String[] |
处理结果的消息 |
errorCode |
int |
业务处理的错误代码,参见错误代码表 |
data |
Json |
单据实体信息 |
cashierUid |
Long |
收银员唯一标识 |
customerUid |
Long |
会员唯一标识 |
sn |
String |
单据序列号 |
datetime |
String |
单据产生的时间,格式为yyyy-MM-dd hh:mm:ss |
totalAmount |
BigDecimal |
单据价钱总额 |
totalProfit |
BigDecimal |
单据总利润 |
discount |
BigDecimal |
单据折扣 |
rounding |
BigDecimal |
抹零数额,比如3.1元收别人3元,0.1就是被抹零数额 |
ticketType |
String |
单据类型:SELL销售单据, SELL_RETURN退货单据。不区分大小写 |
invalid |
Int |
值为1时表示单据已作废 |
payments |
List |
多种支付方式 |
code |
String |
支付方式代码 |
amount |
BigDecimal |
支付金额 |
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 |
属性值 |
ticketStoreAppIdOrAccount |
String |
所在消费门店的appId或账号 |