addOrderTransactionStep - Medusa Core Workflows Reference

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

This step creates order transactions.

src/workflows/my-workflow.ts
1import { createWorkflow } from "@medusajs/framework/workflows-sdk"2import { addOrderTransactionStep } from "@medusajs/medusa/core-flows"3
4const myWorkflow = createWorkflow(5  "my-workflow",6  () => {7    const data = addOrderTransactionStep({8      "order_id": "order_123",9      "amount": 32,10      "currency_code": "btn"11    })12  }13)

Input#

AddOrderTransactionStepInputAddOrderTransactionStepInput
The transaction(s) to add to the order.
order_idstring
The associated order's ID.
The amount of the transaction.
currency_codestring
The currency code of the transaction.
return_idstringOptional
The associated return's ID.
claim_idstringOptional
The associated claim's ID.
exchange_idstringOptional
The associated exchange's ID.
referencestringOptional
The data model this transaction references. For example, payment.
reference_idstringOptional
The ID of the data model's record referenced. For example, pay_132.

Output#

({ order_id: string | WorkflowData<string>; return_id?: string | WorkflowData<string | undefined> | undefined; claim_id?: string | WorkflowData<string | undefined> | undefined; ... 4 more ...; currency_code: string | WorkflowData<...>; } | (CreateOrderTransactionDTO | WorkflowData<...>)[]) & (CreateOrderTransactionD...({ order_id: string | WorkflowData<string>; return_id?: string | WorkflowData<string | undefined> | undefined; claim_id?: string | WorkflowData<string | undefined> | undefined; ... 4 more ...; currency_code: string | WorkflowData<...>; } | (CreateOrderTransactionDTO | WorkflowData<...>)[]) & (CreateOrderTransactionD...
({ order_id: string | WorkflowData<string>; return_id?: string | WorkflowData<string | undefined> | undefined; claim_id?: string | WorkflowData<string | undefined> | undefined; ... 4 more ...; currency_code: string | WorkflowData<...>; } | (CreateOrderTransactionDTO | WorkflowData<...>)[]) & (CreateOrderTransactionD...({ order_id: string | WorkflowData<string>; return_id?: string | WorkflowData<string | undefined> | undefined; claim_id?: string | WorkflowData<string | undefined> | undefined; ... 4 more ...; currency_code: string | WorkflowData<...>; } | (CreateOrderTransactionDTO | WorkflowData<...>)[]) & (CreateOrderTransactionD...
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