Fix Midtrans ip_not_whitelisted: Give Your Disbursement Server a Fixed IP

Midtrans made IP whitelisting mandatory for its Disbursement API on 30 November 2026. Payout calls from unlisted addresses now fail with 401 Unauthorized and ip_not_whitelisted.

Diagram of a cloud payout backend sending Midtrans Disbursement API calls through QuotaGuard Shield's two static IPs, with both IPs on the merchant account whitelist.

Midtrans flipped on a mandatory IP whitelist for its Disbursement API on 30 November 2026. If the public address your payout server calls from isn't on that list, the call is rejected. This guide shows the exact error you'll see, what the whitelist accepts, and how to give a cloud or container host one fixed public address you can register.

Midtrans Requires a Whitelisted Address for Every Disbursement Call

Midtrans is an Indonesian payment gateway, part of the GoTo Group. Its Disbursement API, formerly Iris, sends payouts to Indonesian bank accounts and e-wallets. From 30 November 2026, IP whitelisting is mandatory for that API on your merchant account.

A blocked request returns 401 Unauthorized with the code ip_not_whitelisted. That's the failure you'll see in your logs, not a generic timeout.

Midtrans's own docs explain why this catches cloud teams off guard. The FAQ states that dynamic IPs used by serverless, autoscaling and container hosts can't be reliably whitelisted, and recommends routing outbound traffic through a NAT gateway with a static public IP. A static-IP proxy solves the same problem: one address that never changes, registered once.

One Midtrans page words the same block as a 403. The page that owns the Disbursement whitelist feature is specific, and it says a blocked call returns 401 with ip_not_whitelisted. Alert on the code, not on a status guess.

The mandate is scoped. It applies to the Disbursement API only. It doesn't apply to the Payment API (Snap or Core), to Dashboard actions, or to Midtrans-to-merchant webhooks.

The Whitelist Takes Up to 50 Individual IPv4 Addresses

Before you plan anything, know the shape of the list. From Midtrans's IP whitelist docs:

  • Up to 50 entries.
  • IPv4 only, as a single address or a CIDR block from /24 to /32.
  • No IPv6, and no private ranges.

You set it at Settings > Access Keys > IP Whitelist for API, under the Disbursement permission. The list covers the whole merchant account, so every server that calls Disbursement shares one set of allowed addresses.

A two-address pair fits easily. A /32 pair uses two of the fifty entries, and both belong on the list. Either address can carry a given call, so a single-entry list refuses the calls that use the other one.

Two Static IPs Give Your Payout Server a Fixed Address to Whitelist

The fix is to give your payout server a fixed outbound address, then add that address to the Midtrans list. QuotaGuard assigns two static IPs to each subscription, active behind a load balancer. Each is a single /32 Elastic IP, one node per AWS Availability Zone. You register both addresses, because traffic can use either one. If a node fails, new connections continue through its partner and egress from the other whitelisted address. Detection and rerouting take about 90 seconds, and a connection that was open on the failed node drops and reconnects rather than changing its IP. The pair never grows to a third address, and the two addresses stay reserved to the subscription for its life. How proxying works covers the mechanism.

This is money movement, so use QuotaGuard Shield. Shield uses SSL passthrough, which means the TLS session runs end to end between your app and Midtrans and QuotaGuard doesn't decrypt the payload. That's the right default when a request carries payout instructions and recipient PII. The HTTPS proxy setup covers the client side.

  1. Copy your Shield connection URL and both IPs. The dashboard shows both under Setup, then Outbound. Store the URL as a server-side secret named QUOTAGUARDSHIELD_URL. It has the form https://username:password@<your-quotaguard-shield-host>:9294. Shield listens for the HTTPS proxy on port 9294 and Secure SOCKS5 on port 1081; Static uses 9293 and 1080.
  2. Route only the Midtrans Disbursement client. Point the HTTP client that calls api.midtrans.com at the proxy. You don't need to send unrelated traffic through it. The Disbursement API is HTTPS, so use the HTTPS CONNECT proxy; HTTP vs SOCKS5 explains which protocol fits which traffic. If part of your payout tooling speaks a non-HTTP protocol, use SOCKS5 or QGTunnel for raw TCP.
  3. Add both IPs to the Midtrans whitelist. Open Settings > Access Keys > IP Whitelist for API, choose the Disbursement permission, add both addresses, and save.
  4. Test before you move real money. Confirm the outbound address from every process that sends payouts, then run one small Disbursement call.
Your payout backend (Heroku, Railway, Render, Vercel, Lambda, Cloud Run, containers)
  -> QuotaGuard Shield outbound proxy (two fixed IPv4 addresses, port 9294)
  -> api.midtrans.com
     (sees one of your two addresses and checks it against the Disbursement whitelist)

