Knox developer docs Test mode

Paste one prompt into your coding agent.

Your agent reads Knox's setup guide, inspects your app, integrates payments or migrates your existing Stripe or processor code, and verifies the sandbox integration before it reports back.

Browse the API reference

Works with Claude Code, Codex, Cursor and other coding agents. Credentials stay out of chat.

Onboard your agent to Knox
Set up Knox payments in this repository. Fetch and read https://docs.knoxapi.com/agent-setup/prompt.md, then follow its sandbox integration workflow. Detect whether this is a fresh app, an existing Stripe integration, or another processor; perform the corresponding integration or migration yourself. Keep credentials out of chat and source code, preserve existing payment flows, and verify the integration before reporting success.

Using Meta Knox routing instead?
Onboard your agent to Meta Knox
Set up Meta Knox routing in this repository. Fetch and read https://docs.knoxapi.com/agent-setup/prompt.md?product=meta, then follow its sandbox integration workflow. Inspect the app first, Keep credentials out of chat and source code, preserve existing payment flows, and verify the integration before reporting success.

By hand

Make your first request

Knox answers a subset of Stripe's API with identical requests and responses, so a Stripe SDK works once it points at Knox.

  1. Get a test key. Sign in to the dashboard and open API keys. Keep your sk_test_... secret key on your server.
  2. Point your SDK at Knox. Send requests to https://api.knoxapi.com; the request format is unchanged.
  3. Use test payment methods. pm_card_visa succeeds and pm_card_chargeDeclined declines.
  4. Fulfil from webhooks. Verify the Stripe-Signature header with the SDK's webhook helper and your endpoint secret.

Test mode. Live processing is currently disabled. Never send real card numbers.

Create and confirm a PaymentIntent
curl https://api.knoxapi.com/v1/payment_intents \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -H "Idempotency-Key: your-unique-order-id" \
  -d amount=1200 \
  -d currency=usd \
  -d payment_method=pm_card_visa \
  -d confirm=true

Routing

Configure routing with Meta Knox

Meta Knox is a separate product. Its control API is https://meta.knoxapi.com/v1; routing configuration is not exposed on the Stripe-compatible API host. Use GET /v1/gateways to inspect processors and POST /v1/routing_rules to create routing configurations.

Open the Meta Knox dashboard

List routing rules
curl https://meta.knoxapi.com/v1/routing_rules \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"