> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paywithsoap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Latest Geo Check

> GET /api/v1/device_pings/latest_geo_check retrieves the most recent geolocation check result for a customer. Server-side call authenticated with the API key.

# Get Latest Geo Check

Use this endpoint to retrieve the latest geolocation check for a customer. This endpoint returns the most recent location verification data for a given customer, including whether the location check passed or failed.

This is useful for checking a customer's current geo-compliance status before processing transactions or granting access to location-restricted features.

Returns `null` if no geo check has been performed for the customer.

Only checks made from coordinates the customer's device reported (the browser's or your app's location) are returned. When the browser shares no position, the checkout may pass the customer on an IP-based location instead; that pass is not returned here, so the result can be an older check (possibly a failed one) or `null`. The checkout's own outcome is authoritative.

> [!NOTE]
>
> This endpoint authenticates with your **API key**, unlike [Create Device Ping](https://docs.paywithsoap.com/api-reference/api-v1/device_pings/create.md) which uses the client secret. Call it server-side.

Every Soap API request is authenticated with a bearer token in the `Authorization` header:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

Your API key is in the Soap Dashboard under the Developers section. It looks like `key_...`.

Requests with a missing or invalid API key return `422` — never `401` — with a JSON `error` field, usually `{"error": "API key not found."}`. Branch on the status code rather than the message: `GET /api/v1/device_pings/latest_geo_check` does not yet return the same wording.

Never expose your API key in client-side code — it is server-side only.

```bash Curl theme={null}
curl -X GET 'https://api-sandbox.paywithsoap.com/api/v1/device_pings/latest_geo_check?customer_id=cus_vi57KegYgcRqcGHqip8q6UZiqtrwMT870' \
--header 'Authorization: Bearer YOUR_API_KEY'
```

```javascript JavaScript theme={null}
const fetch = require('node-fetch');

const customerId = 'cus_vi57KegYgcRqcGHqip8q6UZiqtrwMT870';
const url = `https://api-sandbox.paywithsoap.com/api/v1/device_pings/latest_geo_check?customer_id=${customerId}`;

const options = {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
};

fetch(url, options)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
```

```json Response theme={null}
{
  "id": "gc_8HpqVXHQ7672sFi38yLN9kCMJN1LtiMw",
  "passed": true,
  "municipality": "San Francisco",
  "region": "CA",
  "country": "USA",
  "latitude": 37.785834,
  "longitude": -122.406417,
  "checked_at": "2024-01-15T14:30:22Z"
}
```


## OpenAPI

````yaml GET /api/v1/device_pings/latest_geo_check
openapi: 3.1.0
info:
  title: Soap API
  description: >-
    API documentation for Soap - AI-native payments infrastructure for complex,
    compliance-heavy payment flows
  license:
    name: MIT
  version: 1.4.0
servers:
  - url: https://api-sandbox.paywithsoap.com
security:
  - bearerAuth: []
paths:
  /api/v1/device_pings/latest_geo_check:
    get:
      tags:
        - Device Pings
      summary: Get latest geolocation check for a customer
      parameters:
        - name: customer_id
          in: query
          required: true
          description: Unique identifier for the customer
          schema:
            type: string
            example: cus_vi57KegYgcRqcGHqip8q6UZiqtrwMT870
      responses:
        '200':
          description: >-
            The customer's most recent geo check, or the JSON literal null when
            no geo check has been performed for the customer yet. Only checks
            made from coordinates the customer's device reported (the browser's
            or your app's location) are returned: an IP-based location pass
            (used when the browser shares no position) is not, so the result may
            be an older check, possibly a failed one, or null. The checkout's
            own outcome is authoritative.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: gc_8HpqVXHQ7672sFi38yLN9kCMJN1LtiMw
                  passed:
                    type: boolean
                    example: true
                    description: Whether the location is in a state that you support.
                  municipality:
                    type: string
                    example: San Francisco
                    nullable: true
                  region:
                    type: string
                    example: CA
                  country:
                    type: string
                    example: USA
                  latitude:
                    type: number
                    example: 37.785834
                  longitude:
                    type: number
                    example: -122.406417
                  checked_at:
                    type: string
                    format: date-time
                    example: '2024-01-15T14:30:22Z'
                    description: ISO 8601 timestamp of when the check was performed
                nullable: true
              example:
                id: gc_8HpqVXHQ7672sFi38yLN9kCMJN1LtiMw
                passed: true
                municipality: San Francisco
                region: CA
                country: USA
                latitude: 37.785834
                longitude: -122.406417
                checked_at: '2024-01-15T14:30:22Z'
        '422':
          description: >-
            Invalid request — a missing or invalid API key. Note this endpoint
            authenticates with your API key, not the client secret used by POST
            /api/v1/device_pings. Its error message is not yet normalized to the
            standard "API key not found." string other endpoints return, so
            match on the status code rather than the message. A customer with no
            geo check is not an error: it returns 200 with a null body.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication using your API key (key_...). Used for every
        endpoint except POST /api/v1/device_pings.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.