> For the complete documentation index, see [llms.txt](https://docs.payshield.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payshield.ai/txfind-payreveal-order-insight-ican/merchant/upload-transaction-batch-file.md).

# Upload Transaction Batch File

<mark style="color:green;">`POST`</mark> `https://{base_url}/api/v2/merchant/{merchantId}/transactionBatch`

The **Request Body** must include a file named`transactionsFile`, which contains a batch of transaction details. The file should be in JSON format, with each entry representing a single transaction.

This endpoint is used to upload and validate a batch of transactions for a specified merchant. It performs general validation and mandatory field checks on the transaction data. If all validations pass, a success message is returned. Otherwise, detailed error messages are provided for any validation failures.

### **Headers**

| Name          | Value                 |
| ------------- | --------------------- |
| Content-Type  | `multipart/form-data` |
| Authorization | `Bearer <token>`      |

### Path Parameters

| Name         | Description                                   |
| ------------ | --------------------------------------------- |
| `merchantId` | Merchant Id for transaction batch file upload |

### **Body**

<table data-full-width="true"><thead><tr><th>Name</th><th>Type</th><th width="227">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>transactionsFile</code></td><td>File</td><td>True</td><td>A file that contains transactions</td></tr></tbody></table>

**NOTE: The JSON file data structure inside will be the same as Upload Transaction Batch**

## Upload Transaction Batch File

> Upload a file containing a batch of merchant transactions

```json
{"openapi":"3.0.1","info":{"title":"TxFind API's Version 2 Endpoints","version":"2.0.0"},"tags":[{"name":"Merchant","description":"Call related to merchant transaction."}],"servers":[{"url":"https://{baseUrl}","description":"Current server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/api/v2/merchant/{merchantId}/transactionBatch":{"post":{"tags":["Merchant"],"summary":"Upload Transaction Batch File","description":"Upload a file containing a batch of merchant transactions","operationId":"merchantTransactionBatchFileUpload","parameters":[{"name":"merchantId","in":"path","description":"Merchant Id for transaction batch file upload","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"transactionsFile":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["success","error"]},"index":{"type":"integer","description":"Zero-based position of the transaction in the submitted batch"},"transactionReference":{"type":"string","nullable":true,"description":"Merchant-supplied transaction reference from the submitted record"},"txShieldOICartReference":{"type":"string","description":"PayShield-assigned UUID for the stored record (present on success)"},"msg":{"type":"string","description":"Error description (present on error)"},"reference":{"type":"string","description":"Generated UUID returned on certain error paths (e.g. DynamoDB failure after reference was assigned)"}}}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"msg":{"type":"string"},"error":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payshield.ai/txfind-payreveal-order-insight-ican/merchant/upload-transaction-batch-file.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
