Indomaret

Using Over the Counter payment feature provided by Indomaret, the customer can make a purchase in your web/app and complete the payment at any Indomaret stores. Midtrans sends a real-time notification to you for every incoming payment.

The steps to integrate with Indomaret stores are given below.

  1. Send the charge API request to Midtrans with the selected acquirer.
  2. Display the payment code to customers.
  3. Handle notifications.

By default, default expiry time for Indomaret is 24 hours unless specified by merchant (min 20s, max 180 days).


📘

Note

In some transactions, the transaction_status SETTLEMENT turns into DENY within a span of one minute. This is caused by a payment reversal triggered by the corresponding payment provider


Send a Charge API request with payment details, transaction details, convenience store details, customer details, and item details. Successful request returns status_code:201.




Indomaret Charge API Request


{
  "payment_type": "cstore",
  "transaction_details": {
    "gross_amount": 162500,
    "order_id": "order04"
  },
  "cstore": {
    "store": "Indomaret",
    "message": "Tiket1 transaction"
  },
  "customer_details": {
    "first_name": "Budi",
    "last_name": "Utomo",
    "email": "[email protected]",
    "phone": "0811223344"
  },
  "item_details": [
    {
      "id": "id1",
      "price": 162500,
      "quantity": 1,
      "name": "tiket1"
    }
  ]
}
JSON AttributeDescriptionTypeRequired
payment_typeThe payment method used by the customer. Value: cstore.StringRequired
transaction_detailsThe details of the specific transaction such as order_id and gross_amount.ObjectRequired
cstoreDetails of the convenience store.ObjectRequired
customer_detailsDetails of the customer.ObjectRequired
item_detailsDetails of the item(s) purchased by the customer.ObjectRequired



Indomaret Charge Response and Notifications


{
  "status_code": "201",
  "status_message": "Success, cstore transaction is successful",
  "transaction_id": "e3f0b1b5-1941-4ffb-9083-4ee5a96d878a",
  "order_id": "order04",
  "gross_amount": "162500.00",
  "payment_type": "cstore",
  "transaction_time": "2016-06-19 17:18:07",
  "transaction_status": "pending",
  "payment_code": "25709650945026",
  "expiry_time": "2017-01-09 09:56:44"
}
{
  "status_code": "201",
  "status_message": "midtrans payment notification",
  "transaction_id": "e3f0b1b5-1941-4ffb-9083-4ee5a96d878a",
  "order_id": "order04",
  "gross_amount": "162500.00",
  "payment_type": "cstore",
  "transaction_time": "2016-06-19 17:18:07",
  "transaction_status": "pending",
  "signature_key": "2d488c1ff0adc2396ee9b9765807b6d53182a0aa17cd9bb251b99879099d4f727903a75440b1814539f565774f7a80de0a7336c81d2071b4d3efe92f15400e41",
  "payment_code": "25709650945026",
  "store": "indomaret",
  "expiry_time": "2017-01-09 09:56:44"
}
{
  "status_code": "200",
  "status_message": "midtrans payment notification",
  "transaction_id": "991af93c-1049-4973-b38f-d6052c72e367",
  "order_id": "order04",
  "gross_amount": "162500.00",
  "payment_type": "cstore",
  "transaction_time": "2016-06-20 11:44:07",
  "transaction_status": "settlement",
  "approval_code": "59061607081045705101",
  "signature_key": "a198f93ac43cf98171dcb4bd0323c7e3afbee77a162a09e2381f0a218c761a4ef0254d7650602971735c486fea2e8e9c6d41ee65d6a53d65a12fb1c824e86f9f",
  "payment_code": "25709650945026",
  "store": "indomaret",
  "expiry_time": "2017-01-09 09:56:44"
}
{
  "status_code": "202",
  "status_message": "midtrans payment notification",
  "transaction_id": "fd70880f-3458-4b16-9f09-289924185977",
  "order_id": "order04",
  "gross_amount": "162500.00",
  "payment_type": "cstore",
  "transaction_time": "2016-06-20 17:18:08",
  "transaction_status": "expire",
  "signature_key": "c260504a448018b4c4831b381f8a8c5088c37f2706dcc60b4d7d99a16e0ae3c22bc8945cb5177742386bab1ddb12e7c175e1f57686b488e215406fa40fc75481",
  "payment_code": "25709650945026",
  "store": "indomaret",
  "expiry_time": "2017-01-09 09:56:44"
}
JSON AttributeDescriptionType
status_codeStatus code of transaction charge result.String
status_messageMessage describing the status of the result of API request.String
transaction_idTransaction ID given by Midtrans.String
order_idOrder ID specified by merchant.String
gross_amountTotal amount of transaction in IDR.String
payment_typePayment method used by the customer. Value: cstore.String
transaction_timeTimestamp of transaction in ISO 8601 format. Time Zone (GMT+7).String
transaction_statusTransaction status of the Indomaret transaction. Possible values are pending, settlement, and expire.String
signature_keySpecial string to verify the integrity of the response. For more details, refer Verifying Notification Authenticity.String
payment_codeUnique payment code for the customer to complete the payment in Indomaret.String
storeConvenience store identifier.String

📘

Note

Possible error codes are 400, 401, 402, 406, 410

Language
Authorization
Basic
base64
:
Click Try It! to start a request and see the response here!