# Change a template entry

`POST https://api.fiscalisto.com/v1/accounting/entry_templates/{id}`

Replaces it with what you send. The journal entries already made with it don't change.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | The object's id. |
| `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 |
| --- | --- | --- | --- |
| `name` | string | yes | The template's name, unique within the issuer: «Compra con IVA al 16%». (up to 80 characters) |
| `description` | string | yes | The description of the journal entries made with it. (up to 300 characters) |
| `kind` | `adjustment`, `accrual`, `reclassification`, `other` |  | adjustment, accrual, reclassification or other. (default "adjustment") |
| `journal_type` | `journal`, `income`, `expense` |  | The journal entry type: journal, income or expense. (default "journal") |
| `lines` | array of object | yes | Its lines: the account, the side and the percentage of the total or the fixed amount. (up to 100) |
| `lines[].account` | string | yes | The account's number in your catalog (GET /v1/accounting/accounts). (up to 100 characters) |
| `lines[].side` | `debit`, `credit` | yes | Whether the line is a debit or a credit. |
| `lines[].percentage` | number or null |  | The percentage of the total it carries (86.2069 is 86.2069%). A side's add up to 100 at most. |
| `lines[].amount` | number or null |  | A fixed amount, when it doesn't depend on the total. Without percentage or amount, the line comes out at 0 to type it each time. |
| `lines[].cost_center` | string or null |  | Its cost center (ccn_…, GET /v1/cost_centers), optional. |

Example:

```json
{
  "name": "Compra con IVA al 16%",
  "description": "Compra de papelería",
  "kind": "other",
  "journal_type": "expense",
  "lines": [
    {
      "account": "601-84",
      "side": "debit",
      "percentage": 86.2069
    },
    {
      "account": "118-01",
      "side": "debit",
      "percentage": 13.7931
    },
    {
      "account": "102-01",
      "side": "credit",
      "percentage": 100
    }
  ]
}
```

## With the TypeScript SDK

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

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

const entryTemplate = await fiscalisto.entryTemplates.update("mjt_OufpKqnrvx9p1", {
  name: "Compra con IVA al 16%",
  description: "Compra de papelería",
  kind: "other",
  journal_type: "expense",
  lines: [
    {
      account: "601-84",
      side: "debit",
      percentage: 86.2069,
    },
    {
      account: "118-01",
      side: "debit",
      percentage: 13.7931,
    },
    {
      account: "102-01",
      side: "credit",
      percentage: 100,
    },
  ],
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

entry_template = fiscalisto.entry_templates.update("mjt_OufpKqnrvx9p1", {
    "name": "Compra con IVA al 16%",
    "description": "Compra de papelería",
    "kind": "other",
    "journal_type": "expense",
    "lines": [
        {
            "account": "601-84",
            "side": "debit",
            "percentage": 86.2069,
        },
        {
            "account": "118-01",
            "side": "debit",
            "percentage": 13.7931,
        },
        {
            "account": "102-01",
            "side": "credit",
            "percentage": 100,
        },
    ],
}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$entryTemplate = $fiscalisto->entryTemplates->update('mjt_OufpKqnrvx9p1', [
    'name' => 'Compra con IVA al 16%',
    'description' => 'Compra de papelería',
    'kind' => 'other',
    'journal_type' => 'expense',
    'lines' => [
        [
            'account' => '601-84',
            'side' => 'debit',
            'percentage' => 86.2069,
        ],
        [
            'account' => '118-01',
            'side' => 'debit',
            'percentage' => 13.7931,
        ],
        [
            'account' => '102-01',
            'side' => 'credit',
            'percentage' => 100,
        ],
    ],
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var entryTemplate = await fiscalisto.EntryTemplates.UpdateAsync("mjt_OufpKqnrvx9p1", new UpdateEntryTemplateParams
{
    Name = "Compra con IVA al 16%",
    Description = "Compra de papelería",
    Kind = "other",
    JournalType = "expense",
    Lines = new()
    {
        new()
        {
            Account = "601-84",
            Side = "debit",
            Percentage = 86.2069m,
        },
        new()
        {
            Account = "118-01",
            Side = "debit",
            Percentage = 13.7931m,
        },
        new()
        {
            Account = "102-01",
            Side = "credit",
            Percentage = 100,
        },
    },
}, 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()

	entryTemplate, err := client.EntryTemplates.Update(ctx, "mjt_OufpKqnrvx9p1", &fiscalisto.UpdateEntryTemplateParams{
		Name:        "Compra con IVA al 16%",
		Description: "Compra de papelería",
		Kind:        fiscalisto.String("other"),
		JournalType: fiscalisto.String("expense"),
		Lines: []fiscalisto.UpdateEntryTemplateParamsLine{
			{
				Account:    "601-84",
				Side:       "debit",
				Percentage: fiscalisto.Float64(86.2069),
			},
			{
				Account:    "118-01",
				Side:       "debit",
				Percentage: fiscalisto.Float64(13.7931),
			},
			{
				Account:    "102-01",
				Side:       "credit",
				Percentage: fiscalisto.Float64(100),
			},
		},
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(entryTemplate.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.UpdateEntryTemplateParams;
import com.fiscalisto.model.UpdateEntryTemplateParamsLine;
import java.util.List;

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

var entryTemplate = fiscalisto.entryTemplates().update("mjt_OufpKqnrvx9p1", new UpdateEntryTemplateParams()
        .setName("Compra con IVA al 16%")
        .setDescription("Compra de papelería")
        .setKind("other")
        .setJournalType("expense")
        .setLines(List.of(
                new UpdateEntryTemplateParamsLine()
                        .setAccount("601-84")
                        .setSide("debit")
                        .setPercentage(86.2069),
                new UpdateEntryTemplateParamsLine()
                        .setAccount("118-01")
                        .setSide("debit")
                        .setPercentage(13.7931),
                new UpdateEntryTemplateParamsLine()
                        .setAccount("102-01")
                        .setSide("credit")
                        .setPercentage(100)
        )), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(entryTemplate.getId());
```

