Skip to content

Generate QR MPM SNAP

Information

This API is requested from the merchants to generate QRIS codes. You can use QR string, QR URL or QR image to convert to QR Code.

Path/v1.0/qr/qr-mpm-generate
HTTP MethodPOST
Service Code47

Request

Details
ParameterData TypeMandatoryLengthDescription
partnerReferenceNoStringM64Transaction identifier on service consumer system. Alphanumeric only, not special characters and space allowed.
amountObjectM
amount.valueStringC16,2Amount of the transaction.
If it's IDR then the value includes 2 decimal digits.
e.g. IDR 10.000,- will be placed with 10000.00 with 2 decimal
amount.currencyStringC3Currency (Format: ISO4217)
fixed value: IDR
terminalIdStringO16Terminal Identification
validityPeriodStringO25The time when the QRIS is valid.
- Minimum 15 minutes
- Maximum 60 minutes. 
- If empty, default validityPeriod 15 minutes.
ISO-8601
additionalInfoObjectCAdditional information
additionalInfo.tipObjectOFees charged by merchants to customers.
additionalInfo.tip.typeStringO2There are 2 categories of tips:
_ Value "01": The customer inputs the amount of tip to be paid to the merchant.
_ Value "02": The merchant sets a fixed amount. The tip value must be filled.
additionalInfo.tip.valueStringC16,2Mandatory if the tip value is either 02.
additionalInfo.callbackUrlTextMPayment Notification URL, must use SNAP format.
additionalIfo.customerDetailObjectO
additionalIfo.customerDetail.emailStringO255Give validation format. Use @
additionalIfo.customerDetail.phoneStringO30Number only
additionalIfo.customerDetail.fullNameStringO100
additionalIfo.itemDetailsArray of ObjectsOExplain the items purchased
additionalIfo.itemDetails.itemIdString(25)C25ID of product. Mandatory if item details is filled
additionalIfo.itemDetails.nameString(150)C100Name of product.
Mandatory if item details is filled
additionalIfo.itemDetails.amountObjectCPrice per unit.
Mandatory if item details is filled. Accumulation amount should be match with original amount
additionalIfo.itemDetails.amount.valueStringCMandatory if item details is filled
additionalIfo.itemDetails.amount.currencyStringC16,2Mandatory if item details is filled
additionalIfo.itemDetails.qtyInt(10)C8Number of product units.
Mandatory if item details is filled. Maximum 99999999
additionalIfo.itemDetails.descriptionString(255)O255Description of product

Example Request

