---
title: Registration - API QRIS SNAP
slug: nicepay-api-snap-registration-qris
description: Informasi tentang Registration - API QRIS SNAP yang terdapat pada sistem NICEPAY
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/Dbt70jQrxBc7By--kH4w2_microsoftteams-image.png
icon: {"faIcon":"fa-solid fa-book"}
docTags: 
createdAt: 2023-02-17T09:54:55.000Z
---

# Tentang Registration - API QRIS SNAP

***

API dengan standar SNAP ini digunakan untuk mengajukan pendaftaran pesanan sebelum melakukan pembayaran menggunakan metode pembayaran QRIS.



# &#x20;Registration - API QRIS SNAP

***

:::hint{type="warning"}
Silakan mengajukan akses token terlebih dahulu untuk melakukan autentikasi melalui bagian [Request Access Token API - SNAP](docId\:GcGqBIYXG1Etcd0Ji9cHX).
:::

| **Service Code** | `47`                                        |
| ---------------- | ------------------------------------------- |
| **API Endpoint** | `/api/v1.0/qr/qr-mpm-generate`              |
| **HTTP Method**  | **POST**                                    |
| **Description**  | Merchant Request Registration API QRIS&#xD; |
| **Content-type** | `application/json`                          |



## Request Header Parameter for Registration - API QRIS SNAP

***

| **Nama Parameter Header** | **Tipe**          | **Kebutuhan** | **Deskripsi**                                                                                                                                                                     | **Contoh**         |
| ------------------------- | ----------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `Content-Type`            | String (127)      | Mandatory     | Type of the content.                                                                                                                                                              | `Application/Json` |
| `X-TIMESTAMP`             | String <br />(25) | Mandatory     | Using ISO 8601 as timestamp format.<br />Transaction date time, in format `YYYYMMDDTHH:mm:ss+07:00`.<br />Time must be in GMT+7 (Jakarta time).<br />`2022-03-21T10:11:40+07:00`. |                    |
| `Authorization`           | String (Variable) | Mandatory     | "Bearer" + \{`access_token`}                                                                                                                                                      |                    |
| `X-SIGNATURE`             | String (Variable) | Mandatory     | Signature will be generated by Merchant.<br />[Panduan X-Signature - Symmetric](docId\:UZex33ReLyENKOgbJJnYp)                                                                     |                    |
| `X-PARTNER-ID`            | String <br />(20) | Mandatory     | NICEPAY Client ID (`MID`)                                                                                                                                                         | IONPAYTEST         |
| `X-EXTERNAL-ID`           | String <br />(40) | Mandatory     | Unique messaging Reference ID generated by Merchant. Numeric String. Reference number that should be unique in every transaction in One Day.                                      |                    |
| `CHANNEL-ID`              | String <br />(20) | Mandatory     | Unique Channel Merchant Credential ID Number.<br />Client ID + "01" =  Channel ID <br />`"IONPAYTEST" + "01" = "IONPAYTEST01"`                                                    | IONPAYTEST01       |



## Request Body Parameter for Registration - API QRIS SNAP

***

