Skip to content

Commit 70b1627

Browse files
committed
feat(tiktokshop): 新增创建履约起步价套餐接口
1 parent d39dba1 commit 70b1627

6 files changed

Lines changed: 180 additions & 0 deletions

File tree

docs/TikTokGlobalShop/Basic_ModelDefinition.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Notes: The following catalog is consistent with the catalog structure of [TikTok
8585
- Get Order Split Attributes: `FulfillmentGetOrderSplitAttributes`
8686
- Split Orders: `FulfillmentSplitOrder`
8787
- Get Eligible Shipping Service: `FulfillmentSearchOrderShippingServices`
88+
- Create First Mile Bundle: `FulfillmentCreateBundle`
8889
- Create Packages: `FulfillmentCreatePackage`
8990
- Search Package: `FulfillmentSearchPackages`
9091
- Search Combinable Packages: `FulfillmentSearchCombinablePackages`

src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteFulfillmentExtensions.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,30 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop
1111

1212
public static class TikTokShopClientExecuteFulfillmentExtensions
1313
{
14+
#region Bundle
15+
/// <summary>
16+
/// <para>异步调用 [POST] /fulfillment/{version}/bundles 接口。</para>
17+
/// <para>
18+
/// REF: <br/>
19+
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/669f4a4e762e2402ff17df5c ]]>
20+
/// </para>
21+
/// </summary>
22+
/// <param name="client"></param>
23+
/// <param name="request"></param>
24+
/// <param name="cancellationToken"></param>
25+
/// <returns></returns>
26+
public static async Task<Models.FulfillmentCreateBundleResponse> ExecuteFulfillmentCreateBundleAsync(this TikTokShopClient client, Models.FulfillmentCreateBundleRequest request, CancellationToken cancellationToken = default)
27+
{
28+
if (client is null) throw new ArgumentNullException(nameof(client));
29+
if (request is null) throw new ArgumentNullException(nameof(request));
30+
31+
IFlurlRequest flurlReq = client
32+
.CreateFlurlRequest(request, HttpMethod.Post, "fulfillment", request.ApiVersion, "bundles");
33+
34+
return await client.SendFlurlRequesAsJsontAsync<Models.FulfillmentCreateBundleResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
35+
}
36+
#endregion
37+
1438
#region Orders
1539
/// <summary>
1640
/// <para>异步调用 [GET] /fulfillment/{version}/orders/split_attributes 接口。</para>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using System.Collections.Generic;
2+
3+
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models
4+
{
5+
/// <summary>
6+
/// <para>表示 [POST] /fulfillment/{version}/bundles 接口的请求。</para>
7+
/// </summary>
8+
public class FulfillmentCreateBundleRequest : TikTokShopRequest
9+
{
10+
/// <summary>
11+
/// 获取或设置 API 版本号。
12+
/// <para>默认值:202407</para>
13+
/// </summary>
14+
[Newtonsoft.Json.JsonIgnore]
15+
[System.Text.Json.Serialization.JsonIgnore]
16+
public override int ApiVersion { get; set; } = 202407;
17+
18+
/// <summary>
19+
/// 获取或设置订单 ID 列表。
20+
/// </summary>
21+
[Newtonsoft.Json.JsonProperty("order_ids")]
22+
[System.Text.Json.Serialization.JsonPropertyName("order_ids")]
23+
public IList<string> OrderIdList { get; set; } = new List<string>();
24+
25+
/// <summary>
26+
/// 获取或设置交接方式。
27+
/// </summary>
28+
[Newtonsoft.Json.JsonProperty("handover_method")]
29+
[System.Text.Json.Serialization.JsonPropertyName("handover_method")]
30+
public string HandoverMethod { get; set; } = string.Empty;
31+
32+
/// <summary>
33+
/// 获取或设置运输服务商 ID。
34+
/// </summary>
35+
[Newtonsoft.Json.JsonProperty("shipping_provider_id")]
36+
[System.Text.Json.Serialization.JsonPropertyName("shipping_provider_id")]
37+
public string? ShippingProviderId { get; set; }
38+
39+
/// <summary>
40+
/// 获取或设置物流单号。
41+
/// </summary>
42+
[Newtonsoft.Json.JsonProperty("tracking_number")]
43+
[System.Text.Json.Serialization.JsonPropertyName("tracking_number")]
44+
public string? TrackingNumber { get; set; }
45+
46+
/// <summary>
47+
/// 获取或设置电话号码后四位。
48+
/// </summary>
49+
[Newtonsoft.Json.JsonProperty("phone_tail_number")]
50+
[System.Text.Json.Serialization.JsonPropertyName("phone_tail_number")]
51+
public string? PhoneTailNumber { get; set; }
52+
}
53+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [POST] /fulfillment/{version}/bundles 接口的响应。</para>
5+
/// </summary>
6+
public class FulfillmentCreateBundleResponse : TikTokShopResponse<FulfillmentCreateBundleResponse.Types.Data>
7+
{
8+
public static class Types
9+
{
10+
public class Data
11+
{
12+
public static class Types
13+
{
14+
public class Error
15+
{
16+
public static class Types
17+
{
18+
public class Detail
19+
{
20+
/// <summary>
21+
/// 获取或设置订单 ID。
22+
/// </summary>
23+
[Newtonsoft.Json.JsonProperty("order_id")]
24+
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
25+
public string OrderId { get; set; } = default!;
26+
}
27+
}
28+
29+
/// <summary>
30+
/// 获取或设置错误码。
31+
/// </summary>
32+
[Newtonsoft.Json.JsonProperty("code")]
33+
[System.Text.Json.Serialization.JsonPropertyName("code")]
34+
public int Code { get; set; }
35+
36+
/// <summary>
37+
/// 获取或设置错误信息。
38+
/// </summary>
39+
[Newtonsoft.Json.JsonProperty("message")]
40+
[System.Text.Json.Serialization.JsonPropertyName("message")]
41+
public string Message { get; set; } = default!;
42+
43+
/// <summary>
44+
/// 获取或设置详细信息。
45+
/// </summary>
46+
[Newtonsoft.Json.JsonProperty("detail")]
47+
[System.Text.Json.Serialization.JsonPropertyName("detail")]
48+
public Types.Detail Detail { get; set; } = default!;
49+
}
50+
}
51+
52+
/// <summary>
53+
/// 获取或设置套餐 ID。
54+
/// </summary>
55+
[Newtonsoft.Json.JsonProperty("first_mile_bundle_id")]
56+
[System.Text.Json.Serialization.JsonPropertyName("first_mile_bundle_id")]
57+
public string FirstMileBundleId { get; set; } = default!;
58+
59+
/// <summary>
60+
/// 获取或设置运单链接。
61+
/// </summary>
62+
[Newtonsoft.Json.JsonProperty("url")]
63+
[System.Text.Json.Serialization.JsonPropertyName("url")]
64+
public string Url { get; set; } = default!;
65+
66+
/// <summary>
67+
/// 获取或设置错误列表。
68+
/// </summary>
69+
[Newtonsoft.Json.JsonProperty("errors")]
70+
[System.Text.Json.Serialization.JsonPropertyName("errors")]
71+
public Types.Error[]? ErrorList { get; set; } = default!;
72+
}
73+
}
74+
}
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"handover_method": "PICKUP",
3+
"order_ids": [
4+
"578967030217083407"
5+
],
6+
"phone_tail_number": "1234",
7+
"shipping_provider_id": "7463353253533",
8+
"tracking_number": "SF1244442424"
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"code": 0,
3+
"data": {
4+
"errors": [
5+
{
6+
"code": 10007014,
7+
"detail": {
8+
"order_id": "578967030217083407"
9+
},
10+
"message": "invalid package id"
11+
}
12+
],
13+
"first_mile_bundle_id": "BA123444534",
14+
"url": "https://open-fs-va.tiktokshop.com/doc_tts/object/28b05?skipCookie=true&timeStamp=1721272360&sign=ef63cd6"
15+
},
16+
"message": "Success",
17+
"request_id": "202203070749000101890810281E8C70B7"
18+
}

0 commit comments

Comments
 (0)