Initialize and add a payment session to a payment collection. This is used during checkout, where you create a payment collection for the cart, then initialize a payment session for the payment provider that the customer chooses.
It’s highly recommended to have an amount greater than 0 in the payment collection, as some payment providers, such as Stripe, require a non-zero amount to create a payment session. Otherwise, an error will be thrown on the payment provider’s side.
In cases where you want to create a payment session for a payment collection with an amount of 0, you can use the Manual System Payment Provider instead of third-party payment providers. The Manual System Payment Provider is built into Medusa and allows you to create payment sessions without interacting with an external payment provider.
Make sure to configure the Manual System Payment Provider in your store’s region. Learn more in the Manage Region user guide.
Publishable API Key created in the Medusa Admin.
The locale in BCP 47 format to retrieve localized content.
"en-US"
The payment collection's ID.
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
The locale in BCP 47 format to retrieve localized content.
"en-US"
OK
The payment collection's details.
The payment collection's details.