> This page is for version Legacy.
> For other versions, use one of these documentation indexes:
> - 2024-10-01 (default): https://docs.getkard.com/2024-10-01/llms.txt
> - Legacy: https://docs.getkard.com/legacy/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getkard.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getkard.com/_mcp/server.

# Get Location by ID

GET https://rewards-api.getkard.com/rewards/merchant/location/{id}

Retrieve location data for a specific Kard location ID.
Required scopes: `rewards:read`

Reference: https://docs.getkard.com/legacy/api/rewards/locations/get-location-by-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://rewards-api.getkard.com` (Production, default)
- `https://test-rewards-api.getkard.com` (Sandbox)

## Request

### Path parameters

- `id` (string, required) — The Kard location ID to query

## Response

### 200

- `_id` (string, required) — Location ID in Kard's system
- `merchantId` (string, required) — Merchant ID in Kard's system associated to location
- `name` (string, required) — Name of the location
- `locationType` (enum, required) — Type of offer associated to location, will always be in INSTORE
  - Allowed values: `INSTORE`
- `address` (Address, required) — Address of location
- `geoLocation` (GeoLocation, required) — Geo-coordinates of location
- `phone` (string, required) — Phone number for location
- `createdDate` (datetime, required) — Created date of location in Kard's system (UTC)
- `lastModified` (datetime, required) — Last modified date of location in Kard's system (UTC)
- `source` (enum, required) — Source of the merchant associated to the location
  - Allowed values: `NATIONAL`, `LOCAL`
- `category` (enum, required) — Category of merchant associated with location
  - Allowed values: `Arts & Entertainment`, `Baby, Kids & Toys`, `Books & Digital Media`, `Clothing, Shoes & Accessories`, `Computers, Electronics & Software`, `Convenience`, `Gas`, `Department Stores`, `Food & Beverage`, `Health & Beauty`, `Home & Garden`, `Miscellaneous`, `Occasions & Gifts`, `Pets`, `Sports & Outdoors`, `Supplies & Services`, `Travel`
- `operationHours` (OperatingHours, optional) — Hours of operation for location
- `googleId` (string, optional) — GoogleId of location

## Errors

### 400 Invalid Request

- `InvalidRequestUnion`

### 404 Does Not Exist Error

- `string`

### 500 Internal Server Error

- `string`

### 401 Unauthorized Error

- `message` (string, required)

## Types

### Address

- `street` (string, required)
- `city` (string, required)
- `state` (enum, required)
  - Allowed values: `AL`, `AK`, `AS`, `AZ`, `AR`, `CA`, `CO`, `CT`, `DE`, `DC`, `FM`, `FL`, `GA`, `GU`, `HI`, `ID`, `IL`, `IN`, `IA`, `KS`, `KY`, `LA`, `ME`, `MH`, `MD`, `MA`, `MI`, `MN`, `MS`, `MO`, `MT`, `NE`, `NV`, `NH`, `NJ`, `NM`, `NY`, `NC`, `ND`, `MP`, `OH`, `OK`, `OR`, `PW`, `PA`, `PR`, `RI`, `SC`, `SD`, `TN`, `TX`, `UT`, `VT`, `VI`, `VA`, `WA`, `WV`, `WI`, `WY`
- `zipCode` (string, required)

### GeoLocation

- `longitude` (double, required) — Longitude of location
- `latitude` (double, required) — Latitude of location

### OperatingHours

- `SUNDAY` (string, optional)
- `MONDAY` (string, optional)
- `TUESDAY` (string, optional)
- `WEDNESDAY` (string, optional)
- `THURSDAY` (string, optional)
- `FRIDAY` (string, optional)
- `SATURDAY` (string, optional)

### RequestValidationErrorResponse

- `errors` (list of string, required)

## Examples

**Response**

```json
{
  "_id": "5e27318c9b346f00087fba8l",
  "merchantId": "615cc7df498bed0009bbf3bf",
  "name": "Some Location",
  "locationType": "INSTORE",
  "address": {
    "street": "120 Main St",
    "city": "Philadelphia",
    "state": "PA",
    "zipCode": "19147"
  },
  "geoLocation": {
    "longitude": -75.1446869,
    "latitude": 39.9419429
  },
  "phone": "(123) 555-8880",
  "createdDate": "2021-10-05T21:47:11.994Z",
  "lastModified": "2024-05-10T01:38:11.542Z",
  "source": "LOCAL",
  "category": "Food & Beverage",
  "operationHours": {
    "SUNDAY": "4:00PM - 10:00PM",
    "MONDAY": "4:30PM - 10:00PM",
    "TUESDAY": "4:30PM - 10:00PM",
    "WEDNESDAY": "4:30PM - 10:00PM",
    "THURSDAY": "4:30PM - 10:00PM",
    "FRIDAY": "4:30PM - 11:00PM",
    "SATURDAY": "4:30PM - 11:00PM"
  },
  "googleId": "ChIJUwU6IZrIxokRgX-V0_Y0eXx"
}
```

**SDK Code**

```python
import requests

url = "https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://rewards-api.getkard.com/rewards/merchant/location/%7Bid%7D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```