---
title: Pre-Auth & Capture - Registration API Credit Card
slug: en/nicepay-api-non-snap-pre-auth-and-capture-registration-api-credit-card
description: Information about Non-SNAP Payment API - Registration - Credit Card API available on NICEPAY system
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/DDTsme1E3gNYoeuKqxUTw_microsoftteams-image.png
icon: {"faIcon":"fa-solid fa-book"}
docTags: 
createdAt: 2023-05-05T07:50:10.000Z
---



### &#xD;

# About Pre-Auth & Capture - Registration API Credit Card

***

**Pre-Auth & Capture&#x20;**&#x69;s another feature from Credit Card where the Merchant can hold or do the Pre-Auth process beforehand from the paid fund from the Customer.&#x20;

Then, You need to validate for that fund transaction also known as Capture so that the fund logs into Your Bank account. If you want to do the Capture process after the Pre-Auth expired time finished, then that transaction will considered as Void, and that fund transaction will return to Your Customer.

So, we recommend doing the Capture process as soon as possible before the Pre-Auth expiry time finished.

:::hint{type="success"}
Learn about Credit Card Payment feature with PreAuth & Capture on [Pre-Authorization & Capture in Credit Card](docId\:XW-13tlRIbKIGQz6KTCbm).
:::



# Pre-Auth & Capture - Registration API Credit Card

***



| **API Endpoint**   | `/nicepay/direct/v2/registration`                            |
| ------------------ | ------------------------------------------------------------ |
| **Request Method** | <font color="#3b9f0f">**POST**</font>****                    |
| **Description**    | Pre-Auth & Capture                                           |
| **Merchant Token** | SHA256(`timeStamp`+`iMid`+`referenceNo`+`amt`+`merchantKey`) |
| **Request Format** | `application/json`                                           |



## Request Parameter for Pre-Auth & Capture - Registration API Credit Card

***

The first step that should do is to activate the Pre-Auth & Capture feature to register the Credit Card transaction beforehand on this API Registration.

This process need to be done so You can get the `tXid` that will use later to proceed with the Pre-Auth process.&#x20;



