> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.paymentkit.com/guides/integration/overview/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.paymentkit.com/_mcp/server. # 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: ```bash curl https://app.paymentkit.com/api/{account_id}/customers \ -H "Authorization: Bearer st_prod_..." ``` > **Note** > > 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: | Key Type | Prefix | Use | | --------------------- | ---------- | --------------------- | | **Secret token** | `st_prod_` | Server-side API calls | | **Publishable token** | `pt_prod_` | Client-side SDKs | Both live and sandbox accounts use the `_prod_` prefix (e.g., `st_prod_abc123`, `pt_prod_xyz789`). **Generate API tokens:** 1. Navigate to **Developers > API Tokens** 2. Click **Create API Token** 3. Copy your tokens and store them securely > **Tip** > > Use sandbox accounts during development. Sandbox tokens work with test payment methods and don't process real payments. # Integration options Choose the integration approach that best fits your needs: #### [Hosted Checkout](/guides/hosted-pages/checkout-sessions) Redirect customers to a PaymentKit-hosted checkout page. Fastest to implement with no frontend code required. #### [Embedded Checkout](/guides/integration/sdk-reference/payment-kit-js/getting-started) Embed checkout elements directly in your site for a seamless branded experience. #### No-Code Use the dashboard to create checkout links and manage billing without writing code. # SDKs Use our official SDK for easier integration: #### [Python](/guides/integration/sdk-reference/python) Official Python SDK for server-side integrations. # Frontend libraries For client-side integrations, use our frontend library: #### [PaymentKit.js](/guides/integration/sdk-reference/payment-kit-js/getting-started) JavaScript library for embedding secure payment elements on your website. # Webhooks Receive real-time notifications when events occur in your PaymentKit account: #### [Webhooks](/guides/integration/webhooks) Set up webhook endpoints to receive event notifications and trigger automated workflows. **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. ```mermaid sequenceDiagram participant PK as PaymentKit participant YS as Your Server participant DB as Your Database PK->>YS: POST webhook (event data) YS->>DB: Update records ``` ## Pull (API) Query the API to fetch current state when needed. ```mermaid sequenceDiagram participant YS as Your Server participant PK as PaymentKit YS->>PK: GET /api/{account_id}/{resource} PK-->>YS: Response (current state) ``` > **Tip** > > 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 #### [Simulations (Test Clocks)](/guides/integration/simulations-test-clocks) Test subscription lifecycle behavior by advancing time with virtual test clocks. # Next steps #### [Accept your first payment](/guides/getting-started/accept-payments) Follow our quickstart guide to process your first payment. #### [Set up webhooks](/guides/integration/webhooks) Configure webhook endpoints to receive event notifications. #### [Embed checkout](/guides/integration/sdk-reference/payment-kit-js/getting-started) Add payment forms directly to your website. #### [Explore the API](/api-reference) Browse the full API reference documentation.