Appearance
Payment Session
A payment session is a mandatory channel that enables end-users to complete a payment flow. Every payment transaction is associated with exactly one session, which serves as the foundation for the entire payment process.
Overview
Payment sessions are the core building blocks of Stable Mint's payment infrastructure. They provide a secure and controlled environment for processing payments, ensuring that each transaction is properly tracked, authenticated, and completed.
Customer Management Models
Before creating payment sessions, partners must be onboarded to use one of two customer management flows:
Stable Mint-Managed Customers
In this model, Stable Mint owns and manages the customer relationship. This is ideal for partners who want a simplified integration without managing customer data.
Characteristics:
- Stable Mint handles all customer KYC/AML requirements
- Customer data is stored and managed by Stable Mint
- Partners don't need to manage user identities
- Simplified integration with minimal data requirements
- Available for hosted sessions only (
/session/hosted
)
Best for:
- Anonymous or one-time transactions
- Partners who don't want to manage customer data
- Quick marketplace integrations
- When customer relationship isn't critical to your business
Partner-Managed Customers
In this model, the partner owns and manages their customer relationships. Partners maintain control over their customer data while leveraging Stable Mint's payment infrastructure.
Characteristics:
- Partner retains ownership of customer relationships
- Partner provides customer identification (userId, email, country)
- Partner can optionally provide KYC data
- Customer data is linked to the partner's account
- Available for both hosted and embedded sessions
Best for:
- Businesses with existing customer bases
- When maintaining customer relationships is important
- Recurring payment scenarios
- When you need to track customer payment history
Important: Partners must be specifically onboarded and configured to use either Stable Mint-managed or partner-managed customer flows. Contact your account manager to enable the appropriate flow for your use case.
Types of Sessions
Stable Mint offers two types of payment sessions, each designed for different integration scenarios:
Hosted Session
A hosted session redirects users to Stable Mint's hosted checkout page. This is the simplest integration method and requires minimal development effort.
Available variants:
- Stable Mint-Managed:
/session/hosted
- For anonymous users - Partner-Managed:
/session/hosted/partner-managed-customer
- For identified customers
Best for:
- Quick integration
- Standard checkout flows
- When you want to maintain a consistent checkout experience
- When you don't need to customize the checkout UI
Learn more about Hosted Sessions →
Embedded Session
An embedded session integrates the payment flow directly into your website using Stable Mint's widget. This provides a seamless experience for your users without leaving your website.
Available variants:
- Partner-Managed only:
/session/embedded/partner-managed-customer
- Requires customer identification
Best for:
- Custom checkout experiences
- Single-page applications
- When you want to maintain your website's look and feel
- When you need more control over the payment flow
Learn more about Embedded Sessions →
Key Features
Both session types provide:
Security
- Encrypted communication
- Session-based authentication
- Fraud prevention measures
Flexibility
- Support for multiple payment methods
- Customizable user experience
- Webhook notifications
Reliability
- Idempotent requests
- Error handling
- Session expiration management
Implementation Considerations
When choosing between session types, consider:
Technical Requirements
- Hosted sessions require redirect handling
- Embedded sessions require widget integration
- Both require proper error handling
User Experience
- Hosted sessions provide a consistent experience
- Embedded sessions offer more customization
- Both support mobile and desktop devices
Development Effort
- Hosted sessions are quicker to implement
- Embedded sessions require more integration work
- Both require proper testing
Maintenance
- Both types require monitoring
- Both need proper error handling
- Both should implement webhook processing
Best Practices
Session Management
- Always validate session status
- Handle session expiration
- Implement proper error handling
Security
- Use HTTPS for all communications
- Implement proper authentication
- Follow security best practices
User Experience
- Provide clear error messages
- Implement proper loading states
- Handle edge cases gracefully
Testing
- Test in sandbox environment
- Verify all payment flows
- Test error scenarios
Getting Started
To implement payment sessions:
- Choose the appropriate session type based on your needs
- Follow the specific implementation guide for your chosen type
- Implement proper error handling and webhook processing
- Test thoroughly in the sandbox environment
- Monitor and maintain your implementation
For detailed implementation guides, refer to: