# Change a quote

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

Only what you send changes. A draft changes right there; one already sent (also if it expired, was rejected or withdrawn) becomes a new draft version (same number, version + 1) that the customer sees when you send it; meanwhile, its link shows the previous one. An accepted or invoiced one no longer changes.

## 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 |
| --- | --- | --- | --- |
| `customer` | string (cus_…) or object |  | A customer from your catalog (cus_…), one with their tax data (as in POST /v1/invoices: added to your customers) or just name and email if you don't have them yet. |
| `customer.tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `customer.legal_name` | string | yes | Name or razón social exactly as on the constancia de situación fiscal, without the capital regime (without «S.A. de C.V.»). (up to 300 characters) |
| `customer.tax_system` | string | yes | Tax regime (RegimenFiscal), a c_RegimenFiscal key: 601, 612, 626… |
| `customer.zip` | string | yes | Postal code of the customer's tax address (DomicilioFiscalReceptor), 5 digits. |
| `customer.email` | string |  | Their email (up to 5, separated by commas). (up to 500 characters) |
| `customer.foreign` | object |  | If they're foreign: their country of residence (ResidenciaFiscal, c_Pais) and their tax registration number (NumRegIdTrib), with the generic RFC XEXX010101000. |
| `customer.foreign.country` | string | yes | Country of tax residence, a 3-letter key from c_Pais (USA, CAN…). (3 characters) |
| `customer.foreign.tax_id` | string | yes | Tax identity registration number in their country (NumRegIdTrib). (up to 40 characters) |
| `customer.ieps_taxpayer` | boolean |  | true if the customer is an IEPS taxpayer: IEPS is broken out instead of added to the price, except that of alcohol and tobacco (rates 0.5, 1.6 and 0.304), which always goes in the price (LIEPS art. 19 fr. II). |
| `customer.name` | string | yes | Who it's addressed to. (up to 200 characters) |
| `items` | array of object |  | The line items, as in POST /v1/invoices. (up to 200) |
| `items[].product` | string (prd_…) |  | A product from your catalog (prd_…): takes its key, unit, price and taxes. |
| `items[].description` | string |  | Line item description (Descripcion), up to 1,000 characters. (up to 1000 characters) |
| `items[].product_key` | string |  | Product or service key (ClaveProdServ), 8 digits from c_ClaveProdServ. Look it up with GET /v1/sat_catalogs/product_keys?q=… |
| `items[].unit_key` | string |  | Unit key (ClaveUnidad) from c_ClaveUnidad: E48 service unit, H87 piece, ACT activity… By default H87 if the product key is for goods (segments 10 to 60) and E48 if it's for a service. (up to 5 characters) |
| `items[].unit_name` | string or null |  | Unit name (Unidad), up to 20 characters. |
| `items[].sku` | string or null |  | Identification number or SKU (NoIdentificacion). |
| `items[].quantity` | number |  | Quantity (Cantidad). 1 by default. (greater than 0 and up to 1000000000) |
| `items[].unit_price` | number |  | Unit price before taxes (ValorUnitario). (from 0 to 1000000000000) |
| `items[].discount` | number |  | Discount (Descuento). (from 0 to 1000000000000) |
| `items[].taxability` | `01`, `02`, `03`, `04`, `05`, `06`, `07`, `08` |  | Tax object (ObjetoImp), c_ObjetoImp: 01 not subject, 02 subject (the default), 03 not broken out, 04 not taxable… |
| `items[].iva` | `0`, `0.16`, `0.08`, `exento` |  | Transferred VAT rate: 0.16 (the default), 0.08 (border region), 0 or exento. |
| `items[].ieps` | number |  | Transferred IEPS: rate (0.265…) or amount in pesos per unit, depending on ieps_factor. (from 0 to 72.1605) |
| `items[].ieps_factor` | `Tasa`, `Cuota` |  | Tasa or Cuota (IEPS TipoFactor). |
| `items[].ieps_units` | number |  | IEPS units for per-unit rates (liters, cigarettes…), if they aren't the quantity. (greater than 0 and up to 1000000000) |
| `items[].iva_retention` | number |  | Withheld VAT rate (for example 0.106667, two thirds of 16%). (from 0 to 0.16) |
| `items[].isr_retention` | number |  | Withheld ISR rate (for example 0.10 professional fees, 0.0125 RESICO). (from 0 to 0.35) |
| `items[].predial` | array of string |  | Property tax account numbers (CuentaPredial) in leasing. (up to 10) |
| `items[].pedimentos` | array of string |  | Pedimento numbers (InformacionAduanera) of imported goods. (up to 50) |
| `items[].third_party` | object |  | On behalf of third parties (ACuentaTerceros): RFC, name, regime and postal code. |
| `items[].third_party.tax_id` | string | yes | RFC of the party on whose behalf (RfcACuentaTerceros). (up to 13 characters) |
| `items[].third_party.name` | string | yes | Name (NombreACuentaTerceros). (up to 300 characters) |
| `items[].third_party.tax_system` | string | yes | Tax regime (RegimenFiscalACuentaTerceros), c_RegimenFiscal. |
| `items[].third_party.zip` | string | yes | Postal code of their tax address (DomicilioFiscalACuentaTerceros). |
| `items[].iedu` | object |  | Private educational institutions complement (IEDU): student, CURP, level and RVOE. |
| `items[].iedu.student_name` | string | yes | Student's name (nombreAlumno). (up to 300 characters) |
| `items[].iedu.curp` | string | yes | CURP, 18 characters. (18 characters) |
| `items[].iedu.level` | `Preescolar`, `Primaria`, `Secundaria`, `Profesional técnico`, `Bachillerato o su equivalente` | yes | Education level (nivelEducativo). |
| `items[].iedu.rvoe` | string | yes | Official recognition of the studies' validity (autRVOE). (up to 30 characters) |
| `items[].iedu.payer_tax_id` | string or null |  | RFC of whoever pays, if it isn't the recipient (rfcPago). |
| `items[].used_vehicle` | object |  | Used vehicle complement. |
| `items[].used_vehicle.purchase_amount` | number | yes | Acquisition amount (montoAdquisicion). (greater than 0 and up to 1000000000000) |
| `items[].used_vehicle.sale_amount` | number | yes | Sale amount (montoEnajenacion). (greater than 0 and up to 1000000000000) |
| `items[].used_vehicle.vehicle_key` | string | yes | Vehicle key (claveVehicular). (up to 7 characters) |
| `items[].used_vehicle.make` | string | yes | Make (marca). (up to 50 characters) |
| `items[].used_vehicle.type` | string | yes | Type or version (tipo). (up to 50 characters) |
| `items[].used_vehicle.model` | string | yes | Model year (modelo), 4 digits. |
| `items[].used_vehicle.engine_number` | string |  | Engine number (numeroMotor). (up to 17 characters) |
| `items[].used_vehicle.serial_number` | string |  | Serial number (numeroSerie). (up to 17 characters) |
| `items[].used_vehicle.niv` | string |  | Vehicle identification number (NIV). (up to 17 characters) |
| `items[].used_vehicle.guide_value` | number | yes | Value according to the EBC guide or Libro Azul (valor). (greater than 0 and up to 1000000000000) |
| `items[].used_vehicle.customs` | array of object |  | Customs information of the vehicle's import (InformacionAduanera). (up to 10) |
| `items[].used_vehicle.customs[].number` | string | yes | Number of the import document (numero). (up to 100 characters) |
| `items[].used_vehicle.customs[].date` | string | yes | Date of the document (fecha), YYYY-MM-DD. |
| `items[].used_vehicle.customs[].office` | string |  | Customs office (aduana). (up to 100 characters) |
| `items[].hydrocarbon` | object |  | Hidrocarburos y Petrolíferos complement: required on each line item of diesel (15101505) or gasoline (15101514, 15101515) of an invoice or credit note, in liters (LTR). |
| `items[].hydrocarbon.permit_type` | string | yes | CNE or CRE permit type (TipoPermiso, c_TipoPermiso): PER01 to PER11. |
| `items[].hydrocarbon.permit_number` | string | yes | CNE or CRE permit number (NumeroPermiso), like PL/12345/EXP/ES/2016: from 15 to 35 characters. (up to 35 characters) |
| `items[].hydrocarbon.subproduct` | string | yes | Subproduct (SubProductoHYP, c_SubProductoHYP): SP16 regular gasoline, SP17 premium, SP18 automotive diesel… |
| `items[].addenda` | object |  | The recipient's addenda (Walmart, Soriana…), with its own fields. |
| `currency` | string |  | Currency, an ISO 4217 key from c_Moneda (MXN, USD, EUR…). MXN by default. (3 characters) |
| `exchange_rate` | number |  | Exchange rate to pesos (TipoCambio). Required if the currency isn't MXN; use the DOF's from the previous day. (greater than 0 and up to 1000000) |
| `payment_form` | string |  | Payment form (FormaPago), a c_FormaPago key: 01 cash, 03 transfer, 04 credit card, 28 debit, 99 to be defined… Required with PUE; with PPD it's 99. |
| `payment_method` | `PUE`, `PPD` |  | Payment method (MetodoPago): PUE (a single payment, the default) or PPD (in installments or deferred, collected with payment complements). |
| `use` | string |  | CFDI use (UsoCFDI), a c_UsoCFDI key. G03 by default, or S01 with regime 616. |
| `notes` | string |  | Remarks that appear on the PDF (they don't go into the XML). (up to 1000 characters) |
| `valid_until` | string |  | Until when it's valid (YYYY-MM-DD, up to a year). By default, in 15 days. |
| `terms` | string |  | Terms: delivery time, advance payment, warranty… (up to 2000 characters) |

Example:

```json
{
  "valid_until": "2026-11-30"
}
```

## With the TypeScript SDK

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

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

const quote = await fiscalisto.quotes.update("quo_OufpKqnrvx9p3Kd8wQm2XyT5uBcW8sKdLx", { valid_until: "2026-11-30" }, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

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

quote = fiscalisto.quotes.update("quo_OufpKqnrvx9p3Kd8wQm2XyT5uBcW8sKdLx", {"valid_until": "2026-11-30"}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

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

$quote = $fiscalisto->quotes->update('quo_OufpKqnrvx9p3Kd8wQm2XyT5uBcW8sKdLx', ['valid_until' => '2026-11-30'], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

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

var quote = await fiscalisto.Quotes.UpdateAsync("quo_OufpKqnrvx9p3Kd8wQm2XyT5uBcW8sKdLx", new UpdateQuoteParams { ValidUntil = "2026-11-30" }, 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()

	quote, err := client.Quotes.Update(ctx, "quo_OufpKqnrvx9p3Kd8wQm2XyT5uBcW8sKdLx", &fiscalisto.UpdateQuoteParams{
		ValidUntil: fiscalisto.String("2026-11-30"),
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(quote.ID)
}
```

## With the Java SDK

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

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

var quote = fiscalisto.quotes().update("quo_OufpKqnrvx9p3Kd8wQm2XyT5uBcW8sKdLx", new UpdateQuoteParams().setValidUntil("2026-11-30"), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(quote.getId());
```

## Response 200

OK.

A `Quote` 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` | `"quote"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer` | string | yes | The issuer (iss_…). |
| `number` | string | yes | Its series and folio, as the customer sees it (COT-12). |
| `version` | integer | yes | Changing one already sent makes a new version with the same number; the id always returns the latest. (from -9007199254740991 to 9007199254740991) |
| `status` | `draft`, `sent`, `viewed`, `accepted`, `rejected`, `withdrawn`, `expired`, `invoiced` | yes | draft, sent, viewed (the customer opened the link), accepted, rejected, withdrawn (you withdrew it), expired (valid_until passed) or invoiced. |
| `url` | string or null | yes | The link where the customer views it, downloads its PDF, accepts it, asks for changes or rejects it; null while it is a draft. |
| `customer` | object | yes | Who it is for: tax_id null if you don't have their tax details yet; catalog_id is their customer (cus_…) in your catalog, or null. |
| `customer.tax_id` | string or null | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `customer.name` | string or null | yes | Name. |
| `customer.email` | string or null | yes | Email to send it to (several separated by commas). Only used if sending is requested. |
| `customer.catalog_id` | string or null | yes | The customer (cus_…) in your catalog, or null if they aren't in it. |
| `currency` | string | yes | The currency. |
| `items` | array of object | yes | The line items, like an invoice's. |
| `items[].description` | string | yes | Line item description (Descripcion), up to 1,000 characters. |
| `items[].product_key` | string | yes | Product or service key (ClaveProdServ), 8 digits from c_ClaveProdServ. Look it up with GET /v1/sat_catalogs/product_keys?q=… |
| `items[].quantity` | number |  | Quantity (Cantidad). 1 by default. |
| `items[].unit_key` | string |  | Unit key (ClaveUnidad) from c_ClaveUnidad: E48 service unit, H87 piece, ACT activity… By default H87 if the product key is for goods (segments 10 to 60) and E48 if it's for a service. |
| `items[].unit_price` | number | yes | Unit price before taxes (ValorUnitario). |
| `total` | number or null | yes | The total with taxes. |
| `valid_until` | string | yes | Its last day of validity (YYYY-MM-DD). |
| `terms` | string or null | yes | The printed terms: delivery, advance payment, warranty… |
| `notes` | string or null | yes | The notes, like an invoice's. |
| `auto_invoice` | boolean | yes | Whether accepting it stamps the invoice on its own. |
| `remind` | boolean | yes | Whether an email reminder is sent 3 days before its last day while there is no answer (remind in POST /v1/quotes/{id}/send). |
| `reminded_at` | string (date-time) or null | yes | When the reminder was sent, or null. |
| `customer_comment` | string or null | yes | What the customer wrote when asking for changes or rejecting it, your note when withdrawing it or marking it rejected, or null. |
| `sent_at` | string (date-time) or null | yes | When it was sent. |
| `viewed_at` | string (date-time) or null | yes | When the customer first opened the link. |
| `decided_at` | string (date-time) or null | yes | When it was accepted, rejected or withdrawn. |
| `decided_by` | `customer`, `user` or null | yes | customer (on their link) or user (you: POST /v1/quotes/{id}/accept, /reject or /withdraw, or from the app). |
| `invoice` | string or null | yes | The invoice (inv_…) stamped from it, or null. |
| `created_at` | string (date-time) or null | yes | When it was created. |

```json
{
  "id": "quo_OufpKqnrvx9p3Kd8wQm2XyT5uBcW8sKdLx",
  "object": "quote",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "number": "COT-12",
  "version": 1,
  "status": "sent",
  "url": "https://fiscalisto.com/cotizacion/7Hq2mZr1XyT5uBcW8sKdLx0VeNOufpKq",
  "customer": {
    "tax_id": "ICV060329BY0",
    "name": "INMOBILIARIA CVA",
    "email": "compras@cva.example",
    "catalog_id": "cus_OufpKqnrvx9p42"
  },
  "currency": "MXN",
  "items": [
    {
      "description": "Desarrollo del sitio web",
      "product_key": "81112103",
      "quantity": 1,
      "unit_key": "E48",
      "unit_price": 45000
    }
  ],
  "total": 52200,
  "valid_until": "2026-11-09",
  "terms": "50% de anticipo, entrega en 4 semanas.",
  "notes": null,
  "auto_invoice": true,
  "remind": true,
  "reminded_at": null,
  "customer_comment": null,
  "sent_at": "2026-10-25T10:12:00-06:00",
  "viewed_at": null,
  "decided_at": null,
  "decided_by": null,
  "invoice": null,
  "created_at": "2026-10-25T10:05:00-06:00"
}
```

## Errors

- `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.
- `quote_invalid` (400): The quote couldn't be saved or can't change anymore (accepted, rejected or invoiced), or can't be sent that way. `message_es` says why.
- `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.