| **Nama Parameter BI** | **Tipe Parameter** | **Kebutuhan** | **Parameter NICEPAY**              | **Deskripsi**                                                                                                                                                                | **Contoh**       |
| --------------------- | ------------------ | ------------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `partnerReferenceNo`  | String (40)        | Mandatory     | `referenceNo`                      | Unique Transaction ID from Merchant                                                                                                                                          | OrdNo20230303001 |
| `amount`              | Object             | Mandatory     | -                                  | `"amount": {`<br />`         "value":"100", `<br />`       "currency":"IDR" `<br />`    }`                                                                                | -                |
| `value`               | String (12)        | Mandatory     | `amt`                              | Transaction Amount<br />Note: Amount Format, currently only supported IDR (Indonesian Currency Rupiah) then value includes 2 decimal digits which are seperated by a dot (.) | 10000.00         |
| `currency`            | String (3)         | Mandatory     | `currency`                         | Default Value: IDR                                                                                                                                                           | IDR              |
| `merchantId`          | String (10)        | Mandatory     | `iMid`                             | Merchant Identifier                                                                                                                                                          |                  |
| `storeId`             | String (32)        | Optional      | `storeCd` / `shopId`               | Merchant ID from Acquirer Pay Side                                                                                                                                           |                  |
| `validityPeriod`      | String (25)        | Mandatory     | `paymentExpDt`<br />`paymentExpTm` | Set Default: 5 minutes<br />Maximum: 20 minutes<br /><br />Using ISO 8601 Timestamp Format                                                                                   |                  |
| `additionalInfo`      | Object             | Mandatory     | -                                  | `"additionalInfo": {`<br />`         ..., `<br />`         "cartData":"{...}", `<br />`         "mitraCd":"QSHP" `<br />`    }`                                          | -                |
| - `goodsNm`           | String (200)       | Mandatory     | -                                  | Goods Name                                                                                                                                                                   |                  |
| - `billingNm`         | String (100)       | Mandatory     | -                                  | Buyer Name                                                                                                                                                                   |                  |
| - `billingPhone`      | String (20)        | Mandatory     | -                                  | Buyer Phone Number                                                                                                                                                           |                  |
| - `billingEmail`      | String (100)       | Mandatory     | -                                  | Buyer Email                                                                                                                                                                  |                  |
| - `billingCity`       | String (50)        | Mandatory     |                                    | Buyer City                                                                                                                                                                   |                  |
| - `billingState`      | String (50)        | Mandatory     | -                                  | Buyer State                                                                                                                                                                  |                  |
| - `billingPostCd`     | String (10)        | Mandatory     | -                                  | Buyer Post Number                                                                                                                                                            |                  |
| - `billingCountry`    | String (10)        | Mandatory     | -                                  | Buyer Country                                                                                                                                                                |                  |
| - `callBackUrl`       | String (500)       | Conditional   | -                                  |                                                                                                                                                                              |                  |
| - `dbProcessUrl`      | String (500)       | Mandatory     | -                                  | Payment Notification URL (Async Notification)                                                                                                                                |                  |
| - `userIP`            | String (64)        | Mandatory     | -                                  | User IP (Customer)                                                                                                                                                           |                  |
| - `cartData`          | String (4000)      | Mandatory     | -                                  | JSON String<br />`"cartData":"{...}"`                                                                                                                                        |                  |
| - `mitraCd`           | String (4)         | Mandatory     | -                                  | [Mitra Code - API SNAP](docId\:mebNfCDEq1GFUs9oE_MOF)                                                                                                                        |                  |
| - `msId`              | String (20)        | Optional      | -                                  | Merchant Seller ID                                                                                                                                                           |                  |
| - `msFee`             | String (7)         | Optional      | -                                  | Merchant Seller Fee                                                                                                                                                          |                  |
| - `msFeeType`         | String (2)         | Optional      | -                                  | Merchant Seller Fee Type                                                                                                                                                     |                  |
| - `mbFee`             | String (7)         | Optional      | -                                  | Merchant Balance Fee                                                                                                                                                         |                  |
| - `mbFeeType`         | String (2)         | Optional      | -                                  | Merchant Balance Fee Type                                                                                                                                                    |                  |



## Request Cart Data Parameter for Registration - API QRIS SNAP

***

| **Parameter**       | **Deskripsi**                           | **Contoh**                          |
| ------------------- | --------------------------------------- | ----------------------------------- |
| `count`             | Total Cart Data Count                   | 1                                   |
| `item`              |                                         |                                     |
|  - `img_url`        | Goods Image URL (Image Size 50px\*50px) | `https://merchant.com/goodsImg.png` |
|  - `goods_name`     | Goods Name                              | Merchant Goods                      |
|  - `goods_detail`   | Goods Detail Description                | Goods Type 001                      |
|  - `goods_amt`      | Goods Payment Amount                    | 100                                 |
|  - `goods_quantity` | Goods Quantity                          | 1                                   |



## Response Parameter for Registration - API QRIS SNAP

***

