post https://api.sandbox.midtrans.com/v2/charge
QRIS is a QR payment standard in Indonesia, developed by Bank Indonesia (BI). Users can scan and pay the QR from any payment providers registered as the issuer here.
For QRIS, we are currently integrated with the acquirers given below.
- GoPay
- AirPay Shopee (ShopeePay)
The steps to integrate with QRIS are given below.
- Send the charge API request to Midtrans with the selected acquirer.
- Show the rendered QR string to the users.
- Handle notifications.
Send a Charge API request with the details of the transaction such as payment_type
, qris
, transaction_details
, item_details
, and customer_details
. Successful request returns a QR code image URL.
QRIS Charge API Request
{
"payment_type": "qris",
"transaction_details": {
"order_id": "order03",
"gross_amount": 275000
},
"item_details": [
{
"id": "id1",
"price": 275000,
"quantity": 1,
"name": "Bluedio H+ Turbine Headphone with Bluetooth 4.1 -"
}
],
"customer_details": {
"first_name": "Budi",
"last_name": "Utomo",
"email": "[email protected]",
"phone": "081223323423"
},
"qris": {
"acquirer": "gopay"
}
}
JSON Attribute | Description | Type | Required |
---|---|---|---|
payment_type | Set QRIS payment method. Value: qris | String | Required |
transaction_details | The details of the specific transaction such as order_id and gross_amount . | Object | Required |
item_details | Details of the item(s) purchased by the customer. | Object | Optional |
customer_details | Details of the customer. | Object | Optional |
qris | Charge details using QRIS. | Object | Optional |
QRIS Charge Response and Notifications
{
"status_code": "201",
"status_message": "QRIS transaction is created",
"transaction_id": "0d8178e1-c6c7-4ab4-81a6-893be9d924ab",
"order_id": "order03",
"merchant_id": "M099098",
"gross_amount": "275000.00",
"currency": "IDR",
"payment_type": "qris",
"transaction_time": "2020-09-29 11:46:13",
"transaction_status": "pending",
"fraud_status": "accept",
"acquirer": "gopay",
"actions": [
{
"name": "generate-qr-code",
"method": "GET",
"url": "https://api.midtrans.com/v2/qris/0d8178e1-c6c7-4ab4-81a6-893be9d924ab/qr-code"
}
]
}
{
"transaction_time":"2020-09-29 11:18:06",
"transaction_status":"pending",
"transaction_id":"ce0a3584-5a0c-4049-ad88-5590a96be4fe",
"status_message":"midtrans payment notification",
"status_code":"201",
"signature_key":"b1798748303cf0817733c1e312d630793b84d8125a96af0cb7251f8266d5c5256285084ba3ffbfae1f264a031d41927124fba0b552f249ee68180e9c7566448e",
"payment_type":"qris",
"order_id":"order03",
"merchant_id":"M099098",
"gross_amount":"275000.00",
"fraud_status":"accept",
"currency":"IDR",
"acquirer":"gopay"
}
{
"transaction_type":"on-us",
"transaction_time":"2020-09-29 11:27:33",
"transaction_status":"settlement",
"transaction_id":"9f07920a-6145-4d1e-9fc2-66e6fd6bc6fc",
"status_message":"midtrans payment notification",
"status_code":"200",
"signature_key":"155b03b554092326ad9d2ed936f5765fe759b6bc491c0161a26e4340978fb6e8f07683bf012552a9498bfc919abab834aade57eda01f7a18a3490a515cf17632",
"settlement_time":"2020-09-29 11:30:44",
"payment_type":"qris",
"order_id":"order03",
"merchant_id":"M099098",
"issuer":"gopay",
"gross_amount":"275000.00",
"fraud_status":"accept",
"currency":"IDR",
"acquirer":"gopay",
"shopeepay_reference_number": "144854469038383602",
"reference_id": "QR-ZbbffKucJPEksDmXMFChZa"
}
{
"transaction_time":"2020-09-29 11:31:39",
"transaction_status":"expire",
"transaction_id":"9728e0fd-a49c-4c25-8c88-404ef1c45e0e",
"status_message":"midtrans payment notification",
"status_code":"202",
"signature_key":"4580d8fc6c4a8dca3319efc1f629b8b33e923ec62b2e6ad7254ed6230ef0e57977b2f6124ba8f2a7a71c53ac7368f3f795ffbdecac3b5cf23e82f1ca5440ad1a",
"payment_type":"qris",
"order_id":"order03",
"merchant_id":"M099098",
"gross_amount":"275000.00",
"fraud_status":"accept",
"currency":"IDR",
"acquirer":"gopay"
}
JSON Attribute | Description | Type |
---|---|---|
status_code | Status code of transaction charge result. | String |
status_message | Description of transaction charge result. | String |
transaction_id | Transaction ID given by Midtrans. | String |
order_id | Order ID specified by you. | String |
gross_amount | Total amount of transaction in IDR. | String |
payment_type | Transaction payment method. | String |
transaction_time | Timestamp of transaction in ISO 8601 format. Time Zone: GMT+7. | String |
transaction_status | Status of QRIS transaction. Possible values arepending , settlement , expire , deny . | String |
transaction_type | To determine how the transaction is being acquired. Possible values are on-us or off-us . | String |
issuer | The provider that is making the payment over the QR. | String |
actions | Actions which can be performed with this transaction. Use generate-qr-code action to render the QR code image (PNG format). | Array(Object) |
acquirer | The provider creating the QR and accepting the payment. The value is the same as the one set in the charge request. | String |
merchant_id | Merchant ID given by Midtrans. | String |
currency | ISO-4217 representation of three-letter alphabetic currency code. Value: IDR .Note: Currently only IDR is supported. | String |
signature_key | Combination of parameters such as order_id , status_code , gross_amount , server_key to verify integrity of payload/response. | String |
shopeepay_reference_number | Reference number given by ShopeePay. Only available for acquirer airpay shopee | String |
reference_id | Reference id given by payment provider. Only available for acquirer airpay shopee | String |
Note
Possible error codes are 400, 401, 402, 406, 410