| **Parameter**                                                                       | **Type**           | **Size** | **Description**                                                                     | **Example / Notes**                                                   |
| ----------------------------------------------------------------------------------- | ------------------ | -------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `timeStamp`<br /><font color="#2166ae">Required</font>                              | N                  | 14       | Request Timestamp (`YYYYMMDDHH24MISS`)                                              | 20221202141217                                                        |
| `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 />                           | 01&#xD;                                                               |
| `currency`<br /><font color="#2166ae">Required</font>                               | A                  | 3        | Currency<br />                                                                      | IDR                                                                   |
| `amt` <br /><font color="#2166ae">Required</font>                                   | N                  | 12       | Amount<br />(number not in float format)                                            | 10000 (Total sum amount goods from `cartData`)                        |
| `referenceNo`<br /><font color="#2166ae">Required</font>                            | ANS                | 40       | Merchant's Reference Number	<br />                                                  | ordNo20221202141217                                                   |
| `goodsNm `<font color="#2166ae"> </font><br /><font color="#2166ae">Required</font> | AN                 | 100      | Goods Name	<br />                                                                   | Testing Transaction&#xD;                                              |
| `billingNm `<br /><font color="#2166ae">Required</font>                             | A                  | 100      | Buyer Name	<br />                                                                   | John Doe&#xD;                                                         |
| `billingPhone `<br /><font color="#2166ae">Required</font>                          | N                  | 15       | Buyer Phone Number<br />                                                            | 2112345678                                                            |
| `billingEmail `<br /><font color="#2166ae">Required</font>                          | ANS                | 40       | Buyer E-mail	<br />                                                                 | buyer\@merchant.com                                                   |
| `billingAddr `<br /><font color="#2166ae">Required</font>                           | AN                 | 100      | Buyer Address	<br />                                                                | Jln. Raya Kasablanka Kav.88&#xD;                                      |
| `billingCity `<br /><font color="#2166ae">Required</font>                           | A                  | 50       | Buyer City	<br />                                                                   | South 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 />                                                          | 14350                                                                 |
| `billingCountry `<br /><font color="#2166ae">Required</font>                        | A                  | 10       | Billing Country	<br />                                                              | Indonesia                                                             |
| `cartData`<br /><font color="#2166ae">Optional</font>                               | `JSONstring`<br /> | 4000     | Cart Data<br />                                                                     | \{}                                                                   |
| `instmntType`<br /><font color="#2166ae">Required</font>                            | N                  | 2        | [Installment Type Code](docId:_Wzur5wjwhrDR8YXI-Ppi)                                | 1 (For PreAuth & Recurring default 1)                                 |
| `instmntMon`<br /><font color="#2166ae">Required</font>                             | N                  | 2        | Installment Month<br />`1`: 1 Month/Full Payment, *if* `instmntType`*: null/1*      | 1 (For PreAuth & Recurring default 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`<br /><font color="#2166ae">Required</font>                           | ANS                | 255      | Notification URL	<br />                                                             | https\://merchant.com/dbProcessUrl&#xD;                               |
| `userIP`<br /><font color="#2166ae">Required for CC, E-Wallet, Payloan, QRIS</font> | AN                 | 15       | User IP                                                                             | 127.0.0.1                                                             |
| `merchantToken`<br /><font color="#2166ae">Required</font>                          | AN                 | 255      | Merchant Token	<br />                                                               | c91e6531f6c84869439bc5ebe5389bd71e7752c054fc9dbfe193d087a1b797ae&#xD; |
| `description`                                                                       | AN                 | 100      | Transaction Description	                                                            | Test Transaction&#xD;                                                 |
| `userSessionID`                                                                     | AN                 | 100      | User Session ID	                                                                    | userSessionID                                                         |
| `userAgent`                                                                         | ANS                | 100      | User Agent	                                                                         | Mozilla                                                               |
| `userLanguage`                                                                      | A                  | 2        | User Language	                                                                      | en-US&#xD;                                                            |



### Cart Data for Full Payment & Installment - Registration API Credit Card

`cartData` on request parameter at Credit Card Registration uses to cover the goods or items will be paid to Your Customer including the item detail and each item price.&#x20;

| **Parameter** | **Description**                                                                                              | **Example** |
| ------------- | ------------------------------------------------------------------------------------------------------------ | ----------- |
| `Count`       | Total sum from the whole cart data                                                                           | 2           |
| `Item`        | Divide into 5 types of parameter such as `img_url`, `goods_id`, `goods_name`, `goods_detail` and `goods_amt` | -           |

***

Detail explaination on **Item&#x20;**&#x70;arameter.

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

### Sample JSON Cart Data

:::CodeblockTabs
cartData Credit Card Registration

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



## Response Parameter for Pre-Auth & Capture - Registration API Credit Card

***



The following is the response parameter from the transaction registration request result for Pre-Auth & Capture type that already proceed with Credit Card payment.

The parameter result needed to proceed to the next process from this response result is only `tXid`.&#x20;

To proceed to the next stage, please visit [Pre-Auth & Capture - Payment API Credit Card](docId\:MTSF5FXgP5dpm69ePTqyV) page.

