Skip to Content

API Keys

Cashonrails issues separate credentials for test and live traffic. Use the dashboard environment toggle to view or generate credentials for the selected mode.

Credential Types

CredentialWhere to use itSecurity handling
Public keyBrowser checkout, mobile SDKs, identifying a business in public flows.Can be exposed to clients, but should still be scoped to Cashonrails usage.
Secret keyServer-side Merchant API and S2S API requests.Never expose publicly. Store only in a backend secret manager.
Encryption keyAES-256-GCM payload encryption for businesses enrolled in API encryption.32-byte secret. Store like a password.
Webhook keyMerchant-side verification of outbound Cashonrails webhooks when enabled.Store server-side only.
RSA public keyUploaded to Cashonrails to verify payout request signatures.Public by design.
RSA private keyUsed by your backend to sign payout request bodies.Never upload or share. Rotate immediately if exposed.

Secret keys and encryption keys are shown only when generated or regenerated. If a secret is lost, regenerate the affected credentials and deploy the new values to your backend.

Test and Live Modes

Test keys create test-mode resources and can be used for QA without moving real money. Live keys create live resources and can move real funds.

Do not mix keys across environments. A transaction or payout reference created in test mode should be verified with a test secret key; a live reference should be verified with a live secret key.

Key Rotation

Rotate keys when onboarding a new production environment, after staff changes that affect secret access, after a suspected exposure, or as part of your regular security calendar.

Recommended rotation pattern:

  1. Generate new credentials in the dashboard.
  2. Store them in your secret manager.
  3. Deploy the backend with the new values.
  4. Run smoke tests for transaction initialization, verification, payout signing, and webhooks.
  5. Remove old credentials from runtime environments and CI secrets.

Dashboard Settings

Configure these values from Settings > API Keys and Webhook:

SettingPurpose
Test callback URLDefault redirect URL for test checkouts.
Test webhook URLTest-mode webhook destination.
Live callback URLDefault redirect URL for live checkouts.
Live webhook URLLive-mode webhook destination.
RSA PEM keyPublic key used by Cashonrails to verify signed payout requests.

Common Pitfalls

  • Using a public key in the Authorization header. Use the secret key.
  • Sending live traffic with test keys.
  • Regenerating keys without updating all worker and scheduler environments that also call Cashonrails.
  • Treating the encryption key as an HMAC key. AES encryption and HMAC/webhook signatures are separate mechanisms.
Last updated on