---
agentTools:
  projectIndex: https://docs.decentro.tech/llms.txt
---

# Bulk Execution API - CSV

This API allows clients to initiate bulk mandate execution requests for eNach mandates via csv

> 🚧 Please export Postman Collection to test this API
>
> **Note:** This API cannot be tested here as file upload is not supported in this interface. Please export the Postman Collection and try the API there.
>
> Or, use the cURL given below

```json json
curl --location --globoff '{{url}}/decentro/bulk/enach_mandate_presentation' \
--header 'client-id: {{client_id}}' \
--header 'client-secret: {{client_secret}}' \
--form 'input=@"/path/to/file"' \
--form 'reference_id="7897a4dc-feae-4349-882d-e41c6b29559w"' \
--form 'input_type="csv"'
```

* The reference\_id (in form data) must be unique for each request.
* Each row’s reference\_id must also be unique within the CSV & everywhere.
* Mandates must be in Active status for successful debit.
* Dates must follow the format YYYY-MM-DD.
* Amount should be a numeric string (e.g., "10000").
* Duplicate reference\_ids (used before or within the same batch) will result in rejection.
* The API returns a download URL pointing to a CSV file with individual execution statuses. Same can be verified via Bulk Execution Status API/ Merchant dashboard.

### CSV File Format

The CSV should have the following headers:

| reference\_id    | decentro\_mandate\_id | debit\_date | amount                  |
| :--------------- | :-------------------- | :---------- | :---------------------- |
| Unique string ID | Valid mandate ID      | YYYY-MM-DD  | Amount as number string |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Decfin Staging",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://staging.api.decentro.tech"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "//decentro/bulk/enach_mandate_presentation": {
      "post": {
        "summary": "Bulk Execution API - CSV",
        "description": "This API allows clients to initiate bulk mandate execution requests for eNach mandates via csv",
        "operationId": "bulk-execution-api-csv",
        "parameters": [
          {
            "name": "client-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client-secret",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input",
                  "reference_id",
                  "input_type"
                ],
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "CSV file containing mandate presentation data",
                    "format": "binary"
                  },
                  "reference_id": {
                    "type": "string",
                    "description": "Unique identifier for this bulk request"
                  },
                  "input_type": {
                    "type": "string",
                    "description": "Accepted values are json & csv. If file uploading, then it has to be \"csv\""
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"status\": \"SUCCESS\",\n    \"download_url\": \"https://staging.api.decentro.tech/XXXXX\",\n    \"decentroTxnId\": \"CD6OTXXXXXXXXXXXMSTJIPFWTK60J\",\n    \"message\": \"Enach Mandate Presentation initiated successfully.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "SUCCESS"
                    },
                    "download_url": {
                      "type": "string",
                      "example": "https://staging.api.decentro.tech/XXXXX"
                    },
                    "decentroTxnId": {
                      "type": "string",
                      "example": "CD6OTXXXXXXXXXXXMSTJIPFWTK60J"
                    },
                    "message": {
                      "type": "string",
                      "example": "Enach Mandate Presentation initiated successfully."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Failure - Missing Input File": {
                    "value": "{\n    \"error\": {\n        \"response_key\": \"missing_input_file\",\n        \"message\": \"Missing input file in the request\"\n    },\n    \"status\": \"FAILURE\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "response_key": {
                          "type": "string",
                          "example": "missing_input_file"
                        },
                        "message": {
                          "type": "string",
                          "example": "Missing input file in the request"
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "example": "FAILURE"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "65e59db4d5a4dc005d972404:682f2f774e92e00027915a7a"
}
```