---
title: "Upload a remittance file"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a remittance file

Path: Nicer API › Commerce

`POST /commerce/remittance-batches`

URL: `https://api.nicer.travel/commerce/remittance-batches`

Registers a remittance file (CSV, TSV, TXT or XLSX, up to 100 MiB: a clearinghouse or chain statement, an EFT detail) and answers a presigned upload. Once S3 has the file, a worker reads it into draft remittances and lines and matches them (status PARSING, then READY); without a preset it stops at UPLOADED with the column names until APPLY_MAPPING. The same file twice answers 409 COMMISSION_FILE_ALREADY_IMPORTED. Poll `GET /remittance-batches/{batchId}`. Agency admins and finance staff.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Header parameters

- `Idempotency-Key` (`commerce.remittanceBatches.create.header.Idempotency-Key`; string, required) — Unique key (8–255 chars) per request; replays return the original result.
- `x-nicer-company` (`commerce.remittanceBatches.create.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.

## Request body

_Required._

- `channel` (`commerce.remittanceBatches.create.channel`; string, required)
  - one of `"ARC"`, `"BSP"`, `"CHECK"`, `"ACH"`, `"WIRE"`, `"CARD"`, `"STRIPE"`, `"CASH"`, `"HOST_STATEMENT"`, `"OTHER"`
- `fileName` (`commerce.remittanceBatches.create.fileName`; string, required)
  - maxLength: `255` · minLength: `1`
- `format` (`commerce.remittanceBatches.create.format`; string, required)
  - one of `"CSV"`, `"TSV"`, `"TXT"`, `"XLSX"`
- `sha256` (`commerce.remittanceBatches.create.sha256`; string, required)
  - pattern: `^[0-9a-f]{64}$`
- `sizeBytes` (`commerce.remittanceBatches.create.sizeBytes`; integer, required)
  - maximum: `104857600` · minimum: `1`
- `presetId` (`commerce.remittanceBatches.create.presetId`; any of, optional)
  - any of the following: `string`, `null`
- `source` (`commerce.remittanceBatches.create.source`; string, optional)
  - one of `"FILE_IMPORT"`

## Example request

```json
{
  "channel": "ARC",
  "fileName": "string",
  "format": "CSV",
  "presetId": "string",
  "sha256": "string",
  "sizeBytes": 1,
  "source": "FILE_IMPORT"
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
  headers: { "Idempotency-Key": process.env.NICER_IDEMPOTENCY_KEY, "x-nicer-company": process.env.NICER_COMPANY },
});

