> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/classic-tokenization/use-cases/synchronize-tokens-using-batch-files/output-batch-file-structure.md).

# Output batch file structure

## Output batch file structure <a href="#batch-file-output-structure" id="batch-file-output-structure"></a>

The output file has a similar structure to the input batch file.

The output file structure is as follows:

| NAME           | TYPE   | SIZE | M/O/C | DESCRIPTION                                                                                                                                  |
| -------------- | ------ | ---- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| header         | Object | -    | M     | Summary of token synchronization results.                                                                                                    |
| recordsResults | Array  | -    | C     | <p>An array of records.<br>Each record contains the result of the operation. This field may not be present if a file-level error occurs.</p> |

### Header <a href="#header" id="header"></a>

The header has the following structure:

| NAME         | TYPE    | SIZE | M/O/C | DESCRIPTION                                                                                                                                                |
| ------------ | ------- | ---- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| batchId      | String  | 48   | M     | Identifier from the input file batch header.                                                                                                               |
| seqNumber    | String  | 48   | M     | Sequence number from the input file batch header.                                                                                                          |
| issuerId     | String  | 48   | M     | Issuer identifier from the input file batch header.                                                                                                        |
| operation    | String  | 48   | M     | Operation from the input file batch header.                                                                                                                |
| totalRecords | Integer | N/A  | M     | Total number of records included in the report.                                                                                                            |
| errorCode    | String  | 3    | C     | Present only when a file-level error occurs. See [Error codes](/classic-tokenization/use-cases/synchronize-tokens-using-batch-files/error-codes-table.md). |

### Record results <a href="#records-result" id="records-result"></a>

Each record has the following structure:

| NAME                          | TYPE    | SIZE | M/O/C | DESCRIPTION                             |
| ----------------------------- | ------- | ---- | ----- | --------------------------------------- |
| rowId                         | Integer | -    | M     | Value provided in the input batch file. |
| virtualCardRegistrationResult | Object  | -    | M     |                                         |

#### Virtual card registration result <a href="#virtual-card-registration-result" id="virtual-card-registration-result"></a>

| NAME      | TYPE          | SIZE | M/O/C | DESCRIPTION                                                                                                                                              |
| --------- | ------------- | ---- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status    | String        | 2    | M     | <p>- OK (Batch registration completes successfully.)<br>- KO (Batch registration fails.)</p>                                                             |
| card      | Card (Object) | N/A  | M     | Object containing the card identification data and the result.                                                                                           |
| errorCode | String        | 3    | C     | Error code returned when `status` is `KO`. See [Error codes](/classic-tokenization/use-cases/synchronize-tokens-using-batch-files/error-codes-table.md). |

**Card**

| NAME           | TYPE            | SIZE   | M/O/C | DESCRIPTION                                                                                                                                              |
| -------------- | --------------- | ------ | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id             | String          | 1...48 | M     | Unique identifier assigned by the Issuer.                                                                                                                |
| status         | String          | 2      | M     | <p>- OK (Card record registration completes successfully.)<br>- KO (Card record registration fails.)</p>                                                 |
| virtualCardIds | Array of String | N/A    | O     | List of virtual card IDs that TIG registers for the card.                                                                                                |
| errorCode      | String          | 3      | C     | Error code returned when `status` is `KO`. See [Error codes](/classic-tokenization/use-cases/synchronize-tokens-using-batch-files/error-codes-table.md). |

### Batch file example <a href="#batch-file-example" id="batch-file-example"></a>

<br>

```json
{"header":
    {
        "batchId":"0000000000001111111111FF",
        "seqNumber":"001",
        "operation":"VIRTUAL_CARD_REGISTRATION",
        "issuerId":"BANK_PQRST",
        "totalRecords":1
    },
    "recordsResults":
        [
            {"rowId":0,
                "virtualCardRegistrationResult":{
                    "card": {
                                "id":"cms_f71b83a3-75da-4056-82a6-2d6128555463",
                                "status":"OK",
                                "virtualCardIds":["c05f9cf0-40f9-11ee-a782-af4a746b","c05f75e1-40f9-11ee-9761-af4a746b"],
                            }
            }
        ]
}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/classic-tokenization/use-cases/synchronize-tokens-using-batch-files/output-batch-file-structure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
