Editar cotización
PUT /api/quotations/{quotation_id}
Autenticación: Bearer del usuario del tenant (Authorization: Bearer <api_token>).
Reemplaza la cabecera y todos los ítems de la cotización (envía la cotización completa, no es parcial). Acepta PUT o PATCH. Los pagos registrados no se modifican. Si envías number, series, user_id, state_type_id, establishment_id o external_id se ignoran.
Quién puede usarlo: cualquier usuario autenticado. Un administrador accede a todos los registros; un vendedor solo a los que registró él (o en los que figura como vendedor). Si el registro existe pero es de otro vendedor responde 403.
| Campo | Tipo | Obligatorio | Descripción / valores permitidos |
|---|---|---|---|
customer_id |
integer | Sí | customer_id es el id de un cliente ya registrado (persona de tipo cliente). |
customer_address_id |
integer | No | Dirección del cliente a usar (si tiene varias). |
date_of_issue |
date | Sí | YYYY-MM-DD. |
time_of_issue |
string | No | HH:MM:SS. |
date_of_due |
date | No | Validez de la cotización. |
delivery_date |
date | No | Fecha de entrega. |
currency_type_id |
string | Sí | PEN o USD. |
exchange_rate_sale |
numeric | Sí | Tipo de cambio (1 en soles). |
total_* / subtotal / total |
numeric | Sí | Totales de cabecera: total_taxed (gravado), total_exonerated, total_unaffected, total_free, total_igv, total_taxes, total_value (sin IGV), subtotal y total (con IGV). Deben cuadrar con la suma de las líneas: la plataforma no recalcula los totales que envías. |
items |
array | Sí | Líneas (mín. 1). Ver tabla de líneas. |
payment_method_type_id |
string | No | Forma de pago propuesta. |
description |
string | No | Observaciones. |
shipping_address |
string | No | Dirección de envío. |
account_number |
string | No | Cuenta para el depósito. |
contact / phone |
string | No | Contacto y teléfono. |
custom_fields_data |
array | No | Campos personalizados de la empresa. |
Línea (items[]):
| Campo | Tipo | Obligatorio | Descripción / valores permitidos |
|---|---|---|---|
item_id |
integer | Sí | Id del producto. |
item |
object | Sí | Copia del producto tal como se guardará en el documento (al menos id, description, unit_type_id, internal_id, is_set, presentation). Se obtiene de los endpoints de productos de la API. |
quantity |
numeric | Sí | Cantidad (> 0). |
unit_value |
numeric | Sí | Valor unitario sin IGV. |
unit_price |
numeric | Sí | Precio unitario con IGV. |
affectation_igv_type_id |
string | Sí | Afectación IGV (catálogo SUNAT 07): 10 gravado, 20 exonerado, 30 inafecto. |
price_type_id |
string | Sí | 01 precio unitario (incluye IGV), 02 valor referencial (gratuito). |
percentage_igv |
numeric | Sí | Porcentaje de IGV (18, o 10 si aplica la Ley 31556). |
total_base_igv / total_igv / total_taxes / total_value / total |
numeric | Sí | Totales de la línea: base imponible, IGV, impuestos, valor (sin IGV) y total (con IGV). |
warehouse_id |
integer | No | Almacén del que sale el stock (por defecto el del establecimiento). |
total_discount / total_charge / charges / discounts / attributes |
varios | No | Descuentos, cargos y atributos de la línea (usa 0 y [] si no aplica). |
system_isc_type_id / total_base_isc / percentage_isc / total_isc / total_plastic_bag_taxes |
varios | No | ISC e ICBPER (usa null/0 si no aplica). |
Errores: 409 si la cotización está anulada; 422 si falta customer_id (o no existe), currency_type_id, exchange_rate_sale, date_of_issue, total o items; 403; 404.
Parámetros
| Parámetro | Dónde | Obligatorio | Ejemplo | Descripción |
|---|---|---|---|---|
quotation_id |
ruta | sí | 1 |
Cuerpo
Content-Type: application/json
{
"date_of_issue": "2026-11-07",
"time_of_issue": "15:00:00",
"date_of_due": "2026-11-14",
"delivery_date": "2026-11-20",
"customer_id": 1,
"customer_address_id": null,
"currency_type_id": "PEN",
"exchange_rate_sale": 1,
"total_prepayment": 0,
"total_charge": 0,
"total_discount": 0,
"total_exportation": 0,
"total_free": 0,
"total_taxed": 20.0,
"total_unaffected": 0,
"total_exonerated": 0,
"total_igv": 3.6,
"total_igv_free": 0,
"total_base_isc": 0,
"total_isc": 0,
"total_base_other_taxes": 0,
"total_other_taxes": 0,
"total_taxes": 3.6,
"total_value": 20.0,
"subtotal": 23.6,
"total": 23.6,
"items": [
{
"item_id": 120,
"item": {
"id": 120,
"item_id": 120,
"internal_id": "P0001",
"description": "GASEOSA 500ML",
"unit_type_id": "NIU",
"currency_type_id": "PEN",
"sale_unit_price": 3.5,
"purchase_unit_price": 2.2,
"sale_affectation_igv_type_id": "10",
"purchase_affectation_igv_type_id": "10",
"is_set": false,
"has_igv": true,
"presentation": null
},
"currency_type_id": "PEN",
"quantity": 2,
"unit_value": 10.0,
"affectation_igv_type_id": "10",
"total_base_igv": 20.0,
"percentage_igv": 18,
"total_igv": 3.6,
"system_isc_type_id": null,
"total_base_isc": 0,
"percentage_isc": 0,
"total_isc": 0,
"total_base_other_taxes": 0,
"percentage_other_taxes": 0,
"total_other_taxes": 0,
"total_plastic_bag_taxes": 0,
"total_taxes": 3.6,
"price_type_id": "01",
"unit_price": 11.8,
"total_value": 20.0,
"total_discount": 0,
"total_charge": 0,
"total": 23.6,
"attributes": [],
"charges": [],
"discounts": [],
"warehouse_id": 1
}
],
"payment_method_type_id": "01",
"description": "Precios válidos por 7 días",
"shipping_address": "AV. LOS PINOS 789, SURCO",
"account_number": null,
"contact": "María López",
"phone": "987123456",
"additional_information": null
}
Respuestas
200 — Editada
{
"success": true,
"data": {
"id": 33,
"number_full": "COT-33",
"state_type_id": "01",
"state_type_description": "Registrado",
"date_of_issue": "2026-11-07",
"customer_id": 1,
"currency_type_id": "PEN",
"total": 23.6,
"items_count": 1
},
"message": "Cotización actualizada"
}
422 — Sin ítems
{
"success": false,
"message": {
"items": [
"El campo items es obligatorio."
]
}
}
409 — Anulada
{
"success": false,
"message": "La cotización está anulada y no se puede editar."
}
Pruébalo
Prueba este endpoint con tu empresa y tu token: elige la URL en Servers, pega el token en Authorize y haz clic en Try it out.