KashierDevelopersKashier Developers
Get started

API keys

Manage your API keys to authenticate requests with Kashier

Kashier authenticates your API requests using your account's API keys. If you do not include your key when making an API request, or if you use one that is incorrect or outdated, Kashier returns an error.

Every account is provided with separate keys for testing and running live transactions. All API requests exist in either test or live mode, so one mode cannot interact with objects in the other.

There are also two types of API keys: Payment API Keys and Secret API Keys.

  • Payment API Keys are used to sign requests and verify Kashier's responses. You use this key to compute the order hash — an HMAC-SHA256 signature over the order's details that proves the amount and order ID were not tampered with in the customer's browser — and to verify the signature Kashier sends back. See request hashing.
  • Secret API Keys should be kept confidential and stored only on your own servers. A Secret API Key authenticates the request and belongs to your merchant account, not to a team member. Each key carries its own permissions, its own optional IP allow-list and an optional expiry date. See Secret keys for how to create, scope, roll and revoke them.

Each mode has its own keys: you can create several Payment API Keys and Secret Keys, separately for test mode and live mode.

Credentials at a glance

The docs and API refer to your credentials by different names depending on context — the prose term, the HTTP header you send it in, and the identifier used in the API reference aren't always the same word. Use this table to map between them:

CredentialHTTP header / body fieldOther identifiers
Payment API Keyapi-key headerapiKey — OpenAPI security-scheme ID in the API reference
Secret KeyAuthorization header (raw value, not a Bearer token). New keys start with ksk_test_ or ksk_live_secretKey — OpenAPI security-scheme ID in the API reference
Merchant ID (MID)merchantId — JSON request-body field (most endpoints); mid — query parameter on some endpoints (e.g. installment plans)authmerchantid — HTTP header, see Multi-merchant accounts

Obtaining your keys and MID

Your API keys are available in the Dashboard. Kashier shows a live secret key's value only once, when you create or roll it, so copy it then. The MID can be found under your username in the dashboard's top navigation bar.

API keys

Secret keys

Use only your test API keys for testing and development. This ensures that you don't accidentally modify your live customers or charges.

Multi-merchant accounts: the authmerchantid header

A secret key belongs to exactly one merchant, so a call made with a secret key does not need authmerchantid. If you send the header anyway, it must name the key's own MID.

Managing keys

Secret keys are managed only from the dashboard — see Secret keys. Each secret key has its own IP allow-list, set in the dashboard. Payment API Keys are created and deleted from the Dashboard.

Test and live modes

The test and live modes function almost identically for integration testing and education, with a few necessary differences:

  • In test mode, payments are not processed by card networks or payment providers, and only our test payment information can be used.
  • Payment and Secret Keys differ for each mode.
  • Base URLs are prefixed with 'test-'.
  • You may use and test features before being onboarded and activated.

The status of the created account will be marked as a "Test" account by default. This will allow you to test all of Kashier's services. When you finish your testing phase, you should switch to live mode and obtain your live keys if you are onboarded and activated.

Switch between test and live modes using the "It's live data" toggle from the sidebar, as shown below.

Live data toggle

Always ensure you are in the correct mode by checking the mode toggle at the bottom of the side navigation bar. Verify that you are using the correct keys for your intended mode.

A test Payment API Key never validates against a live host

If a hash is rejected, check that you signed with the Payment API Key for the same mode as the host: a test key for the test- hosts and a live key for the live hosts. See request hashing.

On this page