Skip to content

Commit

Permalink
feat(tiktokshop): 新增新版退货退款相关接口
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed May 14, 2024
1 parent 20bd104 commit 620183d
Show file tree
Hide file tree
Showing 48 changed files with 2,724 additions and 8 deletions.
18 changes: 15 additions & 3 deletions docs/TikTokGlobalShop/Basic_ModelDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Naming Policies:

### APIs

Notes: The following catalog is consistent with the catalog structure of [TikTokShop Partner Center API Reference](https://partner.tiktokshop.com/docv2/page/6507ead7b99d5302be949ba9?external_id=6507ead7b99d5302be949ba9).
Notes: The following catalog is consistent with the catalog structure of [TikTokShop Partner Center API Reference](https://partner.tiktokshop.com/docv2/page/6632a7434585a502e1cb5591).

<details>

Expand Down Expand Up @@ -58,6 +58,7 @@ Notes: The following catalog is consistent with the catalog structure of [TikTok
- Get Global Product: `ProductGetGlobalProductDetail`
- Edit Global Product: `ProductUpdateGlobalProduct`
- Delete Global Products: `ProductDeleteGlobalProducts`
- Check Product Listing: `ProductCreateProductListingCheck`
- Check Listing Prerequisites: `ProductGetPrerequisites`
- Search Global Products: `ProductSearchGlobalProducts`
- Search Products: `ProductSearchProducts`
Expand All @@ -66,9 +67,20 @@ Notes: The following catalog is consistent with the catalog structure of [TikTok
- Get Order List: `OrderSearchOrders`
- Get Order Detail: `OrderBatchGetOrderDetail`
- Fulfillment
- *Pending ...*
- _Pending ..._
- Return and Refund
- *Pending ...*
- Search Cancellations: `ReturnRefundSearchCancellations`
- Approve Cancellation: `ReturnRefundApproveCancellation`
- Reject Cancellation: `ReturnRefundRejectCancellation`
- Search Returns: `ReturnRefundSearchReturns`
- Approve Return: `ReturnRefundApproveReturn`
- Reject Return: `ReturnRefundRejectReturn`
- Get Aftersale Eligibility: `ReturnRefundGetOrderAftersaleEligibility`
- Get Reject Reasons: `ReturnRefundGetRejectReasons`
- Calculate Refund: `ReturnRefundCalculateRefund`
- Get Return Records: `ReturnRefundGetReturnRecords`
- Cancel Order: `ReturnRefundCreateCancellation`
- Create Return: `ReturnRefundCreateReturn`
- Logistics
- Get Warehouse Delivery Options: `LogisticsGetWarehouseDeliveryOptions`
- Get Warehouse List: `LogisticsGetWarehouses`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class TikTokShopClientExecuteAuthExtensions
/// <para>异步调用 [GET] /token/get 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/doc/page/261250 ]]>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/6632a7a926b40c02d97de61b ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -32,7 +32,7 @@ public static class TikTokShopClientExecuteAuthExtensions
.SetQueryParam("app_secret", client.Credentials.AppSecret)
.SetQueryParam("grant_type", request.GrantType)
.SetQueryParam("auth_code", request.AuthorizedCode)
.RemoveQueryParams("access_token", "timestamp", "shop_id", "shop_cipher", "version");
.RemoveQueryParams("access_token", "timestamp", "shop_cipher");

return await client.SendFlurlRequesAsJsontAsync<Models.AuthGetTokenResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand All @@ -41,8 +41,7 @@ public static class TikTokShopClientExecuteAuthExtensions
/// <para>异步调用 [GET] /token/refresh 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/doc/page/261250 ]]> <br/>
/// <![CDATA[ https://partner.tiktokshop.com/doc/page/262967 ]]>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/6632a7a926b40c02d97de61b ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -61,7 +60,7 @@ public static class TikTokShopClientExecuteAuthExtensions
.SetQueryParam("app_secret", client.Credentials.AppSecret)
.SetQueryParam("grant_type", request.GrantType)
.SetQueryParam("refresh_token", request.RefreshToken)
.RemoveQueryParams("access_token", "timestamp", "shop_id", "shop_cipher", "version");
.RemoveQueryParams("access_token", "timestamp", "shop_cipher");

return await client.SendFlurlRequesAsJsontAsync<Models.AuthRefreshTokenResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,28 @@ public static class TikTokShopClientExecuteProductExtensions
return await client.SendFlurlRequesAsJsontAsync<Models.ProductCreateProductResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// <para>异步调用 [POST] /product/{version}/products/listing_check 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://partner.tiktokshop.com/docv2/page/650a0ee8f1fd3102b91c6493 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ProductCreateProductListingCheckResponse> ExecuteProductCreateProductListingCheckAsync(this TikTokShopClient client, Models.ProductCreateProductListingCheckRequest 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, "product", request.ApiVersion, "products", "listing_check");

return await client.SendFlurlRequesAsJsontAsync<Models.ProductCreateProductListingCheckResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// <para>异步调用 [POST] /product/{version}/products/search 接口。</para>
/// <para>
Expand Down
Loading

0 comments on commit 620183d

Please sign in to comment.