# Transaction Footprints Calculation
source: https://developer.mastercard.com/carbon-calculator/documentation/use-cases/txn_footprint_calculation/index.md

The **Transaction Footprints Calculation** service allows the issuer to calculate the transaction footprints based on the consumers' payment transactions. This service does not require any payment card registration. It can be requested for merchant category code(MCC) and [AiiA](https://developer.mastercard.com/carbon-calculator/documentation/support/index.md#aiia-code) code which supports open banking transactions. It can also provide [Profile](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/engagement-services/profiles/index.md)-based scoring for the transactions having MCC type.

The issuer can choose to call this service as required and may also process the response data to generate additional insights before sending the response to the consumers. For example, providing real-time notification of transaction footprint, providing a weekly and monthly transaction footprint, or providing a weekly comparison of transaction footprint and letting consumers know if they need to take action.

You can create apps to let consumers view the environmental impact based on their spending habits both in real-time and historically.

### Sample Screenshots {#sample-screenshots}

The following screenshots show the sample screens that can be rendered using this service:
![Carbon Score](https://static.developer.mastercard.com/content/carbon-calculator/Images/usecases/CarbonFootprints.png)

## Pre-requisites {#pre-requisites}

Following are the pre-requisites for the issuer to use this service:

* The issuer must have the consumer's payment transactions ready for carbon scoring.
* For profile-based scoring, the issuer must have the consumer's climate profile ready.

Tip: To create your project on Mastercard Developers, refer to the [Before You Start](https://developer.mastercard.com/carbon-calculator/documentation/index.md#before-you-start) section for more information.

## Sequence Diagram {#sequence-diagram}

The following sequence diagram shows the order of events for a solution that uses the `/transaction-footprints` endpoint.

Diagram txn-footprints
Note: The issuer needs to send the card brand with each transaction in the request parameter.

Possible values for the card brand are:

* **MA** - Mastercard branded payment card
* **OTH** - Payment card brands other than Mastercard
* **NC** - Non card-based transaction

For [AiiA](https://developer.mastercard.com/carbon-calculator/documentation/support/index.md#aiia-code)-based scoring additional fields are required as follows:

* `type` field is required.
* `additionalInformation` field is required with a key-value pair.
* `mcc` field is optional.

**If you are providing a `MCC` field then it will be used as the fallback for AIIA.**

For [Profile](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/engagement-services/profiles/index.md)-based scoring additional fields are required as follows:

* `profile` field is required.

**Following are the execution steps:**

1. The consumer requests to view the carbon impact from the issuer app.
2. The issuer app sends a request to the issuer server to calculate the carbon score.
3. The issuer server fetches the payment transactions of the consumer from the system.
4. The issuer server filters the payment transactions based on supported currencies and MCCs.
5. The issuer server sends the filtered payment transactions in the request to the `/transaction-footprints` endpoint. The issuer needs to send a card brand for each transaction with the value MA, OTH, or NC (MA-Mastercard, OTH-Other, NC-Non card).
6. The Carbon Calculation application validates the request for valid currencies and MCCs.
7. In the case of AIIA-based scoring, `type` and `additionalInformation` fields are mandatory.`mcc` field will be optional here and it will be used as the fallback for AIIA. Refer to the [FAQs](https://developer.mastercard.com/carbon-calculator/documentation/support/index.md) section to learn more about AIIA.
8. In the case of profile-based scoring, the `profile` field should be sent in addition to the MCC-based scoring details. This profile refers to the climate profile of the consumer. Refer to [Profiles](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/engagement-services/profiles/index.md) to learn more about how to generate a consumer's profile.
9. If the request validation is successful, then the application calculates the transaction footprints for all payment transactions.
10. The Carbon Calculation application returns the transaction footprints to the issuer server.
11. The issuer server can complement the transaction footprints with actionable insights before returning to the issuer app.
12. The issuer server returns the transaction footprints with actionable insights to the issuer app.
13. The issuer app displays the consumer's carbon impact along with actionable insights.

You will receive an error response for an invalid request or any missing request parameter.
Note: For more information about the error codes, refer to [Code and Formats](https://developer.mastercard.com/carbon-calculator/documentation/code-and-formats/index.md).

## Endpoint {#endpoint}


API Reference: `GET /transaction-footprints`

