# Payment Cards Profiles
source: https://developer.mastercard.com/carbon-calculator/documentation/testing/testcase/test_case_payment_card_profiles/index.md

Provides the climate profile of the consumer based on survey answers against the payment card that is provided.

## Pre-requisites {#pre-requisites}

Refer to the [Payment cards profiles](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/payment-cards-profiles/index.md) use case.


API Reference: `GET /payment-cards/{payment_card_id}/profiles`

<br />

## Test Cases {#test-cases}

### Test Case: Success-Payment card profiles {#test-case-success-payment-card-profiles}

##### Request {#request}

```json
{
  "profile": {
    "traits": {
      "knowledge": 0,
      "lifestyle": 0.683,
      "motivated": 0.3
    },
    "userAttributes": {
      "demo": 34,
      "diet": 16399,
      "lifestyle": 16,
      "energy": 0,
      "transport": 0,
      "country": "AF"
    },
    "created": "2024-01-19T09:31:08.065Z",
    "surveys": {
      "key1": {
        "key2": 1,
        "key3": 2
      }
    },
    "persona": "5",
    "benchmarks": {
      "key1": {
        "key2": 1,
        "key3": 2
      }
    }
  }
}
```

##### Response {#response}

```json
{
    "paymentCardId": "c5d88571-ac15-465a-a0d8-1ad1327b9a06",
    "profile": {
        "traits": {
            "knowledge": 0,
            "lifestyle": 0.683,
            "motivated": 0.3
        },
        "userAttributes": {
            "demo": 34,
            "diet": 16399,
            "lifestyle": 16,
            "energy": 0,
            "transport": 0,
            "country": "AF"
        },
        "created": "2024-01-19T09:31:08.065Z",
        "surveys": {
            "key1": {
              "key2": 1,
              "key3": 2
            }
        },
        "persona": "5",
        "benchmarks": {
            "key1": {
              "key2": 1,
              "key3": 2
            }
        }
    }
}
```

### Test Case: Fail-Invalid Request parameter-Path parameter {#test-case-fail-invalid-request-parameter-path-parameter}

##### Request {#request-1}

    {{host}}/payment-cards/abc/profiles

##### Response {#response-1}

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "Service-Provider-Mgmt",
        "ReasonCode": "INVALID_REQUEST_PARAMETER",
        "Description": "One of the request parameters is invalid, try again with correct request.",
        "Recoverable": false,
        "Details": "paymentCardId must match \"^[0-9A-Fa-f\\-]{36}\""
      }
    ]
  }
}
```

### Test Case: Fail-Service Provider Not Found {#test-case-fail-service-provider-not-found}

##### Request {#request-2}

```json
{
  "profile": {
    "traits": {
      "knowledge": 0,
      "lifestyle": 0.683,
      "motivated": 0.3
    },
    "userAttributes": {
      "demo": 34,
      "diet": 16399,
      "lifestyle": 16,
      "energy": 0,
      "transport": 0,
      "country": "AF"
    },
    "created": "2024-01-19T09:31:08.065Z",
    "surveys": {
      "key1": {
        "key2": 1,
        "key3": 2
      }
    },
    "persona": "5",
    "benchmarks": {
      "key1": {
        "key2": 1,
        "key3": 2
      }
    }
  }
}
```

##### Response {#response-2}

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "Service-Provider-Mgmt",
        "ReasonCode": "ACCOUNT_NOT_FOUND",
        "Description": "We cannot find the account which you are using to access this service. Kindly register your account or contact your Mastercard associate if you have already registered with us earlier.",
        "Recoverable": false,
        "Details": ""
      }
    ]
  }
}
```

