@@ -22,6 +22,17 @@ partial class ShopOperations
2222
2323public partial interface IOrderOperations
2424{
25+ /// <summary>
26+ /// Cancels an order. The Order ID can also be a Basket ID.
27+ /// HTTP POST /shop/orders/{orderId}/cancel
28+ /// </summary>
29+ /// <param name="orderId">The order ID, or the basket ID.</param>
30+ /// <param name="cancellationToken">The cancellation token.</param>
31+ /// <returns>The order instance.</returns>
32+ Task < TrybeResponse < Order > > CancelOrderAsync (
33+ string orderId ,
34+ CancellationToken cancellationToken = default ) ;
35+
2536 /// <summary>
2637 /// Submits an order. The Order ID can also be a Basket ID.
2738 /// HTTP POST /shop/orders/{orderId}/submit
@@ -49,6 +60,18 @@ Task<TrybeResponse<Order>> UpdateOrderAsync(
4960
5061public partial class OrderOperations ( PathString path , ApiClient client ) : IOrderOperations
5162{
63+ public async Task < TrybeResponse < Order > > CancelOrderAsync (
64+ string orderId ,
65+ CancellationToken cancellationToken = default )
66+ {
67+ Ensure . IsNotNullOrEmpty ( orderId , nameof ( orderId ) ) ;
68+
69+ var request = new TrybeRequest ( HttpMethod . Post , path + $ "/{ orderId } /cancel") ;
70+
71+ return await client . FetchAsync < Order > ( request , cancellationToken )
72+ . ConfigureAwait ( false ) ;
73+ }
74+
5275 public async Task < TrybeResponse < Order > > SubmitOrderAsync (
5376 string orderId ,
5477 CancellationToken cancellationToken = default )
0 commit comments