Tahweel Docs
Security Optional

IP Whitelist

Lock your production API keys to the servers you trust. Once a store has a whitelist, Tahweel accepts production requests only from those addresses — every other call is rejected, even with valid credentials.

Production keys onlyUp to 20 addressesEffective immediately

How it works

Every production API call runs through a fixed chain of checks. The whitelist sits immediately after your credentials are verified, so a stolen key is useless from an unknown network.

1

API key & secret

Credentials verified

2

IP whitelist

Is the caller listed?

3

Account & store

Active and approved

4

Subscription

Plan still valid

Listed — the request continues through the remaining checks.

Not listed — rejected with 403, nothing is charged.

Try the rules

This checker runs the same validation Tahweel applies to your list. The sample store below allows two addresses — test any IP against them.

Sample whitelist203.0.113.102001:db8::10

Waiting for an address

Type an IP or pick an example below.

Enable it

1

Open your store settings

In the Merchant Dashboard, go to Stores → your store → View and scroll to the IP Whitelist card, just below API Credentials.

2

Find your server's outgoing IP

Important

Run this on the server that calls the API — not on your laptop. Many setups send traffic out through a different address than the one you connect to.

curl ifconfig.me
3

Add each address

Enter the IP with an optional label such as Production server, then press Add IP. Repeat for every server that calls the API.

4

Save with your password

Goes live

Click Save Whitelist and confirm with your account password. The badge switches to Enforced and the rule applies to the very next request.

What it looks like in your dashboard

IP Whitelist

Production API keys only

Enforced · 2 IPs
203.0.113.10IPv4

Production server

2001:db8::10IPv6

Backup region

Verify it straight away with a production call from the whitelisted server:

Test request
curl -X POST "https://backend.tahweel.io/merchant/payment/create" \
  -H "Content-Type: application/json" \
  -H "api-key: your_production_api_key" \
  -H "api-secret: your_production_api_secret" \
  -d '{ "amount": 10, "currency": "USD" }'

What you can add

Accepted

• Public IPv4 — 203.0.113.10
• Public IPv6 — 2001:db8::10
• Up to 20 addresses per store
• Optional label, 50 characters max

Rejected

• Private & reserved — 192.168.x, 10.x, 127.0.0.1
• Ranges in CIDR form — 203.0.113.0/24
• Addresses with a port — 203.0.113.10:443
• Duplicates, in any notation

Private and reserved addresses are blocked on purpose: a request from the public internet can never arrive from one, so whitelisting it would only lock you out of your own integration.

Rejected requests

A call from an address that is not on the list is refused before any payment logic runs. The response names the exact IP Tahweel saw, so you can add it without guessing.

403 Forbidden
{
  "status": 403,
  "message": "Request IP is not whitelisted for this store",
  "ip": "203.0.113.45"
}
💡

Use the ip field

That address is the one our servers observed for your request. If it differs from what you expected, your traffic leaves through a different route — a NAT gateway, proxy or load balancer. Whitelist the address shown here.

Good to know

You cannot lock yourself out

The whitelist never limits dashboard access. If an address is wrong, sign in from anywhere and correct it.

An empty list means open

With no addresses saved, production keys work from anywhere. Removing every entry turns the restriction off.

One entry per server

Running several app servers, workers or regions? Add the outgoing IP of each one. Every store keeps its own list.

Watch out for changing IPs

Cloud servers without a reserved IP, serverless platforms and office networks rotate addresses. Use a static or NAT gateway IP.

Before you switch it on

Add every server that calls the API first, then save once. If your integration is live and the saved list misses a server, its payments start failing with 403 immediately. Testing from a browser or home network is not a reliable check — those addresses usually differ from your server's.

Recommended setup

  1. Reserve a static outgoing IP for your production servers (Elastic IP, NAT gateway or equivalent).
  2. Whitelist that address, plus any backup or worker servers, and label each one.
  3. Keep testing on sandbox keys — they are never restricted, so development is unaffected.
  4. Review the list whenever you move hosting, add a region or decommission a server.