| **Nama Parameter BI** | **Tipe Parameter** | **Kebutuhan** | **Parameter NICEPAY**               | **Deskripsi**                                                                                                              | **Contoh**                                                                                                                                                           |
| --------------------- | ------------------ | ------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `responseCode`        | String (7)         | Mandatory     | `responseCode`                      | Error code to specify the error returned<br />[General Response Code and Message - API SNAP](docId\:lKqJXSl5CMKdXYXxHYYSs) | 2004700                                                                                                                                                              |
| `responseMessage`     | String (150)       | Mandatory     | `responseMsg`                       | Debug message to provide more information                                                                                  | Successful                                                                                                                                                           |
| `referenceNo`         | String (40)        | Mandatory     | `tXid`                              | NICEPAY Transaction ID or Identifier                                                                                       | IONPAYTEST08202106091121206416                                                                                                                                       |
| `partnerReferenceNo`  | String (40)        | Mandatory     | `referenceNo`                       | Transaction Identifier on Merchant side                                                                                    | ncpy20221017161458                                                                                                                                                   |
| `qrContent`           | String (360)       | Mandatory     | `qrContent`                         | QR string in plain text                                                                                                    | "000201010212265400161D.CO.SHOPEE.WWWO11893600918002024585002082024585052041234530<br />336054041.0058021D5911test6007Bandung61054016362200516-1- July 20-126304D0A9 |
| `qrUrl`               | String (360)       | Mandatory     | `qrUrl`                             | URL to download QR image, URL is valid for 5 minutes                                                                       | https: //xxx.co.id/v3/merchant-host/qr/download?<br />4aRLCjAqjXYxIFavFxz0EPRX5C£G4nnzgEauyn1rL"                                                                     |
| `additionalInfo`      | Object             | Mandatory     | -                                   | `"additionalinfo": {`<br />`        ... `<br />`    }`                                                                   |                                                                                                                                                                      |
| - `goodsNm`           | String (200)       | Mandatory     | -                                   | Goods Name                                                                                                                 | Merchant Goods 1                                                                                                                                                     |
| - `billingNm`         | String (100)       | Mandatory     | -                                   | Buyer Name                                                                                                                 | John Doe                                                                                                                                                             |
| - `validityPeriod`    | String (25)        | Mandatory     | `paymentExpDt`,<br />`paymentExpTm` | Transaction date ISO-8601                                                                                                  | 2023-03-08T07:15:00+07:00                                                                                                                                            |
| - `mitraCd`           | String (4)         | Mandatory     |                                     | [Mitra Code - API SNAP](docId\:mebNfCDEq1GFUs9oE_MOF)                                                                      | QSHP                                                                                                                                                                 |
| - `msId`              | String (20)        | Optional      |                                     | Merchant Seller ID                                                                                                         | 123                                                                                                                                                                  |
| - `msFee`             | String (7)         | Optional      |                                     | Merchant Seller Fee                                                                                                        | 2000                                                                                                                                                                 |
| - `msFeeType`         | String (2)         | Optional      |                                     | Merchant Seller Fee Type                                                                                                   | 2                                                                                                                                                                    |
| - `mbFee`             | String (7)         | Optional      |                                     | Merchant Balance Fee                                                                                                       | 2000                                                                                                                                                                 |
| - `mbFeeType`         | String (2)         | Optional      |                                     | Merchant Balance Fee Type                                                                                                  | 2                                                                                                                                                                    |



## Sample Parameter for Registration - API QRIS SNAP

***

### Request Parameter

:::CodeblockTabs
cURL

