Official Midtrans Payment API Postman Collections |
Midtrans :heart: Postman!
This repository contains Postman collection for various payment API call to Midtrans Payment API.
API covered:
Use this button to download:
Clone or download this repository, then import postman collections from Midtrans Payment API.postman_collection.json
file.
Settings > Access Keys
. Copy your Server Key
Authorization
tab (beside Headers tab)Basic Auth
, fill Username with your Server Key (looks like this VT-server-xxxxxx
). Leave Password field blank, click Update Request
save
then click send
the request. You will get server response.If you are testing Snap transaction token request
you will get response like:
{ "token": "bffb82ff-f8bb-4651-86b0-0c2316b77c0a" }
To see how that token works, you can open file ../snap-opener/index.html
in your web browser to preview the SNAP payment page.
../snap-opener/index.html?snap_token=bffb82ff-f8bb-4651-86b0-0c2316b77c0a&is_production=false
You can also edit file snap/index.html
and insert your own token to the HTML, then open in web browser.
For real example on how you can use Snap token in your website front-end, you can see sample minimum implementation here:
../sample-frontend/index.html
Edit the file and insert
<Your-Client-Key-Here>
with your client key.
To get credit card token for Core API Credit Card charge process & how to open 3ds redirect_url, here's sample implementation that you can check. (mandiri clickpay also need get token process).
Don't forget to change client_key to your client key inside that file.
All endpoint used in this postman collection is for sandbox transaction
, to switch to production
change endpoint URL from:
https://api.sandbox.midtrans.com/../..
to
https://api.midtrans.com/../..
(Just remove the sandbox.
from url)
If you get error
{
"error_messages": [
"Access denied due to unauthorized transaction, please check client or server key",
"Visit https://snap-docs.midtrans.com/#request-headers for more details"
]
}
15/11/2018
25/01/2018
12/04/2019