Added shipping method data to tax module context (#13747)

This commit is contained in:
Pepijn
2025-10-21 19:36:29 +02:00
committed by GitHub
parent 17fb3e2e10
commit 5df903f5fb
3 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@medusajs/core-flows": patch
"@medusajs/types": patch
---
Added shipping method data to tax module context

View File

@@ -91,6 +91,12 @@ function normalizeTaxModuleContext(
},
customer,
is_return: isReturn ?? false,
shipping_methods: orderOrCart.shipping_methods?.map((method) => ({
id: method.id,
name: method.name,
shipping_option_id: method.shipping_option_id,
amount: method.amount,
})),
}
}

View File

@@ -490,6 +490,31 @@ export interface TaxCalculationContext {
* Whether the tax lines are calculated for an order return.
*/
is_return?: boolean
/**
* The shipping method details.
*/
shipping_methods?: {
/**
* The associated shipping method's ID.
*/
id: string
/**
* The name of the shipping method.
*/
name: string
/**
* The associated shipping options's ID.
*/
shipping_option_id: string
/**
* The amount of the shipping method.
*/
amount: number
}[]
}
/**