Lorixen.
EN

Partner API needs your IP? Give your app a fixed outbound IP

Short answer: When a supplier API, payment gateway, bank feed or partner database says "send us the IP address your requests come from so we can allowlist it", your app needs a fixed outbound (egress) IP address. Many modern hosting platforms send requests from changing, shared addresses, so you either enable a static-egress feature on your platform, route outbound traffic through a NAT gateway with a reserved address on a cloud provider, or send the calls through a small proxy server with a fixed IP. Give the partner more than one address if you can, so you're not locked to a single machine.

Why your app doesn't have a fixed IP already

Your website's domain points to an address for incoming traffic. Outgoing requests your app makes, for example to fetch stock from a supplier's API, can leave from a completely different address:

  • Serverless functions and many platform-as-a-service hosts run your code on shared infrastructure, and outbound requests come from a pool of addresses that can change without notice.
  • Autoscaled servers each have their own address, and new ones appear whenever capacity grows.
  • Containers may share the host's address or go through the platform's network.

That's fine until a partner only accepts connections from addresses on a list. Then integrations fail intermittently: requests from one server work, from another they're refused, and after a redeploy nothing works.

Typical symptoms

  • The integration works in development or on one server, but not in production.
  • Errors like "403 Forbidden", "connection refused" or "IP not whitelisted" from the partner, often only some of the time.
  • Everything breaks after a platform migration, scaling event or redeploy.

Option 1: Your hosting platform's static IP feature

Several app hosting platforms offer static outbound IPs as an add-on or setting. Check your platform's documentation for terms like "static outbound IP", "dedicated egress" or "fixed IP". Points to check:

  • Whether it applies to all your services or must be enabled per app.
  • Whether you get one address or a small set, and whether they're dedicated to you or shared with other customers. Shared addresses mean the partner's allowlist also lets in other people's traffic.
  • What happens to the addresses if you change region or plan.

If your platform offers it, this is usually the simplest route.

Option 2: A NAT gateway on a cloud provider

If you run on a cloud provider such as AWS or Google Cloud, a NAT gateway gives a group of servers one shared outbound identity:

  • AWS: the VPC documentation explains that a NAT gateway lets instances in a private subnet connect to services outside the VPC while external services can't initiate connections to them. A public NAT gateway must be associated with an Elastic IP address when it's created, and uses that Elastic IP as the source address when routed through the VPC's internet gateway.
  • Google Cloud: Cloud NAT allocates external IP addresses and source ports to the VMs using it. Its documentation notes that with manual NAT IP assignment, you can confidently share a set of common external source IP addresses with a destination party, for example a service that only allows connections from known addresses.

With either, every server behind the gateway reaches the partner from the same address or set of addresses, however many servers you run.

Option 3: A small outbound proxy

If your platform has no static-egress feature, you can run a tiny proxy server with a fixed IP and send only the allowlisted traffic through it:

  • A forward proxy that your app uses for requests to the partner's domain.
  • Or a small relay service you write that calls the partner on your app's behalf.

Keep it minimal, patched and locked down: only your app should be able to use it, and only for the partner's hostname. Otherwise you've built an open proxy.

Practical advice

  • Ask the partner for the exact requirement. Is it IPv4 only? How many addresses can you register? How long do changes take?
  • Register at least two addresses where possible, for example two NAT gateways in different zones, so maintenance doesn't stop the integration.
  • Route only what's needed. Send partner traffic through the fixed IP and let everything else use normal routing, which reduces load and cost on the gateway or proxy.
  • Document the addresses in your runbook, with who owns them and which partners use them.
  • Don't treat the allowlist as authentication. Keep API keys or certificates as well. An IP allowlist is an extra layer, not a password.
  • Test from production. Make a request from the live environment to a "what is my IP" endpoint you control and confirm the address matches the one registered.

When the address has to change

Addresses do change: you move region, switch hosting provider or rebuild the network. Plan it like any cut-over. Ask the partner to add the new addresses alongside the old ones first, move traffic to the new route, confirm requests succeed, and only then ask them to remove the old addresses. Doing it in the other order guarantees an outage, and some partners take days to process allowlist changes, so start early and keep their support contact in your runbook.

An illustrative example

A hypothetical Hamilton wholesale distributor built a stock-sync service on a serverless platform. Its biggest supplier's API required an allowlisted IP, and calls failed at random. The team set up a NAT gateway with two reserved addresses in their cloud account, moved the sync function into the private network behind it, registered both addresses with the supplier, and added a daily check that logged the outbound address. Failures stopped.

FAQ

Can I use my website's IP address?

Only if outbound requests actually leave from it. On many hosts they don't. Test from production.

Will a CDN give me a fixed outbound IP?

No. CDNs handle incoming traffic to your site, not requests your app makes.

Does a static IP cost money?

Often, on cloud providers and platforms. Check current pricing before enabling it.

What about IPv6?

Ask the partner. Many allowlists are IPv4 only.

If a partner's IP allowlist is breaking your integration and you'd like a fixed outbound address set up, tell us where your app is hosted.

Sources

WhatsAppBook a call