```curl
curl -X POST \
  'https://dev.nicepay.co.id/nicepay/api/v1.0/qr/qr-mpm-generate' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs=' \
  -H 'X-TIMESTAMP: 2022-04-18T09:00:40+07:00' \
  -H 'X-SIGNATURE: SbvRKrqxRzvJtR/7rwtheRtEYYdS5NGUOtyFDCeGt1noVZUhf/uy25rVGGvzMzQdKX6TiVN9CmYTRVXhWLGFzQ==' \
  -H 'X-PARTNER-ID: TNICEQR081' \
  -H 'X-EXTERNAL-ID: 09041220240418' \
  -H 'CHANNEL-ID: TNICEQR08101' \
  -d '{"partnerReferenceNo":"ordNo2022120215134035","amount":{"value":"100.00","currency":"IDR"},"merchantId":"TNICEQR081","storeId":"NicepayStoreID1","validityPeriod":"2024-04-18T10:31:33+07:00","additionalInfo":{"goodsNm":"Test SNAP Transaction Nicepay","billingNm":"John Doe","billingPhone":"082213561712","billingEmail":"email@merchant.com","billingCity":"Jakarta","billingAddr":"Jalan Bukit Berbunga 22","billingState":"DKI Jakarta","billingPostCd":"12345","billingCountry":"Indonesia","callBackUrl":"https://ptsv2.com/t/jhon/post","dbProcessUrl":"https://ptsv2.com/t/jhon/post","userIP":"127.0.0.1","cartData":"{\"count\":1,\"item\":[{\"img_url\":\"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium\",\"goods_name\":\"Nokia 3360\",\"goods_detail\":\"Old Nokia 3360\",\"goods_amt\":\"100\",\"goods_quantity\":\"1\"}]}","mitraCd":"QSHP","msId":"","msFee":"","msFeeType":"","mbFee":"","mbFeeType":""}}'
```

Node.js

```nodejs
const config = {
  isProduction: false, // set true if using prod
  privateKey: cons.privateKey, 
  clientSecret: cons.clientSecret, 
  clientId: "TNICEQR081", 
  isCloudServer: false,
};

const accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs=";

const parameter = {
  body: {
    partnerReferenceNo: "ordNo2022120215134035",
    amount: {
      value: "100.00",
      currency: "IDR"
    },
    merchantId: "TNICEQR081",
    storeId: "NicepayStoreID1",
    validityPeriod: "2024-04-18T10:31:33+07:00",
    additionalInfo: {
      goodsNm: "Test SNAP Transaction Nicepay",
      billingNm: "John Doe",
      billingPhone: "082213561712",
      billingEmail: "email@merchant.com",
      billingCity: "Jakarta",
      billingAddr: "Jalan Bukit Berbunga 22",
      billingState: "DKI Jakarta",
      billingPostCd: "12345",
      billingCountry: "Indonesia",
      callBackUrl: "https://ptsv2.com/t/jhon/post",
      dbProcessUrl: "https://ptsv2.com/t/jhon/post",
      userIP: "127.0.0.1",
      cartData: "{\"count\":1,\"item\":[{\"img_url\":\"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium\",\"goods_name\":\"Nokia 3360\",\"goods_detail\":\"Old Nokia 3360\",\"goods_amt\":\"100\",\"goods_quantity\":\"1\"}]}",
      mitraCd: "QSHP",
      msId: "",
      msFee: "",
      msFeeType: "",
      mbFee: "",
      mbFeeType: ""
    }
  },
  headers: {
    X_EXTERNAL_ID: "09041220240418", 
    CHANNEL_ID: "TNICEQR08101", 
  },
};

// Initialize Snap and make the request
let snap = new Snap(config);
let endPoint = `/api/v1.0/qr/qr-mpm-generate`; 
let response = snap
  .requestSnapTransaction(parameter, endPoint, accessToken, "POST");

```

