# Creem HMAC-SHA256 Webhook Credit Top-Up API Gateway (Replay-Safe)

> **Target Keyword**: `Creem HMAC webhook credit top-up API gateway` | **Pricing**: `$19` Starter / `$79` Pro / `$249` Agency prepaid via Creem (3.9%+$0.40 MoR, $0/mo base) | **treg hub Commission**: `0%` | **Empty/Error Billing**: `$0.00`
>
> **Zero Prompt & Trace Resale Guarantee**: Customer inputs, code, datasets, and call traces are never sold or licensed to third-party model labs.
>
> **Disclaimer**: Independent alternative; not affiliated with or endorsed by RapidAPI, Apify, Replicate, HuggingFace, Modal, Fal.ai, Zuplo, AWS Marketplace, ConvertAPI, Firecrawl, Diffbot, GitGuardian, dbt Cloud, Codacy, or any other vendor benchmarked here.

## Summary

Creem acts as global Merchant of Record at 3.9% + $0.40 per transaction with $0/mo base fee, handling VAT/GST/sales tax and paying out on the 1st and 15th. Every server compiled by Monetize-Anything ships a hardened POST /webhooks/creem handler (alias /v1/webhooks/creem) using constant-time HMAC-SHA256 signature verification, SQLite WAL event_id replay idempotency, and automatic API key provisioning. Verified in our live adversarial Gauntlet (16/16 real non-mocked heterogeneous cases passing in 13546.33 ms total, median 305.8 ms, plus 34/34 unit tests under python3 -W default with 0 warnings).

## Deterministic Architecture

Raw request bytes are verified against CREEM_WEBHOOK_SECRET via core_kit.payment_kit.verify_creem_signature. Missing or forged creem-signature headers immediately return HTTP 401; valid events map product_id to micro-USD credits inside SQLite WAL BEGIN IMMEDIATE and ignore duplicate event_id retries safely.

## Data-Backed Comparison & Live Benchmarks

| Webhook / Checkout Property | DIY Unhardened Handler | Monetize-Anything Creem Gateway | Verified Status |
| --- | --- | --- | --- |
| Forged Signature Attack | Attackers mint unlimited free credits | Constant-time HMAC-SHA256 -> HTTP 401 reject | Verified 401 in Gauntlet |
| Duplicate Retry Replay | Credits applied 2x-5x on webhook retries | UNIQUE event_id in SQLite WAL -> exact 1x credit | Verified idempotent in Gauntlet |
| Global Tax & MoR Overhead | DIY VAT/GST registration across 40+ countries | Creem MoR 3.9%+$0.40 ($0/mo base, payouts 1st & 15th) | 91.5% creator net take-home |
| Prepaid Credit Packs | Complex recurring seat proration | Starter $19 (2,500 cr) / Pro $79 (15,000 cr) / Agency $249 (65,000 cr) | Zero seat tax, zero sales calls |

## Copy-Paste Integration

```bash
curl -i -X POST "https://monetize.fastmesh.dev/webhooks/creem" \
  -H "Content-Type: application/json" \
  -H "creem-signature: $HMAC_SHA256_HEX" \
  -d '{"event_id":"evt_creem_live_001","eventType":"checkout.completed","object":{"product_id":"prod_pending_b01_monetize_starter_19","customer_email":"buyer@example.com"}}'
```

### Deterministic Output

```json
{
  "ok": true,
  "idempotent_replay": false,
  "credited_micros": 19000000,
  "api_key_provisioned": true
}
```

## Implementation Steps

1. **Bind Creem SKUs in gateway_route.json**: Map prod_pending_b01_monetize_starter_19 ($19), Pro ($79), and Agency ($249) product IDs to credit grants.
2. **Inject CREEM_WEBHOOK_SECRET via environment**: Never hardcode secrets in code; read strictly from env or 0600 credential files.
3. **Verify 401 signature block & exact-once replay**: Confirm forged digests fail with HTTP 401 and duplicate event_id calls never double-credit.

## Frequently Asked Questions

### What are Creem's verified Merchant of Record fees?

3.9% + $0.40 per checkout with $0/mo fixed base fee, global VAT/GST/sales tax handled automatically, and rolling payouts on the 1st and 15th.

### Are both /webhooks/creem and /v1/webhooks/creem supported?

Yes. Both routes map to the identical HMAC-verified, replay-safe handler.

### What happens if Creem retries a checkout.completed webhook?

The UNIQUE event_id table inside SQLite WAL detects the replay and returns HTTP 200 idempotent_replay: true with zero duplicate credits added.

---
Canonical HTML: https://monetize.fastmesh.dev/seo_geo/creem-hmac-webhook-credit-topup-api-gateway.html | Root: https://monetize.fastmesh.dev/ | Agent Manual: https://monetize.fastmesh.dev/skill.md | LLM Index: https://monetize.fastmesh.dev/llms.txt
