refundPaymentAndRecreatePaymentSessionWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the refundPaymentAndRecreatePaymentSessionWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow refunds a payment and creates a new payment session.
Source CodeExamples#
Steps#
Workflow hook
Step conditioned by when
View step details
Input#
refundPaymentAndRecreatePaymentSessionWorkflowInput
refundPaymentAndRecreatePaymentSessionWorkflowInputThe data to create payment sessions.
refundPaymentAndRecreatePaymentSessionWorkflowInput
refundPaymentAndRecreatePaymentSessionWorkflowInputpayment_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
stringpayment_id
stringThe ID of the payment to refund.
payment_id
stringamount
BigNumberInputThe amount to refund.
amount
BigNumberInputcustomer_id
stringOptionalThe ID of the customer that the payment session should be associated with.
customer_id
stringOptionaldata
Record<string, unknown>OptionalCustom data relevant for the payment provider to process the payment session.
Learn more in this documentation.
data
Record<string, unknown>Optionalcontext
Record<string, unknown>OptionalAdditional context that's useful for the payment provider to process the payment session.
Currently all of the context is calculated within the workflow.
context
Record<string, unknown>Optionalnote
stringOptionalThe note to attach to the refund.
note
stringOptionalOutput#
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
PaymentSessionStatuscreated_at
string | DateWhen the payment session was created
created_at
string | Dateupdated_at
string | DateWhen the payment session was updated
updated_at
string | Datepayment_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?