> 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 Merchant by ID

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

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

Reference: https://docs.getkard.com/legacy/api/rewards/merchants/get-merchant-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 merchant ID to query

## Response

### 200

- `GetMerchantByIdResponse`

## Errors

### 400 Invalid Request

- `InvalidRequestUnion`

### 404 Does Not Exist Error

- `string`

### 500 Internal Server Error

- `string`

### 401 Unauthorized Error

- `message` (string, required)

## Types

### Merchant

- `_id` (string, required) — Merchant ID in Kard's system
- `acceptedCards` (list of enum, required)
  - Allowed values: `VISA`, `MASTERCARD`, `AMERICAN EXPRESS`, `DISCOVER`
- `category` (enum, required) — Category of merchant
  - 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`
- `createdDate` (datetime, required) — Created date of merchant in Kard's system (UTC)
- `description` (string, required) — Merchant description - usually a blurb outlining more details about the merchant
- `imgUrl` (string, required) — Merchant image asset URL
- `lastModified` (datetime, required) — Last modified date of merchant in Kard's system (UTC)
- `name` (string, required) — Merchant name
- `offers` (list of MerchantOffer, required) — Offers associated to the merchant
- `source` (enum, required) — Merchant source
  - Allowed values: `NATIONAL`, `LOCAL`
- `websiteURL` (string, required) — Merchant's URL website
- `bannerImgUrl` (string, optional) — Merchant banner image asset URL

### RequestValidationErrorResponse

- `errors` (list of string, required)

### MerchantOffer

- `_id` (string, required) — Offer ID in Kard's system
- `commissionType` (enum, required) — Type of commission on offer (% or a flat $)
  - Allowed values: `FLAT`, `PERCENT`
- `createdDate` (datetime, required) — Create date of offer (UTC)
- `expirationDate` (datetime, required) — Expiration date of offer if applicable (UTC)
- `isLocationSpecific` (boolean, required) — Is offer location specific
- `isTargeted` (boolean, required) — True returns targeted offers, false returns targeted and non-targeted offers
- `lastModified` (datetime, required) — Last modified date of offer (UTC)
- `merchantId` (string, required) — Id of Merchant associated with Offer
- `name` (string, required) — Name of offer
- `offerType` (enum, required) — Type of offer (whether it is run online or in-store)
  - Allowed values: `INSTORE`, `ONLINE`
- `optInRequired` (boolean, required) — Is opt in required
- `redeemableOnce` (boolean, required) — Is the offer redeemable once
- `startDate` (datetime, required) — Beginning date of offer (UTC)
- `status` (string, required) — Status of offer
- `terms` (string, required) — Terms and conditions on offer
- `totalCommission` (double, required) — Commission going to issuer and cardholder
- `issuersCommission` (double, optional) — Commission going to the issuer
- `maxRewardAmount` (integer, optional) — Max Reward Amount for Offer, if available
- `maxTransactionAmount` (integer, optional) — Max Transaction Amount for Offer, if available
- `merchantLocationIds` (list of string, optional) — Location Ids when isLocationSpecific is true
- `minRewardAmount` (integer, optional) — Min Reward Amount for Offer, if available
- `minTransactionAmount` (integer, optional) — Min Transaction Amount for Offer, if available
- `usersCommission` (double, optional) — Commission going to user

## Examples

**Response**

```json
{
  "_id": "5e27318c9b346f00087fbb5c",
  "name": "Some merchant",
  "source": "NATIONAL",
  "description": "N/A",
  "imgUrl": "https://www.somemerchant.com/image.png",
  "bannerImgUrl": "https://www.somemerchant.com/bannerImage.png",
  "websiteURL": "https://www.somemerchant.com",
  "acceptedCards": [
    "AMERICAN EXPRESS",
    "MASTERCARD",
    "VISA",
    "DISCOVER"
  ],
  "category": "Food & Beverage",
  "createdDate": "2022-03-12T05:00:58.456Z",
  "lastModified": "2022-03-12T05:00:58.456Z",
  "offers": [
    {
      "_id": "5e27318c9b346f00087fbb5b",
      "name": "Some Offer",
      "merchantId": "5e27318c9b346f00087fbb5c",
      "offerType": "INSTORE",
      "isLocationSpecific": false,
      "optInRequired": false,
      "expirationDate": "2022-03-12T05:00:58.456Z",
      "commissionType": "PERCENT",
      "totalCommission": 9.5,
      "issuersCommission": 3.5,
      "usersCommission": 6,
      "startDate": "2022-01-01T05:00:00Z",
      "terms": "Not all cards are eligible and not all transactions can be monitored. For debit cards, run transaction as credit, do not use PIN. Offer valid from 12/19/2018. Maximum individual reward 250 dollars. The business may change or end the Offer at any time up to the point of purchase without notice.",
      "createdDate": "2022-03-12T05:00:58.456Z",
      "lastModified": "2022-03-12T05:00:58.456Z",
      "minRewardAmount": 5,
      "maxRewardAmount": 20,
      "minTransactionAmount": 5,
      "maxTransactionAmount": 20,
      "redeemableOnce": true,
      "isTargeted": true,
      "status": "ACTIVE",
      "merchantLocationIds": [
        "5e27318c9b346f00087fba8l"
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://rewards-api.getkard.com/rewards/merchant/%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/%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/%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/%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/%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/%7Bid%7D', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://rewards-api.getkard.com/rewards/merchant/%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/%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()
```