On Starter, Production and Business plans, the pair is shared with other customers. Enterprise plans include dedicated IPs. Either way, the two addresses stay fixed for your subscription and are safe to register.

In code, the change is one environment variable and one client. The value comes from the dashboard, so the address is never hardcoded.

// Illustrative; not tested.
import { ProxyAgent, fetch } from "undici";

// QUOTAGUARDSHIELD_URL is the Shield connection URL from the dashboard:
// https://username:password@<region>-shield-01.quotaguard.com:9294
const dispatcher = new ProxyAgent(process.env.QUOTAGUARDSHIELD_URL);

// POST to your Midtrans Payouts endpoint (see Midtrans's Payouts API
// reference for the path) through the proxy. Only this client changes.
const res = await fetch(payoutEndpoint, {
  method: "POST",
  dispatcher,
  headers: {
    "Content-Type": "application/json",
    Authorization: "Basic " + Buffer.from(serverKey + ":").toString("base64"),
  },
  body: JSON.stringify(payout),
});

console.log(res.status, await res.json());

One trap is worth knowing. Node's fetch and undici's fetch ignore HTTPS_PROXY unless Node 24 starts with NODE_USE_ENV_PROXY=1, so an environment-variable-only setup can send payout calls from your platform's own address with nothing raised. The dispatcher above covers the calls that carry it, or every fetch call when it is registered with setGlobalDispatcher. Other HTTP clients, and any vendor SDK that ships its own client, need their own proxy setting. Confirm the address from every process that sends payouts before you move real money.

The Midtrans host sees a request from one of your two Shield addresses, never your platform's own address. Both addresses go on the Midtrans whitelist, because either one can carry the connection.

Changing the proxy later does not create a gap. When a subscription's proxy changes, the old and new credentials stay active at the same time for a configurable window, 7 days by default and 0 to 180, so you can add the new addresses to Midtrans before the old ones retire.

Confirm the Address Your Payout Server Actually Uses

Run the echo check first. It proves the address this process calls from. The sample below is illustrative and not tested. It follows QuotaGuard's docs, so use your own key and a read-only endpoint.

# Illustrative; not tested.
import os
import requests

# Shield's URL starts with https://, so the client opens TLS to the proxy first.
proxy_url = os.environ["QUOTAGUARDSHIELD_URL"]
session = requests.Session()
session.proxies = {"http": proxy_url, "https": proxy_url}

# Which address does the outside world see through this session?
# No Authorization header here: never send your key to an echo service.
print(session.get("https://ip.quotaguard.com", timeout=10).text)

The first call should print one of your two Shield IPs. If it prints anything else, this client isn't using the proxy. Run it from every process that sends payouts, because a worker or a cron job can bypass the proxy even when your main app uses it.

The check endpoint always returns JSON in the form {"ip":"..."}, with no plain-text form, so parse the ip field rather than the whole body. Don't expect one client to show both addresses. The egress IP is chosen per connection, not per request, and a client that reuses a connection or resolves inside the DNS TTL usually lands on one node. A health check should assert that the address is one of your two, not that both appear.

Register the Same Static Pair With Midtrans, Brick, Durianpay and Xendit

Midtrans is the anchor, but Indonesia's payout APIs are converging on the same control:

  • Brick enforces a mandatory production client-IP whitelist. Its docs list 401 ip_not_whitelisted, the same code Midtrans uses.
  • Durianpay recommends IP whitelisting for disbursements in its docs.
  • Xendit is the fourth vendor in this cluster.

If you send payouts through more than one of these providers, the same static pair can front all of them. You register the same two addresses with each vendor, which keeps one egress path and one address list to audit instead of a different NAT address per provider.

Shield Keeps Payout Data Encrypted While the Address Stays Fixed

The Midtrans list applies to every Disbursement call on the merchant account. A shared proxy address that other teams also use can weaken the control, because the whitelist no longer maps to your servers alone. That's one reason to prefer Shield for payout traffic. The payload stays encrypted end to end, so adding a proxy hop doesn't expose payout instructions or recipient data.

An IP allowlist isn't authentication. Keep your Midtrans Server key secret and rotate it if it leaks. The whitelist is a second control, not a replacement for key hygiene.

Webhooks Keep Working While You Fix the Outbound Path

Midtrans-to-merchant webhooks arrive at your server, so an outbound proxy doesn't change them. The IP whitelist doesn't apply to webhooks, to the Payment API (Snap or Core), or to Dashboard actions. If a webhook triggers your payouts, that path keeps working while you fix the outbound side. If you also need a vendor to reach a fixed address on your side, the inbound direction is configured separately: see the static inbound proxy setup.

