---
title: Geo-Fencing
slug: v3-gateway/geo-fencing
description: Learn how to use the Geo-fencing API to define geographical boundaries and verify user or device location. This document provides code examples, expected responses, and a list of response parameters including IP address, country, state, city, zip code, ti
createdAt: 2023-03-23T03:31:10.000Z
---

# Introduction

The Geo-fencing API is a feature in a software program that utilizes the global positioning system (GPS) or radio frequency identification (RFID) technology to define geographical boundaries. In the context of this API, it provides a powerful tool for performing background checks and verifying the location of users or devices, thereby helping to prevent fraud.

## API Input Guidelines

Need to pass the following information &#x20;

- IP address&#x20;
- Country Name
- State

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://preproduction.signzy.xyz/plexus/backgroundcheck/geofencing",
  "name": "Geo Fencing",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [
      {
        "kind": "required",
        "name": "Authorization ",
        "type": "string",
        "children": [],
        "description": "Contains the id parameter returned from the login step"
      },
      {
        "kind": "required",
        "name": "Content-Type",
        "type": "string",
        "children": [],
        "description": "application/json"
      }
    ],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "task",
        "type": "string",
        "description": "Type of Tasks to be performed : Geofencing"
      },
      {
        "kind": "required",
        "name": "essentials",
        "type": "Object",
        "children": [
          {
            "kind": "required",
            "name": "ip",
            "type": "String",
            "description": "IP address "
          },
          {
            "kind": "optional",
            "name": "country",
            "type": "string",
            "description": "Country name"
          },
          {
            "kind": "optional",
            "name": "state",
            "type": "string",
            "description": "State name"
          }
        ],
        "description": "Contains essential input parameters"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "k8zrHxUVhnpswk7jMcVp6",
        "code": "{\n    \"task\": \"geoFencing\",\n    \"essentials\": {\n        \"ip\": \"<IP Address\",\n        \"country\": \"IN\",\n        \"state\": \"WB\",\n        \"patronId\": \"<Unique Patron ID >\"\n    },\n    \"id\": \"<ID>\",\n    \"patronId\": \"<PAtron ID>\",\n    \"result\": {\n        \"ip\": \"<IP Address>\",\n        \"country\": \"INDIA\",\n        \"countryCode\": \"IN\",\n        \"state\": \"<State Name>\",\n        \"stateCode\": \"<State Code>\",\n        \"city\": \"<City Name>\",\n        \"zipCode\": \"<Zip Code>\",\n        \"timezone\": \"<Time Zone>\",\n        \"latitude\": <Latitude>,\n        \"longitude\": <Longitude>,\n        \"asn\": \"<ASN\",\n        \"riskip\": <true/e>,\n        \"validUser\": <true/false>\n    }\n}",
        "language": "200",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "k8zrHxUVhnpswk7jMcVp6"
  },
  "examples": {
    "languages": [
      {
        "id": "ACHhNNLMLYLGGnUana4fX",
        "code": "",
        "language": "curl",
        "customLabel": "Preproduction"
      },
      {
        "id": "VLf3Q830ySDAQUbr-1WPS",
        "code": "curl --location --request POST 'https://api.signzy.app/api/v3/geofencing-api' \\\r\n--header 'Content-Type: application/json' \\\r\n--data-raw ' {\r\n        \"ip\": \"223.225.57.209\",\r\n        \"country\": \"AD\",\r\n        \"state\": \"\"\r\n    }\r\n'",
        "language": "curl",
        "customLabel": "Production"
      }
    ],
    "selectedLanguageId": "VLf3Q830ySDAQUbr-1WPS"
  },
  "description": "",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "autoGeneratedAnchorSlug": "geo-fencing",
  "legacyHash": "uvL0Wovu4zeBA-GRN3Ym3"
}
```
:::

### Response Parameter

| **Parameter Name**  | **Data Type** | **Description**                                                                                                       |
| ------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------- |
| id                  | String        | Unique Id                                                                                                             |
| patronId            | String        | Unique ID for each patron. Which will be a alphanumeric value of 24 characters in length eg: 5a12eaf09fa3e67936b43c52 |
| result.ip           | String        | IP address for which geo fencing is done                                                                              |
| result.country      | String        | Contains Country name                                                                                                 |
| result.state        | String        | Name of state                                                                                                         |
| result.statecode    | String        | State code of the state                                                                                               |
| result.city         | String        | City name of the location                                                                                             |
| result.zipcode      | String        | Zip code of the located region                                                                                        |
| result.timezone     | String        | Time zone of the located region                                                                                       |
| result.latitude     | Float         | Latitude of the location                                                                                              |
| result.longitude    | Float         | Longitude of the location                                                                                             |

***

# Error Codes

| Error Code | HTTP Status Code  | Description                                                          |
| ---------- | ----------------- | -------------------------------------------------------------------- |
| 409        | Conflict (409)    | Max retries reached while attempting to retrieve data from upstream. |
| 400        | Bad Request (400) | An error occurred while retrieving data from the upstream.           |

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