sh
curl --location '.../v1.0/qr/qr-mpm-generate' \
--header 'Content-Type: application/json' \
--header 'X-TIMESTAMP: 2020-12-18T10:55:00+07:00' \
--header 'X-SIGNATURE: EW54nOonmAK58n7lFuAd6RJCa9Th1NnIkRO3fEk2IXSPqukTvBukrBTSJKEsh8Lk5A3cCWnTpMUjcirsvCGpjqtBuDLfQWHA6Cr/Ah4lfPwVMxfDS+tPqb+ZhGBBSv6Wz39CfHHWXoEs1hpRONBUc02zO5ancLtyU3mn4IbYPfP72eUKpqH+Zw9IDBnFyVQ0isr9DDwiS8MZyNdN7io3ZL6SCvuOpxeaC4I/zbeauyiswqwb/hF51M60tD79yTzjDLlgz/e4X3Z3kJyQHUauVldb13Fl7F81wxj+iDrg6AjfSbRJ3QnkAndo/ZIUKcihq7AkUm9uhLYEhrW+iUW4eg==' \
--header 'X-PARTNER-ID: MC2024113943' \
--header 'X-EXTERNAL-ID: 63005301609284' \
--header 'CHANNEL-ID: QR004' \
--data '{
    "partnerReferenceNo": "63064359768847",
    "amount": {
        "value": "800000.00",
        "currency": "IDR"
    },
    "terminalId": "A01",
    "validityPeriod": "2025-02-26T16:00:08+07:00",
    "additionalInfo": {
        "callbackUrl": "https://testcallback.com",
		"customerDetail": {
            "email": "test@gmail.com",
            "phone": "08888888888",
            "fullName": "Customer name"
        },
        "itemDetails": [
            {
                "itemId": "12345",
                "name": "Dress wanita",
                "amount": {
                    "value": "700000.00",
                    "currency": "IDR"
                },
                "qty": 1,
                "description": "pembelian baju"
            },
            {
                "itemId": "45789",
                "name": "kaos kaki",
                "amount": {
                    "value": "100000.00",
                    "currency": "IDR"
                },
                "qty": 1,
                "description": "pembelian kaos kaki"
            }
        ]
    }
}
go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := ".../v1.0/qr/qr-mpm-generate"
  method := "POST"

  payload := strings.NewReader(`{`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-TIMESTAMP", "2020-12-18T10:55:00+07:00")
  req.Header.Add("X-SIGNATURE", "EW54nOonmAK58n7lFuAd6RJCa9Th1NnIkRO3fEk2IXSPqukTvBukrBTSJKEsh8Lk5A3cCWnTpMUjcirsvCGpjqtBuDLfQWHA6Cr/Ah4lfPwVMxfDS+tPqb+ZhGBBSv6Wz39CfHHWXoEs1hpRONBUc02zO5ancLtyU3mn4IbYPfP72eUKpqH+Zw9IDBnFyVQ0isr9DDwiS8MZyNdN7io3ZL6SCvuOpxeaC4I/zbeauyiswqwb/hF51M60tD79yTzjDLlgz/e4X3Z3kJyQHUauVldb13Fl7F81wxj+iDrg6AjfSbRJ3QnkAndo/ZIUKcihq7AkUm9uhLYEhrW+iUW4eg==")
  req.Header.Add("X-PARTNER-ID", "MC2024113943")
  req.Header.Add("X-EXTERNAL-ID", "63005301609284")
  req.Header.Add("CHANNEL-ID", "QR004")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
js
const axios = require('axios');
let data = '{';

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: '.../v1.0/qr/qr-mpm-generate',
  headers: {
    'Content-Type': 'application/json',
    'X-TIMESTAMP': '2020-12-18T10:55:00+07:00',
    'X-SIGNATURE': 'EW54nOonmAK58n7lFuAd6RJCa9Th1NnIkRO3fEk2IXSPqukTvBukrBTSJKEsh8Lk5A3cCWnTpMUjcirsvCGpjqtBuDLfQWHA6Cr/Ah4lfPwVMxfDS+tPqb+ZhGBBSv6Wz39CfHHWXoEs1hpRONBUc02zO5ancLtyU3mn4IbYPfP72eUKpqH+Zw9IDBnFyVQ0isr9DDwiS8MZyNdN7io3ZL6SCvuOpxeaC4I/zbeauyiswqwb/hF51M60tD79yTzjDLlgz/e4X3Z3kJyQHUauVldb13Fl7F81wxj+iDrg6AjfSbRJ3QnkAndo/ZIUKcihq7AkUm9uhLYEhrW+iUW4eg==',
    'X-PARTNER-ID': 'MC2024113943',
    'X-EXTERNAL-ID': '63005301609284',
    'CHANNEL-ID': 'QR004'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
rust
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::builder()
        .build()?;

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("Content-Type", "application/json".parse()?);
    headers.insert("X-TIMESTAMP", "2020-12-18T10:55:00+07:00".parse()?);
    headers.insert("X-SIGNATURE", "EW54nOonmAK58n7lFuAd6RJCa9Th1NnIkRO3fEk2IXSPqukTvBukrBTSJKEsh8Lk5A3cCWnTpMUjcirsvCGpjqtBuDLfQWHA6Cr/Ah4lfPwVMxfDS+tPqb+ZhGBBSv6Wz39CfHHWXoEs1hpRONBUc02zO5ancLtyU3mn4IbYPfP72eUKpqH+Zw9IDBnFyVQ0isr9DDwiS8MZyNdN7io3ZL6SCvuOpxeaC4I/zbeauyiswqwb/hF51M60tD79yTzjDLlgz/e4X3Z3kJyQHUauVldb13Fl7F81wxj+iDrg6AjfSbRJ3QnkAndo/ZIUKcihq7AkUm9uhLYEhrW+iUW4eg==".parse()?);
    headers.insert("X-PARTNER-ID", "MC2024113943".parse()?);
    headers.insert("X-EXTERNAL-ID", "63005301609284".parse()?);
    headers.insert("CHANNEL-ID", "QR004".parse()?);

    let data = "{";

    let request = client.request(reqwest::Method::POST, ".../v1.0/qr/qr-mpm-generate")
        .headers(headers)
        .body(data);

    let response = request.send().await?;
    let body = response.text().await?;

    println!("{}", body);

    Ok(())
}
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '.../v1.0/qr/qr-mpm-generate',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-TIMESTAMP: 2020-12-18T10:55:00+07:00',
    'X-SIGNATURE: EW54nOonmAK58n7lFuAd6RJCa9Th1NnIkRO3fEk2IXSPqukTvBukrBTSJKEsh8Lk5A3cCWnTpMUjcirsvCGpjqtBuDLfQWHA6Cr/Ah4lfPwVMxfDS+tPqb+ZhGBBSv6Wz39CfHHWXoEs1hpRONBUc02zO5ancLtyU3mn4IbYPfP72eUKpqH+Zw9IDBnFyVQ0isr9DDwiS8MZyNdN7io3ZL6SCvuOpxeaC4I/zbeauyiswqwb/hF51M60tD79yTzjDLlgz/e4X3Z3kJyQHUauVldb13Fl7F81wxj+iDrg6AjfSbRJ3QnkAndo/ZIUKcihq7AkUm9uhLYEhrW+iUW4eg==',
    'X-PARTNER-ID: MC2024113943',
    'X-EXTERNAL-ID: 63005301609284',
    'CHANNEL-ID: QR004'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Response

Details
ParameterData TypeMandatoryLengthDescription
responseCodeStringM7Response code
responseMessageStringM150Response description
referenceNoStringM64Transaction identifier on service provider system. Must be filled upon successful transaction.
Value : UUID
partnerReferenceNoStringM64Transaction identifier on service consumer system
qrContentStringM512QR String MPM.
qrUrlStringO256QR URL for download QR Image. QR URL is valid until 1 menit before validityPeriod
qrImageStringO-base64 from image QRIS.
Max length is unlimited.
terminalIdStringO-Default value A01
additionalInfoObjectO-Additional information
additionalInfo.paymentChannelStringM-Description of the payment channel name
additionalInfo.typeStringC-QR Type
additionalInfo.validityPeriodStringOThe time when the QRIS is valid.
additionalInfo.createdTimeStringOThe time when the QRIS is created.

Example Response

{
    "responseCode": "2004700",
    "responseMessage": "Request has been processed successfully",
    "referenceNo": "2020102977770000000009",
    "partnerReferenceNo": "2020102900000000000001",
    "qrContent": "xxxxxxxxxxxxxxxx",
"qrUrl": "https": //qrurl?img=12345,          "qrImage":"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCAuLi4=",
    "terminalId": "213141251124",
    "additionalInfo": {
        "paymentChannel": "IFORTEPAY",
        "type": "DYNAMIC",
       "validityPeriod":"2024-07-03T12:08:56+07:00",
	   "createdTime":"2024-07-03T12:08:20+07:00",
        }
    }
}

iFortepay API Documentation