Registration - API QRIS SNAP
Tentang Registration - API QRIS SNAP
API dengan standar SNAP ini digunakan untuk mengajukan pendaftaran pesanan sebelum melakukan pembayaran menggunakan metode pembayaran QRIS.
Registration - API QRIS SNAP
Silakan mengajukan akses token terlebih dahulu untuk melakukan autentikasi melalui bagian Request Access Token API - SNAP.
Service Code | 47 |
|---|---|
API Endpoint | /api/v1.0/qr/qr-mpm-generate |
HTTP Method | POST |
Description | Merchant Request Registration API QRIS |
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 (25) | Mandatory | Using ISO 8601 as timestamp format. Transaction date time, in format YYYYMMDDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time). 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. | |
X-PARTNER-ID | String (20) | Mandatory | NICEPAY Client ID (MID) | IONPAYTEST |
X-EXTERNAL-ID | String (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 (20) | Mandatory | Unique Channel Merchant Credential ID Number. Client ID + "01" = Channel ID "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": { "value":"100", "currency":"IDR" } | - |
value | String (12) | Mandatory | amt | Transaction Amount 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 paymentExpTm | Set Default: 5 minutes Maximum: 20 minutes Using ISO 8601 Timestamp Format | |
additionalInfo | Object | Mandatory | - | "additionalInfo": { ..., "cartData":"{...}", "mitraCd":"QSHP" } | - |
- 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 "cartData":"{...}" | |
- mitraCd | String (4) | Mandatory | - | | |
- 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 | 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 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? 4aRLCjAqjXYxIFavFxz0EPRX5C£G4nnzgEauyn1rL" |
additionalInfo | Object | Mandatory | - | "additionalinfo": { ... } | |
- goodsNm | String (200) | Mandatory | - | Goods Name | Merchant Goods 1 |
- billingNm | String (100) | Mandatory | - | Buyer Name | John Doe |
- validityPeriod | String (25) | Mandatory | paymentExpDt, paymentExpTm | Transaction date ISO-8601 | 2023-03-08T07:15:00+07:00 |
- mitraCd | String (4) | Mandatory | | 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
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 protected]",
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");
Response Parameter
{
"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"
}
}