```java
// --- 1. Configure the NICEPay client ---
NICEPay config = NICEPay.builder()
        .isProduction(false)
        .clientSecret("YOUR_CLIENT_SECRET")
        .partnerId("TNICEQR081")
        .externalID("09041220240418")
        .timestamp("2022-04-18T09:00:40+07:00")
        .privateKey("YOUR_PRIVATE_KEY")
        .build();

// --- 2. Set the Access Token ---
String accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs=";

// --- 3. Build the Qris request body ---
String cartDataJson = "{\"count\":1,\"item\":[{\"img_url\":\"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium\",\"goods_name\":\"Nokia 3360\",\"goods_detail\":\"Old Nokia 3360\",\"goods_amt\":\"100\",\"goods_quantity\":\"1\"}]}";

Qris qris = Qris.builder()
        .merchantId("TNICEQR081")
        .storeId("NicepayStoreID1")
        .amount("100.00", "IDR")
        .partnerReferenceNo("ordNo2022120215134035")
        .validityPeriod("2024-04-18T10:31:33+07:00")
        .additionalInfo(
                "Test SNAP Transaction Nicepay",
                "John Doe",
                "082213561712",
                "email@merchant.com",
                "Jakarta",
                "Jalan Bukit Berbunga 22",
                "DKI Jakarta",
                "12345",
                "Indonesia",
                "https://ptsv2.com/t/jhon/post",
                "https://ptsv2.com/t/jhon/post",
                "127.0.0.1",
                cartDataJson,
                "QSHP",
                "", // msId 
                "", // msFee
                "", // msFeeType
                "", // mbFee
                ""  // mbFeeType
        )
        .build();

// --- 4. Make the API call ---
NICEPayResponse response =
        SnapQrisService.callServiceQrisRegist(qris, accessToken, config);


```

```python
    # --- 1. Define the token request body ---
    bodyCreateToken = (
        builderAccessToken.BuildAccessToken()
        .setGrantType("client_credentials")
        .setAdditionalInfo("")
        .build()
    )

    # --- 2. Define the Qris request body components ---
    amount = {
        "value": "100.00",
        "currency": "IDR"
    }

    cart_data_string = '{"count":1,"item":[{"img_url":"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium","goods_name":"Nokia 3360","goods_detail":"Old Nokia 3360","goods_amt":"100","goods_quantity":"1"}]}'

    additionalInfo = {
        "goodsNm": "Test SNAP Transaction Nicepay",
        "billingNm": "John Doe",
        "billingPhone": "082213561712",
        "billingEmail": "email@merchant.com",
        "billingAddr": "Jalan Bukit Berbunga 22",
        "billingCity": "Jakarta",
        "billingState": "DKI Jakarta",
        "billingCountry": "Indonesia",
        "billingPostCd": "12345",
        "callBackUrl": "https://ptsv2.com/t/jhon/post",
        "dbProcessUrl": "https://ptsv2.com/t/jhon/post",
        "userIP": "127.0.0.1",
        "msId": "",  
        "msFee": "",  
        "msFeeType": "",  
        "mbFee": "", 
        "mbFeeType": "",  
        "cartData": cart_data_string,
        "mitraCd": "QSHP"
    }

    # --- 3. Build the main Qris request body ---
    bodyQris = (
        builderQris.BuildQris()
        .setMerchantId("TNICEQR081")
        .setPartnerReferenceNo("ordNo2022120215134035")
        .setStoreId("NicepayStoreID1")
        .setValidityPeriod("2024-04-18T10:31:33+07:00")
        .setAmount(amount)
        .setAdditionalInfo(additionalInfo)
        .build()
    )

    # --- 4. Set the environment ---
    environment = (builderEnvironment.BuildEnvironment()
                   .isCloud(False)
                   .isProduction(False)
                   .build())

    # --- 5. Make the API call ---
    result = SnapService.serviceTransaction(
        bodyCreateToken.jsonAccessToken(),
        bodyQris.jsonQris(),
        ConstantsEndpoints.qris(),
        environment
    )


```

C#

