---
title: Registration - API GPN
slug: en/nicepay-api-non-snap-registration-api-gpn
description: Information about Non-SNAP Payment API - Registration - GPN API available on NICEPAY system
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/O2iz0eHuMsTPNyt6yJ8NZ_nicepay-docs-logo.png
icon: {"faIcon":"fa-solid fa-book"}
docTags: 
createdAt: 2022-12-01T07:16:52.000Z
---

# About API for GPN Registration&#x20;

***

On the GPN payment method, the Customer gets a lot of benefits other than accessibility and efficiency because the Customer can use an ATM card with the GPN logo for any Bank transaction using an EDC machine from any Bank throughout Indonesia.



# API for GPN Registration  &#x20;

***

GPN Registration aims to connect the Merchant to the GPN API Payment system available on NICEPAY. So the payment system that prepares and hosts from the Merchant side can integrate with the NICEPAY system.



| **API Endpoint**   | `/nicepay/direct/v2/registration`                            |
| ------------------ | ------------------------------------------------------------ |
| **Request Method** | <font color="#3b9f0f">**POST**</font>****                    |
| **Description**    | Performs Transaction Regist to NICEPAY&#xD;                  |
| **Merchant Token** | SHA256(`timeStamp`+`iMid`+`referenceNo`+`amt`+`merchantKey`) |
| **Request Format** | `application/json`                                           |

:::hint{type="info"}
Please visit the [GPN](docId\:e4Q7ba-jVPFrFBuIJRrYy) section to learn general information related the GPN payment method.
:::



## Request Parameter for GPN Registration &#x20;

***

The following is a list of parameters for requesting registration of the GPN payment method. This parameter is used through the API testing platform as one of the stages so that the Merchant's system can connect with NICEPAY services. The `cartData` detail information is optional to be added.

| **Parameter**                                                                      | **Type**           | **Size** | **Description**                                                                     | **Example / Notes**                                              |
| ---------------------------------------------------------------------------------- | ------------------ | -------- | ----------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `timeStamp `<br /><font color="#2166ae">Required</font>                            | N                  | 14       | Request Timestamp (`YYYYMMDDHH24MISS`)                                              | 20200813103605                                                   |
| `iMid `<br /><font color="#2166ae">Required</font>                                 | AN                 | 10       | Merchant ID	<br />                                                                  | IONPAYTEST                                                       |
| `payMethod `<br /><font color="#2166ae">Required</font>                            | N                  | 2        | [Payment Method Code](docId\:NQ1y7vMa25ZtvQHN5He6W) <br />                          | 09&#xD;                                                          |
| `currency `<br /><font color="#2166ae">Required</font>                             | A                  | 3        | Currency<br />                                                                      | IDR                                                              |
| `amt ` <br /><font color="#2166ae">Required</font>                                 | N                  | 12       | Amount<br />                                                                        | 1000                                                             |
| `referenceNo`<br /> <font color="#2166ae">Required</font>                          | ANS                | 40       | Merchant's Reference Number	<br />                                                  | order12345                                                       |
| `goodsNm`<font color="#2166ae"> </font><br /><font color="#2166ae">Required</font> | AN                 | 100      | Goods Name	<br />                                                                   | Testing Normal FULL PAYMENT GPN&#xD;                             |
| `billingNm`<br /><font color="#2166ae">Required</font>                             | A                  | 100      | Buyer Name	<br />                                                                   | Customer Name&#xD;                                               |
| `billingPhone`<br /> <font color="#2166ae">Required</font>                         | N                  | 15       | Buyer Phone Number<br />                                                            | 12345678                                                         |
| `billingEmail`<br /><font color="#2166ae">Required</font>                          | ANS                | 40       | Buyer E-Mail	<br />                                                                 | Email\@merchant.com                                              |
| `billingCity`<br /><font color="#2166ae">Required</font>                           | A                  | 50       | Buyer City	<br />                                                                   | Jakarta &#xD;                                                    |
| `billingState`<br /><font color="#2166ae">Required</font>                          | A                  | 50       | Billing State	<br />                                                                | DKI Jakarta&#xD;                                                 |
| `billingPostCd`<br /><font color="#2166ae">Required</font>                         | N                  | 10       | Billing Post Number	<br />                                                          | 12345                                                            |
| `billingCountry`<br /><font color="#2166ae">Required</font>                        | A                  | 10       | Billing Country	<br />                                                              | Indonesia                                                        |
| `cartData`<br /><font color="#2166ae">Required</font>                              | `JSONstring`<br /> | 4000     | Cart Data<br />                                                                     | Optional                                                         |
| `instmntType`<br /><font color="#2166ae">Required</font>                           | N                  | 2        | [Installment Type Code](docId:_Wzur5wjwhrDR8YXI-Ppi) <br />                         | 1                                                                |
| `instmntMon`<br /><font color="#2166ae">Required</font>                            | N                  | 2        | Installment Month                                                                   | 1                                                                |
| `recurrOpt`<br /><font color="#2166ae">Required</font>                             | N                  | 2        | `0`: Automatic Cancel&#xD;<br />`1`: Do Not Cancel&#xD;<br />`2`: Do Not Make Token | 2                                                                |
| `dbProcessUrl`                                                                     | ANS                | 255      | Notification URL                                                                    | https\://ptsv2.com/t/rizal/post                                  |
| `merchantToken`                                                                    | AN                 | 255      | Merchant Token                                                                      | 129b8f6ce5c94e7c6200dee63a42a05caa4175ba4523068651d3e17a3208772c |
| `userIP`                                                                           | AN                 | 15       | User IP                                                                             | 127.0.0.1                                                        |



