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
- Download and open Postman.
- Follow any of the steps given below to import Midtrans API collection.
- Download from Postman.
- GitHub Source: Repo Link.
- Click Run in Postman button below, to download and import the collection.
- Create a test account in Midtrans.
- Login to Midtrans Merchant Administration Portal (MAP), and follow the steps given below to get the Server Key.
- Switch to Sandbox environment.
- On the home page, go to SETTINGS > ACCESS KEYS.
- Copy the Server Key.
- In Postman, double-click to open Midtrans Payment API folder.
- Click any request you want to try.
- Select the Auth tab.
- Select Basic Auth from the TYPE drop-down list.
- Enter Server Key in the Username field.
- Leave Password field blank.
- Click Send.
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.
- Change endpoint URL from:
https://api.sandbox.midtrans.com/../..
tohttps://api.midtrans.com/../..
- 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
- Download and open Postman.
- Click Run in Postman button below, to download and import the collection.
- Login to Midtrans Dashboard, go to Sandbox mode, retrieve your user's API key.
- In Postman, click any request you want to try.
- Select the Auth tab.
- Select Basic Auth from the TYPE drop-down list.
- Enter Server Key in the Username field.
- Leave Password field blank.
- Click Send.
The server response is displayed.
Switching to Production Mode
To switch to transactions in Production environment, follow the steps given below.
- Change variable on the request URL from:
{{iris_base_url_sandbox}}
to{{iris_base_url_production}}
- 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.
Updated about 1 year ago