# Parameters
source: https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md

## Overview {#overview}

This section outlines the parameters and values that you need to provide to CCE APIs when you execute them.

## Parameters to Enroll Users {#parameters-to-enroll-users}

Enrolls cardholders to the Carbon Calculator Experience platform to allow issuers to track the carbon footprints of the cardholders' transactions and provide them with an option to donate towards tree plantations.

| Method |    Endpoint    |
|--------|----------------|
| POST   | /issuers/users |

Note: This API requires encrypted data.

### Request body parameters {#request-body-parameters}

|       Name       |  Type  |                                                               Description                                                               |  Notes   |
|------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------|----------|
| email            | object | See [email](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#email)                   | Required |
| name             | object | See [name](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#name)                     | Optional |
| cardholderName   | string | Name of the card holder. **Format** : FirstName LastName For example, John Doe.                                                         | Required |
| cardNumber       | string | Original payment card number in full. For example, 5344035171229750.                                                                    | Required |
| cardBaseCurrency | string | Currency code as per [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).                                                                | Required |
| expiryInfo       | object | See [expiryInfo](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#expiryinfo)         | Required |
| billingAddress   | object | See [billingAddress](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#billingaddress) | Optional |
| locale           | string | User locale registered with the issuer. For example, en-US.                                                                             | Optional |

### Child attributes {#child-attributes}

#### email {#email}

| Name  |  Type  |                                      Description                                      |  Notes   |
|-------|--------|---------------------------------------------------------------------------------------|----------|
| type  | string | Type of email For example, home or work.                                              | Required |
| value | string | Email address of the user. For example, [John.Doe@mail.com](mailto:John.Doe@mail.com) | Required |

#### name {#name}

|   Name    |  Type  |                Description                |  Notes   |
|-----------|--------|-------------------------------------------|----------|
| firstName | string | First name of the user For example, John. | Required |
| lastName  | string | Last name of the user For example, Doe.   | Required |

#### expiryInfo {#expiryinfo}

| Name  |  Type  |                         Description                         |  Notes   |
|-------|--------|-------------------------------------------------------------|----------|
| month | string | The month when the card validity expires. For example, 10.  | Required |
| year  | string | The year when the card validity expires. For example, 2024. | Required |

#### billingAddress {#billingaddress}

|    Name     |  Type  |                                                               Description                                                                |  Notes   |
|-------------|--------|------------------------------------------------------------------------------------------------------------------------------------------|----------|
| countryCode | string | The country two-character code per the ISO 3166-1 standards. **Format** : alpha-2 For example, USA.                                      | Required |
| locality    | string | The city, district, suburb, town, or village of the address. For example, Huf Station.                                                   | Optional |
| postalCode  | string | The postal code in the address is the ZIP code or equivalent and can be an alphanumeric value including whitespaces. For example, 11746. | Optional |
| state       | string | The state, region, or province of the billing address. For example, New York.                                                            | Optional |
| city        | string | The city of the billing address For example, Brooklyn.                                                                                   | Optional |
| line1       | string | The first line of the street address. For example, 83 Mayfair Street.                                                                    | Optional |
| line2       | string | The second line of the street address. For example, Main Road.                                                                           | Optional |
| line3       | string | The third line of the street address. For example, Snake Hill Ave.                                                                       | Optional |
| type        | string | Denotes type of address. For example, home or work.                                                                                      | Required |

### Response body parameters {#response-body-parameters}

A successful response returns the `HTTP 200 Success` status code and a JSON response body.

|           Name           |  Type  |                                         Description                                         |
|--------------------------|--------|---------------------------------------------------------------------------------------------|
| userid                   | string | A unique identifier for a user enrolled onto the CCE platform.                              |
| cardNumberLastFourDigits | string | The last 4-digits of the payment card number that was provided during enrollment.           |
| status                   | string | The status of the payment card in the CCE platform. Possible values are ACTIVE and DELETED. |

## Parameters to Update Users {#parameters-to-update-users}

Updates the user or cardholder information enrolled in the Carbon Calculator Experience platform.

| Method |        Endpoint         |
|--------|-------------------------|
| PUT    | /issuers/users/{userid} |

Note: This API requires encrypted data.

### Request body parameters {#request-body-parameters}

|      Name      |  Type  |                                                               Description                                                               |  Notes   |
|----------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------|----------|
| name           | object | See [name](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#name)                     | Required |
| billingAddress | object | See [billingAddress](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#billingaddress) | Optional |
| locale         | string | User locale which is registered with issuer. For example, en-US.                                                                        | Required |

### Child attributes {#child-attributes}

#### name {#name}

|   Name    |  Type  |            Description             |  Notes   |
|-----------|--------|------------------------------------|----------|
| firstName | string | First name of user, such as, John. | Required |
| lastName  | string | Last name of user, such as, Doe.   | Required |

#### billingAddress {#billingaddress}

|    Name     |  Type  |                                                               Description                                                                |  Notes   |
|-------------|--------|------------------------------------------------------------------------------------------------------------------------------------------|----------|
| countryCode | string | The address's country in two-character ISO 3166-1 alpha-2 format. For example, USA.                                                      | Required |
| locality    | string | The city, district, suburb, town, or village of the address. For example, Huf Station.                                                   | Optional |
| postalCode  | string | The postal code in the address is the ZIP code or equivalent and can be an alphanumeric value including whitespaces. For example, 11746. | Optional |
| state       | string | The state, region, or province to which the address belongs. For example, New York.                                                      | Optional |
| city        | string | Denotes the city in the address. For example, Brooklyn.                                                                                  | Optional |
| line1       | string | Street address line1. For example, 83 Mayfair Street.                                                                                    | Optional |
| line2       | string | Street Address line2. For example, Main Road.                                                                                            | Optional |
| line3       | string | Street Address line3. For example, Snake Hill Ave.                                                                                       | Optional |
| type        | string | Denotes type of address. For example, home or work.                                                                                      | Required |

### Response body parameters {#response-body-parameters}

A successful response returns the `HTTP 200 Success` status code and a JSON response body.

|           Name           |  Type  |                                      Description                                      |
|--------------------------|--------|---------------------------------------------------------------------------------------|
| userid                   | string | A unique identifier for a user enrolled onto the CCE platform.                        |
| cardNumberLastFourDigits | string | Last 4-digits of a full payment card number which was provided during enrollment.     |
| status                   | string | Status of a payment card in the CCE platform. Possible values are ACTIVE and DELETED. |

## Parameters to Retrieve Dashboard URL {#parameters-to-retrieve-dashboard-url}

Fetches a short-lived URL for an enrolled user. The issuer should load this URL within their application so that user can view their dashboard containing carbon footprints and donations.

| Method |              Endpoint              |
|--------|------------------------------------|
| GET    | /issuers/users/{userid}/dashboards |

### URL parameters {#url-parameters}

|   Name   |  Type  |                                                                              Description                                                                              |  Notes   |
|----------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| userid   | string | Unique identifier for a user enrolled in the CCE platform. For example, f5d88571-ac15-465a-a0d8-1ad1327b9a06.                                                         | Required |
| language | string | Language preference. For example: * en-US - English * es-cr - Spanish (Costa Rica) * es-cl - Spanish (Chile) * sv - Swedish * pl-PL - Polish (Poland) * ms-MY (Malay) | Optional |

### Response body parameters {#response-body-parameters}

A successful response returns the `HTTP 200 Success` status code and a JSON response body. The response object contains the short-lived URL along with authentication token.

|      Name      |  Type  |                                                                                                                                    Description                                                                                                                                    |
|----------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| url            | string | This is the URL which needs to be rendered in web view. For example, <https://ppctwebview.b221.net/home/?auth_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c>. |
| expiryInMillis | string | Denotes expiry limit for the URL. For example, 300000.                                                                                                                                                                                                                            |

## Parameters to Fetch Aggregate Carbon Score {#parameters-to-fetch-aggregate-carbon-score}

Retrieves a monthly aggregate carbon score for the transactions done by a user.

| Method |                    Endpoint                     |
|--------|-------------------------------------------------|
| GET    | /issuers/users/{userid}/aggregate-carbon-scores |

### URL parameters {#url-parameters}

|  Name  |  Type  |                                                 Description                                                  |  Notes   |
|--------|--------|--------------------------------------------------------------------------------------------------------------|----------|
| userid | string | Unique identifier of a user enrolled in the CCE platform. For example, f5d88571-ac15-465a-a0d8-1ad1327b9a06. | Required |

### Response body parameters {#response-body-parameters}

A successful response returns the `HTTP 200 Success` status code and a JSON response body. The response object contains aggregation of carbon footprint.

|         Name          |  Type  |                            Description                             |
|-----------------------|--------|--------------------------------------------------------------------|
| carbonEmissionInGrams | string | An aggregate value of CO~2~ emission in grams. For example, 32.45. |
| aggregateDate         | string | Denotes aggregate duration. For example, November 2020.            |

## Parameters to Delete Users {#parameters-to-delete-users}

Deletes one or more user details from the CCE platform. Payment cards associated with the user are also deleted.

| Method |        Endpoint         |
|--------|-------------------------|
| POST   | /issuers/user-deletions |

### Request body parameters {#request-body-parameters}

|  Name  |     Type     |                        Description                         |  Notes   |
|--------|--------------|------------------------------------------------------------|----------|
| UserID | string array | Unique identifier for a user enrolled in the CCE platform. | Required |

### Response body parameters {#response-body-parameters}

A successful response returns the `HTTP 202 Success` status code and a JSON response body.

|  Name  |     Type     |                   Description                    |
|--------|--------------|--------------------------------------------------|
| UserID | string array | The response object contains a list of user IDs. |

## Parameters to Retrieve Issuer Details {#parameters-to-retrieve-issuer-details}

Fetches the issuer details onboarded to the CCE platform, such as, a supported account range, currency code, and country code along with the color theme.

| Method | Endpoint |
|--------|----------|
| GET    | /issuers |

### Response body parameters {#response-body-parameters}

A successful response returns the `HTTP 202 Success` status code and a JSON response body.

|         Name          |  Type  |                                                    Description                                                    |
|-----------------------|--------|-------------------------------------------------------------------------------------------------------------------|
| clientId              | string | Unique issuer identifier in the Mastercard Developers platform.                                                   |
| customerId            | string | Unique issuer identifier assigned by Mastercard which remains the same across all Mastercard systems.             |
| supportedAccountRange | string | Comma separated account range. The value must be between 4 and 8 supported by an issuer.                          |
| status                | string | Status of the issuer on the server. Possible values are ACTIVE and SUSPENDED.                                     |
| email                 | string | Email address of the issuer.                                                                                      |
| currencyCode          | string | Currency code as per ISO 4217.                                                                                    |
| countryCode           | string | DE 19 (Acquiring Institution Country Code) is the code of the country where the acquiring institution is located. |
| countryName           | string | ISO 3166 country short name. **Pattern**: \^\[a-zA-Z\\s\\(\\),\\.\]+$                                             |
| privacyNoticeURL      | string | Privacy Notice URL. For example, <https://www.issuer.privacy-policy-url.html>                                     |
| termsAndConditionURL  | string | Terms and conditions URL for the given user. For example, <https://www.issuer.term-and-conditions.html>           |
| optOutURL             | string | Opt out URL for the given user. For example, <https://www.issuer.opt-out-url.html>                                |
| preferredTheme        | object | Color hex code to set preferred colors for webview.                                                               |

## Parameters to Update Issuer Details {#parameters-to-update-issuer-details}

Updates the issuer configuration details of an issuer registered issuer on the CCE platform.

| Method | Endpoint |
|--------|----------|
| PUT    | /issuers |

### Request body parameters {#request-body-parameters}

|         Name          |  Type  |                                  Description                                  |  Notes   |
|-----------------------|--------|-------------------------------------------------------------------------------|----------|
| supportedAccountRange | String | Comma-separated account range must be between 4 and 8 supported by an issuer. | Optional |
| privacyNoticeURL      | string | Privacy Notice URL.                                                           | Optional |
| termsAndConditionURL  | string | Terms and conditions URL for the given issuer.                                | Optional |
| optOutURL             | string | Opt out URL for the given issuer.                                             | Optional |
| preferredTheme        | object | Color hex code to set preferred colors for webview.                           | Optional |

### Response body parameters {#response-body-parameters}

A successful response returns the `HTTP 200 Success` status code and a JSON response body.

|         Name          |  Type  |                                            Description                                            |
|-----------------------|--------|---------------------------------------------------------------------------------------------------|
| clientId              | string | Unique issuer identifier from the Mastercard Developer Portal.                                    |
| customerId            | string | Unique issuer identifier assigned by Mastercard which remains same across all Mastercard systems. |
| status                | string | Status of an issuer on the server. Possible values are ACTIVE and SUSPENDED.                      |
| supportedAccountRange | string | Comma-separated account range must be between 4 and 8 supported by an issuer.                     |
| privacyNoticeURL      | string | Privacy Notice URL.                                                                               |
| termsAndConditionURL  | string | Terms and conditions URL for the given issuer.                                                    |
| optOutURL             | string | Opt-out URL for the given issuer.                                                                 |
| preferredTheme        | object | Color hex code to set preferred colors for webview.                                               |