## Response 200

OK.

A `EntryTemplate` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `object` | `"entry_template"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer` | string | yes | The issuer. |
| `name` | string | yes | The template's name. |
| `description` | string | yes | The description of the journal entries made with it. |
| `kind` | `adjustment`, `accrual`, `reclassification`, `other` | yes | The class of journal entries made with it: adjustment, accrual, reclassification or other. |
| `journal_type` | `journal`, `income`, `expense` | yes | Its journal entry type: journal, income or expense. |
| `lines` | array of object | yes | Its lines: the account, the side and the percentage or fixed amount. |
| `lines[].account` | string | yes | The account number. |
| `lines[].account_name` | string | yes | The account name. |
| `lines[].side` | `debit`, `credit` | yes | Whether the line is a debit or a credit. |
| `lines[].percentage` | number or null | yes | The percentage of the total it carries, or null. |
| `lines[].amount` | number or null | yes | Its fixed amount, or null. |
| `lines[].cost_center` | string or null | yes | Its cost center (ccn_…), or null. |
| `updated_at` | string (date-time) or null | yes | When it last changed. |

```json
{
  "id": "mjt_OufpKqnrvx9p1",
  "object": "entry_template",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "name": "Compra con IVA al 16%",
  "description": "Compra de papelería",
  "kind": "other",
  "journal_type": "expense",
  "lines": [
    {
      "account": "601-84",
      "account_name": "Otros gastos generales",
      "side": "debit",
      "percentage": 86.2069,
      "amount": null,
      "cost_center": null
    },
    {
      "account": "118-01",
      "account_name": "IVA acreditable pagado",
      "side": "debit",
      "percentage": 13.7931,
      "amount": null,
      "cost_center": null
    },
    {
      "account": "102-01",
      "account_name": "Bancos nacionales",
      "side": "credit",
      "percentage": 100,
      "amount": null,
      "cost_center": null
    }
  ],
  "updated_at": "2026-11-20T10:15:00-06:00"
}
```

## 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.
- `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.
- `resource_missing` (404): There's no object with that id (or it belongs to another issuer or the other mode).

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