Direct API

QRIS

Espay Payment Gateway provides QRIS services with QR MPM mode (Merchant Presented Mode), allowing you to display a QR code your customers can scan to make payments.

Before Integration

Make sure you have received the credentials from the Espay team.

Integration Steps

You can use the following steps to integrate with Direct API – QRIS.

1. Display Payment Method

Inquiry Merchant Info is a service that helps find active bank and product codes. This service allows you to customize the user interface (UI) when selecting a payment method. Learn Inquiry Merchant Info.

2. Generate Asymmetric Signature

Every request you send will be validated by the Espay Payment Gateway using the signature parameters you have created. Learn how to make a Payment Gateway | Asymmetric Signature.

3. Create Inquiry and Payment Services

You are required to provide a callback that the Espay Payment Gateway can access. Learn more about Inquiry and Payment.

  1. Generate QRIS
Type Value
Service Code
47
Name
QR MPM
HTTP Method
POST

Flow

You send the required parameters to make a request, and Espay Payment Gateway will respond in JSON format.

API URL

Environment URL
Sandbox
Port of HTTPS (443)
https://sandbox-api.espay.id/api/v1.0/qr/qr-mpm-generate
Production
Port of HTTPS (443)
https://api-merchant.espay.id/api/v1.0/qr/qr-mpm-generate

Headers

Name Type Mandatory Description
Content-Type
String
Y
Content of your request body.

Example:
application/json
X-TIMESTAMP
String (25)
Y
Customer's current local date and time.

Format:
yyyy-MM-ddThh:mi:ssTZD (ISO 8601)

Example:
2024-03-14T07:49:28+07:00
X-SIGNATURE
String (255)
Y
Code used to validate transactions. Learn Payment Gateway | Asymmetric Signature
X-EXTERNAL-ID
String (32)
Y
Numeric String. Reference number that should be unique on the same day.
X-PARTNER-ID
String (50)
Y
Merchant Code from Espay team.

Example:
SGWYESSISHOP
CHANNEL-ID
String (5)
Y
Channel id.

Value:
Espay
Authorization-Customer
String (150)
C
Access Token B2B2C. Espay -> Bank
Y: Yes, O: Optional, C: Conditional

Request Parameters

Parameter Type Mandatory Description
partnerReferenceNo
String (32)
Y
Unique code to identify the order/billing/invoice.

Example:
Transaction number, invoice ID, etc.
merchantId
String (28)
Y
Merchant code from Espay team.

Example:
SGWYESSISHOP
amount
Object
Y
  value
String (16.2)
Y
Paid amount.

Format:
Desimal .00 (ISO 4217)

Example:
150000.00
  currency
String (3)
Y
Transaction currency code.

Format:
  • Rupiah: IDR
additionalInfo
Object
Y
  productCode
String (16)
Y
Product code. See the list of product codes here.
validityPeriod
String(25)
O
Time and expiration date of the transaction.

Format:
yyyy-MM-ddThh:mi:ssTZD (ISO 8601)

Example:
2024-03-14T07:49:28+07:00
Y: Yes, O: Optional, C: Conditional

Response Parameters

Parameter Type Mandatory Description
responseCode
String (7)
Y
Response code. See response codes here.

Format:
HTTP Code + Service Code + Error Code

Example:
200+47+00 = 2004700
responseMessage
String (150)
Y
Response description. See response descriptions here.
qrUrl
String (256)
Y
QR URL for download QR Image.
qrContent
String (256)
Y
QR content in String format.
qrImage
Base64
Y
QR image in Base64 format.
additionalInfo
Object
  referenceNo
String (64)
Y
Transaction ID from Espay.
  partnerReferenceNo
String (64)
Y
Unique code to identify the order/billing/invoice.

Example:
Transaction number, invoice ID, etc.
  merchantName
String (64)
Y
Merchant name.
  amount
String (16.2)
Y
Paid amount.

Format:
Desimal .00 (ISO 4217)

Example:
150000.00
Y: Yes, O: Optional, C: Conditional
5. After Payment
Espay Payment Gateway provides an optional API that you can use to support other payment needs.

Try It!

You can enter data using the input provided. After that, you submit and see the results!

Request

Value

Response

FAQ
QRIS (QR-MPM) is an API service that generates a payment QR Code, which can then be displayed to customers on the merchant’s payment page.
  • QRIS (QR-MPM)
    QRIS (QR-MPM) is used to display a payment QR Code on your own page. You send an API request to Espay, and Espay will return data such as qrUrl, qrImage, or qrContent. The QR Code is displayed on your payment page, and overall page management is handled entirely by you.
  • Payment Host to Host
    Payment Host-to-Host is used to obtain an Espay payment URL. You send an API request to Espay and then redirect the customer to the Espay payment page (Espay Checkout Page). All payment method selection and UI are fully handled by Espay.
QRIS (QR-MPM) is suitable if you want to provide the QRIS payment method on your own payment page. Espay will return data such as qrUrl, qrImage, and qrContent, which you can display on your page.
Yes, you can set the QRIS expiration time by providing the validityPeriod parameter in the request or through the expiredDatetime parameter in the Inquiry service response.

If it is not specified, the QRIS expiration time will follow Espay default setting, which is 10 minutes.
This error may occur because Espay is unable to access the Inquiry callback you provided, which causes the transaction process to stop.

Please refer to the detailed explanation in General FAQ – Transaction Status.
The response code occurs because the partnerReferenceNo parameter has already been used.

Please ensure that the partnerReferenceNo is unique and has not been used in any previous transactions.
The minimum transaction amount for QRIS is IDR 10,000.
Sample Headers

