- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
validateRefundStep - Medusa Core Workflows Reference
This documentation provides a reference to the validateRefundStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step validates that the refund is valid for the order
1import { createWorkflow } from "@medusajs/framework/workflows-sdk"2import { validateRefundStep } from "@medusajs/medusa/core-flows"3 4const myWorkflow = createWorkflow(5 "my-workflow",6 () => {7 const data = validateRefundStep({8 "order": {9 "id": "id_ScT29ulv8OCuFN",10 "version": 31,11 "display_id": 24,12 "status": "draft",13 "currency_code": "{value}",14 "created_at": "2025-11-03T11:49:09.128Z",15 "updated_at": "2025-10-23T16:49:38.203Z",16 "original_item_total": {17 "numeric": 4318 },19 "original_item_subtotal": {20 "numeric": 4921 },22 "original_item_tax_total": {23 "numeric": 4724 },25 "item_total": {26 "numeric": 2127 },28 "item_subtotal": {29 "numeric": 4630 },31 "item_tax_total": {32 "numeric": 2333 },34 "original_total": {35 "numeric": 1936 },37 "original_subtotal": {38 "numeric": 1239 },40 "original_tax_total": {41 "numeric": 542 },43 "total": {44 "numeric": 945 },46 "subtotal": {47 "numeric": 048 },49 "tax_total": {50 "numeric": 2451 },52 "discount_subtotal": {53 "numeric": 4054 },55 "discount_total": {56 "numeric": 3257 },58 "discount_tax_total": {59 "numeric": 3760 },61 "gift_card_total": {62 "numeric": 3763 },64 "gift_card_tax_total": {65 "numeric": 166 },67 "shipping_total": {68 "numeric": 1369 },70 "shipping_subtotal": {71 "numeric": 472 },73 "shipping_tax_total": {74 "numeric": 175 },76 "original_shipping_total": {77 "numeric": 4178 },79 "original_shipping_subtotal": {80 "numeric": 2881 },82 "original_shipping_tax_total": {83 "numeric": 184 }85 },86 "payment": {87 "id": "id_wQ7DWNOU1Vhpofgzrs",88 "amount": {89 "numeric": 4990 },91 "currency_code": "{value}",92 "provider_id": "{value}",93 "payment_collection_id": "{value}"94 }95 })96 }97)
Input#
order
OrderDTOThe order details.
order
OrderDTOid
stringThe ID of the order.
id
stringversion
numberThe version of the order.
version
numberdisplay_id
numberThe order's display ID.
display_id
numberstatus
OrderStatusThe status of the order.
status
OrderStatuscurrency_code
stringThe currency of the order
currency_code
stringcreated_at
string | DateWhen the order was created.
created_at
string | Dateupdated_at
string | DateWhen the order was updated.
updated_at
string | Dateoriginal_item_total
BigNumberValueThe original item total of the order.
original_item_total
BigNumberValueoriginal_item_subtotal
BigNumberValueThe original item subtotal of the order.
original_item_subtotal
BigNumberValueoriginal_item_tax_total
BigNumberValueThe original item tax total of the order.
original_item_tax_total
BigNumberValueitem_total
BigNumberValueThe item total of the order.
item_total
BigNumberValueitem_subtotal
BigNumberValueThe item subtotal of the order.
item_subtotal
BigNumberValueitem_tax_total
BigNumberValueThe item tax total of the order.
item_tax_total
BigNumberValueoriginal_total
BigNumberValueThe original total of the order.
original_total
BigNumberValueoriginal_subtotal
BigNumberValueThe original subtotal of the order.
original_subtotal
BigNumberValueoriginal_tax_total
BigNumberValueThe original tax total of the order.
original_tax_total
BigNumberValuetotal
BigNumberValueThe total of the order.
total
BigNumberValuesubtotal
BigNumberValueThe subtotal of the order. (Excluding taxes)
subtotal
BigNumberValuetax_total
BigNumberValueThe tax total of the order.
tax_total
BigNumberValuediscount_subtotal
BigNumberValueThe discount subtotal of the order.
discount_subtotal
BigNumberValuediscount_total
BigNumberValueThe discount total of the order.
discount_total
BigNumberValuediscount_tax_total
BigNumberValueThe discount tax total of the order.
discount_tax_total
BigNumberValuegift_card_total
BigNumberValueThe gift card total of the order.
gift_card_total
BigNumberValuegift_card_tax_total
BigNumberValueThe gift card tax total of the order.
gift_card_tax_total
BigNumberValueshipping_total
BigNumberValueThe shipping total of the order.
shipping_total
BigNumberValueshipping_subtotal
BigNumberValueThe shipping subtotal of the order.
shipping_subtotal
BigNumberValueshipping_tax_total
BigNumberValueThe shipping tax total of the order.
shipping_tax_total
BigNumberValueoriginal_shipping_total
BigNumberValueThe original shipping total of the order.
original_shipping_total
BigNumberValueoriginal_shipping_subtotal
BigNumberValueThe original shipping subtotal of the order.
original_shipping_subtotal
BigNumberValueoriginal_shipping_tax_total
BigNumberValueThe original shipping tax total of the order.
original_shipping_tax_total
BigNumberValueThe active order change, if any.
region_id
stringOptionalThe ID of the region the order belongs to.
region_id
stringOptionalcustomer_id
stringOptionalThe ID of the customer on the order.
customer_id
stringOptionalsales_channel_id
stringOptionalThe ID of the sales channel the order belongs to.
sales_channel_id
stringOptionalemail
stringOptionalThe email of the order.
email
stringOptionalThe associated shipping address.
The associated billing address.
The associated order details / line items.
The associated shipping methods
The tramsactions associated with the order
The credit lines for an order
The summary of the order totals.
metadata
null | Record<string, unknown>OptionalHolds custom data in key-value pairs.
metadata
null | Record<string, unknown>Optionalcanceled_at
string | DateOptionalWhen the order was canceled.
canceled_at
string | DateOptionalpayment
PaymentDTO
payment
PaymentDTOid
stringThe ID of the payment.
id
stringamount
BigNumberValueThe payment's total amount.
amount
BigNumberValuecurrency_code
stringThe ISO 3 character currency code of the payment.
currency_code
stringprovider_id
stringThe ID of the associated payment provider.
provider_id
stringpayment_collection_id
stringThe ID of the associated payment collection.
payment_collection_id
stringThe raw amount of the payment.
The authorized amount of the payment.
The raw authorized amount of the payment.
cart_id
stringOptionalThe ID of the associated cart.
cart_id
stringOptionalorder_id
stringOptionalThe ID of the associated order.
order_id
stringOptionalorder_edit_id
stringOptionalThe ID of the associated order edit.
order_edit_id
stringOptionalcustomer_id
stringOptionalThe ID of the associated customer.
customer_id
stringOptionaldata
Record<string, unknown>OptionalThe data relevant for the payment provider to process the payment.
data
Record<string, unknown>Optionalcreated_at
string | DateOptionalWhen the payment was created.
created_at
string | DateOptionalupdated_at
string | DateOptionalWhen the payment was updated.
updated_at
string | DateOptionalcaptured_at
string | DateOptionalWhen the payment was captured.
captured_at
string | DateOptionalcanceled_at
string | DateOptionalWhen the payment was canceled.
canceled_at
string | DateOptionalThe sum of the associated captures' amounts.
The sum of the associated captures' raw amounts.
The sum of the associated refunds' amounts.
The sum of the associated refunds' raw amounts.
The associated captures.
The associated refunds.
The associated payment collection.
The payment session from which the payment is created.
Was this page helpful?