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

# Convert coordinates to address

> Convert geographic coordinates (latitude/longitude) to a human-readable address using reverse geocoding.

## Request

```http theme={null}
GET /shipping-address/coords-to-address?lat=6.4216348975198825&lng=7.483457659243914
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
```

## Headers

| Header          | Type   | Description                                   |
| --------------- | ------ | --------------------------------------------- |
| `Authorization` | string | Provide the customer token as `Bearer <jwt>`. |
| `x-shop-id`     | string | Identify the shop context.                    |

## Query parameters

| Parameter | Type   | Required | Description           |
| --------- | ------ | -------- | --------------------- |
| `lat`     | number | Yes      | Latitude coordinate.  |
| `lng`     | number | Yes      | Longitude coordinate. |

## Successful response

```json theme={null}
{
  "status": 200,
  "success": true,
  "message": "Address resolved successfully",
  "data": {
    "address": {
      "results": [
        {
          "formatted": "Eugene Oba Street, Enugu 400251, Enugu State, Nigeria",
          "address_line1": "Eugene Oba Street",
          "address_line2": "Enugu 400251, Enugu State",
          "city": "Enugu",
          "state": "Enugu State",
          "postcode": "400251",
          "country": "Nigeria",
          "country_code": "ng",
          "lat": 6.4216348975198825,
          "lon": 7.483457659243914
        }
      ]
    }
  }
}
```

<Note>
  This endpoint uses the Geoapify reverse geocoding API to convert coordinates into a structured address format.
</Note>

## Error response

```json theme={null}
{
  "status": 400,
  "success": false,
  "message": "Latitude and longitude are required",
  "data": {}
}
```


## OpenAPI

````yaml GET /shipping-address/coords-to-address
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /shipping-address/coords-to-address:
    get:
      summary: Convert coordinates to address
      description: >-
        Convert geographic coordinates (latitude/longitude) to a human-readable
        address using reverse geocoding.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
        - name: lat
          in: query
          required: true
          description: Latitude coordinate.
          schema:
            type: number
        - name: lng
          in: query
          required: true
          description: Longitude coordinate.
          schema:
            type: number
      responses:
        '200':
          description: Address resolved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoordsToAddressResponse'
        '400':
          description: Latitude and longitude are required.
        '401':
          description: Unauthorized.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  schemas:
    CoordsToAddressResponse:
      type: object
      required:
        - status
        - success
        - message
        - data
      properties:
        status:
          type: integer
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            address:
              type: object
              description: Geoapify reverse geocoding response.
              properties:
                results:
                  type: array
                  items:
                    $ref: '#/components/schemas/GeoapifyAddress'
    GeoapifyAddress:
      type: object
      properties:
        formatted:
          type: string
          description: Fully formatted address string.
        address_line1:
          type: string
          description: Primary address line (street, number).
        address_line2:
          type: string
          description: Secondary address line (city, state, postal code).
        city:
          type: string
          description: City name.
        state:
          type: string
          description: State or province name.
        postcode:
          type: string
          description: Postal or ZIP code.
        country:
          type: string
          description: Country name.
        country_code:
          type: string
          description: ISO country code.
        lat:
          type: number
          description: Latitude coordinate.
        lon:
          type: number
          description: Longitude coordinate.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````