Key Management
Secure storage, rotation, and handling of Cresora API keys.
API keys are the primary credential for the Cresora API. Managing them securely is critical.
Storage requirements
Never store API keys in:
- Source code files
.envfiles committed to source control- Client-side code (browser JavaScript)
- Log files
- Database records (in plain text)
Always store API keys in:
- A secrets manager (AWS Secrets Manager, Azure Key Vault, HashiCorp Vault)
- A CI/CD environment variable vault (GitHub Actions secrets, Vercel environment variables)
- An encrypted configuration service
Rotation policy
Cresora recommends rotating API keys every 90 days as routine practice.
Two cases call for replacing the key instead, because a rotation keeps the previous secret working through the grace period:
- Suspected compromise: note the key's permissions (its Scopes column; a revoked key leaves the list), revoke it at once, and follow Responding to a suspected compromise, because revoking leaves in place what the key already changed. Calls fail until you deploy a replacement.
- Someone who created, rotated or could read a key's secret leaves: once they are deactivated under Settings → Team, or set to Read-only if shown as Invited (see Removing a user, also if they are your only Partner admin), and can no longer reach where you store it, create a new key with only the permissions your integration uses (the old key's, or fewer), switch to it, then revoke the old one. Revoke any key your integration does not use, and if you cannot tell which keys they knew, replace them all. If the departure may be hostile, a key's Scopes are not what your team set, or nobody on your team can deactivate them because they were your only Partner admin, follow Responding to a suspected compromise instead.
Whenever anyone leaves your team, whether or not they had a key secret: once their access to the Portal (see Removing a user) and to where you store secrets is removed, and any key they knew is revoked, check under Settings → Team that every member and role is one you expect, under Settings → API keys that every key and its Scopes are what you expect, and under Settings → Webhooks every endpoint's URL, events and merchants, and have a Partner admin check Settings → Audit Log, with the entity type set to Webhook and the actor to Partner user, then to API key for changes made with a key they knew, from when they could first act. If anything changed without your team's knowledge, an endpoint you rely on was disabled, or the departure may be hostile, follow Responding to a suspected compromise instead. Otherwise disable any endpoint your integration does not use (if it is limited to merchants, also recover those merchants' events from when it was added until you disable it, as the last bullet of step 6 below describes), and rotate the signing secret of every endpoint; steps 1 to 5 there are enough, accepting only the new secret in step 3, unless you suspect misuse. Sandbox and production each have their own Partner Portal, team, keys and webhooks, so do this in each one they could sign in to or whose secrets they could read.
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.
Zero-downtime rotation
To rotate a key without downtime:
- Rotate the key in the Partner Portal and copy the new key string (the full
csk_…value). The previous secret keeps working through the grace period - 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: Revoke ends the whole key, the new secret included
See API Keys for the grace period and how to retire the previous secret sooner.
Detecting key compromise
Signs your key may be compromised:
- Unexpected transactions in your dashboard
- Entries in Settings → Audit Log for changes nobody on your team made, such as a webhook endpoint added or edited, or a signing secret rotated
- Alerts from your secrets manager about unusual access patterns
- A member or role under Settings → Team, or a key or its Scopes under Settings → API keys, that nobody on your team set up: a sign that a Portal sign-in rather than a key may have leaked
Responding to a suspected compromise
Act at once. Revoking the key stops it, but anything it already changed stays in place, including your webhook endpoints and their signing secrets. Before you store a replacement key or signing secret, close the path the key leaked through, such as someone's access to your secrets manager, CI or hosts, or a log it was written to. If you must store one sooner, replace it again once that path is closed. Sandbox and production each have their own Partner Portal, keys, webhooks and audit log, so do steps 3 to 8 in each one where you revoke a key or whose signing secrets were stored with it.
If the cause is a hostile departure or a leaked Portal sign-in, with or without a stolen key, start here. Below, the person is whoever left or whose sign-in may have leaked.
- If no Partner admin you trust can act, for example because your only one left without handing over the Admin role, the Partner Portal cannot secure your account. Nobody on your team can deactivate the person or give anyone the Admin role, and anyone they invite or make Admin keeps access that nobody on your team can remove. Nobody on your team can create or rotate a key that can process payments, so revoking one stops your payments with no replacement. Have a Partner developer you trust note every key's Scopes (step 1), then contact security@cresoracommerce.com and your account manager at once: they can revoke API keys, and you decide with them which to revoke. If you control the email account the person's sign-in links go to, disable it; otherwise nothing you can do in the Partner Portal ends their access, because they can request a new sign-in link at any time. Even then, a session they already have keeps working for up to 8 hours, and a link they already received can open a new one for 15 minutes. Meanwhile, the Partner developer can do step 3, although the person can undo it while their access lasts. Once 8 hours 15 minutes have passed since you disabled the email account, have the developer do step 3 again and compare every key under Settings → API keys with your own records, and ask security@cresoracommerce.com to revoke any you do not recognize. This does not end the incident: anyone they invited or made Admin can still act, and a Partner developer cannot see your team. Steps that need a Partner admin, such as reviewing the audit log in step 5, cannot be done, so in step 6 treat every endpoint as changed, from when the person could first act.
- If the person is a Partner admin you still trust but whose sign-in may have leaked, they cannot deactivate themselves: have another Partner admin they trust do it. If there is none, they first give a member they trust the Admin role (Manage, then Change role), or invite someone they trust as Admin (Invite member).
- In each Partner Portal the person could sign in to or whose keys or signing secrets they could read, have a Partner admin, under Settings → Team, deactivate the person and every member who should no longer have access, recognized or not (Manage, then Deactivate). Check that every remaining member has the role you expect.
- A member shown as Invited already has an account that can sign in, but its menu offers Reactivate instead of Deactivate. If it should no longer have access, set it to Read-only (Manage, then Change role), which can still read your data. Check often and deactivate it as soon as Deactivate appears, which happens once it signs in. Do not wait for that before you continue with the next bullets.
- Do not reactivate a member whose sign-in may have leaked until they have secured the email account their sign-in links go to and any authenticator app they use.
- Do steps 1 and 2 below for every key your integration does not use and every key any of them created, rotated or knew the secret of; if you cannot tell which keys those are (the Partner Portal does not show who created or rotated a key), revoke them all. Then check that every key you keep shows the Scopes you expect; if one does not, have a Partner admin set it back to only what your integration uses.
- Do steps 3 to 8 once in each of those Portals. In step 5, also set the actor filter to Partner user, from as far back as the person could act in your Portal, and undo whatever they did that you do not recognize. In step 7, start from when they could first see each signing secret.
- Note the key's permissions, listed in its Scopes column, and those of every other key the same leak could reach, such as one kept in the same store, CI, host or log. A revoked key leaves the list, so you cannot read them afterwards.
- Have a Partner admin revoke these keys under Settings → API keys. Unlike rotation, revoke has no grace period: calls with the key fail until you deploy a replacement, although a rare fault can delay this (see Key rotation). Then email security@cresoracommerce.com and your account manager at once.
- Secure your webhook endpoints under Settings → Webhooks, whatever the Scopes you noted: a key with All permissions,
partner:webhook:writeorpartner:webhook:rotate_secretcan change them, and a Partner admin can edit a key's permissions, so it may once have held one of these. A Partner admin can list the changes in Settings → Audit Log with the entity type set to Webhook. Before you disable, restore or add again any endpoint, note which merchants it is limited to, if any; step 6 needs them.- Disable any endpoint your integration does not use, including one a departing person added, and any endpoint the key added, even if it copies one of yours (Disable endpoint). Revoking the key does not stop it: it keeps receiving your events until you disable it.
- Restore the URL, events or merchants of any of your endpoints that was changed (Edit endpoint). Do not disable it instead: you could no longer redeliver from its delivery log.
- Add again any of your endpoints that was disabled, because disabling is permanent. Take its URL, events and merchants from your own records, since the key may have changed them before disabling it, and deploy its new signing secret in place of the old one, so your handler accepts only the new one.
- Rotate the signing secret of every endpoint you keep that you did not add again or rotate after revoking the keys, following the steps for an exposed secret in Rotating your signing secret: the key may have rotated one, and whatever exposed the key may have exposed them too.
- Create and deploy replacement keys with only the permissions your integration uses: the old key's, or fewer. You can do this while you work through step 3.
- Have a Partner admin review the audit log under Settings → Audit Log in the Partner Portal, from when the key may first have been exposed, with the actor filter set to API key. Your integration's own key shows up there too, so compare each entry with your integration's records, and undo any change your integration did not make. Check as well for what outlasts the key, such as merchants, locations, terminals, recurring contracts, fees, customers, custom-field definitions, hosted-page settings and hosted-payment-page sessions that can still be paid. Only a Partner admin can read the audit log, and only in the Portal. The partner trail does not show changes to API keys or team members, even with the entity type set to API key, so check those under Settings → API keys and Settings → Team.
- Recover the webhook events you missed. For each endpoint that was changed, disabled or failing:
- If Cresora suspended the endpoint, ask support to resume it first.
- While it is active, redeliver from its delivery log, within the replay limits, the deliveries it did not receive, including any recorded
SUCCEEDEDwhile its URL pointed elsewhere. Redelivery to a disabled endpoint is refused. - Reconcile against the API every kind of object the endpoint subscribes to, for what redelivery cannot reach: a disabled endpoint, events never sent while its events or merchants were narrowed, events from while it was suspended (unless it is limited to specific merchants, its delivery log records only the retries that were already pending), and anything past the replay limits. Reconcile missed events shows how for transactions.
- Do the same for your endpoints that are not limited to merchants, for every merchant listed on any endpoint that the key or person added, or whose merchants or events they changed, including one you disabled, restored or added again in step 3, from when they did so until step 3. While any endpoint is limited to a merchant, endpoints that are not limited to merchants do not receive that merchant's events of the types it subscribes to.
- Check the deliveries received since the key may first have been exposed on every endpoint you rotated or added again in step 3, as described in Rotating your signing secret: whatever exposed the key may have exposed their signing secrets too.
- Report what you found to security@cresoracommerce.com and your account manager, especially actions that cannot be undone, such as a refund, a cancelled contract or a revoked stored credential, and any events that may have been delivered to an endpoint or URL you did not set.
Least privilege
Use separate keys for different environments and purposes:
- One sandbox key per developer (revoke it when they leave)
- One production key for live traffic (tightly controlled)
- Consider separate keys for different services if your architecture permits
Limit access to production keys to the minimum number of people and systems. Every system and person with production key access is a potential breach vector.