## Response Parameter for GPN Registration&#x20;

***

The following is the response parameter from the result of the request parameter to register on the GPN payment method.

| **Parameter**   | **Type** | **Size** | **Description**                                             | **Example / Notes**            |
| --------------- | -------- | -------- | ----------------------------------------------------------- | ------------------------------ |
| `resultCd`      | N        | 4        | [Result Code](docId:9eC3yH9CQqpb6cRWauWWO)                  | 0000                           |
| `resultMsg`    | AN       | 255      | Result Message: [Error Code](docId\:FsX1GESJKxOp0T9rvUHp_)  | SUCCESS                        |
| `tXid`          | AN       | 30       | Transaction ID&#xD;                                         | IONPAYTEST09202212070935176733 |
| `referenceNo`   | ANS      | 40       | Merchant Reference Number&#xD;                              | order12345                     |
| `payMethod`     | N        | 2        | [Payment Method Code](docId\:NQ1y7vMa25ZtvQHN5He6W)         | 09                             |
| `amt`           | N        | 12       | Payment Amount                                              | 1000                           |
| `transDt`       | N        | 8        | Transaction Date (`YYYYMMDD`)&#xD;                          | 20221207                       |
| `transTm`       | N        | 6        | Transaction Time (`HH24MISS`)&#xD;                          | 093518                         |
| `description`   | AN       | 100      | Transaction Description&#xD;                                | null                           |
| `vacctNo`       | N        | 20       | VA Number                                                   | null                           |
| `mitraCd`       | A        | 4        | [Mitra Code](docId:0luP35KfOWksiSrzKx6yZ)                   | null                           |
| `payNo`         | N        | 12       | CVS Payment Number                                          | null                           |
| `currency`     | A        | 3        | Currency                                                    | null                           |
| `goodsNm`       | AN       | 100      | Goods Name&#xD;                                             | null                           |
| `billingNm`     | A        | 100      | Buyer Name&#xD;                                             | null                           |
| `vacctValidDt` | N        | 8        | VA Expiry Date (`YYYYMMDD`)&#xD;                            | null                           |
| `vacctValidTm`  | N        | 6        | VA Expiry Time (`HH24MISS`)&#xD;                            | null                           |
| `payValidDt`   | N        | 8        | Expiry Date (`YYYYMMDD`)&#xD;                               | null                           |
| `payValidTm`    | N        | 6        | Expiry Time (`HH24MISS`)&#xD;                               | null                           |
| `requestURL`    | ANS      | 360      | Request URL&#xD;                                            | null                           |
| `paymentExpDt`  | N        | 6        | QR Payment Expiry Date (`YYYYMMDD`)&#xD;                    | null                           |
| `paymentExpTm`  | N        | 6        | QR Payment Expiry Time (`HH24MISS`)&#xD;                    | null                           |
| `qrContent`     | ANS      | 360      | QR String in Plain Text&#xD;                                | null                           |
| `qrUrl`         | ANS      | 360      | URL for QR Image, Valid for 5 Minutes&#xD;                  | null                           |



## Sample JSON for GPN Registration &#x20;

***

:::CodeblockTabs
JSON Request

```json
{
    "timeStamp": "20200813103605",
    "iMid": "IONPAYTEST",
    "payMethod": "09",
    "currency": "IDR",
    "amt": "1000",
    "referenceNo": "order12345",
    "goodsNm": "Testing Normal FULL PAYMENT GPN",
    "billingNm": "Customer Name",
    "billingPhone": "12345678",
    "billingEmail": "Email@merchant.com",
    "billingCity": "Jakarta",
    "billingState": "DKI Jakarta",
    "billingPostCd": "12345",
    "billingCountry":"Indonesia",
    "dbProcessUrl": "https://ptsv2.com/t/rizal/post",
    "merchantToken": "129b8f6ce5c94e7c6200dee63a42a05caa4175ba4523068651d3e17a3208772c",
    "userIP":"127.0.0.1",
    "instmntType":"1",
	"instmntMon":"1", 
	"recurrOpt":"1"
}
```

