> For the complete documentation index, see [llms.txt](https://startbutton.gitbook.io/startbutton-product-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://startbutton.gitbook.io/startbutton-product-api/startbutton-api-doc/security-measures./ip-whitelisting.md).

# IP Whitelisting

#### To Get Started:&#x20;

<table><thead><tr><th width="314">Authorization</th><th>Set value to Bearer {{MERCHANT_AUTH_TOKEN}}</th></tr></thead><tbody><tr><td>Content-type</td><td>Set value to <code>application/json</code></td></tr></tbody></table>

{% hint style="info" %}
To generate `{{MERCHANT_AUTH_TOKEN}}`; Log in to your account via the API.
{% endhint %}

Make a request to the URL below, where the base URL is determined by the environment you are on.

<details>

<summary>BaseUrl</summary>

Sandbox/PROD: <https://api.startbutton.tech&#x20>;

</details>

{% tabs %}
{% tab title="Endpoint" %}
PATCH `{{baseUrl}}/merchant/ip-whitelist/configure`
{% endtab %}
{% endtabs %}

Add your IP(s) to be whitelisted just as in the sample request below.

{% tabs %}
{% tab title="Sample Request" %}

```
{
    "whitelistedIps": ["127.0.0.1"],
    "password": "@mypassword"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Response" %}

<pre><code>{
    "success": true,
    "message": "Whitelisted IPs updated successfully",
    "data": {
                [ ]
<strong>            }
</strong><strong>  {
</strong>        "whitelistedIps": [
            "127.0.0.1"
        ],
    }
}
</code></pre>

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
NOTE: Once you whitelist your IP, the system validates the IP address in your request for all endpoints that require a PRIVATE/SECRET\_KEY Authorization. If it's invalid, the request will Fail.
{% endhint %}

If a request is made with a non-whitelisted IP address you get the response below:

{% tabs %}
{% tab title="403 Error" %}

```
{
    "message": "Access denied: IP not whitelisted",
    "success": false
}
```

{% endtab %}
{% endtabs %}
