IP Whitelist for API
Restrict which servers can call your Midtrans Disbursement API. Once enabled, only requests coming from IP addresses you've whitelisted are accepted, so even if an API key leaks, it can't be used from anyone else's server.
Action required by 30 Nov 2026IP whitelisting becomes mandatory for Disbursement API access starting 30 Nov 2026. If you haven't added at least one IP address by then, all Disbursement API requests will be rejected.
Contents
- Who needs to do this
- How it works
- Before you start
- Add IP addresses
- View and search your IP list
- Remove IP addresses
- CIDR notation cheat sheet
- Rules and limits
- When a request is blocked
- FAQ
- Need help?
Who needs to do this
| If you… | Do you need to act? |
|---|---|
| Send disbursements (payouts) via API from your servers | ✅ Yes, add your server IPs before 30 Nov 2026 |
| Only create and approve disbursements on the Midtrans Dashboard | ❌ No, Dashboard actions aren't affected |
| Only use the Payment API (e.g. Snap, Core API) | ❌ No, this release applies to Disbursement only |
How it works
- You add the public IP addresses of the servers that call the Disbursement API.
- Every Disbursement API request is checked against your list before the API key is validated.
- Requests from a whitelisted IP proceed as normal. Requests from any other IP are rejected with
ip_not_whitelisted.
Good to know:
- The whitelist covers your whole merchant account. Every IP you add applies to all your Disbursement API keys.
- Dashboard actions are never blocked. Disbursements created or approved on the Midtrans Dashboard work regardless of your whitelist.
- Webhooks and notifications are not affected. The whitelist only controls requests you send to Midtrans, not the callbacks Midtrans sends to you.
- This is different from Account → IP Whitelist. That setting controls who can log in to the Dashboard. This one controls API access. They're managed separately.
Using the Dashboard too? Secure it as well.The API whitelist doesn't protect Dashboard activity. If your team creates or approves disbursements on the Dashboard, we recommend also turning on IP whitelisting for Dashboard login under Account → IP Whitelist, so only your trusted networks can sign in.
Before you start
You'll need:
- Admin access to your Midtrans Dashboard account.
- 2FA set up on your account, you may be asked to verify changes.
- The public (outbound) IP addresses of every server that calls the Disbursement API — including production servers, backup/failover servers, and any job runners or workers.
How to find your server's public IP
Run this from the server itself (not your laptop):
curl https://ifconfig.mePrivate addresses such as
10.x.x.x,172.16–31.x.x,192.168.x.xor127.0.0.1will not work. Midtrans only sees your server's public IP. If you're unsure, ask your infrastructure or cloud team for your egress / NAT IP.
Add IP addresses
- Log in to the Midtrans Dashboard.
- Go to Settings → Access Keys.
- Click the IP Whitelist for API card.
- Expand the Add IP Address section.
-
In the IP address box, enter one or more IP addresses in CIDR notation. Separate multiple entries with commas.
203.0.113.20/32, 203.0.113.21/32, 198.51.100.0/24 - Under Permissions, make sure Disbursement is ticked.
- Click Add.
- Complete verification if prompted.
Your new entries appear in the IP Address List, showing who added them and when.
Tip: Add all your servers in one go, it's easy to forget a backup server or a scheduled job that only runs once a day.
View and search your IP list
The IP Address List shows every whitelisted entry:
| Column | What it shows |
|---|---|
| IP Address | The whitelisted IP or range, in CIDR notation |
| Added by | The Dashboard user who added it |
| Permissions | Which API the entry allows (e.g. Disbursement) |
| Added on | Date the entry was added |
| Action | Delete icon to remove the entry |
Use the Search IP address box to find a specific entry, or the All permissions dropdown to filter by permission.
Remove IP addresses
Remove one entry
Click the 🗑️ delete icon in the Action column, then confirm.
Remove several entries at once
- Tick the checkbox next to each entry (or tick the header checkbox to select all).
- Click Remove.
- Confirm and complete verification if prompted.
Careful with the last IP. After 30 Nov 2026, if you remove every Disbursement IP, all Disbursement API requests will be rejected immediately. Always add the new IP before removing the old one.
Need to change an entry? Entries can't be edited. Add the new IP first, then remove the old one.
CIDR notation cheat sheet
CIDR notation is an IP address followed by / and a number that sets how many addresses are included.
| You want to allow… | Enter | Addresses covered |
|---|---|---|
| A single server | 203.0.113.20/32 | 1 |
| 4 consecutive IPs | 203.0.113.20/30 | 4 (.20–.23) |
| 16 consecutive IPs | 203.0.113.16/28 | 16 (.16–.31) |
| A full block of 256 IPs | 203.0.113.0/24 | 256 (.0–.255) |
- Single IP? Use
/32. - The smaller the range, the safer. Only whitelist what you actually use.
- The broadest range allowed is
/24.
Rules and limits
| Rule | Detail |
|---|---|
| Format | IPv4 in CIDR notation only (e.g. 203.0.113.20/32) |
| Broadest range | /24 (256 addresses). Ranges like /16 or 0.0.0.0/0 are rejected |
| Maximum entries | 50 per merchant account |
| Private / reserved ranges | Not accepted (10.x, 172.16–31.x, 192.168.x, 127.x, 169.254.x, etc.) |
| IPv6 | Not supported yet |
| Duplicates | An IP that's already on the list is rejected |
| Editing | Not possible, remove and add again |
When a request is blocked
If a Disbursement API request comes from an IP that isn't on your whitelist, Midtrans rejects it with:
- HTTP status:
401 Unauthorized
This is different from an invalid or revoked key error, so you can tell immediately that the problem is the IP, not the key.
To fix it:
- Check the server's current public IP (
curl https://ifconfig.mefrom that server). - Make sure that IP is in your IP Address List with the Disbursement permission.
- If it's missing, add it and retry the request.
FAQ
What happens if I do nothing before 30 Nov 2026?
All Disbursement API requests will be rejected with ip_not_whitelisted until you add at least one IP. Disbursements made through the Dashboard keep working.
Does this affect my Payment API (Snap / Core API)?
No. This release applies to the Disbursement API only.
My servers use dynamic IPs (serverless, autoscaling, containers). What do I do?
Dynamic IPs can't be reliably whitelisted. Route your outbound traffic through a NAT gateway with a static public IP, then whitelist that IP. Most cloud providers (AWS, GCP, Azure, Alibaba Cloud) support this.
Can I set different IPs for different API keys?
Not yet. The whitelist applies to all Disbursement API keys on your account.
Can I whitelist 0.0.0.0/0 to allow everything?
No. The broadest allowed range is /24.
We have multiple admins. Will others know if the list changes?
Yes. Admins are notified by email whenever the whitelist changes, and every change is recorded in Account → Activity Log.
Is this the same as the IP whitelist under Account settings?
No. Account → IP Whitelist controls Dashboard login. Settings → Access Keys → IP Whitelist for API controls API access.
Does this affect BI SNAP?
No. BI SNAP has its own IP settings. Contact Midtrans Support if you'd like to use BI SNAP.
Need help?
- Click Guide at the top of the Dashboard for in-app help.
- Contact Midtrans Support via the chat assistant in the bottom-right corner of the Dashboard.
Updated 14 days ago