Secret keys
Create merchant-owned secret keys with their own permissions, IP allow-list and expiry, and roll or revoke them without breaking your integration.
A secret key is the credential your server sends in the Authorization header to call the Kashier API. Each key belongs to your merchant account, not to a team member, and carries its own settings:
- Permissions: the modules the key may read or write, such as Transactions or Payment links.
- IP allow-list: the server addresses allowed to use the key.
- Expiry: an optional date after which the key stops working.
Because each key has its own scope, you can give every integration its own key with only the access it needs. Roll a key that leaked, or revoke a key you no longer use, without touching the others.
Secret key or Payment API Key?
The secret key authenticates server-to-server API calls. The Payment API Key is a different credential: you use it to compute the order hash and to verify Kashier's signatures. This page covers secret keys only. See API keys for both.
Key format
New keys start with a prefix that names their mode:
| Mode | Prefix | Works on |
|---|---|---|
| Test | ksk_test_ | test-api.kashier.io, test-fep.kashier.io |
| Live | ksk_live_ | api.kashier.io, fep.kashier.io |
A test key never works on a live host, and a live key never works on a test host. Keys that existed before merchant-owned keys keep their original value and format. See Existing keys.
Send the key
Put the raw key in the Authorization header. Do not add a Bearer prefix.
curl --location 'https://test-api.kashier.io/v2/aggregator/transactions' \
--header 'Authorization: ksk_test_YOUR_SECRET_KEY'A key belongs to exactly one merchant, so you do not need the authmerchantid header. If you send it, it must name the key's own MID.
Create a key
Create keys in the Dashboard under Developers → Integrations → Secret Keys. Switch the dashboard to the mode you want the key for first. A key is created in the mode the dashboard is in.

- Click Create secret key and give the key a name of up to 60 characters. Name it after the integration that will use it, for example
ERP refunds. - Choose the permissions the key needs. Pick at least one.
- Add the IP addresses of the servers that will call the API with this key.
- Optionally set an expiry date.
- If the dashboard asks for one, enter the code Kashier sends by SMS to your phone number.
- Copy the key value and store it in your secrets manager.

Kashier shows a live key's value only once
Copy the value when the dialog shows it. Kashier does not show a live key's value again. If you lose it, roll the key to get a new value.

Secret keys are created, edited, rolled and revoked from the dashboard.
Permissions
Each permission is a module and a level. Read lets the key view and export a module's data. Write lets it create and change that data. Read and Write are separate, so a key can hold Write without Read.
| Module | Read lets the key | Write lets the key | Notes |
|---|---|---|---|
| Dashboard | View dashboard data | Not available | |
| Transactions | View transactions and their details, export them, view fees | Refund transactions | Voids also need Transactions: Write |
| Payment links | View, share and export payment links | Create, edit, cancel, delete and mark payment links as paid | |
| Payment pages | View, share and export payment pages | Create, edit and delete payment pages | |
| Payment sessions | View payment sessions | Create and expire payment sessions | Only for keys. See Payment sessions. |
| Products and categories | View products | Create and edit products, adjust stock, delete categories | |
| Balance management | View and export balance and settlements | Not available | |
| Instant settlement | View instant settlements | Request an instant settlement | |
| Transfers | View and export transfers | Create transfers | Add at least one IP address to the key |
| Beneficiaries | View beneficiaries | Create, edit and delete beneficiaries | Add at least one IP address to the key |
| Customers | View customers | Create, edit and delete customers, manage the customer portal | |
| Terminals | View and export terminals | Edit terminals | |
| Webhooks configuration | View webhook settings | Create, edit and delete webhook settings | |
| Webhooks log | View sent webhooks | Resend webhooks | |
| Branches | Not available | Manage branches | |
| User management | View users | Invite and edit users |
The permissions you can grant to a key depend on your own role.
Payment sessions
Creating a payment session with a key needs Payment sessions: Write. Listing, viewing or exporting sessions needs Payment sessions: Read and Transactions: Read.
Team roles don't include the Payment sessions permission. It exists only for keys.
IP allow-list
Each key has its own IP allow-list. A call from an address that is not on the key's list is rejected.

- Add at least one IP address to every key.
- Use exact public IPv4 addresses. CIDR ranges, IPv6, and private or loopback addresses are not accepted. A key holds up to 50 addresses, each listed once.
- Transfers and Beneficiaries need an IP. A key that holds either module, at Read or Write, must list at least one IP address.
- Allow-list your egress address. Behind a proxy or NAT, allow-list the public IP your traffic leaves from. Update the list before you move servers, or every call from the new server fails.
The Authorized IP addresses table under Secret Keys lists every address on every active key in one read-only view. To change an address, edit the key that holds it.
Expiry
A key can stay valid forever or stop on a date you choose. The earliest expiry you can set is tomorrow, counted from midnight Cairo time. There is no latest date. Once a key passes its expiry date, it stops working and its status shows Expired.
You can change or remove the expiry date by editing the key, as long as it has not expired yet. An expired key cannot be brought back. Create a new key instead.
Edit a key
You can change a key's name, permissions, IP addresses and expiry date. The key value stays the same, so your integration keeps working. Changes apply to the next call the key makes.
Some edits ask for an SMS code. Revoked and expired keys cannot be edited.
Roll a key
Rolling replaces the key's value and keeps everything else: name, permissions, IP addresses and expiry. Roll a key when its value may have leaked, or to rotate it on a schedule.
When you roll, choose what happens to the old value:

| Option | Old value | Use it when |
|---|---|---|
| Keep the current key working for 24 hours | Keeps working for 24 hours with the same permissions, then stops. The key shows Rolling until then. | You need time to deploy the new value without downtime |
| Stop the current key immediately | Stops at once | The value leaked |
The new value is shown once, as on create. Some rolls ask for an SMS code.
Revoke a key
Revoking stops a key immediately and for good. The key stays in the list with the status Revoked. A revoked key cannot be edited, rolled or reactivated.
Statuses
| Status | Meaning |
|---|---|
| Active | The key works |
| Rolling | The key was rolled with a 24-hour overlap. The new value works, and the old value works until the overlap ends |
| Expired | The key passed its expiry date and no longer works |
| Revoked | The key was revoked and no longer works |
Who can see and manage keys
Five permissions in the Integrations section of a team role control secret keys: View, Create, Edit, Roll and Revoke secret keys. Every action except View also needs View. Manage roles under Settings → Manage team → Roles. See Teams and user roles.
- The Owner and the Administrator role see and manage every key on the account.
- Every other team member sees and manages only the keys they created, within their role's permissions.
Existing keys
Secret keys that existed before merchant-owned keys were moved to your merchant account with the same value. You don't need to change your integration. Review your existing keys in the dashboard and add IP addresses and permissions as needed.
Errors
If a call is rejected with 401 or 403, check the key, its permissions and its IP allow-list. For 400, check the request. See Error responses.
Keep your keys safe
- Store keys only on your servers, in a secrets manager. Never put them in client-side code, a mobile app or a Git repository.
- Give each integration its own key with only the permissions it needs.
- Add IP addresses to every live key.
- Set an expiry date on keys for temporary integrations, such as a contractor's tool.
- If a key may have leaked, roll it and choose Stop the current key immediately. Revoke keys you no longer use.