92 lines
3.6 KiB
Markdown
92 lines
3.6 KiB
Markdown
integration.callback.virtual.eticket.reverse
|
|
需用户授权
|
|
POST
|
|
电子凭证冲正回调接口
|
|
更新时间: 2022-05-11 16:25:25
|
|
电子凭证冲正回调,后续再开放主动通知冲正接口
|
|
系统环境
|
|
环境 域名
|
|
线上环境(推荐) https://openapi.kwaixiaodian.com
|
|
线上环境(备用) https://open.kwaixiaodian.com
|
|
系统参数
|
|
参数名 类型 必须 详情描述
|
|
appkey String 是 平台分配的appId
|
|
timestamp Number 是 发起请求的Unix时间戳,单位为毫秒
|
|
access_token String 是 访问token,所有需用户授权API使用code模式获取,不需要用户授权API使用client_credentials获取,详情参考《授权说明》文档
|
|
version Number 是 请求的API版本号,目前版本为1
|
|
param JSON 是 业务参数,详见下方的请求入参
|
|
method String 是 请求的API英文名,详见各API定义
|
|
sign String 是 API入参的签名结果参数
|
|
signMethod String 是 签名算法,支持HMAC_SHA256和MD5,推荐使用HMAC_SHA256
|
|
请求参数
|
|
参数名 类型 必须 示例值 详情描述
|
|
oid String 是 21111 订单id
|
|
eticketType String 否 DINING_OPEN_TICKET/DEFAULT_MEDICAL_TICKET 电子凭证类型,跟商家想要入驻的类目相关联,非必传,默认DINING_OPEN_TICKET
|
|
etickets List<ReverseETicket> 是 [] 冲正的卡券列表
|
|
serialNum String 否 fffassaass 核销时的序列号,冲正时必填!
|
|
reason String 否 消费者投诉 冲正原因
|
|
ext String 否 {} 扩展信息
|
|
token String 否 fasddda 鉴权Token,订单操作维度
|
|
返回参数
|
|
参数名 类型 示例值 详情描述
|
|
code String 1 主返回码
|
|
msg String success 主返回信息
|
|
sub_code String 1 子返回码
|
|
sub_msg String "success" 子返回信息
|
|
commonResult KwaishopPlatformDigitalBaseRespInfo {} 返回码,1成功
|
|
result Integer 1 返回码,1成功
|
|
error_msg String "success" 错误信息
|
|
错误码
|
|
错误码 错误类型 错误描述 解决方法
|
|
暂无数据
|
|
请求示例
|
|
JAVA
|
|
CURL
|
|
package com.kuaishou.merchant.open.api.sdk.demo;
|
|
import com.kuaishou.merchant.open.api.common.utils.GsonUtils;
|
|
import com.kuaishou.merchant.open.api.request.virtual.IntegrationCallbackVirtualEticketReverseRequest;
|
|
import com.kuaishou.merchant.open.api.response.virtual.IntegrationCallbackVirtualEticketReverseResponse;
|
|
import com.kuaishou.merchant.open.api.client.AccessTokenKsMerchantClient;
|
|
|
|
public class AccessTokenKsMerchantClientDemo {
|
|
|
|
public static void main(String[] args) {
|
|
String url = "https://openapi.kwaixiaodian.com";
|
|
String appKey = "your appKey";
|
|
String signSecret = "your app signSecret";
|
|
String accessToken = "your accessToken";
|
|
|
|
AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(url,appKey,signSecret);
|
|
|
|
IntegrationCallbackVirtualEticketReverseRequest request = new IntegrationCallbackVirtualEticketReverseRequest();
|
|
request.setAccessToken(accessToken);
|
|
request.setApiMethodVersion(1L);
|
|
|
|
request.setOid("21111");
|
|
request.setEticketType("KFC");
|
|
List<ReverseETicket> list1 = new ArrayList<>();
|
|
ReverseETicket obj1 = new ReverseETicket();
|
|
obj1.setId("123");
|
|
list1.add(obj1);
|
|
request.setEtickets(list1);
|
|
request.setSerialNum("fffassaass");
|
|
request.setReason("消费者投诉");
|
|
request.setExt("{}");
|
|
request.setToken("fasddda");
|
|
|
|
IntegrationCallbackVirtualEticketReverseResponse response = client.execute(request);
|
|
|
|
System.out.println(GsonUtils.toJSON(response));
|
|
}
|
|
}
|
|
|
|
响应示例
|
|
JSON
|
|
{
|
|
"commonResult": {
|
|
"code": 1,
|
|
"message": "success"
|
|
},
|
|
"result": 1,
|
|
"error_msg": "\"success\""
|
|
} |