# Import journal entries from another system

`POST https://api.fiscalisto.com/v1/accounting/manual_entry_imports`

Up to 3,000 journal entries at once (those from CONTPAQi, COI or a spreadsheet), all or none: each with the rules of POST /v1/accounting/manual_entries, and the error says which one (param entries[i].…). They come in as kind other. One with the same number, date, type and total as one already imported is skipped (duplicates). DELETE /v1/accounting/manual_entry_imports/{id} removes those of an import.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | header |  | Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge). |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `issuer` | string |  | The issuer (iss_…). By default, your only issuer. |
| `entries` | array of object | yes | The journal entries, up to 3,000. (up to 3000) |
| `entries[].date` | string | yes | The journal entry's date (YYYY-MM-DD). |
| `entries[].journal_type` | `journal`, `income`, `expense` |  | The journal entry type: journal, income or expense. (default "journal") |
| `entries[].number` | string or null |  | Its number in the other system (for example Dr 15). With the date, the type and the total, it recognizes a journal entry already imported and skips it. |
| `entries[].description` | string | yes | Its description. (up to 300 characters) |
| `entries[].lines` | array of object | yes | Its debits and credits: each line one or the other; debits add up the same as credits. (up to 500) |
| `entries[].lines[].account` | string | yes | The account's number in your catalog (GET /v1/accounting/accounts), for example 205-06. (up to 100 characters) |
| `entries[].lines[].debit` | number |  | The debit. (from 0 to 1000000000000; default 0) |
| `entries[].lines[].credit` | number |  | The credit. (from 0 to 1000000000000; default 0) |
| `entries[].lines[].cost_center` | string or null |  | Its cost center (ccn_…, GET /v1/cost_centers), optional: results by cost center and budgets read it. |
| `entries[].lines[].currency` | string or null |  | A line in another currency: its ISO 4217 key (USD, EUR…). With it go foreign_amount and exchange_rate, and debit or credit is their product in pesos. |
| `entries[].lines[].foreign_amount` | number or null |  | The line's amount in its currency. |
| `entries[].lines[].exchange_rate` | number or null |  | The line's exchange rate: pesos per unit of its currency. |
| `entries[].lines[].cfdi_uuid` | string or null |  | The CFDI that documents this line, apart from the entry's: that way an entry carries several. |
| `entries[].lines[].cfdi_tax_id` | string or null |  | The RFC of whoever issued or received the line's CFDI. |

Example:

```json
{
  "entries": [
    {
      "date": "2026-01-05",
      "journal_type": "expense",
      "number": "Eg 1",
      "description": "Pago de renta de enero",
      "lines": [
        {
          "account": "205-06",
          "debit": 11600
        },
        {
          "account": "102-01",
          "credit": 11600
        }
      ]
    },
    {
      "date": "2026-01-31",
      "journal_type": "journal",
      "number": "Dr 4",
      "description": "Provisión de honorarios de enero",
      "lines": [
        {
          "account": "601-84",
          "debit": 5000
        },
        {
          "account": "205-06",
          "credit": 5000
        }
      ]
    }
  ]
}
```

## With the TypeScript SDK

