Overview: Integration
Integrate PaymentKit into your application using our APIs, SDKs, and webhooks. Build custom checkout flows, sync billing data, and automate your payment workflows.
API authentication
All API requests require authentication using your secret API key:
Keep your secret API key secure. Never expose it in client-side code or public repositories.
API keys
PaymentKit provides two types of API keys:
Where {env} is prod for production or stg for staging (e.g., st_prod_abc123, pt_stg_xyz789).
Generate API tokens:
- Navigate to Developers > API Tokens
- Click Create API Token
- Copy your tokens and store them securely
Use staging tokens (st_stg_, pt_stg_) during development. Staging tokens work with test payment methods and don’t process real payments.
Integration options
Choose the integration approach that best fits your needs:
Redirect customers to a PaymentKit-hosted checkout page. Fastest to implement with no frontend code required.
Embed checkout elements directly in your site for a seamless branded experience.
Use the dashboard to create checkout links and manage billing without writing code.
SDKs
Use our official SDK for easier integration:
Frontend libraries
For client-side integrations, use our frontend library:
Webhooks
Receive real-time notifications when events occur in your PaymentKit account:
Common webhook use cases:
- Fulfill orders when payments succeed
- Provision access when subscriptions are created
- Send receipts when invoices are paid
- Revoke access when subscriptions are cancelled
Data synchronization
Keep your systems in sync with PaymentKit:
Push (Webhooks)
Listen for events and update your database when things change in PaymentKit.
Pull (API)
Query the API to fetch current state when needed.
For best results, use webhooks for real-time updates and API calls for verification and reconciliation.
Testing
PaymentKit provides a complete test environment:
- Test API keys - Process test payments without real charges
- Test cards - Simulate various payment scenarios
- Test mode - All dashboard features work in test mode