validateOrderCreditLinesStep - Medusa Core Workflows Reference

This documentation provides a reference to the validateOrderCreditLinesStep. It belongs to the @medusajs/medusa/core-flows package.

src/workflows/my-workflow.ts
1import { createWorkflow } from "@medusajs/framework/workflows-sdk"2import { validateOrderCreditLinesStep } from "@medusajs/medusa/core-flows"3
4const myWorkflow = createWorkflow(5  "my-workflow",6  () => {7    const data = validateOrderCreditLinesStep({8      "order": {9        "id": "id_Nv9dSqpSq22Fmx",10        "version": 1,11        "display_id": 18,12        "status": "canceled",13        "currency_code": "pen",14        "created_at": "2025-10-02T01:01:04.998Z",15        "updated_at": "2026-03-20T06:22:28.691Z",16        "original_item_total": {17          "numeric": 218        },19        "original_item_subtotal": {20          "numeric": 4321        },22        "original_item_tax_total": {23          "numeric": 424        },25        "item_total": {26          "numeric": 2927        },28        "item_subtotal": {29          "numeric": 3730        },31        "item_tax_total": {32          "numeric": 1133        },34        "original_total": {35          "numeric": 1536        },37        "original_subtotal": {38          "numeric": 4339        },40        "original_tax_total": {41          "numeric": 4442        },43        "total": {44          "numeric": 3045        },46        "subtotal": {47          "numeric": 3848        },49        "tax_total": {50          "numeric": 1451        },52        "discount_subtotal": {53          "numeric": 2154        },55        "discount_total": {56          "numeric": 3357        },58        "discount_tax_total": {59          "numeric": 4960        },61        "gift_card_total": {62          "numeric": 1863        },64        "gift_card_tax_total": {65          "numeric": 2166        },67        "shipping_total": {68          "numeric": 4769        },70        "shipping_subtotal": {71          "numeric": 3672        },73        "shipping_tax_total": {74          "numeric": 1075        },76        "original_shipping_total": {77          "numeric": 4378        },79        "original_shipping_subtotal": {80          "numeric": 481        },82        "original_shipping_tax_total": {83          "numeric": 3684        }85      },86      "creditLines": [87        "{value}"88      ]89    })90  }91)

Input#

The order details.
idstring
The ID of the order.
versionnumber
The version of the order.
display_idnumber
The order's display ID.
The status of the order.
currency_codestring
The currency of the order
created_atstring | Date
When the order was created.
updated_atstring | Date
When the order was updated.
original_item_totalBigNumberValue
The original item total of the order.
original_item_subtotalBigNumberValue
The original item subtotal of the order.
original_item_tax_totalBigNumberValue
The original item tax total of the order.
item_totalBigNumberValue
The item total of the order.
item_subtotalBigNumberValue
The item subtotal of the order.
item_tax_totalBigNumberValue
The item tax total of the order.
original_totalBigNumberValue
The original total of the order.
original_subtotalBigNumberValue
The original subtotal of the order.
original_tax_totalBigNumberValue
The original tax total of the order.
The total of the order.
The subtotal of the order. (Excluding taxes)
The tax total of the order.
discount_subtotalBigNumberValue
The discount subtotal of the order.
discount_totalBigNumberValue
The discount total of the order.
discount_tax_totalBigNumberValue
The discount tax total of the order.
gift_card_totalBigNumberValue
The gift card total of the order.
gift_card_tax_totalBigNumberValue
The gift card tax total of the order.
shipping_totalBigNumberValue
The shipping total of the order.
shipping_subtotalBigNumberValue
The shipping subtotal of the order.
shipping_tax_totalBigNumberValue
The shipping tax total of the order.
original_shipping_totalBigNumberValue
The original shipping total of the order.
original_shipping_subtotalBigNumberValue
The original shipping subtotal of the order.
original_shipping_tax_totalBigNumberValue
The original shipping tax total of the order.
order_changeOrderChangeDTOOptional
The active order change, if any.
region_idstringOptional
The ID of the region the order belongs to.
customer_idstringOptional
The ID of the customer on the order.
sales_channel_idstringOptional
The ID of the sales channel the order belongs to.
emailstringOptional
The email of the order.
shipping_addressOrderAddressDTOOptional
The associated shipping address.
billing_addressOrderAddressDTOOptional
The associated billing address.
itemsOrderLineItemDTO[]Optional
The associated order details / line items.
shipping_methodsOrderShippingMethodDTO[]Optional
The associated shipping methods
transactionsOrderTransactionDTO[]Optional
The tramsactions associated with the order
credit_linesOrderCreditLineDTO[]Optional
The credit lines for an order
summaryOrderSummaryDTOOptional
The summary of the order totals.
is_draft_orderbooleanOptional
Whether the order is a draft order.
metadatanull | Record<string, unknown>Optional
Holds custom data in key-value pairs.
canceled_atstring | DateOptional
When the order was canceled.
creditLinesOmit<CreateOrderCreditLineDTO, "order_id">[]
The amount of the credit line.
referencenull | string
The reference model name that the credit line is generated from
reference_idnull | string
The reference model id that the credit line is generated from
metadatanull | Record<string, unknown>Optional
The metadata of the order detail
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break