```ts
import { Fiscalisto } from "fiscalisto";

// La llave viene de FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const manualEntryImport = await fiscalisto.manualEntries.importEntries({
  entries: [
    {
      date: "2026-01-05",
      journal_type: "expense",
      number: "Eg 1",
      description: "Pago de renta de enero",
      lines: [
        { account: "205-06", debit: 11600 },
        { account: "102-01", credit: 11600 },
      ],
    },
    {
      date: "2026-01-31",
      journal_type: "journal",
      number: "Dr 4",
      description: "Provisión de honorarios de enero",
      lines: [
        { account: "601-84", debit: 5000 },
        { account: "205-06", credit: 5000 },
      ],
    },
  ],
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

# La llave viene de FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

manual_entry_import = fiscalisto.manual_entries.import_entries({
    "entries": [
        {
            "date": "2026-01-05",
            "journal_type": "expense",
            "number": "Eg 1",
            "description": "Pago de renta de enero",
            "lines": [
                {
                    "account": "205-06",
                    "debit": 11600,
                },
                {
                    "account": "102-01",
                    "credit": 11600,
                },
            ],
        },
        {
            "date": "2026-01-31",
            "journal_type": "journal",
            "number": "Dr 4",
            "description": "Provisión de honorarios de enero",
            "lines": [
                {
                    "account": "601-84",
                    "debit": 5000,
                },
                {
                    "account": "205-06",
                    "credit": 5000,
                },
            ],
        },
    ],
}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$manualEntryImport = $fiscalisto->manualEntries->importEntries([
    'entries' => [
        [
            'date' => '2026-01-05',
            'journal_type' => 'expense',
            'number' => 'Eg 1',
            'description' => 'Pago de renta de enero',
            'lines' => [
                [
                    'account' => '205-06',
                    'debit' => 11600,
                ],
                [
                    'account' => '102-01',
                    'credit' => 11600,
                ],
            ],
        ],
        [
            'date' => '2026-01-31',
            'journal_type' => 'journal',
            'number' => 'Dr 4',
            'description' => 'Provisión de honorarios de enero',
            'lines' => [
                [
                    'account' => '601-84',
                    'debit' => 5000,
                ],
                [
                    'account' => '205-06',
                    'credit' => 5000,
                ],
            ],
        ],
    ],
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var manualEntryImport = await fiscalisto.ManualEntries.ImportEntriesAsync(new ImportManualEntriesParams
{
    Entries = new()
    {
        new()
        {
            Date = "2026-01-05",
            JournalType = "expense",
            Number = "Eg 1",
            Description = "Pago de renta de enero",
            Lines = new()
            {
                new() { Account = "205-06", Debit = 11600 },
                new() { Account = "102-01", Credit = 11600 },
            },
        },
        new()
        {
            Date = "2026-01-31",
            JournalType = "journal",
            Number = "Dr 4",
            Description = "Provisión de honorarios de enero",
            Lines = new()
            {
                new() { Account = "601-84", Debit = 5000 },
                new() { Account = "205-06", Credit = 5000 },
            },
        },
    },
}, new RequestOptions { IdempotencyKey = "pedido-A-1042" });
```

## With the Go SDK

```go
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// La llave viene de FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	manualEntryImport, err := client.ManualEntries.ImportEntries(ctx, &fiscalisto.ImportManualEntriesParams{
		Entries: []fiscalisto.ImportManualEntriesParamsEntry{
			{
				Date:        "2026-01-05",
				JournalType: fiscalisto.String("expense"),
				Number:      fiscalisto.String("Eg 1"),
				Description: "Pago de renta de enero",
				Lines: []fiscalisto.ImportManualEntriesParamsEntryLine{
					{Account: "205-06", Debit: fiscalisto.Float64(11600)},
					{Account: "102-01", Credit: fiscalisto.Float64(11600)},
				},
			},
			{
				Date:        "2026-01-31",
				JournalType: fiscalisto.String("journal"),
				Number:      fiscalisto.String("Dr 4"),
				Description: "Provisión de honorarios de enero",
				Lines: []fiscalisto.ImportManualEntriesParamsEntryLine{
					{Account: "601-84", Debit: fiscalisto.Float64(5000)},
					{Account: "205-06", Credit: fiscalisto.Float64(5000)},
				},
			},
		},
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(manualEntryImport.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.ImportManualEntriesParams;
import com.fiscalisto.model.ImportManualEntriesParamsEntry;
import com.fiscalisto.model.ImportManualEntriesParamsEntryLine;
import java.util.List;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var manualEntryImport = fiscalisto.manualEntries().importEntries(new ImportManualEntriesParams()
        .setEntries(List.of(
                new ImportManualEntriesParamsEntry()
                        .setDate("2026-01-05")
                        .setJournalType("expense")
                        .setNumber("Eg 1")
                        .setDescription("Pago de renta de enero")
                        .setLines(List.of(
                                new ImportManualEntriesParamsEntryLine()
                                        .setAccount("205-06")
                                        .setDebit(11600),
                                new ImportManualEntriesParamsEntryLine()
                                        .setAccount("102-01")
                                        .setCredit(11600)
                        )),
                new ImportManualEntriesParamsEntry()
                        .setDate("2026-01-31")
                        .setJournalType("journal")
                        .setNumber("Dr 4")
                        .setDescription("Provisión de honorarios de enero")
                        .setLines(List.of(
                                new ImportManualEntriesParamsEntryLine()
                                        .setAccount("601-84")
                                        .setDebit(5000),
                                new ImportManualEntriesParamsEntryLine()
                                        .setAccount("205-06")
                                        .setCredit(5000)
                        ))
        )), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(manualEntryImport.getId());
```