```csharp
string clientId = "TNICEQR081";
string privateKey = config.PrivateKey;
string clientSecret = config.ClientSecret;

string timestampString = "2022-04-18T09:00:40+07:00";
DateTimeOffset timestamp = DateTimeOffset.Parse(timestampString);
string formattedTimestamp = timestamp.ToString("yyyy-MM-ddTHH:mm:sszzz");

string channelId = "TNICEQR08101";
string accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs=";
string externalId = "09041220240418";

ApiEndpoints apiEndpoints = new ApiEndpoints();
APIService qrisService = new APIService(apiEndpoints, clientSecret, clientId, channelId, isProduction, isCloudServer);

var bodyBuilder = new QrisBuilder()
    .SetQrisSnap(
        partnerReferenceNo: "ordNo2022120215134035",
        merchantId: "TNICEQR081",
        storeId: "NicepayStoreID1",
        validityPeriod: "2024-04-18T10:31:33+07:00",
        value: "100.00",
        currency: "IDR",
        goodsNm: "Test SNAP Transaction Nicepay",
        billingNm: "John Doe",
        billingPhone: "082213561712",
        billingEmail: "email@merchant.com",
        billingCity: "Jakarta",
        billingState: "DKI Jakarta",
        billingPostCd: "12345",
        billingCountry: "Indonesia",
        callBackUrl: "https://ptsv2.com/t/jhon/post",
        dbProcessUrl: "https://ptsv2.com/t/jhon/post",
        mitraCd: "QSHP",
        userIP: "127.0.0.1",
        cartData: "{\"count\":1,\"item\":[{\"img_url\":\"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium\",\"goods_name\":\"Nokia 3360\",\"goods_detail\":\"Old Nokia 3360\",\"goods_amt\":\"100\",\"goods_quantity\":\"1\"}]}"
    ).Build();

string jsonPayload = Newtonsoft.Json.JsonConvert.SerializeObject(bodyBuilder, Newtonsoft.Json.Formatting.Indented);

string createResponse = await qrisService.SendPostRequest(
    apiEndpoints.GenerateQris,
    accessToken,
    formattedTimestamp,
    bodyBuilder,
    externalId
);

Console.WriteLine("Generate Qris Response: " + createResponse);
```

Laravel

```php
<?php

use Carbon\Carbon;
use Illuminate\Support\Str;

$this->create_qris_endpoint = '/api/v1.0/qr/qr-mpm-generate';
$this->client_id = 'TNICEQR081';
$this->client_secret = 'YOUR_CLIENT_SECRET'; // Replace with your actual client secret
$this->access_token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs=';
$this->store_id = 'NicepayStoreID1';
$this->amt = '100.00';


// --- 1. Setup request parameters ---
$url = HttpUtil::getNicepayDomain($this->useProd, $this->useCloud) . $this->create_qris_endpoint;
$helper = new Helpers();

$http_method = "POST";
$x_time_stamp = "2022-04-18T09:00:40+07:00";
$validity_period = "2024-04-18T10:31:33+07:00";

$partner_id = $this->client_id;
$client_secret = $this->client_secret;
$access_token = $this->access_token;
$channel_id = "TNICEQR08101";
$store_id = $this->store_id;
$result = array();

$external_id = "09041220240418"; // From X-EXTERNAL-ID
$reference_no = "ordNo2022120215134035"; // From partnerReferenceNo

$totalAmount = [
    "value" => $this->amt,
    "currency" => "IDR"
];

$cartData = [
    "count" => 1,
    "item" => [
        [
            "img_url" => "https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium",
            "goods_name" => "Nokia 3360",
            "goods_detail" => "Old Nokia 3360",
            "goods_amt" => "100.00", 
            "goods_quantity" => "1"
        ]
    ]
];

$additionalInfo = [
    "goodsNm" => "Test SNAP Transaction Nicepay",
    "billingNm" => "John Doe",
    "billingPhone" => "082213561712",
    "billingEmail" => "email@merchant.com",
    "billingCity" => "Jakarta",
    "billingAddr" => "Jalan Bukit Berbunga 22",
    "billingState" => "DKI Jakarta",
    "billingPostCd" => "12345",
    "billingCountry" => "Indonesia",
    "dbProcessUrl" => "https://ptsv2.com/t/jhon/post",
    "callBackUrl"=> "https://ptsv2.com/t/jhon/post",
    "userIP" => "127.0.0.1",
    "cartData" => json_encode($cartData),
    "mitraCd" => "QSHP"
];

$body = [
    "partnerReferenceNo" => $reference_no,
    "amount" => $totalAmount,
    "merchantId" => $partner_id,
    "storeId" => $store_id,
    "validityPeriod" => $validity_period,
    "additionalInfo" => $additionalInfo
];

// --- 2. Generate Signature ---
$string_to_sign = $helper->generateStringToSign(
    $http_method,
    $this->create_qris_endpoint,
    $access_token,
    $body,
    $x_time_stamp
);

$signature = $helper->hmacSHA512Encoded(
    $string_to_sign,
    $client_secret,
    OPENSSL_ALGO_SHA512
);

// --- 3. Generate Header ---
$header = $helper->generateHeader(
    $access_token,
    $x_time_stamp,
    $signature,
    $partner_id,
    $external_id,
    $channel_id 
);

// --- 4. Send Request ---
try {
    $response = HttpUtil::postJsonRequestWithHeader($url, $body, $header);
    // Handle response
} catch (Exception $e) {
    // Handle exception
}

```

