feat(wxapi): 新增微信小店订单补发货接口

This commit is contained in:
Fu Diwei
2026-02-05 17:53:56 +08:00
parent b41ef197d5
commit bced0b4998
4 changed files with 122 additions and 0 deletions

View File

@@ -4873,6 +4873,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderDeliverySendResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderDeliverySendResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
} }
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/delivery/compensation 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-delivery/delivery/api_delivery_compensation.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECOrderDeliveryCompensationResponse> ExecuteChannelsECOrderDeliveryCompensationAsync(this WechatApiClient client, Models.ChannelsECOrderDeliveryCompensationRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "order", "delivery", "compensation")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderDeliveryCompensationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion #endregion
#region ECOrder/Dropship #region ECOrder/Dropship

View File

@@ -0,0 +1,72 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/delivery/compensation 接口的请求。</para>
/// </summary>
public class ChannelsECOrderDeliveryCompensationRequest : WechatApiRequest, IInferable<ChannelsECOrderDeliveryCompensationRequest, ChannelsECOrderDeliveryCompensationResponse>
{
public static class Types
{
public class Delivery
{
public static class Types
{
public class Product : ChannelsECOrderDeliverySendRequest.Types.Delivery.Types.Product
{
}
}
/// <summary>
/// 获取或设置快递公司 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("delivery_id")]
[System.Text.Json.Serialization.JsonPropertyName("delivery_id")]
public string DeliveryId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置快递单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("waybill_id")]
[System.Text.Json.Serialization.JsonPropertyName("waybill_id")]
public string? WaybillId { get; set; }
/// <summary>
/// 获取或设置发货方式。
/// </summary>
[Newtonsoft.Json.JsonProperty("deliver_type")]
[System.Text.Json.Serialization.JsonPropertyName("deliver_type")]
public int DeliverType { get; set; }
/// <summary>
/// 获取或设置商品列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_infos")]
[System.Text.Json.Serialization.JsonPropertyName("product_infos")]
public IList<Types.Product> ProductList { get; set; } = new List<Types.Product>();
}
}
/// <summary>
/// 获取或设置订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
public string OrderId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置快递列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("delivery_list")]
[System.Text.Json.Serialization.JsonPropertyName("delivery_list")]
public IList<Types.Delivery> DeliveryList { get; set; } = new List<Types.Delivery>();
/// <summary>
/// 获取或设置补发原因类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("reason")]
[System.Text.Json.Serialization.JsonPropertyName("reason")]
public int ReasonType { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/delivery/compensation 接口的响应。</para>
/// </summary>
public class ChannelsECOrderDeliveryCompensationResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,18 @@
{
"order_id": "123456",
"reason": 1,
"delivery_list": [
{
"delivery_id": "YD",
"waybill_id": "23424324253",
"deliver_type": 1,
"product_infos": [
{
"product_cnt": 1,
"product_id": "12345",
"sku_id": "678910"
}
]
}
]
}