Overview: Integration

View as Markdown

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:

$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 TypePrefixUse
Secret tokenst_{env}_Server-side API calls
Publishable tokenpt_{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:

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

Next steps