# File reference and error codes
source: https://developer.mastercard.com/carbon-calculator-china/documentation/file-reference-error-codes/index.md

## Scored CSV file {#scored-csv-file}

The scored file contains data only in CSV format. Mastercard follows a standard **file naming convention** for the CSV file according to the stage, MTF, and production environments. For example, MCI.AR.O.TP4D.E0002045.D250626.T010000.A001

For more details on the file naming convention, refer to the [File Transfer Manual](https://trc-techresource.mastercard.com/r/bundle/m_fb_en-us/page/d/en-US/oia1723730949875.html) on the Technical Resource Center (TRC).

## Field constraints {#field-constraints}

This table provides more details on the structure and format of the CSV carbon scores file.

|            Field names            |                                                                                                                                                                                                                                               Field description                                                                                                                                                                                                                                               |                                                                                                    Field constraints                                                                                                     | Mandatory or Optional |
|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| `id`                              | A unique ID assigned to a transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Alphanumeric * Minimum length: 1 * Maximum length: 100                                                                                                                                                                   | Mandatory             |
| `fpan`                            | The original payment card number in full.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Alphanumeric * Minimum length: 16 * Maximum length: 16                                                                                                                                                                   | Mandatory             |
| `banknetReferenceNumber`          | The DE 63 (Network Data), subfield 2 refers to the Banknet Reference Number. It is a unique transaction identifier generated by the Authorization Platform within the specified financial network and used to trace clearing records back to the originating authorization.                                                                                                                                                                                                                                   | Alphanumeric * Minimum length: 6 * Maximum length: 13                                                                                                                                                                    | Optional              |
| `banknetDate`                     | The DE 7, subelement 1 (POS_BANKNET_DATE) is a date when a transaction message enters into the Mastercard Network.                                                                                                                                                                                                                                                                                                                                                                                            | Alphanumeric Format: MMDD                                                                                                                                                                                                | Optional              |
| `retrievalRefNumber`              | The DE 37 (Retrieval Reference Number) is a system‑supplied document reference that helps: * Locate the original transaction source document * Support automated merchant POS systems in meeting regulatory requirements * Relay source document identifiers to issuers during transaction processing. <br /> Merchant POS systems may assign a unique receipt or sales document ID to be used to satisfy regulatory or legal requirements when the merchant performs source document capture and truncation. | When present the DE 37: * Must contain a value other than all zeros or all spaces. * Can have trailing spaces if the transaction is not a Visa or EMV Chip Transaction. <br /> * Minimum length: 12 * Maximum length: 12 | Optional              |
| `processingCode`                  | The DE 3, subfield 1 (Cardholder Transaction Type Code) describes the specific transaction type.                                                                                                                                                                                                                                                                                                                                                                                                              | Alphanumeric * Minimum length: 2 * Maximum length: 2                                                                                                                                                                     | Optional              |
| `authCode`                        | The DE 38 (Authorization ID Response) refers to the transaction response ID code that the authorizing institution assigns. DE 38 is used to transmit a card issuer's authorization code for authorization transactions.                                                                                                                                                                                                                                                                                       | Alphanumeric * Minimum length: 1 * Maximum length: 6                                                                                                                                                                     | Optional              |
| `date`                            | The date of the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Format: DD-MM-YY                                                                                                                                                                                                         | Mandatory             |
| `merchantName`                    | The DE 43 (Card Acceptor Name/Location for All Transactions), subfield 1 (Card Acceptor Name) refers to the merchant 'doing business as' name.                                                                                                                                                                                                                                                                                                                                                                | Alphanumeric * Minimum length: 1 * Maximum length: 25                                                                                                                                                                    | Mandatory             |
| `acquiringInstitutionCountryCode` | The DE 19 (Acquiring Institution Country Code) refers to the code of the country where the Acquiring Institution is located. For more details, refer to the ISO 3166 specification.                                                                                                                                                                                                                                                                                                                           | Alphanumeric * Minimum length: 3 * Maximum length: 3                                                                                                                                                                     | Mandatory             |
| `acquiringInstitutionCode`        | The DE 32 (Acquiring Institution ID Code) identifies the Acquiring Institution (for example, a Merchant Bank) or its agent.                                                                                                                                                                                                                                                                                                                                                                                   | Alphanumeric * Minimum length: 11 * Maximum length: 11                                                                                                                                                                   | Mandatory             |
| `carbonEmissionInGrams`           | The transaction's CO~2~ emission in grams.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Numeric For example, 48.52                                                                                                                                                                                               | Optional              |
| `carbonEmissionInOunces`          | The transaction's CO~2~ emission in ounces.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Numeric For example, 1.71                                                                                                                                                                                                | Optional              |
| `amount`                          | The transaction amount for the given transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Alphanumeric * Minimum length: 1 * Maximum length: 10                                                                                                                                                                    | Mandatory             |
| `currencyCode`                    | The currency code as per ISO 4217 standards.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Alphanumeric * Minimum length: 3 * Maximum length: 3                                                                                                                                                                     | Mandatory             |
| `indicator`                       | The transaction type * **CL**: CLEAR * **RFT**: REFUND                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Alphanumeric * Minimum length: 2 * Maximum length: 8                                                                                                                                                                     | Optional              |
| `mcc`                             | The acceptor business code of a payment transaction that uniquely defines a merchant business (the same as in request).                                                                                                                                                                                                                                                                                                                                                                                       | Alphanumeric * Minimum length: 1 * Maximum length: 4                                                                                                                                                                     | Mandatory             |
| `mainCategory`                    | The main category to which an acceptor business code belongs.                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Alphanumeric * Minimum length: 5 * Maximum length: 100                                                                                                                                                                   | Optional              |
| `subCategory`                     | The sub-category of a category to which an acceptor business code belongs.                                                                                                                                                                                                                                                                                                                                                                                                                                    | Alphanumeric * Minimum length: 5 * Maximum length: 100                                                                                                                                                                   | Optional              |
| `sector`                          | The sector of a category to which an acceptor business code belongs to.                                                                                                                                                                                                                                                                                                                                                                                                                                       | Alphanumeric * Minimum length: 5 * Maximum length: 100                                                                                                                                                                   | Optional              |
| `sectorCode`                      | A unique code assigned to each sector.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Alphanumeric * Minimum length: 3 * Maximum length: 3                                                                                                                                                                     | Optional              |
| `scoreReference`                  | The Score Reference defines a transaction scoring type, based on which a score is generated. Possible values are: * MCC * PROFILE                                                                                                                                                                                                                                                                                                                                                                             | Alphanumeric * Minimum length: 3 * Maximum length: 7                                                                                                                                                                     | Mandatory             |
| `errorCode`                       | The error code in case of errors occurred while scoring. For more details on the error codes, refer to the [Error Codes and Formats](https://developer.mastercard.com/carbon-calculator-china/documentation/file-reference-error-codes/index.md#error-codes-and-formats) section.                                                                                                                                                                                                                             | N/A                                                                                                                                                                                                                      | Optional              |
| `errorMessage`                    | The description of the error in case of errors while scoring. For more details on the error messages, refer to the [Error Codes and Formats](https://developer.mastercard.com/carbon-calculator-china/documentation/file-reference-error-codes/index.md#error-codes-and-formats) section.                                                                                                                                                                                                                     | N/A                                                                                                                                                                                                                      | Optional              |

## Sample scored CSV output file format {#sample-scored-csv-output-file-format}

Following is the format of the sample CSV scored output file:
* Output

```Output
"id","fpan","banknetReferenceNumber","banknetDate","retrievalRefNumber","processingCode","authCode","date","merchantName","acquiringInstitutionCountryCode","acquiringInstitutionCode","carbonEmissionInGrams","carbonEmissionInOunces","amount","currencyCode","indicator","mcc","mainCategory","subCategory","sector","sectorCode","scoreReference","errorCode","errorMessage"
"de6f87c6-9c00-4adb-90c4-be76a23d8bb3","5110440000000113639","MCCBTVNR6","1113","MCCBTVNR6","00","111111","13-11-24","ISSM","USA","11597","204473.66","7212.6","100.0","USD","CLEAR","5271","","","","321","MCC","",""
"58d8d3fc-dc22-49fd-9052-e2d73402cacc","5110440000000113639","MCCRSJ85D","1113","MCCRSJ85D","00","111111","13-11-24","ISSM","USA","11597","204473.66","7212.6","100.0","USD","CLEAR","5271","","","","321","MCC","",""
"323e78f7-2a19-4178-bd35-0401b00187f3","5110440000000113639","MCCADXBK0","1113","MCCADXBK0","00","111111","13-11-24","ISSM","USA","11597","204473.66","7212.6","100.0","USD","CLEAR","5271","","","","321","MCC","",""
"1ac9392c-93ed-4ea3-915b-8eac9fb81c86","5110440000000113639","MCCFJ7HVJ","1113","MCCFJ7HVJ","00","111111","13-11-24","ISSM","USA","11597","204473.66","7212.6","100.0","USD","CLEAR","5271","","","","321","MCC","",""
"d349d04a-ff21-46bc-9c84-e69a16e16ce3","5110440000000113632","MCCQTKBF5","1113","MCCQTKBF5","00","111111","13-11-24","ISSM","USA","11597","204473.66","7212.6","100.0","USD","CLEAR","5271","","","","321","MCC","",""
"d11a5f3a-4b42-41e2-b3c3-059476bc613c","5110440000000113639","MCCTWQYRW","1113","MCCTWQYRW","00","111111","13-11-24","ISSM","USA","11597","","","100.0","USD","CLEAR","00000","","","","321","MCC","INVALID_MERCHANT_CATEGORY_CODE","Given merchant category code is not valid"
"9b4cfa22-1d44-40ed-ad5b-d56deb2f7b60","5110440000000113632","MCCBTJ7RK","1113","MCCBTJ7RK","00","111111","13-11-24","ISSM","USA","11597","","","100.0","US DOLLAR","CLEAR","5271","","","","321","MCC","INVALID-CURRENCY","Given currency detail is not valid"
```

## Error codes and formats {#error-codes-and-formats}

Carbon Calculator generates error codes and messages when it is not able to score a particular transaction. These error codes and messages appear in the `Error Code` and `Error Message` fields of the carbon scores CSV file.

The errors generated by Carbon Calculator are listed in the following table:

|            Error Codes             |                                        Error Description                                         |                                                                                Resolution Tips                                                                                |
|------------------------------------|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| INVALID_MERCHANT_CATEGORY_CODE     | The provided merchant category code (MCC) or acceptor category code is invalid or not supported. | Verify the MCC provided. The MCC must be a 4‑digit numeric value without special characters, spaces, or strings.                                                              |
| INVALID_CURRENCY                   | The specified currency code or details are invalid or unrecognized.                              | Ensure that the currency is supported and properly formatted. The currency code should be specified as per the ISO 4217 standards.                                            |
| INVALID_FINANCIAL_INSTITUTION_DATA | The requested resource was not found.                                                            | The provided financial institution reference or data is invalid. Verify that the resource URL or ID is correct and the resource exists. Check for typos in the endpoint path. |

## Next steps {#next-steps}

Now that you understand the file transfer process, proceed to the [Tutorials and Guides](https://developer.mastercard.com/carbon-calculator-china/documentation/tutorials/index.md) section for a more detailed understanding of the file transfer applications.