PHP Native

```php
<?php

// --- 1. Configure the NICEPay client ---
$config = NICEPay::builder()
    ->setIsProduction(false)
    ->setClientSecret('YOUR_CLIENT_SECRET') // Replace with your actual client secret
    ->setPartnerId('TNICEQR081') 
    ->setExternalID('09041220240418') 
    ->setTimestamp('2022-04-18T09:00:40+07:00')
    ->setPrivateKey('YOUR_PRIVATE_KEY') // Replace with your actual private key
    ->build();

// --- 2. Set the Access Token ---
$accessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs=';

// --- 3. Build the Qris request body ---
$cartDataJson = '{"count":1,"item":[{"img_url":"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium","goods_name":"Nokia 3360","goods_detail":"Old Nokia 3360","goods_amt":"100","goods_quantity":"1"}]}';

$requestBody = Qris::builder()
    ->partnerReferenceNo('ordNo2022120215134035')
    ->amount('100.00', 'IDR')
    ->merchantId('TNICEQR081')
    ->storeId('NicepayStoreID1')
    ->validityPeriod('2024-04-18T10:31:33+07:00')
    ->additionalInfo(
        "Test SNAP Transaction Nicepay",
        "John Doe",
        "082213561712",
        "email@merchant.com",
        "Jakarta",
        "Jalan Bukit Berbunga 22",
        "DKI Jakarta",
        "12345",
        "Indonesia",
        "https://ptsv2.com/t/jhon/post", 
        "https://ptsv2.com/t/jhon/post", 
        "127.0.0.1",
        $cartDataJson,
        "QSHP"
    )
    ->build();

// --- 4. Make the API call ---
$qrisService = new SnapQrisService($config);

try {
    $response = $qrisService->generateQris($requestBody, $accessToken);
} catch (Exception $e) {
    // Handle exception
}


```

```kotlin
// --- 1. Configure the NICEPay client ---
val config: NICEPay = NICEPay.Builder()
    .isProduction(false)
    .clientSecret("YOUR_CLIENT_SECRET") // Replace with your actual client secret
    .partnerId("TNICEQR081") 
    .externalID("09041220240418") 
    .timestamp("2022-04-18T09:00:40+07:00") 
    .privateKey("YOUR_PRIVATE_KEY") // Replace with your actual private key
    .build()

// --- 2. Set the Access Token ---
val accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs="

// --- 3. Build the Qris request body ---
val cartDataJson = "{\"count\":1,\"item\":[{\"img_url\":\"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium\",\"goods_name\":\"Nokia 3360\",\"goods_detail\":\"Old Nokia 3360\",\"goods_amt\":\"100\",\"goods_quantity\":\"1\"}]}"

val qris = SnapQris.Builder()
    .merchantId("TNICEQR081")
    .storeId("NicepayStoreID1")
    .amount("100.00", "IDR")
    .partnerReferenceNo("ordNo2022120215134035")
    .validityPeriod("2024-04-18T10:31:33+07:00")
    .additionalInfo(mapOf(
        "goodsNm" to "Test SNAP Transaction Nicepay",
        "billingNm" to "John Doe",
        "billingPhone" to "082213561712",
        "billingEmail" to "email@merchant.com",
        "billingCity" to "Jakarta",
        "billingAddr" to "Jalan Bukit Berbunga 22",
        "billingState" to "DKI Jakarta",
        "billingPostCd" to "12345",
        "billingCountry" to "Indonesia",
        "callBackUrl" to "https://ptsv2.com/t/jhon/post",
        "dbProcessUrl" to "https://ptsv2.com/t/jhon/post",
        "userIP" to "127.0.0.1",
        "cartData" to cartDataJson,
        "mitraCd" to "QSHP",
        "msId" to "",
        "msFee" to "",
        "msFeeType" to "",
        "mbFee" to "",
        "mbFeeType" to ""
    ))
    .build()

// --- 4. Make the API call ---
val response = snapQrisService.qrMpmGenerate(qris, accessToken, config)

```