await nicer.commerce.remittanceBatches.create({
  "channel": "ARC",
  "fileName": "string",
  "format": "CSV",
  "sha256": "string",
  "sizeBytes": 1
});
```

### Nicer CLI

```bash
nicer commerce remittance-batches create --company "$NICER_COMPANY" --input - <<'JSON'
{
  "channel": "ARC",
  "fileName": "string",
  "format": "CSV",
  "sha256": "string",
  "sizeBytes": 1
}
JSON
```

### cURL

```bash
curl --request POST \
  --url https://api.nicer.travel/commerce/remittance-batches \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --header 'x-nicer-company: string' \
  --data '
{
  "channel": "ARC",
  "fileName": "string",
  "format": "CSV",
  "presetId": "string",
  "sha256": "string",
  "sizeBytes": 1,
  "source": "FILE_IMPORT"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/commerce/remittance-batches';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'string',
    'x-nicer-company': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    channel: 'ARC',
    fileName: 'string',
    format: 'CSV',
    presetId: 'string',
    sha256: 'string',
    sizeBytes: 1,
    source: 'FILE_IMPORT'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/commerce/remittance-batches"

payload = {
    "channel": "ARC",
    "fileName": "string",
    "format": "CSV",
    "presetId": "string",
    "sha256": "string",
    "sizeBytes": 1,
    "source": "FILE_IMPORT"
}
headers = {
    "Content-Type": "application/json",
    "Idempotency-Key": "string",
    "x-nicer-company": "string",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "batch": {
    "committedAt": "2019-08-24T14:15:22Z",
    "companyName": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "createdByUserId": "string",
    "errorCode": "string",
    "fileName": "string",
    "format": "CSV",
    "headers": [
      "string"
    ],
    "jobId": "string",
    "presetId": "string",
    "sizeBytes": 9007199254740991,
    "source": "FILE_IMPORT",
    "status": "AWAITING_UPLOAD",
    "updatedAt": "2019-08-24T14:15:22Z",
    "allowedActions": [
      "APPLY_MAPPING"
    ],
    "batchId": "string",
    "channel": "ARC",
    "committedByUserId": "string",
    "mapping": {
      "columns": {
        "property1": "string",
        "property2": "string"
      },
      "defaults": {
        "property1": "string",
        "property2": "string"
      },
      "dateFormat": "ISO",
      "decimalSeparator": ".",
      "headerRow": 1,
      "sheet": "string"
    },
    "number": "string",
    "parsedAt": "2019-08-24T14:15:22Z",
    "stats": {
      "excluded": 9007199254740991,
      "invalid": 9007199254740991,
      "invalidRows": [
        {
          "errors": [
            {
              "code": "REQUIRED",
              "field": "amount"
            }
          ],
          "rowNumber": 9007199254740991
        }
      ],
      "lines": 9007199254740991,
      "matched": 9007199254740991,
      "pendingReview": 9007199254740991,
      "proposed": 9007199254740991,
      "totals": [
        {
          "amountMinor": -9007199254740991,
          "currency": "string",
          "matchedMinor": -9007199254740991
        }
      ],
      "unmatched": 9007199254740991,
      "zero": 9007199254740991
    },
    "undoneAt": "2019-08-24T14:15:22Z"
  },
  "upload": {
    "expiresAt": "2019-08-24T14:15:22Z",
    "headers": {
      "property1": "string",
      "property2": "string"
    },
    "method": "PUT",
    "url": "http://example.com"
  }
}
```

- `batch` (`commerce.remittanceBatches.create.response.200.batch`; object, required)
  - `committedAt` (`commerce.remittanceBatches.create.response.200.batch.committedAt`; any of, required)
    - any of the following: `string`, `null`
  - `companyName` (`commerce.remittanceBatches.create.response.200.batch.companyName`; string, required)
    - minLength: `1`
  - `createdAt` (`commerce.remittanceBatches.create.response.200.batch.createdAt`; string, required)
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `createdByUserId` (`commerce.remittanceBatches.create.response.200.batch.createdByUserId`; string, required)
    - minLength: `1`
  - `errorCode` (`commerce.remittanceBatches.create.response.200.batch.errorCode`; any of, required)
    - any of the following: `string`, `null`
  - `fileName` (`commerce.remittanceBatches.create.response.200.batch.fileName`; string, required)
    - minLength: `1`
  - `format` (`commerce.remittanceBatches.create.response.200.batch.format`; string, required)
    - one of `"CSV"`, `"TSV"`, `"TXT"`, `"XLSX"`
  - `headers` (`commerce.remittanceBatches.create.response.200.batch.headers`; array of string, required)
  - `jobId` (`commerce.remittanceBatches.create.response.200.batch.jobId`; any of, required)
    - any of the following: `string`, `null`
  - `presetId` (`commerce.remittanceBatches.create.response.200.batch.presetId`; any of, required)
    - any of the following: `string`, `null`
  - `sizeBytes` (`commerce.remittanceBatches.create.response.200.batch.sizeBytes`; integer, required)
    - maximum: `9007199254740991`
  - `source` (`commerce.remittanceBatches.create.response.200.batch.source`; string, required)
    - one of `"FILE_IMPORT"`
  - `status` (`commerce.remittanceBatches.create.response.200.batch.status`; string, required)
    - one of `"AWAITING_UPLOAD"`, `"UPLOADED"`, `"PARSING"`, `"READY"`, `"COMMITTING"`, `"COMMITTED"`, `"UNDONE"`, `"DISCARDED"`, `"FAILED"`
  - `updatedAt` (`commerce.remittanceBatches.create.response.200.batch.updatedAt`; string, required)
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `allowedActions` (`commerce.remittanceBatches.create.response.200.batch.allowedActions`; array of string, required)
    - one of `"APPLY_MAPPING"`, `"SAVE_PRESET"`, `"EDIT_LINE"`, `"EXCLUDE_LINE"`, `"INCLUDE_LINE"`, `"SET_MATCH"`, `"RESET_MATCHES"`, `"RERUN_MATCHING"`, `"RECONCILE"`, `"UNDO_RECONCILE"`, `"DISCARD"`
  - `batchId` (`commerce.remittanceBatches.create.response.200.batch.batchId`; string, required)
    - minLength: `1`
  - `channel` (`commerce.remittanceBatches.create.response.200.batch.channel`; string, required)
    - one of `"ARC"`, `"BSP"`, `"CHECK"`, `"ACH"`, `"WIRE"`, `"CARD"`, `"STRIPE"`, `"CASH"`, `"HOST_STATEMENT"`, `"OTHER"`
  - `committedByUserId` (`commerce.remittanceBatches.create.response.200.batch.committedByUserId`; any of, required)
    - any of the following: `string`, `null`
  - `mapping` (`commerce.remittanceBatches.create.response.200.batch.mapping`; any of, required)
    - any of the following:
      - `RemittanceImportMapping`
        - `columns` (`RemittanceImportMapping.columns`; map of string, required)
        - `defaults` (`RemittanceImportMapping.defaults`; map of string, required)
        - `dateFormat` (`RemittanceImportMapping.dateFormat`; string, required)
          - one of `"ISO"`, `"US"`, `"EU"`
        - `decimalSeparator` (`RemittanceImportMapping.decimalSeparator`; string, required)
          - one of `"."`, `","`
        - `headerRow` (`RemittanceImportMapping.headerRow`; integer, required)
          - maximum: `50` · minimum: `1`
        - `sheet` (`RemittanceImportMapping.sheet`; any of, required)
          - any of the following: `string`, `null`
      - `null`
  - `number` (`commerce.remittanceBatches.create.response.200.batch.number`; string, required)
    - minLength: `1`
  - `parsedAt` (`commerce.remittanceBatches.create.response.200.batch.parsedAt`; any of, required)
    - any of the following: `string`, `null`
  - `stats` (`commerce.remittanceBatches.create.response.200.batch.stats`; object, required)
    - `excluded` (`commerce.remittanceBatches.create.response.200.batch.stats.excluded`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
    - `invalid` (`commerce.remittanceBatches.create.response.200.batch.stats.invalid`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
    - `invalidRows` (`commerce.remittanceBatches.create.response.200.batch.stats.invalidRows`; array of object, required)
      - `errors` (`commerce.remittanceBatches.create.response.200.batch.stats.invalidRows.errors`; array of object, required)
        - `code` (`commerce.remittanceBatches.create.response.200.batch.stats.invalidRows.errors.code`; string, required)
          - one of `"REQUIRED"`, `"INVALID_AMOUNT"`, `"INVALID_DATE"`, `"INVALID_RATE"`, `"INVALID_VALUE"`
        - `field` (`commerce.remittanceBatches.create.response.200.batch.stats.invalidRows.errors.field`; string, required)
          - one of `"amount"`, `"bookingGross"`, `"checkIn"`, `"checkOut"`, `"clientName"`, `"confirmationNumber"`, `"currency"`, `"fee"`, `"fxRate"`, `"identifierNumber"`, `"originalAmount"`, `"originalCurrency"`, `"payableOn"`, `"payerName"`, `"paymentReference"`, `"rate"`, `"receivedOn"`, `"supplierName"`
      - `rowNumber` (`commerce.remittanceBatches.create.response.200.batch.stats.invalidRows.rowNumber`; integer, required)
        - maximum: `9007199254740991`
    - `lines` (`commerce.remittanceBatches.create.response.200.batch.stats.lines`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
    - `matched` (`commerce.remittanceBatches.create.response.200.batch.stats.matched`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
    - `pendingReview` (`commerce.remittanceBatches.create.response.200.batch.stats.pendingReview`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
    - `proposed` (`commerce.remittanceBatches.create.response.200.batch.stats.proposed`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
    - `totals` (`commerce.remittanceBatches.create.response.200.batch.stats.totals`; array of object, required)
      - `amountMinor` (`commerce.remittanceBatches.create.response.200.batch.stats.totals.amountMinor`; integer, required)
        - maximum: `9007199254740991` · minimum: `-9007199254740991`
      - `currency` (`commerce.remittanceBatches.create.response.200.batch.stats.totals.currency`; string, required)
        - pattern: `^[A-Z]{3}$`
      - `matchedMinor` (`commerce.remittanceBatches.create.response.200.batch.stats.totals.matchedMinor`; integer, required)
        - maximum: `9007199254740991` · minimum: `-9007199254740991`
    - `unmatched` (`commerce.remittanceBatches.create.response.200.batch.stats.unmatched`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
    - `zero` (`commerce.remittanceBatches.create.response.200.batch.stats.zero`; integer, required)
      - maximum: `9007199254740991` · minimum: `0`
  - `undoneAt` (`commerce.remittanceBatches.create.response.200.batch.undoneAt`; any of, required)
    - any of the following: `string`, `null`
- `upload` (`commerce.remittanceBatches.create.response.200.upload`; object, required)
  - `expiresAt` (`commerce.remittanceBatches.create.response.200.upload.expiresAt`; string, required)
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `headers` (`commerce.remittanceBatches.create.response.200.upload.headers`; map of string, required)
  - `method` (`commerce.remittanceBatches.create.response.200.upload.method`; string, required)
  - `url` (`commerce.remittanceBatches.create.response.200.upload.url`; string, required)
    - format: `uri`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.remittanceBatches.create.response.400.errorCode`; string, required)
- `errorMessage` (`commerce.remittanceBatches.create.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.remittanceBatches.create.response.401.errorCode`; string, required)
- `errorMessage` (`commerce.remittanceBatches.create.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.remittanceBatches.create.response.403.errorCode`; string, required)
- `errorMessage` (`commerce.remittanceBatches.create.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Commerce/commerce.remittanceBatches.create/index.md
