---
page_source: https://docs.juspay.io/recon-and-settlement/docs/recon--settlement/transaction-file-config
page_title: Transaction File Config
---


# Configuration Guide



Transaction file configuration is used to process **Merchants file**  of transactions. It tells the system **how to handle** , **validate** , and **transform**  the data before saving it to the database.


## Configuring on Juspay Dashboard



[Video](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/dashboard/Base%20COnfig.mov)




## **Configuration Breakdown:** 




### 1. Global Configuration



Used to add or override columns such as Transaction status and Merchant ID. If all transactions belong to the same merchant, this configuration ensures consistency across all records.


#### What it does:



* Automatically adds or overrides fields, for example:
  
  * `txn_status` is set to "`SUCCESS`" for every row
  * `merchant_id` is set to "`reconDemo`"
* How to customize:
  
  * Change "`merchant_id`" to match your own merchant code.
  * Update "`txn_status`" if needed.


### 2. Local Configuration



This configuration section defines how to process different types of transactions such as `ORDER` , `REFUND` , `CHARGEBACK` , `DISPUTE`, etc based on specific filter conditions. 


#### **2.1 Filters:** 



Each block starts with a filter condition that determines which rows the configuration applies to.

* **Configuration for** `ORDER`**Transactions:**


#### Transaction Type: Order Code Snippet:

```transaction type: order
{
"condition": "EQ",
"field": "transaction_type",
"value": "ORDER"
}
```


This configuration **applies**  to rows where transaction_type equals "`ORDER`".

* **Configuration for** `REFUND`**Transactions:**


#### Transaction Type: Refund Code Snippet:

```transaction type: refund
{
  "condition": "NEQ",
  "field": "transaction_type",
  "value": "ORDER"
}
```


This configuration **applies**  to all rows that are NOT "`ORDER`" essentially `REFUND` or others.


#### **2.2 Mappings:** 



Each configuration maps CSV column names to corresponding internal database field names.

* Eg: `card_network`: `payment_methods`
  
  This means the `card_network` column in the CSV will be saved into the `payment_methods` column in the database.


### 3. Validation



The validation section defines a set of **rules that your uploaded transaction data must pass**  before it's accepted for processing **Ensuring Data Integrity** . These checks help ensure that the data is clean, complete, and correctly formatted.

When a file is uploaded, the system will automatically run the defined validations on the mapped columns from your transaction file. 


#### Validation Logic Breakdown




| Validation Type | Purpose |
|---|---|
| date_format_check | Validates date string format |
| duplicate_records_check | Ensures unique values for critical identifiers |
| nan_value_check | Ensures required fields are not empty or null |
| numeric_dtype_check | Confirms numeric fields contain valid numbers |
| pkey_check | Verifies uniqueness and presence for primary key field |
| scientific_value_check | Rejects exponential notation for consistency |


> **Note**
> 💡 To enable any validation, make sure the corresponding name is added to the `checks` list at the end of the validation block.



## Sample Code Snippets:
### Sample Code:

#### Base Config Code Snippet:

```base config
{
  "cluster": [
     "gateway"
  ],
  "global_configuration": {
     "mutations": {
        "computations": [],
        "mutations": [
           {
              "mutation_col": "txn_status",
              "replacement": [
                 {
                    "filters": [],
                    "value": "SUCCESS"
                 }
              ]
           },
           {
              "mutation_col": "merchant_id",
              "replacement": [
                 {
                    "filters": [],
                    "value": "reconDemo"
                 }
              ]
           }
        ]
     }
  },
  "local_configuration": [
     {
        "filters": [
           {
              "condition": "EQ",
              "field": "transaction_type",
              "value": "ORDER"
           }
        ],
        "mappings": {
           "card_network": "payment_methods",
           "gateway": "gateways",
           "order_id": "order_ids",
           "payment_entity_txn_id": "psp_reference",
           "payment_method": "payment_method_types",
           "payment_method_type": "payment_instrument_group",
           "txn_amount": "net_amount",
           "txn_currency": "txn_currencys",
           "txn_date": "txn_initiated",
           "txn_id": "txn_ids",
           "udf2": "transaction_type"
        },
        "mutations": {
           "computations": [],
           "mutations": [
              {
                 "mutation_col": "txn_type",
                 "replacement": [
                    {
                       "filters": [],
                       "value": "ORDER"
                    }
                 ]
              }
           ]
        },
        "type": "ORDER"
     },
     {
        "filters": [
           {
              "condition": "NEQ",
              "field": "transaction_type",
              "value": "ORDER"
           }
        ],
        "mappings": {
           "card_network": "payment_methods",
           "gateway": "gateways",
           "order_id": "order_ids",
           "payment_entity_txn_id": "psp_reference",
           "payment_method": "payment_method_types",
           "payment_method_type": "payment_instrument_group",
           "txn_amount": "net_amount",
           "txn_currency": "txn_currencys",
           "txn_date": "txn_initiated",
           "txn_id": "txn_ids",
           "udf2": "transaction_type"
        },
        "mutations": {
           "computations": [],
           "mutations": [
              {
                 "mutation_col": "txn_type",
                 "replacement": [
                    {
                       "filters": [],
                       "value": "REFUND"
                    }
                 ]
              }
           ]
        },
        "type": "REFUND"
     }
  ],
  "preprocessing": false,
  "validation": {
     "check_fields": {
        "date_format_check": {
           "txn_date": "%Y-%m-%d %H:%M:%S"
        },
        "duplicate_records_check": [
           "payment_entity_txn_id"
        ],
        "nan_value_check": [
           "txn_id",
           "payment_entity_txn_id",
           "txn_amount",
           "txn_date"
        ],
        "numeric_dtype_check": [
           "txn_amount"
        ],
        "pkey_check": [
           "payment_entity_txn_id"
        ],
        "scientific_value_check": [
           "payment_entity_txn_id",
           "txn_amount",
           "txn_id"
        ]
     },
     "checks": [
        "check_fields",
        "date_format_check",
        "nan_value_check",
        "numeric_dtype_check",
        "pkey_check",
        "duplicate_records_check",
        "scientific_value_check"
     ]
  }
}

```