CodeIgniter

```php
<?php
// --- 1. Configure the NICEPay client ---
$config = NICEPay::builder()
    ->setIsProduction(false) // dev
    ->setIsCloudServer(isCloudServer: false) 
    ->setPrivateKey('YOUR_PRIVATE_KEY') // Replace with your actual private key
    ->setClientSecret('YOUR_CLIENT_SECRET') // Replace with your actual client secret
    ->setPartnerId('TNICEQR081') 
    ->setExternalID('09041220240418') 
    ->setTimestamp('2022-04-18T09:00:40+07:00') 
    ->build();

// --- 2. Build the Qris request body ---
$cartDataJson = '{"count":1,"item":[{"img_url":"https://d3nevzfk7ii3be.cloudfront.net/igi/vOrGHXlovukA566A.medium","goods_name":"Nokia 3360","goods_detail":"Old Nokia 3360","goods_amt":"100","goods_quantity":"1"}]}';

$qrisBuilder = Qris::builder();
$requestBody = $qrisBuilder
    ->setPartnerReferenceNo('ordNo2022120215134035')
    ->setAmount('100.00', 'IDR')
    ->setMerchantId('TNICEQR081')
    ->setStoreId('NicepayStoreID1')
    ->setValidityPeriod('2024-04-18T10:31:33+07:00')
    ->setAdditionalInfo(
        "Test SNAP Transaction Nicepay",
        "John Doe",
        "082213561712",
        "email@merchant.com",
        "Jakarta",
        "Jalan Bukit Berbunga 22",
        "DKI Jakarta",
        "12345",
        "Indonesia",
        "https://ptsv2.com/t/jhon/post", 
        "https://ptsv2.com/t/jhon/post", 
        "127.0.0.1",
        $cartDataJson,
        "QSHP"
    )
    ->build();

// --- 3. Set the Access Token and make the API call ---
$accessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUTklDRVFSMDgxIiwiaXNzIjoiTklDRVBBWSIsIm5hbWUiOiJOSUNFUEFZIiwiZXhwIjoiMjAyNC0wNC0xOFQwMjozMToyOVoifQ==.5F1rppWeObC_EqJyW64W87F3M1_TLS5DzfzFhjxPZSs=';
$snapQrisService = new SnapQrisService();

try {
    $response = $snapQrisService->generateQris($requestBody, $accessToken, $config);
} catch (Exception $e) {
    // Handle exception
}


```
:::

### Response Parameter

:::CodeblockTabs
Sample Response

```json
{
    "responseCode": "2004700",
    "responseMessage": "Successful",
    "referenceNo": "TNICEQR08108202404181012168473",
    "partnerReferenceNo": "ordNo2022120215134035",
    "qrContent": "00020101021226610016ID.CO.SHOPEE.WWW01189360091800202508660208202508660303UMI5204123453033605406100.005802ID5913NicepayStore16015KAB. ACEH BARAT61052365962360520082024041810121600660708T00000026304C6F6",
    "qrUrl": "https://mapi.gw.uat.airpay.co.id/v3/merchant-host/qr/download?qr=pS03QyB4ZmuQMPdhSIl1jIr2WmPx3ErgJ3VJbaVfWC",
    "additionalInfo": {
        "goodsNm": "Test SNAP Transaction Nicepay",
        "billingNm": "John Doe",
        "mitraCd": "QSHP",
        "validityPeriod": "2024-04-18T10:31:33+07:00"
    }
}
```
:::