## Response 201

OK.

A `ManualEntryImport` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string or null | yes | The import (mji_…), to undo it; null if all journal entries were already there. |
| `object` | `"manual_entry_import"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer. |
| `imported` | integer | yes | How many journal entries came in. (from -9007199254740991 to 9007199254740991) |
| `duplicates` | integer | yes | How many were skipped because they were already imported. (from -9007199254740991 to 9007199254740991) |
| `from` | string | yes | The date of the file's first journal entry. |
| `to` | string | yes | The date of the last one. |
| `manual_entries` | array of string | yes | The journal entries that came in (mje_…). |

```json
{
  "id": "mji_OufpKqnrvx9p3Hd7Vk2Ny8Pq1aLcWs5R0f",
  "object": "manual_entry_import",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "imported": 2,
  "duplicates": 0,
  "from": "2026-01-05",
  "to": "2026-01-31",
  "manual_entries": [
    "mje_OufpKqnrvx9p1Yc4Wm9Qx2Lr7aZbNs3T0e",
    "mje_OufpKqnrvx9p2Zd5Xn0Ry3Ms8bAcOt4U1f"
  ]
}
```

## Errors

- `account_missing` (400): That account isn't in the issuer's chart of accounts: see it with GET /v1/accounting/accounts or add it with POST /v1/accounting/accounts.
- `asset_already_disposed` (400): The fixed asset was already sold or written off: undo that with DELETE /v1/accounting/fixed_assets/{id}/disposal if it was a mistake.
- `asset_not_disposed` (400): The fixed asset isn't disposed of: there's no disposal to undo.
- `bank_movement_not_bookable` (400): That movement doesn't go to the books this way: a deposit must be classified in the reconciliation as a loan, transfer, refund or interest (its invoice explains the rest), and a withdrawal marked as paid invoices or ignored goes back to pending first.
- `bank_movement_not_posted` (400): That bank movement has no journal entry: there's nothing to remove.
- `bank_movement_posted` (400): That bank movement already has its journal entry: remove it with DELETE /v1/accounting/bank_movements/{id}/post to book it to another account.
- `entry_unbalanced` (400): The journal entry doesn't balance or a line is wrong: debits must add up to the same as credits, and each line has a debit or a credit, not both. The message gives the sums.
- `feature_not_in_plan` (403): Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.
- `issuer_archived` (400): The issuer is archived and no longer stamps. Its documents can still be read and canceled.
- `issuer_linked_empresa` (403): That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.
- `issuer_missing` (404): There is no such issuer in the account (or it belongs to the other mode).
- `issuer_not_allowed` (403): This key can't use that issuer.
- `issuer_required` (400): The account has several issuers and the request doesn't say which: send `issuer` (iss_…).
- `livemode_mismatch` (400): The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.
- `period_closed` (400): That month of the books is closed: nothing dated in it can be booked, changed or deleted. Reopen it with POST /v1/accounting/closed_period to correct it.

Plus those of any call (key, fields, limits): https://fiscalisto.com/en/docs/api/errores.md.
