查询订单可用门店

更新时间 2024-07-24 02:58:49
收藏
我的收藏
查询该 order_id 在该门店下是否可用,可用则返回相应信息。​

使用限制​

无​

接口说明​

    核销工具类小程序才能调用此api。使用核销工具类小程序app_id生成的access-token访问api。​
    核销工具类小程序需要有对应订单的商家(account_id)的授权关系才能查询​

基本信息​

基本信息​
HTTP URL​
HTTP Method​
POST​
Scope​
industry_open.trade.certificate_query​
权限要求​
不需要用户授权​

请求头​

参考通用参数

请求参数​

名称​
类型​
是否必填​
描述​
示例值​
order_id​
string​
是​
抖音内部交易订单号,长度<64byte。​
8000088​
poi_id​
string​
否​
适用门店poi_id​
123​

请求示例​

text
复制
curl --location --request POST 'https://open.douyin.com/api/trade/v2/fulfillment/order_can_use' \
--header 'Content-Type: application/json' \
--header 'access-token: clt.xxx' \
--data-raw='{
"order_id":"8000088",
"poi_id":"123"
}'

响应参数​

名称​
类型​
是否必填​
描述​
示例值​
data​
object​
是​
返回数据​
extra​
object​
是​
额外信息​

data 信息​

名称
类型
是否必填
描述
示例值
order_id​
string​
是​
抖音内部交易订单号,长度<64byte。​
80000088​
certificates​
array(object)​
否​
此订单的券信息,订单可用时才返回​
can_use​
bool​
是​
是否可用​
true​

certificates 参数​

名称
类型
是否必填
描述
示例值
certificate_id​
string​
是​
券ID​
71817​
sku_info​
object​
是​
券相关的sku商品信息。详见下方sku_info参数说明​
amount​
object​
是​
券相关金额信息。详见下方amount参数说明
expire_time​
int64​
是​
券有效时间,秒级​
1703260799​
start_time​
int64​
是​
券有效开始时间,秒级​
1672138509​
code​
string​
否​
三方码则返回明文code,抖音码不返回。​
times_card_info​
object​
否​
次卡信息。详见下方times_card_info参数说明

sku_info 参数​

名称
类型
是否必填
描述
示例值
sku_id​
string​
是​
sku商品id​
123​
title​
string​
是​
商品名称​
测试商品​
groupon_type​
int32​
是​
商品类型​
1 团购券​
2 代金券​
3 次卡​
1​
market_price​
int64​
是​
团购市场价,单位分​
20​
sold_start_time​
int64​
是​
团购售卖开始时间,时间戳,单位秒​
1672123976​
third_sku_id​
string​
否​
商家系统(第三方)团购id​
account_id​
string​
是​
商家团购账号id​
12345​
spu_id​
string​
否​
商品spu_id​
12345​
out_id​
string​
否​
外部商品id​
12345​

amount 参数​

名称
类型
是否必填
描述
示例值
original_amount​
int32​
是​
券原始金额,单位分​
20​
pay_amount​
int32​
是​
用户实付金额,单位分​
20​
merchant_ticket_amount​
int32​
否​
商家营销金额,单位分​
0​
payment_discount_amount​
int32​
否​
支付优惠金额,单位分​
0​
coupon_pay_amount​
int32​
否​
券实付金额(=用户实付金额+支付优惠金额),单位分​
20​
platform_ticket_amount​
int32​
否​
平台补贴金额,单位分​
20​

times_card_info 参数​

名称
类型
是否必填
描述
示例值
total_times
int64
总次数
20
usable_times
int64
可用次数
20

extra 信息​

名称
类型
是否必填
描述
示例值
error_code
int
错误码,0为成功
0
description​
string
错误码描述
success
sub_error_code
int
子错误码​
0
sub_description​
string
子错误码描述​
success
logid
string
请求id​
2022092115392201020812109511046
now
int
毫秒级时间戳
1663745962686

响应示例​

正常示例​

json
复制
{
"data": {
"order_id": "80000088",
"can_use": true,
"certificates": [
{
"certificate_id": "71817",
"expire_time": 1703260799,
"sku_info": {
"account_id": "12345",
"sku_id": "123",
"title": "测试商品",
"groupon_type": 1,
"market_price": 20,
"sold_start_time": 1672123976,
"third_sku_id": ""
},
"amount": {
"original_amount": 20,
"pay_amount": 20,
"merchant_ticket_amount": 0,
"payment_discount_amount": 0,
"coupon_pay_amount": 20
},
"start_time": 1672138509
}
]
},
"extra": {
"now": 1663745962686,
"logid": "2022092115392201020812109511046",
"error_code": 0,
"description": "",
"sub_error_code": 0,
"sub_description": ""
}
}

异常示例​

json
复制
{
"data": {
"error_code": 13000,
"description": "系统错误"
},
"extra": {
"sub_error_code": 13000,
"sub_description": "系统错误",
"logid": "2022092115392201020812109511046",
"now": 1663745962686,
"error_code": 2191000,
"description": ""
}
}

错误码​

HTTP 状态码​
错误码​
sub_error_code
描述​
排查建议​
200​
10000​
参数错误​
参数不符合规范。请根据提示检查参数。​
200​
13000​
系统错误,请重试​
内部错误,重试可解决。​
200​
11001​
应用未获商家授权​
请联系合作商家发起授权​