The steps to integrate with Mandiri Bill Payment are given below.
- Send the charge API request to Midtrans.
- Display bill key and biller code to the customer.
- Handle notifications.
Send a Charge API request with the details of the transaction such as payment_type
, echannel
, transaction_details
, item_details
, and customer_details
. Successful request returns a VA number.
By default, default expiry time for bank transfer is 24 hours unless specified by merchant (min 20s, max 180 days).
Note
Sometimes, because of a reversal triggered by the corresponding payment provider, the transaction status can change from
SETTLEMENT
toDENY
. It may happen within the span of one minute.
Mandiri Charge API Request
{
"payment_type": "echannel",
"transaction_details": {
"order_id": "1388",
"gross_amount": 95000
},
"item_details": [
{
"id": "a1",
"price": 50000,
"quantity": 2,
"name": "Apel"
},
{
"id": "a2",
"price": 45000,
"quantity": 1,
"name": "Jeruk"
}
],
"echannel" : {
"bill_info1" : "Payment For:",
"bill_info2" : "debt",
"bill_key" : "081211111111"
}
}
JSON Attribute | Description | Type | Required |
---|---|---|---|
payment_type | Set E-channel payment method. Value: echannel . | 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 |
echannel | Charge details using Mandiri Bill Payment. | Object | Required |
Mandiri Bill Sample Responses and Notifications
{
"status_code": "201",
"status_message": "Success, Mandiri Bill transaction is successful",
"transaction_id": "883af6a4-c1b4-4d39-9bd8-b148fcebe853",
"order_id": "tes",
"gross_amount": "1000.00",
"payment_type": "echannel",
"transaction_time": "2016-06-19 14:40:19",
"transaction_status": "pending",
"fraud_status": "accept",
"bill_key": "990000000260",
"biller_code": "70012",
"currency": "IDR",
"expiry_time": "2017-01-09 09:56:44"
}
{
"status_code": "201",
"status_message": "midtrans payment notification",
"transaction_id": "883af6a4-c1b4-4d39-9bd8-b148fcebe853",
"order_id": "tes",
"gross_amount": "1000.00",
"payment_type": "echannel",
"transaction_time": "2016-06-19 14:40:19",
"transaction_status": "pending",
"signature_key": "d1ebf5bf14a7c96ca58e719832de459898f61fa8d81560f59e9a38a5187383b1d507e3075277d9b1c6227926fc8a0448e164f1b9de33c8141f81c57b87d23775",
"bill_key": "990000000260",
"biller_code": "70012",
"expiry_time": "2017-01-09 09:56:44"
}
{
"status_code": "200",
"status_message": "midtrans payment notification",
"transaction_id": "883af6a4-c1b4-4d39-9bd8-b148fcebe853",
"order_id": "tes",
"gross_amount": "1000.00",
"payment_type": "echannel",
"transaction_time": "2016-06-19 15:10:29",
"transaction_status": "settlement",
"approval_code": "340093197",
"signature_key": "bbceb3724b0b2446c59435795039fed2d249d3438f06bf90c999cc9d383b95170b7b58f9412fba25ce7756da8075ab1d78a48800156380a62dc84eb22b3f7de9",
"bill_key": "990000000260",
"biller_code": "70012",
"expiry_time": "2017-01-09 09:56:44"
}
{
"status_code": "202",
"status_message": "midtrans payment notification",
"transaction_id": "883af6a4-c1b4-4d39-9bd8-b148fcebe853",
"order_id": "tes",
"gross_amount": "1000.00",
"payment_type": "echannel",
"transaction_time": "2016-06-20 14:40:19",
"transaction_status": "expire",
"signature_key": "69ef827242b29640a1193b6c2f32ba1374c04b969f7723984a6c676349ee7927cb6b263546d138e3a5c788829fbc4f114353b67becad2af7a86b1b741fc8d80a",
"bill_key": "990000000260",
"biller_code": "70012",
"expiry_time": "2017-01-09 09:56:44"
}
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 bank transfer transaction. Value:pending : Bank Transfer transaction is created. | String |
fraud_status | Detection result by Fraud Detection System (FDS). Value:accept : Approved by FDS. | String |
bill_key | Merchant Biller Key ID to perform transaction. | String |
biller_code | Midtrans Unique Biler Code Number. Value is 70012 . | 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 |
Note
Possible error codes are 400, 401, 402, 406, 410