checkresult

Overview

  • API URL: /api/v1/zoloz/location/checkresult
  • API Description: This API is used to retrieve the location detection result, including information such as IP address, geographical location, VPN detection result, and simulated location detection result.

Note: This API does not support repeated calls and is therefore not idempotent.

Request Parameter

Field Name

Data Type

Max Length

Mandatory

Fault Value

Description

Sample

bizId

String

32

Y

-

Business ID, the unique identifier of a business transaction, used for business tracking. For example, a serial number from the merchant's business-related database.
Note: The ZOLOZ server does not verify the uniqueness of this field. To facilitate easier business tracking, it is recommended that merchants generate the Business ID on their server side and ensure its uniqueness.

"2017839040588699"

transactionId

String

64

Y

-

The transaction ID to be queried, returned by the GeoTrust Locator initialize API.

"G000000005FID2020030400000000000157****"

Response Parameter

Field Name

Data Type

Mandatory

Description

Sample

result

Result

Y

The result of the API request, including the operation status, result code, and message.

{

"resultCode": "SUCCESS",

"resultMessage": "Success",

"resultStatus": "S"

}

geoResult

String

N

Overall result of the location detection process.

  • Success: Location detection completed successfully.
  • Failure: Location detection failed. Possible reasons include:
    • The user’s device has VPN or simulated location enabled, and the merchant policy does not allow such usage.
    • The detected location is outside the specified geofenced regions.
    • No valid location data was detected.
    • The IP address and coordinate information are inconsistent.

"Success"

ipLocation

Map

N

Geolocation result parsed from the user’s IP address, including country, region, city, and coordinates. For details, see IpLocation.

{

"ip": "140.*.*.19",

"country": "China",

"city": "Zhejiang",

"latitude": "30.2672",

"longitude": "120.1551"

}

matchedGeoFence

Boolean

N

Geofencing match result.

  • true: The user is located within the designated region(s).
  • false: The user is outside the designated region(s).

true

vpnDetected

Boolean

N

Result of the VPN connection detection.

  • true: A VPN connection has been detected on the device.
  • false: No VPN connection has been detected.

false

mockDetected

Boolean

N

Result of the simulated location detection.

  • true: Simulated location (mock location) has been detected as enabled on the device.
  • false: No simulated location has been detected.

false

IpLocation

Field Name

Data Type

Mandatory

Description

Sample

ip

String

N

The IP address of the user's device

"140.*.*.19"

country

String

N

Country, Chinese is supported for return values.

"China"

city

String

N

City, Chinese is supported for return values.

"Zhejiang"

latitude

String

N

Latitude

"30.2672"

longitude

String

N

Longitude

"120.1551"

Result

Perform the next action based on the request result, as follows:

  • When the value of result.resultStatus is S, it indicates that the call to the ZOLOZ GeoTrust Locator checkresult API was successful:
    • If geoResult returns Success, the location detection has passed.
    • If geoResult returns Failure, the location detection has failed. Analyze the specific cause using the returned parameters: vpnDetected, mockDetected, and matchedGeoFence.
  • When the value of result.resultStatus is F, it indicates that the call to the ZOLOZ GeoTrust Locator checkresult API failed. Please check the error code for more details about the error, and analyze the cause of the failure.

API-common Result codes

For the full list of common result codes, see the API common result code.

Sample

Request Sample

copy
{
    "bizId": "2017839040588699", 
    "transactionId": "G000000005FID2020030400000000000157****"
}

Response Sample

Success Response

copy
{
    "result": {
        "resultCode": "SUCCESS", 
        "resultMessage": "Success", 
        "resultStatus": "S"
    }, 
    "geoResult": "Success", 
    "ipLocation": {
        "ip": "140.*.*.19", 
        "country": "China", 
        "city": "Zhejiang", 
        "latitude": "30.2672", 
        "longitude": "120.1551"
    }, 
    "matchedGeoFence": true, 
    "vpnDetected": false, 
    "mockDetected": false
}

Failure response: VPN detected

copy
{
    "result": {
        "resultCode": "SUCCESS", 
        "resultMessage": "Success", 
        "resultStatus": "S"
    }, 
    "geoResult": "Failure", 
    "ipLocation": {
        "ip": "140.*.*.19", 
        "country": "China", 
        "city": "Zhejiang", 
        "latitude": "30.2672", 
        "longitude": "120.1551"
    }, 
    "matchedGeoFence": true, 
    "vpnDetected": true, 
    "mockDetected": false
}

Failure response: Not within the specified administrative region

copy
{
    "result": {
        "resultCode": "SUCCESS", 
        "resultMessage": "Success", 
        "resultStatus": "S"
    }, 
    "geoResult": "Failure", 
    "ipLocation": {
        "ip": "203.*.*.67", 
        "country": "Singapore", 
        "city": "Singapore", 
        "latitude": "1.3521", 
        "longitude": "103.8198"
    }, 
    "matchedGeoFence": false, 
    "vpnDetected": false, 
    "mockDetected": false
}