> For the complete documentation index, see [llms.txt](https://developer.fraudcheck.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.fraudcheck.co.za/commercial-service/environments-and-base-url.md).

# Environments & Base URL

## Base URLs

Two distinct base URLs are used. Never mix them up.

| Purpose                                  | Base URL                                                                   |
| ---------------------------------------- | -------------------------------------------------------------------------- |
| **All commercial service calls**         | `https://commercial-service-api.fraudcheckonline.co.za/commercial-service` |
| **Authentication (token endpoint only)** | `https://commercial-service-api.fraudcheckonline.co.za/auth/login`         |

`AUTH_URL` is the complete token endpoint — use it directly, do not append any path.

## Using BASE\_URL in your code

Define `BASE_URL` once and reference it throughout your code. This avoids repeating the full domain on every request.

{% tabs %}
{% tab title="cURL" %}

```bash
BASE_URL="https://commercial-service-api.fraudcheckonline.co.za/commercial-service"
AUTH_URL="https://commercial-service-api.fraudcheckonline.co.za/auth/login"

# Authenticate
ACCESS_TOKEN=$(curl -s -X POST "$AUTH_URL" \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"yourpassword"}' \
  | jq -r '.access_token')

# Call a service
curl -X POST "$BASE_URL/quickvet" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"CompanyName": "Example Company (Pty) Ltd","CompanyRegNo": "****/******/**" , "ConsentObtainedByDataSubject": true}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

BASE_URL = "https://commercial-service-api.fraudcheckonline.co.za/commercial-service"
AUTH_URL = "https://commercial-service-api.fraudcheckonline.co.za/auth/login"

# Authenticate
token_response = requests.post(
    AUTH_URL,
    json={"email": "you@example.com", "password": "yourpassword"},
)
access_token = token_response.json()["access_token"]

# Call a service
response = requests.post(
    f"{BASE_URL}/quickvet",
    headers={
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json",
    },
    json={
        "CompanyName": "Example Company (Pty) Ltd",
        "CompanyRegNo": "****/******/**"
        "ConsentObtainedByDataSubject": True,
    },
)
data = response.json()
```

{% endtab %}

{% tab title="JavaScript (Node.js)" %}

```javascript
const BASE_URL = "https://commercial-service-api.fraudcheckonline.co.za/commercial-service";
const AUTH_URL = "https://commercial-service-api.fraudcheckonline.co.za/auth/login";

// Authenticate
const tokenRes = await fetch(AUTH_URL, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ email: "you@example.com", password: "yourpassword" }),
});
const { access_token: accessToken } = await tokenRes.json();

// Call a service
const response = await fetch(`${BASE_URL}/quickvet`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${accessToken}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    CompanyName: "Example Company (Pty) Ltd",
    CompanyRegNo : "****/******/**"
    ConsentObtainedByDataSubject: true,
  }),
});
const data = await response.json();
```

{% endtab %}
{% endtabs %}
