---
title: Authentication - API Checkout
slug: en/nicepay-api-authentication-api-checkout
description: Information about the authentication process and details with the NICEPAY API Checkout system
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/AizdgyMUnW6_AQkuvSuvJ_rdrx9d8diazpgm07xfz2test-1.png
icon: {"faIcon":"fa-solid fa-user-gear"}
docTags: 
createdAt: 2022-09-01T07:21:40.000Z
---

# Authentication Process

***

Authentication is an API security procedure to recognize the identity of a foreign request. If the identity is recognized by the system, then the request can access the API.

In this case, NICEPAY first requires an API Key identity called `merchantKey` from your request. So you can connect with NICEPAY without any obstacles. Apart from `merchantKey`, you are also required to send the mandatory parameter, namely `merchantToken`.



## Merchant Key

Merchant Keys are divided into two types, namely Sandbox Credentials and Production Credentials.

### Sandbox Credentials

If you want to test our API first before carrying out the integration process with NICEPAY, please use the following credentials provided below using `iMid` **IONPAYTEST**.

:::hint{type="info"}
`iMid` is an identity or your ID as a Merchant on NICEPAY. `iMid` that is only devoted to your business usage will be given after you officially register as our Merchant.

To perform testing, please use `iMid` **IONPAYTEST&#x20;**&#x61;nd the specific Merchant key in Sandbox Credentials.
:::



| `iMid `<br />****<font color="#2166ae">**(Merchant ID)**</font> | **IONPAYTEST**<br />**(AutoPaid)**                                                            |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `merchantKey`                                                   | 33F49GnCMS1mFYlGXisbUDzVf2ATWCl9k3R++d5hDd3Frmuos/XLx8XhXpe+LDYAbpGKZYSwtlyyLOtS/8aD7A==&#xD; |

:::hint{type="info"}
The credentials above are provided for testing purposes only and the payment process will be made successful automatically (AutoPaid).
:::

### Production/Live Credentials

If you are already registered as a NICEPAY Merchant and want to perform the integration stage with real transactions, you can view the `merchantKey` that we specifically created with your iMid in the portal [Merchant Back Office](docId\:S2zo71iySoasepJteVVN7).

Here are the steps to get `merchantKey`:

1. Access your [Merchant Back Office](https://bo.nicepay.co.id/logIn.do) dashboard.
2. Select a menu [Profile](docId\:h4VhpK2NUQOghMRfv4EFv).
3. Select a sub-menu [Merchant Data](docId\:TniON0O64lxT8FhPgx_So).
4. Select tab `Other`.
5. Scroll down to get your `merchantKey`.

![](https://api.archbee.com/api/optimize/ZHvSjR5ZrsoxwKbJa3xmo/sXerwgaWCl-lFAYzimrFY_merchant-key.png "Panduan Melihat M_KEY / Merchant Key")

:::hint{type="warning"}
Don't forget to include the `iMid` parameter according to the registered `iMid` for your business when integrating with us.
:::



## Merchant Token

`MerchantToken` uses by the Merchant to proceed the security authentication process with the NICEPAY system. This parameter was created using the `SHA-256` hashing method that includes parameters `iMid`, `merchantKey` along with the other variables needed. Here are the details of Merchant Token:

```javascript
//Generate merchantToken//
merchantData = timeStamp + iMid + refNo + amount + merchantKey;
merTok = CryptoJS.SHA256(merchantData).toString(CryptoJS.enc.Hex);

Sample:

merchantData = 20221202101271 + IONPAYTEST + OrdNo-20221202101271 + 100000 + 33F49GnCMS1mFYlGXisbUDzVf2ATWCl9k3R++d5hDd3Frmuos/XLx8XhXpe+LDYAbpGKZYSwtlyyLOtS/8aD7A==
merTok = d7c10cfccd64fdb21836f4330bb23f9ed357bc4b02420399d48b4661b89a55a0
```

| **Parameter** | **Type** | **Size** | **Description**                          |
| ------------- | -------- | -------- | ---------------------------------------- |
| `timeStamp`   | N        | 14       | Transaction Timestamp (`YYYYMMDDHHMMSS)` |
| `iMid`        | AN       | 10       | Merchant ID                              |
| `refNo`       | ANS      | 40       | Merchant's Reference Number              |
| `amount`      | N        | 12       | Amount                                   |
| `merchantKey` | ANS      | 88       | Merchant Key                             |



## NICEPAY API URL

Here's the NICEPAY API URL you can use according to your needs. This URL must be requested via the HTTPS protocol to connect with us.

| **Environment** | **Protocol** | **Base URL**                     |
| --------------- | ------------ | -------------------------------- |
| Development     | https        | `https://dev.nicepay.co.id/`     |
| Staging         | https        | `https://staging.nicepay.co.id/` |
| Production      | https        | `https://www.nicepay.co.id/`     |



## Payment Method Testing

After you got all the authentication requirements that can interact with our API, please visit the page below to test with our services.

| **Payment Method** | **Credential**                                                    |
| ------------------ | ----------------------------------------------------------------- |
| Credit Card        | [Credit Card Integration & Testing](docId:2foCrf187WMMSsoaiH3mB)  |
| Virtual Account    | [VA Integration & Testing](docId\:j-3a7Xe6Q_2Tn8A5GCvjv)          |
| Convenience Store  | [CVS Integration & Testing](docId\:uwT1vzZLVtCNdNwemm0mR)         |
| Direct Debit       | [Direct Debit Integration & Testing](docId:9lg6VXg1smiFZr4nQi1-f) |
| E-Wallet           | [E-Wallet Integration & Testing](docId\:OBCA35UPC_PLTZiltBrPA)    |
| Paylater           | [Paylater Integration & Testing](docId\:Ba-OIQmDiMI-XGOYFVryI)    |
| GPN                | [GPN Integration & Testing](docId\:YGBHonzJx-g4c-V3Sc3g1)         |
| QRIS               | [QRIS Integration & Testing](docId\:oyHpAEfP8i5JKsH3ZmQ-L)        |
| Payout             | [Payout Integration & Testing](docId:-gewjzQLRoidK21h-YAKJ)       |



