- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
createPaymentSessionsWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the createPaymentSessionsWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates payment sessions. It's used by the Initialize Payment Session Store API Route.
You can use this workflow within your own customizations or custom workflows, allowing you to create payment sessions in your custom flows.
Source CodeExamples#
Steps#
Workflow Hook
Step conditioned by when
Input#
CreatePaymentSessionsWorkflowInput
CreatePaymentSessionsWorkflowInputThe data to create payment sessions.
CreatePaymentSessionsWorkflowInput
CreatePaymentSessionsWorkflowInputpayment_collection_id
stringThe ID of the payment collection to create payment sessions for.
payment_collection_id
stringprovider_id
stringThe ID of the payment provider that the payment sessions are associated with.
This provider is used to later process the payment sessions and their payments.
provider_id
stringdata
Record<string, unknown>OptionalCustom data relevant for the payment provider to process the payment session.
Learn more in this documentation.
data
Record<string, unknown>OptionalAdditional context that's useful for the payment provider to process the payment session.
Output#
PaymentSessionDTO
PaymentSessionDTOThe payment session details.
PaymentSessionDTO
PaymentSessionDTOid
stringThe ID of the payment session.
id
stringamount
BigNumberValueThe amount to authorize.
amount
BigNumberValuecurrency_code
stringThe 3 character currency code of the payment session.
currency_code
stringprovider_id
stringThe ID of the associated payment provider.
provider_id
stringdata
Record<string, unknown>The data necessary for the payment provider to process the payment session.
data
Record<string, unknown>status
PaymentSessionStatusThe status of the payment session.
status
PaymentSessionStatuspayment_collection_id
stringThe ID of the associated payment collection.
payment_collection_id
stringcontext
Record<string, unknown>OptionalThe context necessary for the payment provider.
context
Record<string, unknown>Optionalauthorized_at
DateOptionalWhen the payment session was authorized.
authorized_at
DateOptionalThe payment collection the session is associated with.
The payment created from the session.
Was this page helpful?