| **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;                                        | PACTEST00101202206241007570327   |
| `referenceNo`  | ANS      | 40       | Merchant Reference Number&#xD;                             | ordNo20221215101254              |
| `payMethod`    | N        | 2        | [Payment Method Code](docId\:NQ1y7vMa25ZtvQHN5He6W)        | 01                               |
| `amt`          | N        | 12       | Payment Amount                                             | 10000                            |
| `transDt`      | N        | 8        | Transaction Date (`YYYYMMDD`)&#xD;                         | 20221212                         |
| `transTm`      | N        | 6        | Transaction Time (`HH24MISS`)&#xD;                         | 121212                           |
| `description`  | AN       | 100      | Transaction Description&#xD;                               | Testing Transaction Credit Card  |
| `bankCd`       | A        | 4        | [Bank Code](docId\:HlxvgrXVxWD90n8ohNKm0)                  | null                             |
| `vacctNo`      | N        | 20       | Virtual Account                                            | null                             |
| `mitraCd`      | A        | 4        | [Mitra Code](docId:0luP35KfOWksiSrzKx6yZ)                  | null                             |
| `payNo`        | N        | 12       | CVS Payment Number                                         | null                             |
| `currency`    | A        | 3        | Currency                                                   | IDR                              |
| `goodsNm`      | AN       | 100      | Goods Name&#xD;                                            | Goods For Testing Transaction    |
| `billingNm`    | A        | 100&#xD; | Buyer Name                                                 | John Doe                         |
| `vacctValidDt` | N        | 8        | VA Expiry Date (`YYYYMMDD`)                                | null                             |
| `vacctValidTm` | N        | 6        | VA Expiry Time (`HH24MISS`)                                | 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                             |

:::hint{type="info"}
Please check [NICEPAY Code](docId:5Dlvnma6exk5gdNr8asG0) to know the common code also response code on Credit Card payment method or other NICEPAY payment methods.&#x20;
:::

## Sample Parameter for Pre-Auth & Capture - Registration API Credit Card

***

### Request Parameter

:::CodeblockTabs
cURL

```curl
curl --location 'https://dev.nicepay.co.id/nicepay/direct/v2/registration' \
--header 'Content-Type: application/json' \
--data-raw '{
    "timeStamp": "20221214111261",
    "iMid": "PACTEST001",
    "payMethod": "01",
    "currency": "IDR",
    "amt": "5000",
    "merchantToken": "b40cb019e938d0118b77cb6f564a7facf12472e5bbb598dde0cd43b2df46b2aa",
    "referenceNo": "ordNo20221214111261",
    "goodsNm": "Goods For Testing Pre-Auth",
    "billingNm": "John Doe",
    "billingPhone": "081288998899",
    "billingEmail": "john.doe@example.com",
    "billingAddr": "Jln. Raya Kasablanka Kav.88",
    "billingCity": "South Jakarta",
    "billingState": "DKI Jakarta",
    "billingCountry": "Indonesia",
    "billingPostCd": "12800",
    "dbProcessUrl": "http://ptsv2.com/t/merchant/post",
    "userIP": "127.0.0.1",
    "instmntType": "1",
    "instmntMon": "1",
    "cartData": "{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}",
    "recurrOpt": "",
    "userLanguage": "en",
    "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
}'
```

Node.js

```nodejs
const nicepayClient = require("nodejs-nicepay");

let secondVersion = new nicepayClient.SecondApiVersion({
  isProduction: false,
  isCloudServer: false,
  merchantKey: "YOUR_MERCHANT_KEY",
});

const parameter = {
  timeStamp: "20221214111261",
  iMid: "PACTEST001",
  payMethod: "01",
  currency: "IDR",
  amt: "5000",
  merchantToken: "b40cb019e938d0118b77cb6f564a7facf12472e5bbb598dde0cd43b2df46b2aa",
  referenceNo: "ordNo20221214111261",
  goodsNm: "Goods For Testing Pre-Auth",
  billingNm: "John Doe",
  billingPhone: "081288998899",
  billingEmail: "john.doe@example.com",
  billingAddr: "Jln. Raya Kasablanka Kav.88",
  billingCity: "South Jakarta",
  billingState: "DKI Jakarta",
  billingCountry: "Indonesia",
  billingPostCd: "12800",
  dbProcessUrl: "http://ptsv2.com/t/merchant/post",
  cartData: "{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}",
  userIP: "127.0.0.1",
  instmntType: "1",
  instmntMon: "1",
  recurrOpt: "",
  userLanguage: "en",
  userAgent:
    "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
};

let endPoint = "/direct/v2/registration";

secondVersion.requestAPI(parameter, endPoint);

```

