# m\_payment\_stripe\_api

Source: https://zotonic.com/docs/3164/m_payment_stripe_api

URI: https://zotonic.com/id/3164

Language: en



Create and synchronize Stripe payment-mode Checkout Sessions.

This module exposes Erlang functions rather than template model paths. `create(PaymentId, Context)` creates a session for an existing local payment and returns `{ok, #payment_psp_handler{}}` or an error. Use the shared payment-request notification for ordinary checkout; recurring session creation is unsupported.

For example, `m_payment_stripe_api:fetch_session(SessionId, Context)` returns `{ok, SessionMap}` or `{error, Reason}`. `sync_payment_session_status/2` retrieves and applies session status. `expire_payment_session/2` handles cancellation via the provider. `receive_session/3` feeds verified session data into shared payment receiving. API calls use `mod_payment_stripe.secret_key`.

These functions are trusted server APIs without model-path ACL checks. Webhook signature verification belongs to `controller_stripe_webhook`, before event data reaches this module.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/3164?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/3164?language=en>)
