# 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_..."
```
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_{env}_` | Server-side API calls |
| **Publishable token** | `pt_{env}_` | Client-side SDKs |
Where `{env}` is `prod` for production or `stg` for staging (e.g., `st_prod_abc123`, `pt_stg_xyz789`).
**Generate API tokens:**
1. Navigate to **Developers > API Tokens**
2. Click **Create API Token**
3. 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:
Official Python SDK for server-side integrations.
# Frontend libraries
For client-side integrations, use our frontend library:
JavaScript library for embedding secure payment elements on your website.
# Webhooks
Receive real-time notifications when events occur in your PaymentKit account:
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)
```
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
Learn how to test your integration with test cards and simulated scenarios.
# Next steps
Follow our quickstart guide to process your first payment.
Configure webhook endpoints to receive event notifications.
Add payment forms directly to your website.
Browse the full API reference documentation.