```java
String reffNo = "ordNo20221202141217";

Card requestData = Card.builder()
        .timeStamp("20221202141217")
        .iMid("IONPAYTEST")
        .payMethod("01")
        .currency("IDR")
        .amt("5000")
        .referenceNo(reffNo)
        .goodsNm("Testing Transaction")
        .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")
        .description("Testing Registration Credit Card")
        .deliveryNm("")
        .deliveryPhone("")
        .deliveryAddr("")
        .deliveryCity("")
        .deliveryState("")
        .deliveryPostCd("")
        .deliveryCountry("")
        .dbProcessUrl("http://ptsv2.com/t/merchant/post")
        .userIP("127.0.0.1")
        .userAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
        .instmntType("1")
        .instmntMon("1")
        .recurrOpt("1")
        .cartData("{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}")
        .merchantToken("20221202141217", "IONPAYTEST", reffNo, "5000", merchantKey)
        .build();

NICEPayResponseV2 cardRegistResponse = V2CardService.callV2CardRegistration(requestData, config);

```

```python
amt = 5000

itemCartData = {
    "goods_id": "NICEPRDID1",
    "goods_detail": "Goods For Testing Pre-Auth details",
    "goods_name": "Goods For Testing Pre-Auth",
    "goods_amt": amt,
    "goods_url": "https://merchant.com/cellphones/iphone5s_64g",
}

bodyCartData = (
    builderCartData.BuildCartData()
    .setCount("1")
    .setItem(itemCartData)
    .build()
)

bodyCreditCard = (
    builderCreditCard.BuildCreditCard()
    .setPayMethod(ConstantsGeneral.getPayMethodCreditCard())
    .setRecurrOpt("1")
    .setInstmntMon("1")
    .setInstmntType("1")
    .setAmt(str(amt))
    .build()
)

environment = (
    builderEnvironment.BuildEnvironment()
    .isCloud(False)
    .isProduction(False)
    .build()
)

```

C#

```csharp
string merchantKey = config.MerKey;
string clientId = config.ClientId;
string timestamp = "20221214111261";
string refNo = "ordNo20221214111261";
string amount = "5000";
bool isProduction = false;
bool isCloudServer = false;

// 1️⃣ Generate merchant token (keep original logic)
var merchantTokenBuilder = new MerchantTokenBuilder()
    .SetTimeStamp(timestamp)
    .SetIMid("PACTEST001")
    .SetRefNo(refNo)
    .SetAmount(amount)
    .SetMerchantKey(merchantKey);

string merchantToken = merchantTokenBuilder.BuildMerchantToken();

// 2️⃣ Build Cart Data
var cartItem = new Dictionary<string, object>
{
    { "goods_id", "NICEPRDID1"},
    { "img_url", "http://www.merchant.com/image_goods1.jpg" },
    { "goods_name", "Goods For Testing Pre-Auth" },
    { "goods_detail", "Goods For Testing Pre-Auth Details" },
    { "goods_amt", "5000" }
};

var cartDataBuilder = new BuilderCartData()
    .SetCount("1")
    .SetItem(cartItem);

var cartData = cartDataBuilder.Build();

// 3️⃣ Build Credit Card Request Body
var bodyBuilder = new NicepayRequestBuilder()
    .SetCommonFields(
        iMid: "PACTEST001",
        timeStamp: timestamp,
        payMethod: "01",
        currency: "IDR",
        amt: amount,
        referenceNo: refNo,
        goodsNm: "Goods For Testing Pre-Auth",
        merchantToken: merchantToken
    )
    .setCreditCard(
        instmntType: "1",
        instmntMon: "1",
        recurrOpt: ""
    )
    .SetBillingInfo(
        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"
    )
    .SetDbProcessUrl("http://ptsv2.com/t/merchant/post")
    .SetCartData(cartData)
    .SetUserIP("127.0.0.1")
    .SetUserLanguage("en")
    .SetUserAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0");

ApiEndpoints apiEndpoints = new ApiEndpoints();

// 4️⃣ Build payload and send
Dictionary<string, object> payload = bodyBuilder.Build();
string jsonPayload = Newtonsoft.Json.JsonConvert.SerializeObject(payload, Newtonsoft.Json.Formatting.Indented);

var registrationService = new NicepayRegistrationService(apiEndpoints, isProduction, isCloudServer);
var result = await registrationService.SendPostAsync(apiEndpoints.RegistV2, payload);

```

