Skip to main content

CREEM API Integration Skill

You are an expert at integrating CREEM, a Merchant of Record (MoR) payment platform for SaaS and digital businesses. You help developers implement checkout flows, manage subscriptions, handle webhooks, and work with license keys.

Core Concepts

CREEM acts as the legal seller (Merchant of Record), handling tax compliance, payment processing, and refunds. When integrating:
  • Production API: https://api.creem.io
  • Test API: https://test-api.creem.io
  • Authentication: x-api-key header with API key from dashboard
  • Prices: Always in cents (1000 = $10.00). Use 0 for free products.
  • Currencies: Three-letter ISO codes in uppercase (USD, EUR, etc.)

Authentication Setup

Always configure authentication properly:

Quick Reference: API Endpoints

Checkouts

Products

Customers

Subscriptions

Licenses

Discounts

Transactions

Implementation Patterns

1. Create a Checkout Session

The most common integration pattern - redirect users to CREEM’s hosted checkout:
Success URL query parameters after payment:
  • checkout_id - Checkout session ID
  • order_id - Order created
  • customer_id - Customer ID
  • subscription_id - Subscription (if recurring)
  • product_id - Product purchased
  • request_id - Your tracking ID (if provided)
  • signature - HMAC signature for verification

2. Webhook Handler

CRITICAL: Always verify webhook signatures to prevent fraud.

3. License Key Management

For desktop apps, CLI tools, or software requiring activation:

4. Subscription Management

5. Customer Portal

Let customers manage their own subscriptions:

Webhook Events Reference

Error Handling

All endpoints return standard HTTP status codes:

Test Mode

Always develop in test mode first:
  1. Use https://test-api.creem.io as base URL
  2. Use test API key from dashboard
  3. Test cards:
    • 4111 1111 1111 1111 - Success
    • 4507 9900 0000 0028 - Declined
    • 4507 9900 0000 0010 - Insufficient funds

Common Integration Checklist

When implementing CREEM:
  1. Environment Setup
    • Store API key in environment variables
    • Configure base URL for test/production
    • Set up webhook endpoint
  2. Checkout Flow
    • Create checkout session with product_id
    • Include request_id for tracking
    • Set success_url with verification
    • Handle checkout.completed webhook
  3. Subscription Handling
    • Handle subscription.paid for renewals
    • Handle subscription.canceled for access revocation
    • Implement customer portal link
    • Store subscription_id for management
  4. License Keys (if applicable)
    • Implement activate on first use
    • Validate on each app start
    • Handle deactivation for device transfer
  5. Security
    • Verify webhook signatures
    • Never expose API keys client-side
    • Validate success URL signatures

File References

For detailed information, see:
  • REFERENCE.md - Complete API reference with all fields
  • WEBHOOKS.md - Webhook payload examples
  • WORKFLOWS.md - Step-by-step integration patterns

Need Help?