diff --git a/docs/TikTokGlobalShop/Basic_ModelDefinition.md b/docs/TikTokGlobalShop/Basic_ModelDefinition.md index 25e894de..476164e1 100644 --- a/docs/TikTokGlobalShop/Basic_ModelDefinition.md +++ b/docs/TikTokGlobalShop/Basic_ModelDefinition.md @@ -83,6 +83,10 @@ Notes: The following catalog is consistent with the catalog structure of [TikTok - Orders - Get Order List: `OrderSearchOrders` - Get Order Detail: `OrderBatchGetOrderDetail` + - Get Price Detail: `OrderGetOrderPriceDetail` + - Add External Order References: `OrderCreateExternalOrder` + - Get External Order References: `OrderGetExternalOrders` + - Search Order By External Order Reference: `OrderSearchExternalOrders` - Fulfillment - Get Order Split Attributes: `FulfillmentGetOrderSplitAttributes` - Split Orders: `FulfillmentSplitOrder` diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs index 99caac85..5e5e365f 100644 --- a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Extensions/TikTokShopClientExecuteOrderExtensions.cs @@ -56,5 +56,98 @@ public static class TikTokShopClientExecuteOrderExtensions return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// 异步调用 [GET] /order/{version}/orders/{order_id}/price_detail 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteOrderGetOrderPriceDetailAsync(this TikTokShopClient client, Models.OrderGetOrderPriceDetailRequest 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.Get, "order", request.ApiVersion, "orders", request.OrderId, "price_detail"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + #region ExternalOrder + /// + /// 异步调用 [POST] /order/{version}/orders/external_orders 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteOrderCreateExternalOrderAsync(this TikTokShopClient client, Models.OrderCreateExternalOrderRequest 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, "order", request.ApiVersion, "orders", "external_orders"); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [GET] /order/{version}/orders/{order_id}/external_orders 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteOrderGetExternalOrdersAsync(this TikTokShopClient client, Models.OrderGetExternalOrdersRequest 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.Get, "order", request.ApiVersion, "orders", request.OrderId, "external_orders") + .SetQueryParam("platform", request.Platform); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /order/{version}/orders/external_order_search 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteOrderSearchExternalOrdersAsync(this TikTokShopClient client, Models.OrderSearchExternalOrdersRequest 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, "order", request.ApiVersion, "orders", "external_order_search") + .SetQueryParam("external_order_id", request.ExternalOrderId) + .SetQueryParam("platform", request.Platform); + + return await client.SendFlurlRequesAsJsontAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion } } diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderCreateExternalOrderRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderCreateExternalOrderRequest.cs new file mode 100644 index 00000000..299e6eda --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderCreateExternalOrderRequest.cs @@ -0,0 +1,92 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /order/{version}/orders/external_orders 接口的请求。 + /// + public class OrderCreateExternalOrderRequest : TikTokShopRequest + { + public static class Types + { + public class Order + { + public static class Types + { + public class ExternalOrder + { + public static class Types + { + public class LineItem + { + /// + /// 获取或设置订单行 ID。 + /// + [Newtonsoft.Json.JsonProperty("origin_id")] + [System.Text.Json.Serialization.JsonPropertyName("origin_id")] + public string LineItemId { get; set; } = string.Empty; + + /// + /// 获取或设置外部订单行 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string ExternalLineItemId { get; set; } = string.Empty; + } + } + + /// + /// 获取或设置外部订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string ExternalOrderId { get; set; } = string.Empty; + + /// + /// 获取或设置来源平台。 + /// + [Newtonsoft.Json.JsonProperty("platform")] + [System.Text.Json.Serialization.JsonPropertyName("platform")] + public string Platform { get; set; } = string.Empty; + + /// + /// 获取或设置订单行列表。 + /// + [Newtonsoft.Json.JsonProperty("line_items")] + [System.Text.Json.Serialization.JsonPropertyName("line_items")] + public IList LineItemList { get; set; } = new List(); + } + } + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string OrderId { get; set; } = string.Empty; + + /// + /// 获取或设置外部订单信息。 + /// + [Newtonsoft.Json.JsonProperty("external_order")] + [System.Text.Json.Serialization.JsonPropertyName("external_order")] + public Types.ExternalOrder ExternalOrder { get; set; } = new Types.ExternalOrder(); + } + } + + /// + /// 获取或设置 API 版本号。 + /// 默认值:202406 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override int ApiVersion { get; set; } = 202406; + + /// + /// 获取或设置订单列表。 + /// + [Newtonsoft.Json.JsonProperty("orders")] + [System.Text.Json.Serialization.JsonPropertyName("orders")] + public IList OrderList { get; set; } = new List(); + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderCreateExternalOrderResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderCreateExternalOrderResponse.cs new file mode 100644 index 00000000..47bca069 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderCreateExternalOrderResponse.cs @@ -0,0 +1,88 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /order/{version}/orders/external_orders 接口的响应。 + /// + public class OrderCreateExternalOrderResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class Error + { + public static class Types + { + public class Detail + { + public static class Types + { + public class ExternalOrder + { + /// + /// 获取或设置外部订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string ExternalOrderId { get; set; } = default!; + + /// + /// 获取或设置来源平台。 + /// + [Newtonsoft.Json.JsonProperty("platform")] + [System.Text.Json.Serialization.JsonPropertyName("platform")] + public string Platform { get; set; } = default!; + } + } + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public string OrderId { get; set; } = default!; + + /// + /// 获取或设置外部订单信息。 + /// + [Newtonsoft.Json.JsonProperty("external_order")] + [System.Text.Json.Serialization.JsonPropertyName("external_order")] + public Types.ExternalOrder ExternalOrder { get; set; } = default!; + } + } + + /// + /// 获取或设置错误码。 + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } + + /// + /// 获取或设置错误信息。 + /// + [Newtonsoft.Json.JsonProperty("message")] + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + /// + /// 获取或设置详细信息。 + /// + [Newtonsoft.Json.JsonProperty("detail")] + [System.Text.Json.Serialization.JsonPropertyName("detail")] + public Types.Detail Detail { get; set; } = default!; + } + } + + /// + /// 获取或设置错误列表。 + /// + [Newtonsoft.Json.JsonProperty("errors")] + [System.Text.Json.Serialization.JsonPropertyName("errors")] + public Types.Error[]? ErrorList { get; set; } = default!; + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderGetExternalOrdersRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderGetExternalOrdersRequest.cs new file mode 100644 index 00000000..f2cdb6ca --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderGetExternalOrdersRequest.cs @@ -0,0 +1,30 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [GET] /order/{version}/orders/{order_id}/external_orders 接口的请求。 + /// + public class OrderGetExternalOrdersRequest : TikTokShopRequest + { + /// + /// 获取或设置 API 版本号。 + /// 默认值:202406 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override int ApiVersion { get; set; } = 202406; + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string OrderId { get; set; } = string.Empty; + + /// + /// 获取或设置来源平台。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string? Platform { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderGetExternalOrdersResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderGetExternalOrdersResponse.cs new file mode 100644 index 00000000..8706ca23 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderGetExternalOrdersResponse.cs @@ -0,0 +1,68 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [GET] /order/{version}/orders/{order_id}/external_orders 接口的响应。 + /// + public class OrderGetExternalOrdersResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class ExternalOrder + { + public static class Types + { + public class LineItem + { + /// + /// 获取或设置订单行 ID。 + /// + [Newtonsoft.Json.JsonProperty("origin_id")] + [System.Text.Json.Serialization.JsonPropertyName("origin_id")] + public string LineItemId { get; set; } = default!; + + /// + /// 获取或设置外部订单行 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string ExternalLineItemId { get; set; } = default!; + } + } + + /// + /// 获取或设置外部订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string ExternalOrderId { get; set; } = default!; + + /// + /// 获取或设置来源平台。 + /// + [Newtonsoft.Json.JsonProperty("platform")] + [System.Text.Json.Serialization.JsonPropertyName("platform")] + public string Platform { get; set; } = default!; + + /// + /// 获取或设置订单行列表。 + /// + [Newtonsoft.Json.JsonProperty("line_items")] + [System.Text.Json.Serialization.JsonPropertyName("line_items")] + public Types.LineItem[] LineItemList { get; set; } = default!; + } + } + + /// + /// 获取或设置外部订单列表。 + /// + [Newtonsoft.Json.JsonProperty("external_orders")] + [System.Text.Json.Serialization.JsonPropertyName("external_orders")] + public Types.ExternalOrder[] ExternalOrderList { get; set; } = default!; + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderSearchExternalOrdersRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderSearchExternalOrdersRequest.cs new file mode 100644 index 00000000..1fec2ceb --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderSearchExternalOrdersRequest.cs @@ -0,0 +1,30 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /order/{version}/orders/external_order_search 接口的请求。 + /// + public class OrderSearchExternalOrdersRequest : TikTokShopRequest + { + /// + /// 获取或设置 API 版本号。 + /// 默认值:202406 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override int ApiVersion { get; set; } = 202406; + + /// + /// 获取或设置外部订单 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string? ExternalOrderId { get; set; } + + /// + /// 获取或设置来源平台。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string? Platform { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderSearchExternalOrdersResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderSearchExternalOrdersResponse.cs new file mode 100644 index 00000000..68be8ca2 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/ExternalOrder/OrderSearchExternalOrdersResponse.cs @@ -0,0 +1,48 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [POST] /order/{version}/orders/external_order_search 接口的响应。 + /// + public class OrderSearchExternalOrdersResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class Order + { + public static class Types + { + public class ExternalOrder : OrderGetExternalOrdersResponse.Types.Data.Types.ExternalOrder + { + } + } + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string OrderId { get; set; } = default!; + + /// + /// 获取或设置外部订单信息。 + /// + [Newtonsoft.Json.JsonProperty("external_order")] + [System.Text.Json.Serialization.JsonPropertyName("external_order")] + public Types.ExternalOrder ExternalOrder { get; set; } = default!; + } + } + + /// + /// 获取或设置订单列表。 + /// + [Newtonsoft.Json.JsonProperty("orders")] + [System.Text.Json.Serialization.JsonPropertyName("orders")] + public Types.Order[] OrderList { get; set; } = default!; + } + } + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderPriceDetailRequest.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderPriceDetailRequest.cs new file mode 100644 index 00000000..89290d22 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderPriceDetailRequest.cs @@ -0,0 +1,23 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [GET] /order/{version}/orders/{order_id}/price_detail 接口的请求。 + /// + public class OrderGetOrderPriceDetailRequest : TikTokShopRequest + { + /// + /// 获取或设置 API 版本号。 + /// 默认值:202407 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public override int ApiVersion { get; set; } = 202407; + + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string OrderId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderPriceDetailResponse.cs b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderPriceDetailResponse.cs new file mode 100644 index 00000000..e275db1c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop/Models/Order/OrderGetOrderPriceDetailResponse.cs @@ -0,0 +1,398 @@ +namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.Models +{ + /// + /// 表示 [GET] /order/{version}/orders/{order_id}/price_detail 接口的响应。 + /// + public class OrderGetOrderPriceDetailResponse : TikTokShopResponse + { + public static class Types + { + public class Data + { + public static class Types + { + public class LineItem + { + /// + /// 获取或设置订单行 ID。 + /// + [Newtonsoft.Json.JsonProperty("id")] + [System.Text.Json.Serialization.JsonPropertyName("id")] + public string LineItemId { get; set; } = default!; + + /// + /// 获取或设置币种。 + /// + [Newtonsoft.Json.JsonProperty("currency")] + [System.Text.Json.Serialization.JsonPropertyName("currency")] + public string Currency { get; set; } = default!; + + /// + /// 获取或设置总金额。 + /// + [Newtonsoft.Json.JsonProperty("total")] + [System.Text.Json.Serialization.JsonPropertyName("total")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal TotalAmount { get; set; } + + /// + /// 获取或设置支付金额。 + /// + [Newtonsoft.Json.JsonProperty("payment")] + [System.Text.Json.Serialization.JsonPropertyName("payment")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal PaymentAmount { get; set; } + + /// + /// 获取或设置 SKU 原价。 + /// + [Newtonsoft.Json.JsonProperty("sku_list_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_list_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUListPrice { get; set; } + + /// + /// 获取或设置 SKU 现价。 + /// + [Newtonsoft.Json.JsonProperty("sku_sale_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_sale_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUSalePrice { get; set; } + + /// + /// 获取或设置 SKU 总金额。 + /// + [Newtonsoft.Json.JsonProperty("subtotal")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalAmount { get; set; } + + /// + /// 获取或设置 SKU 卖家折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("subtotal_deduction_seller")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal_deduction_seller")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalAmountSellerDeduction { get; set; } + + /// + /// 获取或设置 SKU 平台折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("subtotal_deduction_platform")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal_deduction_platform")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalAmountPlatformDeduction { get; set; } + + /// + /// 获取或设置 SKU 税费。 + /// + [Newtonsoft.Json.JsonProperty("subtotal_tax_amount")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal_tax_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalTaxAmount { get; set; } + + /// + /// 获取或设置商家促销金额。 + /// + [Newtonsoft.Json.JsonProperty("voucher_deduction_seller")] + [System.Text.Json.Serialization.JsonPropertyName("voucher_deduction_seller")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal VoucherAmountSellerDeduction { get; set; } + + /// + /// 获取或设置平台促销类型。 + /// + [Newtonsoft.Json.JsonProperty("voucher_deduction_platform")] + [System.Text.Json.Serialization.JsonPropertyName("voucher_deduction_platform")] + public string? VoucherPlatformDeductionType { get; set; } + + /// + /// 获取或设置运费原价。 + /// + [Newtonsoft.Json.JsonProperty("shipping_list_price")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_list_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingListPrice { get; set; } + + /// + /// 获取或设置运费现价。 + /// + [Newtonsoft.Json.JsonProperty("shipping_sale_price")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_sale_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingSalePrice { get; set; } + + /// + /// 获取或设置商家运费折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("shipping_fee_deduction_seller")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_deduction_seller")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingFeeSellerDeduction { get; set; } + + /// + /// 获取或设置平台运费折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("shipping_fee_deduction_platform")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_deduction_platform")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingFeePlatformDeduction { get; set; } + + /// + /// 获取或设置平台促销运费折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("shipping_fee_deduction_platform_voucher")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_deduction_platform_voucher")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingFeePlatformVoucherDeduction { get; set; } + + /// + /// 获取或设置税率。 + /// + [Newtonsoft.Json.JsonProperty("tax_rate")] + [System.Text.Json.Serialization.JsonPropertyName("tax_rate")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal TaxRate { get; set; } + + /// + /// 获取或设置税费。 + /// + [Newtonsoft.Json.JsonProperty("tax_amount")] + [System.Text.Json.Serialization.JsonPropertyName("tax_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal TaxAmount { get; set; } + + /// + /// 获取或设置不含税金额。 + /// + [Newtonsoft.Json.JsonProperty("net_price_amount")] + [System.Text.Json.Serialization.JsonPropertyName("net_price_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal NetPriceAmount { get; set; } + + /// + /// 获取或设置货到付款费用。 + /// + [Newtonsoft.Json.JsonProperty("cod_fee")] + [System.Text.Json.Serialization.JsonPropertyName("cod_fee")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? CashOnDeliveryFee { get; set; } + + /// + /// 获取或设置不含税货到付款费用。 + /// + [Newtonsoft.Json.JsonProperty("cod_fee_amount")] + [System.Text.Json.Serialization.JsonPropertyName("cod_fee_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? NetCashOnDeliveryFee { get; set; } + + /// + /// 获取或设置赠品原价。 + /// + [Newtonsoft.Json.JsonProperty("sku_gift_original_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_gift_original_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUGiftOriginalPrice { get; set; } + + /// + /// 获取或设置赠品不含税价格。 + /// + [Newtonsoft.Json.JsonProperty("sku_gift_net_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_gift_net_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUGiftNetPrice { get; set; } + } + } + + /// + /// 获取或设置币种。 + /// + [Newtonsoft.Json.JsonProperty("currency")] + [System.Text.Json.Serialization.JsonPropertyName("currency")] + public string Currency { get; set; } = default!; + + /// + /// 获取或设置总金额。 + /// + [Newtonsoft.Json.JsonProperty("total")] + [System.Text.Json.Serialization.JsonPropertyName("total")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal TotalAmount { get; set; } + + /// + /// 获取或设置支付金额。 + /// + [Newtonsoft.Json.JsonProperty("payment")] + [System.Text.Json.Serialization.JsonPropertyName("payment")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal PaymentAmount { get; set; } + + /// + /// 获取或设置 SKU 原价。 + /// + [Newtonsoft.Json.JsonProperty("sku_list_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_list_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUListPrice { get; set; } + + /// + /// 获取或设置 SKU 现价。 + /// + [Newtonsoft.Json.JsonProperty("sku_sale_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_sale_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUSalePrice { get; set; } + + /// + /// 获取或设置 SKU 总金额。 + /// + [Newtonsoft.Json.JsonProperty("subtotal")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalAmount { get; set; } + + /// + /// 获取或设置 SKU 卖家折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("subtotal_deduction_seller")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal_deduction_seller")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalAmountSellerDeduction { get; set; } + + /// + /// 获取或设置 SKU 平台折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("subtotal_deduction_platform")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal_deduction_platform")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalAmountPlatformDeduction { get; set; } + + /// + /// 获取或设置 SKU 税费。 + /// + [Newtonsoft.Json.JsonProperty("subtotal_tax_amount")] + [System.Text.Json.Serialization.JsonPropertyName("subtotal_tax_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SubtotalTaxAmount { get; set; } + + /// + /// 获取或设置商家促销金额。 + /// + [Newtonsoft.Json.JsonProperty("voucher_deduction_seller")] + [System.Text.Json.Serialization.JsonPropertyName("voucher_deduction_seller")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal VoucherAmountSellerDeduction { get; set; } + + /// + /// 获取或设置平台促销类型。 + /// + [Newtonsoft.Json.JsonProperty("voucher_deduction_platform")] + [System.Text.Json.Serialization.JsonPropertyName("voucher_deduction_platform")] + public string? VoucherPlatformDeductionType { get; set; } + + /// + /// 获取或设置运费原价。 + /// + [Newtonsoft.Json.JsonProperty("shipping_list_price")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_list_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingListPrice { get; set; } + + /// + /// 获取或设置运费现价。 + /// + [Newtonsoft.Json.JsonProperty("shipping_sale_price")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_sale_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingSalePrice { get; set; } + + /// + /// 获取或设置商家运费折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("shipping_fee_deduction_seller")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_deduction_seller")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingFeeSellerDeduction { get; set; } + + /// + /// 获取或设置平台运费折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("shipping_fee_deduction_platform")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_deduction_platform")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingFeePlatformDeduction { get; set; } + + /// + /// 获取或设置平台促销运费折扣金额。 + /// + [Newtonsoft.Json.JsonProperty("shipping_fee_deduction_platform_voucher")] + [System.Text.Json.Serialization.JsonPropertyName("shipping_fee_deduction_platform_voucher")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal ShippingFeePlatformVoucherDeduction { get; set; } + + /// + /// 获取或设置税率。 + /// + [Newtonsoft.Json.JsonProperty("tax_rate")] + [System.Text.Json.Serialization.JsonPropertyName("tax_rate")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal TaxRate { get; set; } + + /// + /// 获取或设置税费。 + /// + [Newtonsoft.Json.JsonProperty("tax_amount")] + [System.Text.Json.Serialization.JsonPropertyName("tax_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal TaxAmount { get; set; } + + /// + /// 获取或设置不含税金额。 + /// + [Newtonsoft.Json.JsonProperty("net_price_amount")] + [System.Text.Json.Serialization.JsonPropertyName("net_price_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal NetPriceAmount { get; set; } + + /// + /// 获取或设置货到付款费用。 + /// + [Newtonsoft.Json.JsonProperty("cod_fee")] + [System.Text.Json.Serialization.JsonPropertyName("cod_fee")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? CashOnDeliveryFee { get; set; } + + /// + /// 获取或设置不含税货到付款费用。 + /// + [Newtonsoft.Json.JsonProperty("cod_fee_net_amount")] + [System.Text.Json.Serialization.JsonPropertyName("cod_fee_net_amount")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal? NetCashOnDeliveryFee { get; set; } + + /// + /// 获取或设置赠品原价。 + /// + [Newtonsoft.Json.JsonProperty("sku_gift_original_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_gift_original_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUGiftOriginalPrice { get; set; } + + /// + /// 获取或设置赠品不含税价格。 + /// + [Newtonsoft.Json.JsonProperty("sku_gift_net_price")] + [System.Text.Json.Serialization.JsonPropertyName("sku_gift_net_price")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberReadOnlyConverter))] + public decimal SKUGiftNetPrice { get; set; } + + /// + /// 获取或设置订单行列表。 + /// + [Newtonsoft.Json.JsonProperty("line_items")] + [System.Text.Json.Serialization.JsonPropertyName("line_items")] + public Types.LineItem[] LineItemList { get; set; } = default!; + } + } + } +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderCreateExternalOrderRequest.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderCreateExternalOrderRequest.json new file mode 100644 index 00000000..1999ba44 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderCreateExternalOrderRequest.json @@ -0,0 +1,17 @@ +{ + "orders": [ + { + "external_order": { + "id": "676461413038785752", + "line_items": [ + { + "id": "577086512123755123", + "origin_id": "677086512123755123" + } + ], + "platform": "SHOPIFY" + }, + "id": "576461413038785752" + } + ] +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderCreateExternalOrderResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderCreateExternalOrderResponse.json new file mode 100644 index 00000000..c8604512 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderCreateExternalOrderResponse.json @@ -0,0 +1,20 @@ +{ + "code": 0, + "data": { + "errors": [ + { + "code": "36020001", + "detail": { + "external_order": { + "id": "676461413038785752", + "platform": "SHOPIFY" + }, + "order_id": "576461413038785752" + }, + "message": "Invalid order_id" + } + ] + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderGetExternalOrdersResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderGetExternalOrdersResponse.json new file mode 100644 index 00000000..9fe94210 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderGetExternalOrdersResponse.json @@ -0,0 +1,19 @@ +{ + "code": 0, + "data": { + "external_orders": [ + { + "id": "676461413038785752", + "line_items": [ + { + "id": "577086512123755123", + "origin_id": "677086512123755123" + } + ], + "platform": "SHOPIFY" + } + ] + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderSearchExternalOrdersResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderSearchExternalOrdersResponse.json new file mode 100644 index 00000000..4cc9aa8b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/ExternalOrder/OrderSearchExternalOrdersResponse.json @@ -0,0 +1,22 @@ +{ + "code": 0, + "data": { + "orders": [ + { + "external_order": { + "id": "676461413038785752", + "line_items": [ + { + "id": "577086512123755123", + "origin_id": "677086512123755123" + } + ], + "platform": "SHOPIFY" + }, + "id": "576461413038785752" + } + ] + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +} diff --git a/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/OrderGetOrderPriceDetailResponse.json b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/OrderGetOrderPriceDetailResponse.json new file mode 100644 index 00000000..7527b384 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.UnitTests/ModelSamples/_/Order/OrderGetOrderPriceDetailResponse.json @@ -0,0 +1,58 @@ +{ + "code": 0, + "data": { + "cod_fee": "0.00", + "cod_fee_net_amount": "0.00", + "currency": "USD", + "line_items": [ + { + "cod_fee": "0.00", + "cod_fee_amount": "0.00", + "currency": "USD", + "id": "576461413032342720", + "net_price_amount": "97.00", + "payment": "101.00", + "shipping_fee_deduction_platform": "12.00", + "shipping_fee_deduction_platform_voucher": "1010000", + "shipping_fee_deduction_seller": "10.00", + "shipping_list_price": "25.00", + "shipping_sale_price": "3.00", + "sku_gift_net_price": "2.02", + "sku_gift_original_price": "2.00", + "sku_list_price": "97.00", + "sku_sale_price": "96.00", + "subtotal": "98.00", + "subtotal_deduction_platform": "0.50", + "subtotal_deduction_seller": "0.50", + "subtotal_tax_amount": "2.00", + "tax_amount": "2.00", + "tax_rate": "0.021", + "total": "122.00", + "voucher_deduction_platform": "1010000", + "voucher_deduction_seller": "1020000" + } + ], + "net_price_amount": "97.00", + "payment": "101.00", + "shipping_fee_deduction_platform": "12.00", + "shipping_fee_deduction_platform_voucher": "1010000", + "shipping_fee_deduction_seller": "10.00", + "shipping_list_price": "25.00", + "shipping_sale_price": "3.00", + "sku_gift_net_price": "2.02", + "sku_gift_original_price": "2.00", + "sku_list_price": "97.00", + "sku_sale_price": "96.00", + "subtotal": "98.00", + "subtotal_deduction_platform": "0.50", + "subtotal_deduction_seller": "0.50", + "subtotal_tax_amount": "2.00", + "tax_amount": "2.00", + "tax_rate": "0.021", + "total": "122.00", + "voucher_deduction_platform": "1010000", + "voucher_deduction_seller": "1020000" + }, + "message": "Success", + "request_id": "202203070749000101890810281E8C70B7" +}