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": 5,10      "currency_code": "bnd"11    })12  }13)

Input#

AddOrderTransactionStepInputAddOrderTransactionStepInput
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?