# Quick Start Guide
source: https://developer.mastercard.com/carbon-calculator/documentation/quick-start-guide/index.md

## Overview {#overview}

The Carbon Calculator API enables issuers to provide their consumers with visibility into the environmental impact based on their spending.

This API allows the issuer to calculate the carbon footprint based on consumers' payment transactions using their Mastercard cards. This API can be used inside a banking application or website to provide meaningful and actionable insights.
Tip: **Postman Collections Quick Start** : If you are already ready to start making calls you can head over to our [Postman Collections page](https://developer.mastercard.com/carbon-calculator/documentation/postman-collection/index.md) to leverage Sandbox and Production environments without having to write code. **You can follow this guide to learn:**
>
> * How to create a project for the service.
> * How Mastercard Developers approaches authentication.
> * How to generate your credentials and API client.
> * How to get access to Sandbox and Production.

## Accessing the API on Mastercard Developers {#accessing-the-api-on-mastercard-developers}

1. Navigate to [Mastercard Developers](https://developer.mastercard.com/) and click sign up and create an account.
2. Activate your account by opening the link sent to your email address, and log in.
3. Request access to the API if needed. APIs with a 'lock icon' require permission to view their documentation and create a project.
4. To gain access to these services, you will need to submit an access request form. Once submitted, you will receive an email confirmation approving or denying your access.

## Generate credentials and create a Sandbox Project {#generate-credentials-and-create-a-sandbox-project}

#### Pre-requisites: {#pre-requisites}

Following are the mandatory values you need to provide at the time of project creation in the sandbox.
Note: Below value is mandatory for all the options (Option 1, Option 2.a, and Option 2.b) to access the Carbon Calculator API:

Customer ID (CID) - Make sure to use a valid Customer ID assigned by Mastercard, which remains the same across all Mastercard systems.

**If you want to opt for Option 1:**   

* BIN Range
* Legal Name

**If you want to opt for Option 2.a:**   

* Legal Name

**If you want to opt for Option 2.b:**   

* Legal Name
* Sender ID - Customer logical name or logical address of the service provider which has been configured in NGFT(Next Gen File Transfer).

Note: Make sure, that the same BIN should not map with multiple Customer IDs.

To generate your Sandbox and Production credentials you must create a new Mastercard Developers project. Generating Sandbox credentials will give you access to our Sandbox, which has rich, mocked data, that will help you understand the API.

Follow these steps to create a Sandbox Carbon Calculator Project:

1. To begin you should go to your dashboard, you can do this by clicking on the [My Projects](https://developer.mastercard.com/dashboard) option in the menu.
2. You can create a new project by clicking the **Create New Project** button, in the upper right portion of the screen as shown in the screenshot below. ![Create Project](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/create_project.png)
3. In the **Project Details** page, enter a descriptive name for your project.
4. Answer "Yes" if you are creating this project on behalf of a client. Select "No" if you are not. After choosing "Yes", two new fields will appear. Please enter your client company name and client legal business address before proceeding. Note: Check Yes if you are creating an API integration project for a customer. For example, you could be an integrator, a processor, or a service provider and the customer could be a merchant, issuer, or acquirer.
5. Provide the client company name and client company address (if applicable).
6. In the **Select your API service** field, select **Carbon Calculator**.
7. Provide the **commercial countries** for the project. This field represents where your client is doing business. Click the **Proceed** button as shown in the screenshot. Note: If you are creating a project on-behalf of a client, the Commercial countries represent where your client is doing business. ![Select API](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/select-api-and-country.png)
8. Enter your **Customer Name**. This does not have to be a legal name. For example, "ABC Bank".
9. Enter your **Customer ID (CID)**. This is a unique Service Provider identifier assigned by Mastercard which remains the same across all Mastercard systems.
10. Enter the (comma-separated) **Sandbox BIN Range**, you want to use for the Carbon Calculator API. For example, "534403, 518145, 518152, 5403, 5424".
11. Enter your **Sender Id**. This is customer logical name or logical address of the service provider which has been configured in NGFT(Next Gen File Transfer). For example, "filebasedscoring@service_provider_name".
12. Enter your **Cardholder Base** . This is the total volume of card holders for whom the cards have been issued. This can be updated later using [Update Service Provider Details API](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/update_service_provider_details/index.md).
13. Proceed to create your 'Project Credentials'. Create a **key alias** and **keystore password**, note this.
14. When the project has successfully created the Sandbox .P12 access credentials will be available for download as shown in the screenshot below.
15. Click the **Download key file** button to download a zip file containing the .p12 file required for OAuth authentication in Sandbox. ![Select API](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/sandbox_download_keys.png)
16. Once you complete this flow you will land on the Project page. From the Project page take note of your:  
    a. Sandbox and Production status ('Ready/Not Requested')  
    b. Sandbox and Production credentials: authentication consumer key and client encryption key fingerprint. ![Select API](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/project_page.png)
17. Once your onboarding process is completed, You will be informed via an email, and you will be able to make API calls in the sandbox environment.
18. Contact the [API Support](mailto:apisupport@mastercard.com) team or email at [carboncalculator@mastercard.com](mailto:carboncalculator@mastercard.com) with any questions or feedback.

Note:   

* **OAuth Key** - When you call our APIs you will need to include an OAuth1.0a Authentication header. You use the private part of this API Signing Key to generate this OAuth header, so that the Mastercard API server can authenticate your access to the APIs.
* **Consumer Key** - Consumer Key is associated with the API Signing Key and is required in the OAuth authorization header. Consumer keys are 97-character identifiers for client applications consuming Mastercard APIs. The consumer key appears in the OAuth1.0a authorization header sent with each request.
* **Encryption Key** - Mastercard will use the public part of this encryption key to encrypt request payloads containing payment card credentials. You will need the corresponding private part to decrypt these payloads.
* You are required to capture Keystore password and key alias shown on the screen. The keystore password is used in conjunction with the .p12 file and Client ID for OAuth authentication.

## Integrate {#integrate}

### Generate your own API client {#generate-your-own-api-client}

1. Navigate to the API documentation page.
2. Download the API specification (OpenAPI or Swagger).
3. Generate and configure an API client for this API.
4. Configure your client using our [client libraries](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/#client-libraries).

### Testing the service {#testing-the-service}

You can test our service using three different methods:

1. Using Postman: If you are using Postman, please follow our [Postman Tutorial](https://developer.mastercard.com/platform/tutorial/use-postman-for-mastercard-apis/)
2. Using Insomnia: If you are using Insomnia, please follow our [Insomnia Tutorial](https://developer.mastercard.com/platform/tutorial/use-insomnia-rest-client-for-mastercard-apis/)
3. Using our Reference Application: If you are using our reference application, please go to our [Reference Application](https://developer.mastercard.com/carbon-calculator/documentation/reference-app/index.md) page.

For more information on testing, see our [Integration and Testing](https://developer.mastercard.com/carbon-calculator/documentation/integration-and-testing/index.md) page.
Note: For a detailed step-by-step guide, see [Generating and Configuring a Mastercard API Client.](https://developer.mastercard.com/platform/documentation/generating-and-configuring-a-mastercard-api-client/)

## Go-Live {#go-live}

After successfully testing in the sandbox environment, you are ready to move your project to production. Follow below steps to move to production.

1. Click the **Request Production Access** button, in the Production section of the screen.
   ![Select API](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/request_production_access.png)

2. Provide the required **Service details** as explained in creating a sandbox project.

3. Enter a descriptive name for the key, which identifies its purpose and environment, in the **Key Alias** field.

4. Enter a password used to encrypt the keys that the customer will receive, in the **Keystore Password** field.
   ![Select API](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/production_keyalias.png)

5. Save your **key alias** and **keystore password** for future reference.

6. Proceed to generate your Additional Credentials (such as Mastercard Encryption keys and Client Encryption keys) by selecting **Update Project** .
   ![Select API](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/additional_credential.png)

7. Production keys are generated and your project updated. Confirm and download your Production keys.
   ![Select API](https://static.developer.mastercard.com/content/carbon-calculator/Images/tutorials/production_download_keys.png)

8. Once you complete this process, the Mastercard API Support Team will review and approve your request for production access.

9. You will receive an email from Mastercard Developers to your registered email address, depending upon the outcome of the review.

Note: Typically, it takes 3-5 working days to review and approve the Carbon Calculator APIs production access request.

### API Consumer Onboarding {#api-consumer-onboarding}

* Using the production keys, you can validate [view service provider details](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/service_provider_details/index.md) API by referring [Integration and testing](https://developer.mastercard.com/carbon-calculator/documentation/integration-and-testing/index.md) section to test authentication and validate your connectivity.
* In case of failure, email at [carboncalculator@mastercard.com](mailto:carboncalculator@mastercard.com).

### File Exchange Onboarding Process {#file-exchange-onboarding-process}

* This [tutorial](https://trc-techresource.mastercard.com/r/bundle/m_fxusg_en-us/page/d/en-US/pvd1747164178802.html) explains the steps to onboard customers on Next Generation File Transfer (NGFT)'s file exchange process.

## Next Steps {#next-steps}

Now that you have access to the service, you can begin testing, proceed to the [Use Cases](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/index.md) section to learn about the different use cases of the service.