JSON Response

```json
{
	"resultCd": "0000",
	"resultMsg": "SUCCESS",
	"tXid": "IONPAYTEST09202212070935176733",
	"referenceNo": "order12345",
	"payMethod": "09",
	"amt": "1000",
	"transDt": "20221207",
	"transTm": "093518",
	"description": null,
	"bankCd": null,
	"vacctNo": null,
	"mitraCd": null,
	"payNo": null,
	"currency": null,
	"goodsNm": null,
	"billingNm": null,
	"vacctValidDt": null,
	"vacctValidTm": null,
	"payValidDt": null,
	"payValidTm": null,
	"requestURL": null,
	"paymentExpDt": null,
	"paymentExpTm": null,
	"qrContent": null,
	"qrUrl": null
}
```

Java Request

```java
//GPN Registration//
nicePay.setTimeStamp("20221202141217");
nicePay.setiMid("IONPAYTEST");
nicePay.setPayMethod("09");
nicePay.setCurrency("IDR");
nicePay.setAmt("5000");
nicePay.setReferenceNo("ordNo20221202141217");
nicePay.setDecription("test GPN");
nicePay.setInstmntType("1");
nicePay.setInstmntMon("1");
nicePay.setMerchantToken(nicePay.makeToken(nicePay.getMerchantToken());
nicePay.setGoodsNm("Testing Registration GPN");
nicePay.setBillingNm("John Doe");
nicePay.setBillingPhone("081288998899");
nicePay.setBillingEmail("john.doe@example.com");
nicePay.setBillingAddr("Jln. Raya Kasablanka Kav.88");
nicePay.setBillingCity("South Jakarta");
nicePay.setBillingState("DKI Jakarta");
nicePay.setBillingCountry("Indonesia");
nicePay.setBillingPostCd("12800");
nicePay.setDbProcessUrl("http://ptsv2.com/t/Merchant/post");
nicePay.setCardData("{\"count\":1,\"item\":[{\"img_url\":\"http:\\\/\\\/www.jamgora.com\\\/media\\\/avatar\\\/noimage.png\",\"goods_name\":\"Hoodie\",\"goods_detail\":\"Hoodie\",\"goods_amt\":\"5000\"}]}");


// Request GPN Registration
nicePay.gpnRegist();

// Response String //
System.out.println("Final Response String : " + nicePay.getResponseString());

String resultCd = nicePay.Get("resultCd");
String resultMsg = nicePay.Get("resultMsg");
String tXid = nicePay.Get("tXid");
String referenceNo = nicePay.Get("referenceNo");
String payMethod = nicePay.Get("payMethod");
String amt = nicePay.Get("amt");
String transDt = nicePay.Get("transDt");
String transTm = nicePay.Get("transTm");
```
:::



# Cart Data GPN Registration

***

`CartData` in GPN Registration is useful for declaring what items will be checked out along with item details and the price for each item.

| **Parameter** | **Description**                                                                                            | **Example** |
| ------------- | ---------------------------------------------------------------------------------------------------------- | ----------- |
| `Count`       | The total number of all card data                                                                          | 2           |
| `Item`        | It is divided into 4 kinds of parameters, namely `img_url`, `goods_name`, `goods_detail` , and `goods_amt` | -           |

***

Detailed explanation on **Item** parameters.

| **Parameter**  | **Description**                      | **Example**                                   |
| -------------- | ------------------------------------ | --------------------------------------------- |
| `img_url`      | URL Goods Picture (Size 50px x 50px) | htttps\://www\.merchant.com/image\_goods1.jpg |
| `goods_name`   | Goods Name                           | Nama Item-1                                   |
| `goods_detail` | Goods Detail Description             | Detail Item-1                                 |
| `goods_amt`    | Goods Price                          | 1000                                          |

***

:::CodeblockTabs
cartData GPN Registration

```json
{
    "count": "2",  
    "item": [  
        {
            "img_url": "http://www.merchant.com/image_goods1.jpg",  
            "goods_name": "Item 1 Name",
            "goods_detail": "Item 1 Detail",
            "goods_amt": "1000"
        },  
        {
            "img_url": "http://www.merchant.com/image_goods2.jpg",
            "goods_name": "Item 2 Name",
            "goods_detail": "Item 2 Detail",
            "goods_amt": "1000"
        }  
        ] 
}
```
:::