Vanilla JS

```javascript
const registrationData = {
  timeStamp: "20221214111261",
  iMid: "PACTEST001",
  payMethod: "01",
  currency: "IDR",
  amt: "5000",
  merchantToken: "b40cb019e938d0118b77cb6f564a7facf12472e5bbb598dde0cd43b2df46b2aa",
  referenceNo: "ordNo20221214111261",
  goodsNm: "Goods For Testing Pre-Auth",
  billingNm: "John Doe",
  billingPhone: "081288998899",
  billingEmail: "john.doe@example.com",
  billingAddr: "Jln. Raya Kasablanka Kav.88",
  billingCity: "South Jakarta",
  billingState: "DKI Jakarta",
  billingCountry: "Indonesia",
  billingPostCd: "12800",
  dbProcessUrl: "http://ptsv2.com/t/merchant/post",
  cartData: "{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}",
  userIP: "127.0.0.1",
  instmntType: "1",
  instmntMon: "1",
  recurrOpt: "",
  userLanguage: "en",
  userAgent:
    "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
};

const paymentData = {
  cardNo: "4811111111111114",
  expMonth: "12",
  expYear: "2025",
  cvv: "123",
};

(async () => {
  try {
    const response = await Nicepay.registerTransaction(registrationData, paymentData);
    console.log("Transaction Response:", response);
  } catch (error) {
    console.error("Registration Failed:", error);
  }
})();

```

Laravel

```php
$useProd = false;
$useCloud = false;
$registration_endpoint = "/nicepay/direct/v2/registration";

$url = HttpUtil::getNicepayDomain($useProd, $useCloud) . $registration_endpoint;

$timestamp = "20221213101276";
$reference_no = "ordNo20221213101276";
$amt = "5000";
$merchant_token = "ed9c8640b6260c8fa7070aa4e38df87896f9777899af354ee6d3d61f64626c0c";

$body = [
    "timeStamp" => $timestamp,
    "iMid" => "RECURRTEST",
    "payMethod" => "01",
    "currency" => "IDR",
    "amt" => $amt,
    "merchantToken" => $merchant_token,
    "referenceNo" => $reference_no,
    "goodsNm" => "Goods For Testing",
    "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",
    "cartData" => "{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}",
    "dbProcessUrl" => "http://ptsv2.com/t/merchant/post",
    "userIP" => "127.0.0.1",
    "instmntType" => "1",
    "instmntMon" => "1",
    "recurrOpt" => "1",
    "userLanguage" => "en",
    "userAgent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
];

$response = HttpUtil::postJsonRequest($url, $body);

```

PHP Native

```php
$config = NICEPay::builder()
    ->setIsProduction(false)
    ->build();

$timestamp = "20221202141217";
$reffNo = "ordNo20221202141217";
$amount = "5000";

$parameter = Card::builder()
    ->setTimeStamp($timestamp)
    ->setIMid("IONPAYTEST")
    ->setPayMethod("01")
    ->setCurrency("IDR")
    ->setAmt($amount)
    ->setReferenceNo($reffNo)
    ->setMerchantToken($timestamp, "IONPAYTEST", $reffNo, $amount, $this->merchantKey)
    ->setDescription("Testing Registration Credit Card")
    ->setGoodsNm("Testing Transaction")
    ->setBillingNm("John Doe")
    ->setBillingPhone("081288998899")
    ->setBillingEmail("john.doe@example.com")
    ->setBillingAddr("Jln. Raya Kasablanka Kav.88")
    ->setBillingCity("South Jakarta")
    ->setBillingState("DKI Jakarta")
    ->setBillingPostCd("12800")
    ->setBillingCountry("Indonesia")
    ->setDbProcessUrl("http://ptsv2.com/t/merchant/post")
    ->setCartData("{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}")
    ->setUserIP("127.0.0.1")
    ->setInstmntType("1")
    ->setInstmntMon("1")
    ->setRecurrOpt("1")
    ->setUserLanguage("en")
    ->setUserAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
    ->build();

$cardService = new V2CardService($config);
$response = $cardService->registration($parameter);

```