Content-Type:application/json
X-TIMESTAMP:2024-03-14T07:49:28+07:00
X-SIGNATURE:SHwb9RwkUyxTV8uLv1MoGShUgZi1Of35GtB9GVmouSt2r8ePf/7Sy3zBuuBaUOhMcWJnojFtOuRhVR64uAES8H8R91kvAhW29l3QU9WO3LFDSp4PI8vwQVeHXOXlnNZa+HLXP8iYqnXRCIsoSTPTRQiBzpjQaUB1nGtEBEnDCMhRG7ijnMRtJQGiWUq2uT2Kfs23i64F8A2sVTojgnB4oPFMaeGuy0vhmtQqKAezBlKI9xhRAQz8cVHo1qcNNtakQjuWI/S0065lL0bDuY7SBY6iMTFzfGZkaxt8pzNLHbs4SbyjvzZnXt8of0ZUwEQxrMg5CLeACE8Tp7cyrgQ93w==
X-EXTERNAL-ID:d41e58d9-0e1d-4632-a9c1-df0eea578c0c
X-PARTNER-ID:SGWYESSISHOP
CHANNEL-ID:ESPAY
               





























Sample Request

{
  "partnerReferenceNo": "DIGSNAP000033",
  "merchantId": "SGWYESSISHOP",
  "amount": {
      "value": "10001.00",
      "currency": "IDR"
  },
  "additionalInfo": {
      "productCode": "QRIS"
  },
  "validityPeriod": "2024-03-20T07:44:11+07:00"
}
               






























Sample Positive Response

{
    "responseCode": "2004700",
    "responseMessage": "Successful",
    "qrUrl": "https://sandbox-api.espay.id/rest/digitalnotify/qr/?trx_id=ESP1710414240U8GO",
    "qrContent": "00020101021226710019ID.CO.CIMBNIAGA.WWW01189360002200006573970",
    "qrImage": "data:image/png;base64,",
    "additionalInfo": {
      "referenceNo": "ESP1710414240U8GO",
      "partnerReferenceNo": "DIGSNAP000033",
      "amount": "890000"
  }
}
                


Sample Negative Response

{
  "responseCode": "4094700",
  "responseMessage": "Duplicate X-EXTERNAL-ID"
}

                    


HTTP

curl --location 'https://sandbox-api.espay.id/api/v1.0/qr/qr-mpm-generate' \
--header 'Content-Type: application/json' \
--header 'X-TIMESTAMP: 2024-03-14T07:49:28+07:00' \
--header 'X-SIGNATURE: SHwb9RwkUyxTV8uLv1MoGShUgZi1Of35GtB9GVmouSt2r8ePf/7Sy3zBuuBaUOhMcWJnojFtOuRhVR64uAES8H8R91kvAhW29l3QU9WO3LFDSp4PI8vwQVeHXOXlnNZa+HLXP8iYqnXRCIsoSTPTRQiBzpjQaUB1nGtEBEnDCMhRG7ijnMRtJQGiWUq2uT2Kfs23i64F8A2sVTojgnB4oPFMaeGuy0vhmtQqKAezBlKI9xhRAQz8cVHo1qcNNtakQjuWI/S0065lL0bDuY7SBY6iMTFzfGZkaxt8pzNLHbs4SbyjvzZnXt8of0ZUwEQxrMg5CLeACE8Tp7cyrgQ93w==' \
--header 'X-EXTERNAL-ID: d41e58d9-0e1d-4632-a9c1-df0eea578c0c' \
--header 'X-PARTNER-ID: SGWYESSISHOP' \
--header 'CHANNEL-ID: ESPAY' \
--data '{
  "partnerReferenceNo": "DIGSNAP000033",
  "merchantId": "SGWYESSISHOP",
  "amount": {
      "value": "10001.00",
      "currency": "IDR"
  },
  "additionalInfo": {
      "productCode": "QRIS"
  },
  "validityPeriod": "2024-03-20T07:44:11+07:00"
}'
               


CURL

POST /api/v1.0/qr/qr-mpm-generate HTTP/1.1
Host: sandbox-api.espay.id
Content-Type: application/json
X-TIMESTAMP: 2024-03-14T07:49:28+07:00
X-SIGNATURE: SHwb9RwkUyxTV8uLv1MoGShUgZi1Of35GtB9GVmouSt2r8ePf/7Sy3zBuuBaUOhMcWJnojFtOuRhVR64uAES8H8R91kvAhW29l3QU9WO3LFDSp4PI8vwQVeHXOXlnNZa+HLXP8iYqnXRCIsoSTPTRQiBzpjQaUB1nGtEBEnDCMhRG7ijnMRtJQGiWUq2uT2Kfs23i64F8A2sVTojgnB4oPFMaeGuy0vhmtQqKAezBlKI9xhRAQz8cVHo1qcNNtakQjuWI/S0065lL0bDuY7SBY6iMTFzfGZkaxt8pzNLHbs4SbyjvzZnXt8of0ZUwEQxrMg5CLeACE8Tp7cyrgQ93w==
X-EXTERNAL-ID: d41e58d9-0e1d-4632-a9c1-df0eea578c0c
X-PARTNER-ID: SGWYESSISHOP
CHANNEL-ID: ESPAY

{
    "partnerReferenceNo": "DIGSNAP000033",
    "merchantId": "SGWYESSISHOP",
    "amount": {
        "value": "10001.00",
        "currency": "IDR"
    },
    "additionalInfo": {
        "productCode": "QRIS"
    },
    "validityPeriod": "2024-03-20T07:44:11+07:00"
}
               
Scroll to Top