API Keys
How Cresora API keys are structured, which environment they belong to, and how to rotate them safely.
Every API request to Cresora must be authenticated with a Bearer token. Your API key is that token.
Key format
Cresora keys have the shape csk_{prefix}_{secret}, three segments:
csk: fixed namespace.{prefix}: 8 URL-safe characters, shown in the Partner Portal and logs so a key can be identified without exposing it (for examplecsk_ab12cd34…).{secret}: the secret component, shown in full only once, at creation or rotation.
The prefix is a random identifier. It does not encode the environment, so you cannot tell a sandbox key from a live key by looking at the string. Track where each key was created. See Environment Model for how sandbox and production are separated.
There is no test/live marker inside a key. Sandbox and production are reached at different hosts, each with its own credentials, and there is no test_mode field on responses.
Where to find your keys
Partner Portal → Settings → API keys
Keys are displayed in full once, at creation (and at rotation, for the new secret). You cannot retrieve the original. If you lose one, rotate it; the lost secret keeps working through the grace period. If the key is already in a rotation's grace period, create a new key instead, switch to it before the grace period ends, then have a Partner admin revoke the first (see Key rotation). If someone else may have the secret, note its Scopes, then have a Partner admin revoke the key instead: see Responding to a suspected compromise.
Key rotation
Rotate a key in the Partner Portal at any time. Rotation keeps the key and its prefix and gives it a new secret, shown once. For a grace period after you rotate (currently 7 days), the previous secret keeps working alongside the new one; the portal shows the key as Grace period, with the time left on the previous secret. That window lets you roll over with zero downtime:
- Rotate the key in the Partner Portal and copy the new key string (the full
csk_…value) - Deploy it to your secrets manager
- Check in your own systems that every caller now uses it. Cresora cannot tell you which of the two secrets a request used
- Let the grace period expire. Do not revoke the key to end it: Revoke ends the whole key, the new secret included
Rotate once per rollover. Rotating again during the grace period replaces the previous secret, so the secret you started with stops working. Rarely, a fault at Cresora can make the new secret fail with 401 for up to about 5 minutes after a rotation: keep using the previous secret meanwhile, and do not rotate again. If you lose the new secret before the grace period ends, create a new key and switch to it while the previous secret still works, then revoke the first. To retire the previous secret sooner than the grace period allows, create a second key instead of rotating, switch to it, then revoke the first.
To cut a key off immediately (for example, on suspected compromise), note its Scopes, because a revoked key leaves the list, then use Revoke instead. It takes effect at once, with no grace period, and calls with that key fail until you deploy a replacement. Rarely, a fault at Cresora can delay this by up to 30 seconds, and calls with the key can then get 403 instead of 401 for up to about 5 minutes. A revoked key cannot be rotated, so create a new key to replace it. Revoking leaves in place what the key already changed, such as webhook endpoints and signing secrets; on a suspected compromise, follow Responding to a suspected compromise.
Within your team, only a Partner admin can revoke a key. A Partner developer can create or rotate a key only if they hold every permission it carries, so a key that can process payments needs a Partner admin. When a new key replaces an old one, give it only the permissions your integration uses: the old key's, listed in its Scopes column, or fewer. The create dialog starts with none selected. Select all grants every permission available today as a fixed list: unlike a key that shows All permissions, the new key does not gain permissions added later. The Partner Portal cannot create a key with All permissions.
Scoping
Keys are scoped to your Partner account. A sandbox key can only access merchants under your partner account in the sandbox environment. A live key can only access your production merchants.
Store API keys in a secrets manager (AWS Secrets Manager, HashiCorp Vault, Vercel Environment Variables, and similar). Never commit keys to source control or log them. Treat sandbox keys with the same care as production keys; they can create merchants and submit transactions in your sandbox.
Capabilities
Some features are enabled per partner account — not per key: ach_payments, recurring_payments, hpp_flow, three_ds2, tap_to_pay. Check what your account can use:
GET https://api.sandbox.cresoracommerce.ai/api/v1/capabilities
Authorization: Bearer csk_ab12cd34_xxxxxxxxxxxxxxxxxxxxxxxxThe response's enabled_features lists the features enabled for your partner account; every key of the account sees the same set. The edge enforces three of them: calling POST /api/v1/hpp/sessions without hpp_flow, POST /api/v1/transactions/{id}/three-ds/complete without three_ds2, or POST /api/v1/contracts without recurring_payments returns 403 feature_not_enabled. ACH is not gated this way: a POST /api/v1/transactions request of type ACH_DEBIT, or a POST /api/v1/contracts request whose payment_method_type is ACH_WEB or ACH_CCD, is refused with 422 ach_not_enabled_for_merchant when it reaches the check for the ach_payments modality and the merchant is not opted into it (see ACH payments). Feature flags do not unlock unreleased endpoints — a planned operation (see API versioning) is not served for anyone, flag or no flag.