What to Do Next

Give your payout server two static IPs, register both with Midtrans, and confirm the outbound address from every process that sends money. QuotaGuard Shield starts at $29 a month and is the right product when the traffic carries payout instructions and recipient PII. QuotaGuard Static starts at $19 a month if you only need a fixed address and don't require the encrypted proxy hop.

See the full pricing table at quotaguard.com/products/pricing. If a step is unclear, write to QuotaGuard Support.

Midtrans IP Whitelist Questions Answered

Which Midtrans APIs need a whitelisted IP?

Only the Disbursement API, formerly Iris, is covered by the mandatory whitelist that took effect on 30 November 2026. The Payment API (Snap and Core), Dashboard actions, and Midtrans-to-merchant webhooks are not affected. A blocked Disbursement call returns 401 Unauthorized with the code ip_not_whitelisted, and the page that owns the whitelist feature is specific about that code, even though one Midtrans page words the same refusal as a 403.

How many addresses can I add, and in what format?

Up to 50 entries, IPv4 only, each a single address or a CIDR block from /24 to /32. IPv6 and private ranges are rejected. You set the list at Settings > Access Keys > IP Whitelist for API under the Disbursement permission, and it covers the whole merchant account, so a two-address QuotaGuard pair uses two of the fifty entries.

Which QuotaGuard product should I use for payout traffic?

Use QuotaGuard Shield, because Disbursement calls carry payout instructions and recipient PII. Shield uses SSL passthrough, so the TLS session runs end to end between your server and Midtrans and QuotaGuard does not decrypt the payload. If you only need a fixed egress address and the traffic is not sensitive, QuotaGuard Static does the same job for less.

Do I have to allowlist both IPs, or only one?

Allowlist both. A subscription includes two static IPs as a load-balanced pair, and any connection can egress from either one, so a single-entry list refuses any payout call that leaves from the other node. If a destination truly accepts only one address, pin the traffic to one node with the -a or -b hostname and accept the loss of failover.

How do I confirm the address my payout server actually calls from?

Call https://ip.quotaguard.com through the same HTTP client your payouts use; it always returns JSON in the form {"ip":"..."}, so it is scriptable. If the address it prints is not one of your two Shield IPs, that client is not using the proxy. Run it from every process that sends payouts, because a worker or a cron job can bypass the proxy even when your main app does not, and a request that never reached the proxy is absent from the dashboard Log Viewer.

What happens on failover, and does the address change?

Each of the two IPs is served by its own instance, and if one fails, new connections continue through the other, so traffic only ever egresses from your two whitelisted addresses and never a third. Detection and rerouting take about 90 seconds, and an open connection on the failed node drops and reconnects through the healthy one rather than changing its IP. The addresses are reserved to your subscription for its life, so a rebuilt or replaced instance comes back on the same IPs.

Can I use one static pair for Midtrans, Brick, Durianpay and Xendit?

Yes. The same two addresses can front all of them, so you register one pair with each vendor instead of a different NAT address per provider. Brick enforces a mandatory production client-IP whitelist and returns the same 401 ip_not_whitelisted code, Durianpay recommends IP whitelisting for disbursements in its docs, and Xendit is the fourth vendor in the cluster. One egress path and one address list to audit is easier to keep current than four.

Do Midtrans webhooks need a static IP too?

No. Midtrans-to-merchant webhooks arrive at your server, so the outbound proxy does not change them and the whitelist does not apply to them. If you also need Midtrans or another vendor to reach a fixed address on your side, a QuotaGuard subscription provides the same pair for inbound traffic, which you point a hostname at. The outbound fix and the inbound setup are independent, so you can do the payout fix now and add inbound later.

What happens if I need to change region later?

A subscription can be reassigned to a different region in place, keeping the same plan and subscription, and the connection URL changes in the hostname only, with the username, password and port unchanged. There is no price change for a same-tier move, and the old region's credentials stay active for the configurable overlap window, so you can add the new IPs to Midtrans before you cut over. Because a region move relocates all egress for that subscription, any other vendor that allowlisted the old pair must add the new one too.

Is the whitelist a replacement for my Midtrans Server key?

No. An IP allowlist is a network-layer control, not authentication, so keep your Midtrans Server key secret and rotate it if it leaks. The whitelist narrows who can call the API; the key decides what the caller can do. Treat them as two controls that work together, not one that substitutes for the other.

QuotaGuard Static IP Blog

Practical notes on routing cloud and AI traffic through Static IPs.

Reliability Engineered for the Modern Cloud

For over a decade, QuotaGuard has provided reliable, high-performance static IP and proxy solutions for cloud environments like Heroku, Kubernetes, and AWS.

Get the fixed identity and security your application needs today.