# Retail Sales Benchmarks
source: https://developer.mastercard.com/small-business-credit-analytics/documentation/use-cases/retail-sales-benchmarks/index.md

## Overview {#overview}

The Retail Sales Benchmarks metrics provides a monthly breakdown of merchant location performance against a benchmark peer set across 14 benchmark metrics for up the latest 12 months. The final number of months in the response depends on the selected country. Please contact your Mastercard representative to learn more

|   Metrics Category    |                              Description                              |                       Sample Metrics                       |
|-----------------------|-----------------------------------------------------------------------|------------------------------------------------------------|
| **Business Metadata** | Metrics on small business identity and operations                     | `Last seen transaction date` `First seen transaction date` |
| **Merchant Sales**    | Metrics on business retail sales and sales growth                     | `Average spend per card index`                             |
| **Channel Sales**     | Metrics on customer's preferred channel at the business location      | `% of e-Commerce transactions index`                       |
| **Customer Loyalty**  | Metrics on recurring customer activity at the small business location | `Cards repeated in 6 months index`                         |
| **Returns**           | Metrics on the rate of returned purchases                             | `Returned transactions index`                              |
| **Business Risk**     | Metrics on business authorization and fraud rates                     | `Fraud chargeback index`                                   |

## Scenario Summary {#scenario-summary}

|      Element      |                                                                                                                                               Detail                                                                                                                                               |
|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Context**       | A lender needs to understand how a small business performs relative to its peers before making a credit decision                                                                                                                                                                                   |
| **Goal**          | Retrieve 14 monthly Retail Sales Benchmarks index metrics for a specific merchant location to compare its performance against a benchmark peer set                                                                                                                                                 |
| **Actors**        | **Lender / Underwriter** --- initiates the API calls; **Small Business** --- provides consent and merchant details                                                                                                                                                                                 |
| **Preconditions** | 1. Lender has a Mastercard Developers project with Sandbox or Production credentials 2. Lender has the merchant's business name and address, or Acquirer Merchant ID 3. Merchant has provided consent (`has_consent=true`) 4. Merchant location has sufficient transaction volume for benchmarking |
| **Outcome**       | Lender receives up to 12 months of monthly benchmark indices (e.g., spend index, chargeback index, loyalty index) showing the merchant's position relative to competitors in the same industry and geography                                                                                       |

## Pre-requisites {#pre-requisites}

Prior to accessing the Retail Sales Benchmarks metrics, clients or lenders must meet the following pre-requisites:

### 1. Merchant Matching {#1-merchant-matching}

The client or lender must have the basic details below for the small business (SMB) merchant location. Small Business Credit Analytics API performs the merchant match based on the information provided for the merchant location. The best matches are shared with the client. The client then decides which result is the intended merchant location to request data on.

* Country
* ID Type
* ID Value
* Merchant Location Name
* Address
* City
* State
* Postal Code

**Note** - The Small Business Credit Analytics API provides clients with access to business metrics pertaining to a distinct merchant location. In case a merchant has presence across multiple locations, the client will need to request details for each merchant location separately.

### 2. Retail Sales Benchmarks Metrics {#2-retail-sales-benchmarks-metrics}

* The client must have consent from the merchant before using the API to request merchant metrics
* The Location ID returned in the merchant match response in the previous step is needed to request merchant metrics
* To request metrics, the client will need to specify "retail_sales_benchmarks" for the metrics_type parameter and "monthly" for the metrics_frequency parameter in the request

## RSB in SMB Lending Flow {#rsb-in-smb-lending-flow}

![RSB in SMB Lending Flow](https://static.developer.mastercard.com/content/small-business-credit-analytics/img/mermaid/retail_sales_benchmarks.svg)

## Accessing RSB Metrics {#accessing-rsb-metrics}

### Step 1: Merchant Matching {#step-1-merchant-matching}

The Matches endpoint resolves merchant identity from metadata. This step is required before requesting the metrics because the Metrics endpoint only accepts a `location_id`.

API Reference: `GET /matches`

1. The small business or retailer provides their details to the lender for credit purposes

2. The lender makes the Small Business Credit Analytics API call for a merchant match. The request for merchant match can be made in one of the following two ways:

   1. By providing ID parameters (Recommended)
      * country
      * id type
      * id value
   2. By providing Name and Address details
      * country
      * merchant location name
      * address
      * city
      * state
      * postal code
3. The Small Business Credit Analytics API takes the input to check the merchant database for location:

   * In the case of multiple matches found, the API response returns the location details in decreasing order of similarity between input and match found
     * For TaxID matching (available in the selected countries), a maximum of 10 matches can be returned as part of the API response. For other types of matching (Name and Address, MID), a maximum of 3 matches can be returned.
   * The response consists of the additional parameters for Location ID (unique ID for location in the Mastercard system)
   * You will receive an error response for an invalid request or any missing request parameter.
4. The lender must check whether the intended merchant location appears in the API response.

   * In case of a validation error or no match found or intended merchant location not in API response, the lender needs to update the input and repeat step 2.

### Step 2: Retrieve Retail Sales Benchmarks Metrics {#step-2-retrieve-retail-sales-benchmarks-metrics}

The Metrics endpoint with `metrics_type=retail_sales_benchmarks` is used to retrieve peer-relative performance indices. This is chosen over RSA when the lender needs comparative data rather than absolute sales figures.

API Reference: `GET /metrics/{location_id}`

1. The lender makes the API call for metrics on the identified location from the merchant match response. The request requires the following input parameters:

   * Location ID
   * `has_consent`
   * Metrics Type- "retail_sales_benchmarks"
   * Metrics Frequency- "monthly"  
     **Note:** Metrics are delivered in "monthly" aggregations only, and the "weekly" frequency is not supported.
2. The API validates the inputs and responds with metrics for the selected merchant location. You will receive an error response for an invalid request or any missing request parameter. Some metric values may be `0`, `null`, or `-1` to indicate low or missing transaction volume --- see [Data Explanations](https://developer.mastercard.com/small-business-credit-analytics/documentation/tutorials-and-guides/data-explanations/index.md#retail-sales-benchmarks-metrics_typeretail_sales_benchmarks) for what each value means.

3. The lender processes the returned metrics and other data sources for credit decisions, performs internal credit decisioning, and communicates the credit decision outcome to the small businesses or retailers.

Retail Sales Analytics

## Next Steps {#next-steps}

* [Testing](https://developer.mastercard.com/small-business-credit-analytics/documentation/testing/merchant-metrics/retail-sales-benchmarks/index.md) --- RSB test cases
* [Code and Formats](https://developer.mastercard.com/small-business-credit-analytics/documentation/code-and-formats/index.md) --- error handling reference
