Postman Collection

Postman is a user-friendly tool that makes it easy for you to quickly send and test REST API requests without doing complex programming. Midtrans provides Postman Collection that you can import to test the Midtrans API in no time.


Payment API Postman Collection


This Postman collection covers the following API:


Usage Instructions


  1. Download and open Postman.
  2. Follow any of the steps given below to import Midtrans API collection.
  1. Create a test account in Midtrans.
  2. Login to Midtrans Merchant Administration Portal (MAP), and follow the steps given below to get the Server Key.
    1. Switch to Sandbox environment.
    2. On the home page, go to SETTINGS > ACCESS KEYS.
    3. Copy the Server Key.
  3. In Postman, double-click to open Midtrans Payment API folder.
  4. Click any request you want to try.
  5. Select the Auth tab.

2222

Postman Usage


  1. Select Basic Auth from the TYPE drop-down list.
  2. Enter Server Key in the Username field.
  3. Leave Password field blank.
  4. Click Send.

2800

Postman Usage


The server response is displayed.


Switching to Production Mode


All endpoints used in this postman collection are for transactions on Sandbox environment. To switch to transactions in Production environment, follow the steps given below.

  1. Change endpoint URL from:
    https://api.sandbox.midtrans.com/../..to https://api.midtrans.com/../..
  2. Update your Server Key with your production environment Server Key.

Troubleshooting


If you encounter an error message similar to the one shown below,


{
  "error_messages": [
    "Access denied due to unauthorized transaction, please check client or server key",
    "Visit https://docs.midtrans.com/reference/request-headers for more details"
  ]
}

Please make sure to,

  • Follow the steps 4 to 11 in Usage Instructions section properly.
  • Use correct Server Key. The Server Keys for the Sandbox and Production environments are different.



Disbursement/Payouts (IRIS) API Postman Collection


This Postman collection covers the Payouts API.


Usage instructions


  1. Download and open Postman.
  2. Click Run in Postman button below, to download and import the collection.
    Run in Postman
  3. Login to Midtrans Dashboard, go to Sandbox mode, retrieve your user's API key.
  4. In Postman, click any request you want to try.
  5. Select the Auth tab.
  6. Select Basic Auth from the TYPE drop-down list.
  7. Enter Server Key in the Username field.
  8. Leave Password field blank.
  9. Click Send.

The server response is displayed.


Switching to Production Mode


To switch to transactions in Production environment, follow the steps given below.

  1. Change variable on the request URL from:
    {{iris_base_url_sandbox}} to {{iris_base_url_production}}
  2. Update your Authorization with your production environment API Key.

To switch to Production API URL, change variable on the request URL and update your Authorization with production IRIS API_KEY.