---
title: "Get address by id"
method: GET
path: "/ecommerce/addresses/{addressId}"
tags: ["🛒 Ecommerce"]
---

# Get address by id

`GET /ecommerce/addresses/{addressId}`

## Request

- Base URL: `https://api.freeapi.app/api/v1`
- URL: `https://api.freeapi.app/api/v1/ecommerce/addresses/{addressId}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi/docs/ecommerce/addresses/:addressId/get.ts> (a function with typed inputs; its response is checked against the schema)

The API endpoint allows users to fetch an address based on the `addressId` provided in the URL path variable.

By accessing this endpoint and specifying a valid `addressId` in the URL, users will receive a response containing the details of the corresponding address.

User can only be able to fetch addresses if they are logged in and the address that they are fetching is added by them.

## Response `200`

Get address by id

- object
  - `data` object
    - `__v` number
    - `_id` string
    - `addressLine1` string
    - `addressLine2` string
    - `city` string
    - `country` string
    - `createdAt` string
    - `owner` string
    - `pincode` string
    - `state` string
    - `updatedAt` string
  - `message` string
  - `statusCode` number
  - `success` boolean

---

[API](https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi.md) - [All operations](https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi/llms.txt) - [OpenAPI document](https://skmtc.dev/hiteshchoudhary-ssesph/apis/freeapi/revisions/a9f3a290e4dc?raw)
