# PSI Non-FCRA
source: https://developer.mastercard.com/open-finance-us/documentation/products/pay/psi-tools/psi/index.md

Note: This documentation has been updated to describe the latest PSI endpoints which add support for an unauthorized return score. For details of the legacy endpoints, see [Legacy PSI Endpoints](https://developer.mastercard.com/open-finance-us/documentation/products/pay/psi-tools/legacy/index.md).

## PSI Non-FCRA Flow {#psi-non-fcra-flow}

Diagram psi

## Execution Steps {#execution-steps}

1. Consumer Consent: The merchant/fintech/PSP obtains consumer consent
   to share bank data when setting up recurring payments.

2. PSI Request: A PSI Non-FCRA request is sent prior to
   payment initiation via a **POST** call

3. Risk Assessment: Mastercard analyzes the account and returns NSF and
   unauthorised return risk scores via a **GET** call

4. Payment Decision: The merchant makes a decision.

## Technical Documentation {#technical-documentation}

Refer to the [Quick Start Guide](https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index.md)
for creating a [Customer](https://developer.mastercard.com/open-finance-us/documentation/customer-records/index.md#customers) record
using your `partnerId` and generating a
[Connect](https://developer.mastercard.com/open-finance-us/documentation/connect/index.md) URL to use this service. Note that the endpoints
require [Authentication](https://developer.mastercard.com/open-finance-us/documentation/onboarding/index.md#authentication).

API Reference: `POST /payments/customers/{customerId}/accounts/{accountId}/payment-success-indicators`

**Generate Payment Success Indicators** returns a `payRequestId` - use it to call the endpoint below and retrieve the PSI scores.

API Reference: `GET /payments/customers/{customerId}/accounts/{accountId}/payment-success-indicators/{payRequestId}`

Tip: If you want the optional NSF reason codes, set `include_reasons` to `true` when calling the above endpoint.

If the PSI data is not yet ready, **Get Non-FCRA Payment Success Indicators by Pay Request ID** returns a `status` value of `IN PROGRESS`. You can poll the endpoint until the data is available.

If you are making multiple GET requests immediately after calling **Generate FCRA Payment Success Indicators**, wait 0.5 to 1 second between each GET request.

We recommend integrating with the [Get Available Balance](https://developer.mastercard.com/open-finance-us/documentation/products/pay/account-balance/index.md#get-available-balance) endpoint as a fallback. Your solution should first call **Get Non-FCRA Payment Success Indicators by Pay Request ID** , then use **Get Available Balance** if the PSI request fails, so you can still retrieve the customer's available balance.

## Understanding the PSI Response Data {#understanding-the-psi-response-data}

* The `nsfReturnRisk` and `unauthorizedReturnRisk` tiers correspond to the `score` value. There are 3 possible tiers:

  * `score` 0-10 corresponds to "High Risk"
  * `score` 11-30 corresponds to "Medium Risk"
  * `score` 31-100 corresponds to "Low Risk"
* The `reasons` array for each day with the `nsfReturnRisk` can be used to see why the score for a given day was generated. Reasons can be interpreted as both negative and positive drivers, influencing the `score` value.

For example:

* `score` 100 and `nsfHistory` 100 may be interpreted as that this account has had few, if any, NSF occurrences in the past, and it is **unlikely** to result in NSF.
* `score` 10 and `nsfHistory` 100 may be interpreted as that this account has multiple NSF occurrences in the past, and it is **likely** to result in NSF.

<br />

See [Interpreting the Scores](https://developer.mastercard.com/open-finance-us/documentation/products/pay/psi-tools/how-psi-works/index.md#interpreting-the-scores) for full details.

## Error Codes {#error-codes}

The following table lists the errors that are specific to this API. See also the
[Error Handling](https://developer.mastercard.com/open-finance-us/documentation/errors/index.md) section for a list of
general errors and status codes which can occur.
Warning: In some cases, a server-side failure can result in an HTTP 200 response being returned with an internal error (such as 18002) in the response body. This is a known issue which we are working to resolve. Retry the request and contact your Customer Success Manager if the problem persists.

| **HTTP Code** | **Status Code** |                          **Description**                           |                                                                                                                     **Remediation for Partner**                                                                                                                      |
|---------------|-----------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 400           | 10006           | "settleByDate must not be in the past"                             | Call the PSI endpoint with a `settleByDate` value equal to today or for a future date.                                                                                                                                                                               |
| 400           | 10007           | "\[FIELD\] is the incorrect type"                                  | Call the PSI endpoint with correct type for the identified field.                                                                                                                                                                                                    |
| 400           | 10008           | "account has no transactions"                                      | This indicates that the consumer's account does not have sufficient transaction history to produce a risk score with confidence. You may decline or accept the transaction.                                                                                          |
| 400           | 10009           | "\[FIELD\] is a required parameter"                                | Call the PSI endpoint with the identified field provided.                                                                                                                                                                                                            |
| 400           | 10013           | "Only active accounts can be used, please use a different account" | The customer must select an active account when linking their accounts.                                                                                                                                                                                              |
| 401           | 24302           | "Bad credentials"                                                  | Call the PSI endpoint with a valid app key and token. If this doesn't work, it is possible that your account is locked due to security reasons (normally as a result of multiple failed attempts). If this happens, contact customer support to unlock your account. |
| 404           | 14001           | "customerId not found"                                             | Ensure you are using the correct customer ID. If the customer ID is correct, it might be that the account has had no activity for a long period leading to an inactive status.                                                                                       |
| 404           | 38003           | "accountId not found"                                              | Ensure you are using the correct account ID and that the customer has connected their account.                                                                                                                                                                       |

## Testing {#testing}

See the [Payment Success Indicator Profiles](https://developer.mastercard.com/open-finance-us/documentation/integration-and-testing/test-the-apis/index.md#payment-success-indicator-profiles) section of [Test Profiles](https://developer.mastercard.com/open-finance-us/documentation/integration-and-testing/test-the-apis/index.md) for details of banking profiles which are provided for testing purposes. These profiles are designed to return different PSI scores for different payment amounts and settlement dates.
