---
title: Hands On API
slug: en/hands-on-api
description: Follow quick integration guidance to start using the NICEPAY API
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/TC5Sz7_hewebAWfeWTpR-_microsoftteams-image.png
icon: {"faIcon":"fa-solid fa-terminal"}
docTags: 
createdAt: 2022-08-11T02:26:29.000Z
---

Enjoy our NICEPAY product and service with a single integrated API that is secure also easy to integrate into your business. Start the rapid integration process only in 15 minutes!



# Precondition

***

1. MID/iMid (Merchant ID)
2. API Key (Merchant Key)
3. NICEPAY SDK  *-&#x20;*&#x4F;ptional

:::hint{type="info"}
Please check this [Authentication](docId\:MYLJED3IOGtJfhMfv1m6i) page first to get the precondition requirements.
:::



# Payment Flow

***

![](https://api.archbee.com/api/optimize/ueSgidS-H3kdWkcRhVS2v-SP0ELo5L25srBTg1gAbja-20240821-024827.jpg "Checkout Credit Card Payment Flow")

Payment Flow step description of Credit Card redirect with 3Ds:

1. The Customer performs checkout.
2. The Customer sends checkout data to Merchant.
3. The Merchant requests checkout using Registration API to NICEPAY.
4. NICEPAY registers checkout data.
5. NICEPAY redirects payment to the NICEPAY page to Merchant.
6. The Merchant sends NICEPAY payment page to Customer.
7. The Customer chooses a payment method.
8. The Customer inputs card data.
9. The Customer sends card data information to NICEPAY.
10. NICEPAY processes FDS calculation.
11. NICEPAY requests 3Ds to Bank.
12. Bank performs 3Ds validation.
13. Bank sends response URL 3Ds to NICEPAY.
14. NICEPAY receives verification response.
15. NICEPAY redirects Customer to ACS authentication page.
16. Bank creates OTP response.
17. Bank sends OTP to Customer.
18. The Customer receives OTP.
19. The Customer inputs OTP.
20. The Customer sends OTP to Bank.
21. Bank performs OTP verification.
22. Bank sends 3Ds result to NICEPAY.
23. NICEPAY receives checking results.
24. NICEPAY requests payment to Bank.
25. Bank proceeds with the payment process.
26. Bank sends payment notification to NICEPAY.
27. NICEPAY redirects `callbackUrl` to Merchant.
28. The Merchant displays `callbackUrl`  result to Customer.
29. NICEPAY sends payment notifications to Merchant.
30. The Merchant receives the notification.
31. The Merchant performs request inquiry to NICEPAY.
32. NICEPAY receives the request.
33. NICEPAY automatically sends an inquiry response to Merchant.
34. The Merchant receives the last status.
35. The Merchant sends the transaction result page to Customer.



# Payment Integration

***

On this process, You will use our [Checkout](docId\:rD_VTX9kDePiChBfiN73-) product. All NICEPAY [API Checkout](docId\:MZwfB77ewiYNEInwfmzdQ)  transactions will redirect to **NICEPAY Secure Payment Page** as the payment process.

Follow these five easy steps to perform payment integration with NICEPAY.

1. Perform call **Transaction Registration** API.
2. Redirect to **NICEPAY** **Secure Payment Page**.
3. Process payment on **NICEPAY Secure Payment Page**.
4. **NICEPAY** will redirect end-user to Merchant `callbackUrl`.
5. Merchant perform call **Status Inquiry API**.



## Transaction Registration

***

| **API End Point**  | [`https://dev.nicepay.co.id/nicepay/redirect/v2/registration`](https://dev.nicepay.co.id/nicepay/redirect/v2/registration) |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| **Request Method** | <font color="#3b9f0f">**POST**</font>****                                                                                  |
| **Header**         | `Content-Type: application/json`                                                                                           |
| **Description**    | Perform Transction Registration                                                                                            |
| **Merchant Token** | `SHA256(timeStamp+iMid+referenceNo+amt+merchantKey)`                                                                       |

:::CodeblockTabs
Request

```json
{
    "timeStamp":"20221012080918",
    "iMid":"IONPAYTEST",
    "payMethod":"00",
    "currency":"IDR",
    "amt":"10000",
    "referenceNo":"ORDER20221012080918",
    "callBackUrl":"https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp",
    "goodsNm":"Test Transaction Nicepay",
    "billingNm":"John Doe",
    "billingPhone":"081288998899",
    "billingEmail":"john.doe@example.com",
    "billingAddr":"Jln. Raya Kasablanka Kav.88",
    "billingCity":"South Jakarta",
    "billingState":"DKI Jakarta",
    "billingPostCd":"12800",
    "billingCountry":"Indonesia",
    "deliveryNm":"delivery@example.com",
    "deliveryPhone":"081288998899",
    "deliveryAddr":"Jln. Raya Kasablanka Kav.88",
    "deliveryCity":"South Jakarta",
    "deliveryState":"DKI Jakarta",
    "deliveryPostCd":"12800",
    "deliveryCountry":"Indonesia",
    "dbProcessUrl":"https://merchant.com/api/dbProcessUrl/Notif",
    "merchantToken":"d8d0968892c568bc6ff5adc17cd755f85334a0b58fce85392682993a9ba653ed",
    "userIP":"127.0.0.1",
    "cartData": "{\"count\":3,\"item\":[{\"goods_id\":30,\"goods_name\":\"Beanie\",\"goods_type\":\"Accessories\",\"goods_amt\":1000,\"goods_sellers_id\":\"NICEPAY-NamaMerchant\",\"goods_sellers_name\":\"NICEPAYSHOP\",\"goods_quantity\":1,\"goods_url\":\"http://www.nicestore.com/product/beanie/\"},{\"goods_id\":31,\"goods_name\":\"Belt\",\"goods_type\":\"Accessories\",\"goods_amt\":5000,\"goods_sellers_id\":\"NICEPAY-NamaMerchant\",\"goods_sellers_name\":\"NICEPAYSHOP\",\"goods_quantity\":1,\"goods_url\":\"http://www.nicestore.store/product/belt/\"},{\"img_url\":\"http://www.jamgora.com/media/avatar/noimage.png\",\"goods_name\":\"Shipping Fee\",\"goods_id\":\"Shipping for Ref. No. 278\",\"goods_detail\":\"Flat rate\",\"goods_type\":\"Shipping with Flat rate\",\"goods_amt\":\"4000\",\"goods_sellers_id\":\"NICEPAY-NamaMerchant\",\"goods_sellers_name\":\"NICEPAYSHOP\",\"goods_quantity\":\"1\",\"goods_url\":\"https://wwww.nicestore.store\"}]}",
    "sellers":"[{\"sellersId\":\"NICEPAY-NamaMerchant\",\"sellersNm\":\"NICEPAYSHOP\",\"sellersUrl\":\"http://nicestore.store/product/beanie/\",\"sellersEmail\":\"Nicepay@nicepay.co.id\",\"sellersAddress\":{\"sellerNm\":\"NICEPAYSHOP\",\"sellerLastNm\":\"NICEPAYSHOP\",\"sellerAddr\":\"Jln. Kasablanka Kav 88\",\"sellerCity\":\"Jakarta\",\"sellerPostCd\":\"14350\",\"sellerPhone\":\"082111111111\",\"sellerCountry\":\"ID\"}}]",
    "instmntType": "2",
    "instmntMon": "1",
    "recurrOpt":"0",
    "bankCd":"",
    "mitraCd":"",
    "merFixAcctId":"",
    "vacctValidDt":"",
    "vacctValidTm":""
}
```

Response

```json
{
    "resultCd": "0000",
    "resultMsg": "SUCCESS",
    "tXid": "IONPAYTEST00202212191025073439",
    "referenceNo": "ORDER20221012080918",
    "payMethod": "00",
    "amt": "10000",
    "transDt": "20221219",
    "transTm": "102508",
    "description": null,
    "currency": "IDR",
    "goodsNm": "Test Transaction Nicepay",
    "billingNm": "John Doe",
    "payValidDt": null,
    "payValidTm": null,
    "paymentURL": "https://dev.nicepay.co.id/nicepay/redirect/v2/payment"
}
```
:::

:::hint{type="success"}
Access further API specification on [Registration - API Checkout](docId\:pjBflBNCehkuuuqQSAiug).
:::



## Transaction Payment

***

| **API End Point**  | [`https://dev.nicepay.co.id/nicepay/redirect/v2/payment`](https://dev.nicepay.co.id/nicepay/redirect/v2/payment) |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| **Request Method** | ****<font color="#3b9f0f">**GET**</font>****                                                                     |
| **Header**         | `Content-Type: application/Form-UrlEncoded`                                                                      |
| **Description**    | Perform Transction Registration                                                                                  |
| **Merchant Token** | `SHA256(timeStamp+iMid+referenceNo+amt+merchantKey)`                                                             |

After receive response, you can redirect Customer to NICEPAY payment page. That URL is a combination of `paymentURL` + `tXid` as response parameter that will has a result like this example:`https://dev.nicepay.co.id/nicepay/redirect/v2/payment?tXid=IONPAYTEST00202212191025073439`&#x20;

![NICEPAY Payment Page](https://api.archbee.com/api/optimize/ZHvSjR5ZrsoxwKbJa3xmo/5EARwUJAR5medSH9j-vpw_image-en-nicepay-secure-payment-page-main-dashboard.jpg "NICEPAY Payment Page")

![Success - NICEPAY Payment Page](https://api.archbee.com/api/optimize/ZHvSjR5ZrsoxwKbJa3xmo/pZlpRGQknjUiD0FL64erG_image-en-credit-card-success-secure-payment-page.jpg "Success - NICEPAY Payment Page")

:::hint{type="success"}
Example at the above is **Transaction Payment** using Credit Card payment method. Find the complete API specification on [Credit Card - API Checkout](docId\:Amf-D0GV7CRmDsuGRikbA).
:::



## Callback Handling

***

After User choose Credit Card as the payment method, User will redirect to Merchant page by `callbackUrl` with **POST** method and sending parameter.

::Image[]{src="https://api.archbee.com/api/optimize/ZHvSjR5ZrsoxwKbJa3xmo/qgAGxkBa5Rgo1C8R-PhJL_nicepay-api-checkout-api-callback-handling-flow-1.png" size="50" width="370" height="361" caption="Callback Handling" position="center" darkWidth="370" darkHeight="361" showCaption="true"}

:::hint{type="success"}
When Callback to Your `callbackUrl` have been received, we strongly recommend Merchant to verify status by using [Status Inquiry - API Credit Card](docId\:NTP9jTSSg4RtkebeOh_Dr).
:::

:::hint{type="warning"}
`CallBack Handling` is very helpful to minimize Fraud actions. We strongly recommend Merchants to verify the `callBack parameter`.
:::

:::CodeblockTabs
callbackUrl

```json
"callbackUrl" : "https://www.merchant.com/callbackUrl/"
```

Callback Parameter

```json
{
    "resultCd":"0000",
    "resultMsg":"SUCCESS",
    "tXid":"IONPAYTEST01202212141112221428",
    "referenceNo":"",
    "payMethod":"01",
    "amt":"10000",
    "transDt":"20221212",
    "transTm":"121212",
    "description":"Testing Credit Card Transaction",
    "authNo":"080623",
    "issuBankCd":"OTHR"
    "acquBankCd":"BMRI",
    "cardNo":"453211*****1111",
    "goodsNm":"Test Transaction Nicepay"
    "billingNm":"John Doe",
    "currency":"IDR",
    "timeStamp":"20221212121212",
    "merchantToken":"2035d2295d9578fffb40137186f0203474142ae3e57992d4847826c5fcaffce6",
    "cardExpYymm":"2712",
    "instmntMon":"1",
    "instmntType":"1",
    "ccTransType":"1"
}
```
:::

Congratulations! You have successfully perform an integration trial!

Explore further through the link below.



# See Also

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
Find out explanation about payment method and custom product on [Payment](docId\:dz03L2we6bt38Qs0b7vp_) page.
:::

:::VerticalSplitItem
Find further explanation related product available on NICEPAY at the [Checkout](docId\:rD_VTX9kDePiChBfiN73-) page.
:::
::::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
Visit the [Payout](docId\:k30HtjQs2650eYRssYtUK) page to learn the detail of API used.
:::

:::VerticalSplitItem
Visit the [Messaging](docId\:wYsQhkAHpZgzFEF0GVmjD) page to learn about NICEPAY’s messaging service.
:::
::::



