# Update an expense report

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

Changes only what you send: its name, the purpose, the destination and the dates. While it isn't approved.

## Before you call

- **Expense reports in the plan** of your empresa, if your API account belongs to an empresa: it comes with Operaciones, which is added to any paid plan in **Ajustes › Plan y pagos** and comes in Corporativo. In test mode you can already use it.

## 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 |
| --- | --- | --- | --- |
| `title` | string or null |  | Its name. By default, «Viaje a {destination}» or the period. |
| `purpose` | string or null |  | What it was for: SAT asks for the trip to be for the business. |
| `destination` | string or null |  | Where to. |
| `abroad` | boolean |  | Abroad: the meal and lodging caps change. |
| `far` | boolean |  | More than 50 km from where the person works (true by default). Closer, they aren't deductible travel expenses. |
| `start_date` | string or null |  | The departure (or the start of the period). |
| `end_date` | string or null |  | The return (or the end of the period). |

Example:

```json
{
  "purpose": "Visita a clientes y feria"
}
```

## With the TypeScript SDK

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

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

const expenseReport = await fiscalisto.expenseReports.update("exr_OufpKqnrvx9p4", { purpose: "Visita a clientes y feria" }, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

expense_report = fiscalisto.expense_reports.update("exr_OufpKqnrvx9p4", {"purpose": "Visita a clientes y feria"}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$expenseReport = $fiscalisto->expenseReports->update('exr_OufpKqnrvx9p4', ['purpose' => 'Visita a clientes y feria'], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var expenseReport = await fiscalisto.ExpenseReports.UpdateAsync("exr_OufpKqnrvx9p4", new UpdateExpenseReportParams
{
    Purpose = "Visita a clientes y feria",
}, 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()

	expenseReport, err := client.ExpenseReports.Update(ctx, "exr_OufpKqnrvx9p4", &fiscalisto.UpdateExpenseReportParams{
		Purpose: fiscalisto.String("Visita a clientes y feria"),
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(expenseReport.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.UpdateExpenseReportParams;

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

var expenseReport = fiscalisto.expenseReports().update("exr_OufpKqnrvx9p4", new UpdateExpenseReportParams()
        .setPurpose("Visita a clientes y feria"), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(expenseReport.getId());
```

## Response 200

OK.

A `ExpenseReport` 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` | `"expense_report"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer` | string | yes | The issuer. |
| `number` | integer | yes | Its number, sequential per issuer. (from -9007199254740991 to 9007199254740991) |
| `label` | string | yes | How it is shown, for example «VIA-0012». |
| `person` | string | yes | Who is reporting it (exp_…). |
| `person_name` | string | yes | That person's name. |
| `kind` | `viaje`, `gastos` | yes | viaje or gastos (office expenses, for a period). |
| `title` | string | yes | Its name. |
| `purpose` | string or null | yes | What it was for, or null. |
| `destination` | string or null | yes | Where to, or null. |
| `abroad` | boolean | yes | true if it was abroad. |
| `far` | boolean | yes | true if it was more than 50 km from where the person works. |
| `start_date` | string or null | yes | The departure or start of the period (YYYY-MM-DD), or null. |
| `end_date` | string or null | yes | The return or end of the period (YYYY-MM-DD), or null. |
| `status` | `draft`, `submitted`, `rejected`, `approved`, `closed` | yes | draft (open), submitted (awaiting approval), rejected (sent back for correction), approved (awaiting settlement) or closed (closed, with a zero balance). |
| `due_date` | string or null | yes | The deadline to report it (the policy), or null. |
| `submitted_at` | string (date-time) or null | yes | When it was submitted for approval, or null. |
| `decided_at` | string (date-time) or null | yes | When it was approved or sent back, or null. |
| `decision_note` | string or null | yes | The note from whoever approved it or sent it back, or null. |
| `closed_at` | string (date-time) or null | yes | When it was closed, or null. |
| `in_payroll` | boolean | yes | true if it was already reported on a payroll receipt (travel expenses 050 and 081). |
| `spent` | number | yes | What was spent, without the rejected expenses. |
| `rejected` | number | yes | The amount of the rejected expenses. |
| `proven` | number | yes | What was backed by an invoice or foreign receipt. |
| `deductible` | number | yes | What is deductible, with the legal caps. |
| `non_deductible` | number | yes | What isn't deductible (exceeds the caps or has no receipt). |
| `advances` | number | yes | What was given to them as advances. |
| `reimbursed` | number | yes | What was reimbursed to them. |
| `returned` | number | yes | What they returned. |
| `balance` | number | yes | Positive, what the person must return; negative, what the company must reimburse them; 0, settled. What was paid with the company card doesn't count. |
| `ready` | boolean | yes | true if it can be submitted or approved: no expense has errors. |
| `issues` | array of object | yes | Warnings for the whole expense report. |
| `issues[].level` | `error`, `warning`, `policy`, `info` | yes | error (prevents submitting it), warning, policy (exceeds the policy) or info. |
| `issues[].code` | string | yes | What it is, as a stable code. |
| `issues[].message` | string | yes | What it is, in words. |
| `payroll` | object or null | yes | For an employee, how it will go on their payroll receipt (or null). |
| `payroll.exempt` | number | yes | Exempt travel expenses backed by receipts (OtroPago/Percepción 050, ImporteExento). |
| `payroll.taxed` | number | yes | What is taxed as wages (050, ImporteGravado): what was spent without receipts. |
| `payroll.adjustment` | number | yes | What is deducted (deduction 081) for what was already given to them and left over. |
| `payroll.net` | number | yes | What they net collect or pay on the receipt for this expense report. |
| `items` | array of object | yes | Its expenses. |
| `items[].id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `items[].object` | `"expense_item"` | yes | What kind of object it is («invoice», «customer»…). |
| `items[].date` | string | yes | When it was spent (YYYY-MM-DD). |
| `items[].category` | `hospedaje`, `alimentos`, `avion`, `transporte`, `auto`, `combustible`, `comidas`, `papeleria`, `mensajeria`, `software`, `otros` | yes | What it is for: hospedaje, alimentos, avion, transporte, auto, combustible, comidas, papeleria, mensajeria, software or otros. |
| `items[].description` | string or null | yes | What it was (the supplier), or null. |
| `items[].amount` | number | yes | In pesos. |
| `items[].foreign_amount` | number or null | yes | In its currency, or null. |
| `items[].foreign_currency` | string or null | yes | Its currency (USD, EUR…), or null. |
| `items[].people` | integer | yes | How many people ate (for meals the cap is per person). (from -9007199254740991 to 9007199254740991) |
| `items[].payment` | `tarjeta_empresa`, `tarjeta_propia`, `efectivo`, `transferencia`, `otro` or null | yes | How it was paid: tarjeta_empresa, tarjeta_propia, efectivo, transferencia or otro, or null. |
| `items[].receipt` | `cfdi`, `extranjero`, `ticket`, `ninguno` | yes | Its proof: cfdi, extranjero, ticket or ninguno. |
| `items[].uuid` | string or null | yes | The UUID of its invoice, or null. |
| `items[].note` | string or null | yes | The person's note, or null. |
| `items[].rejected` | boolean | yes | true if the approver rejected it. |
| `items[].reject_reason` | string or null | yes | Why it was rejected, or null. |
| `items[].deductible` | number | yes | What is deductible from this expense. |
| `items[].non_deductible` | number | yes | What isn't deductible. |
| `items[].over_policy` | boolean | yes | true if it exceeds a policy cap. |
| `items[].issues` | array of object | yes | Its warnings against the law and the policy. |
| `items[].issues[].level` | `error`, `warning`, `policy`, `info` | yes | error (prevents submitting it), warning, policy (exceeds the policy) or info. |
| `items[].issues[].code` | string | yes | What it is, as a stable code. |
| `items[].issues[].message` | string | yes | What it is, in words. |
| `items[].created_at` | string (date-time) or null | yes | When they were added. |
| `movements` | array of object | yes | The money given to them or returned. |
| `movements[].id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `movements[].object` | `"expense_movement"` | yes | What kind of object it is («invoice», «customer»…). |
| `movements[].kind` | `anticipo`, `reembolso`, `devolucion` | yes | anticipo, reembolso or devolucion. |
| `movements[].amount` | number | yes | In pesos. |
| `movements[].date` | string | yes | When it was paid (YYYY-MM-DD). |
| `movements[].method` | `transferencia`, `efectivo`, `tarjeta`, `nomina` | yes | transferencia, efectivo, tarjeta or nomina (on their payroll receipt). |
| `movements[].reference` | string or null | yes | Its reference, or null. |
| `movements[].in_payroll` | boolean | yes | true if it was already paid on a payroll receipt. |
| `movements[].created_at` | string (date-time) or null | yes | When it was recorded. |
| `created_at` | string (date-time) or null | yes | When it was opened. |
| `updated_at` | string (date-time) or null | yes | When it last changed. |

```json
{
  "id": "exr_OufpKqnrvx9p4",
  "object": "expense_report",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "number": 12,
  "label": "VIA-0012",
  "person": "exp_OufpKqnrvx9p3",
  "person_name": "Ana López Ruiz",
  "kind": "viaje",
  "title": "Viaje a Guadalajara",
  "purpose": "Visita a clientes",
  "destination": "Guadalajara",
  "abroad": false,
  "far": true,
  "start_date": "2026-11-03",
  "end_date": "2026-11-05",
  "status": "approved",
  "due_date": "2026-11-15",
  "submitted_at": "2026-11-06T10:00:00-06:00",
  "decided_at": "2026-11-06T12:30:00-06:00",
  "decision_note": null,
  "closed_at": null,
  "in_payroll": false,
  "spent": 4350,
  "rejected": 0,
  "proven": 4350,
  "deductible": 4350,
  "non_deductible": 0,
  "advances": 3000,
  "reimbursed": 0,
  "returned": 0,
  "balance": -1350,
  "ready": true,
  "issues": [],
  "payroll": null,
  "items": [
    {
      "id": "exi_OufpKqnrvx9p5",
      "object": "expense_item",
      "date": "2026-11-03",
      "category": "hospedaje",
      "description": "HOTEL CENTRO HISTORICO SA DE CV",
      "amount": 3480,
      "foreign_amount": null,
      "foreign_currency": null,
      "people": 1,
      "payment": "tarjeta_propia",
      "receipt": "cfdi",
      "uuid": "6F1C2D3E-4A5B-4C6D-8E9F-0A1B2C3D4E5F",
      "note": null,
      "rejected": false,
      "reject_reason": null,
      "deductible": 3480,
      "non_deductible": 0,
      "over_policy": false,
      "issues": [],
      "created_at": "2026-11-05T21:10:00-06:00"
    }
  ],
  "movements": [
    {
      "id": "exm_OufpKqnrvx9p6",
      "object": "expense_movement",
      "kind": "anticipo",
      "amount": 3000,
      "date": "2026-11-02",
      "method": "transferencia",
      "reference": "SPEI 0098123",
      "in_payroll": false,
      "created_at": "2026-11-02T09:30:00-06:00"
    }
  ],
  "created_at": "2026-11-02T09:15:00-06:00",
  "updated_at": "2026-11-06T12:30:00-06:00"
}
```

## Errors

- `expense_report_invalid` (400): Viáticos y gastos doesn't allow it right now: the message says why (a gasto with errors when sending it, a reembolso before approval, approving what you sent yourself).
- `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_not_ready` (400): The issuer can't do that yet: the message says what it's missing (its CSD, or one in force when stamping; its RFC and tax details for viáticos). Upload it and repeat the request with the same Idempotency-Key.
- `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.
