@thorprovider/medusa-extended 1.7.21 → 1.7.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,8 +29,10 @@ import type {
29
29
  // Products & Prices
30
30
  DropshipperCostTier,
31
31
  DropshipperSaleTier,
32
- GetDropshipperProductsOptions,
33
- GetDropshipperProductsResponse,
32
+ GetDropshipperProductsOptions,
33
+ GetDropshipperProductsResponse,
34
+ ValidateCheckoutItemsRequest,
35
+ ValidateCheckoutItemsResponse,
34
36
  UpdateDropshipperProductStatusBody,
35
37
  UpdateDropshipperProductStatusResponse,
36
38
  UpdateDropshipperPricesBody,
@@ -57,6 +59,7 @@ import type {
57
59
  OrderNote,
58
60
  CreateOrderNoteBody,
59
61
  GetOrderNotesResponse,
62
+ CreateOrderNoteResponse,
60
63
  DeleteOrderNoteResponse,
61
64
  // Draft Orders
62
65
  GetDropshipperDraftOrdersOptions,
@@ -417,6 +420,23 @@ export class DropshipperClient {
417
420
  );
418
421
  }
419
422
 
423
+ /**
424
+ * Validate cart items for checkout — returns current stock_quantity, sale_price,
425
+ * and cost_price for each variant so the client can detect stale prices or
426
+ * insufficient stock before creating an order or converting a draft.
427
+ *
428
+ * `POST /admin/thor/dropshipper/checkout/validate`
429
+ */
430
+ async validateCheckoutItems(
431
+ body: ValidateCheckoutItemsRequest,
432
+ ): Promise<ValidateCheckoutItemsResponse> {
433
+ return this.request<ValidateCheckoutItemsResponse>(
434
+ 'POST',
435
+ '/admin/thor/dropshipper/checkout/validate',
436
+ body,
437
+ );
438
+ }
439
+
420
440
  /**
421
441
  * Toggle whether a product is visible in the public store for the current sales channel.
422
442
  * This does not mutate the shared global Medusa product status.
@@ -672,8 +692,8 @@ export class DropshipperClient {
672
692
  async createOrderNote(
673
693
  orderId: string,
674
694
  body: CreateOrderNoteBody,
675
- ): Promise<OrderNote> {
676
- return this.request<OrderNote>(
695
+ ): Promise<CreateOrderNoteResponse> {
696
+ return this.request<CreateOrderNoteResponse>(
677
697
  'POST',
678
698
  `/admin/thor/dropshipper/orders/${orderId}/notes`,
679
699
  body,