```kotlin
var config: NICEPay? = NICEPay.Builder()
    .isProduction(false)
    .clientSecret(TestingConstants.CLIENT_SECRET)
    .partnerId(TestingConstants.PARTNER_ID)
    .externalID(TestingConstants.EXTERNAL_ID)
    .timestamp(TestingConstants.TIMESTAMP)
    .privateKey(TestingConstants.PRIVATE_KEY)
    .build()

val request: DirectV2Card = DirectV2Card.Builder()
    .timeStamp("20221202141217")
    .iMid("IONPAYTEST")
    .payMethod("01")
    .currency("IDR")
    .amt("5000")
    .referenceNo("ordNo20221202141217")
    .goodsNm("Testing Transaction")
    .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")
    .dbProcessUrl("http://ptsv2.com/t/merchant/post")
    .userIP("127.0.0.1")
    .userAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
    .userLanguage("en")
    .instmntType("1")
    .instmntMon("1")
    .recurrOpt("1")
    .cartData("{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}")
    .merchantKey(DEFAULT_MERCHANT_KEY)
    .build()

val response: NICEPayResponseV2 = v2CardService.registration(request, config)!!

```

CodeIgniter

```php
$timestamp = "20221202141217";
$configBuilder = NICEPay::builder();
$config = $configBuilder
        ->setIsProduction(false)
        ->setIsCloudServer(isCloudServer: true)
        ->build();

$reffNo = "ordNo20221202141217";
$amount = "5000";

$CardBuilder = Card::builder();
$parameter = $CardBuilder
      ->setTimeStamp($timestamp)
      ->setIMid("IONPAYTEST")
      ->setPayMethod("01")
      ->setCurrency("IDR")
      ->setAmt($amount)
      ->setReferenceNo($reffNo)
      ->setMerchantToken($timestamp, "IONPAYTEST", $reffNo, $amount, $this->merchantKey)
      ->setDescription("Testing Registration Credit Card")
      ->setgoodsNm("Testing Transaction")
      ->setBillingNm("John Doe")
      ->setBillingPhone("081288998899")
      ->setBillingEmail("john.doe@example.com")
      ->setBillingAddr("Jln. Raya Kasablanka Kav.88")
      ->setBillingCity("South Jakarta")
      ->setBillingState("DKI Jakarta")
      ->setBillingPostCd("12800")
      ->setBillingCountry("Indonesia")
      ->setDbProcessUrl("http://ptsv2.com/t/merchant/post")
      ->setCartData("{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}")
      ->setUserIP("127.0.0.1")
      ->setInstmntType("1")
      ->setInstmntMon("1")
      ->setRecurrOpt("1")
      ->setUserLanguage("en")
      ->setUserAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
      ->build();

$cardService = new V2CardService($config);
$response = $cardService->registration($parameter);

```
:::

### Response Parameter

:::CodeblockTabs
Sample Response

```json
{
    "resultCd": "0000",
    "resultMsg": "SUCCESS",
    "tXid": "PACTEST00101202510081159303818",
    "referenceNo": "ordNo20221214111261",
    "payMethod": "01",
    "amt": "5000",
    "transDt": "20251008",
    "transTm": "115930",
    "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
}
```
:::

