C
Cotizera Docs

Templates API

Templates API

Templates are pre-configured quotes you can reuse to create new quotes instantly. Each template includes products, notes, shipping cost, and currency.

Read: any authenticated user with a tenant. Write: requires PRO plan and config:manage permission (Owner only).


List Templates

GET /api/templates

Lists all active templates for the tenant, including the creator's name.

Response 200 OK:

[
  {
    "id": "clxyz...",
    "tenantId": "...",
    "name": "Premium Package",
    "description": "Standard quote for premium clients",
    "items": [
      {
        "productName": "Consulting service",
        "unitPrice": 5000,
        "quantity": 1,
        "discountPct": 0
      }
    ],
    "notes": "Includes priority support",
    "shippingCost": 0,
    "currency": "MXN",
    "isActive": true,
    "createdAt": "2026-04-01T10:00:00.000Z",
    "updatedAt": "2026-04-01T10:00:00.000Z",
    "creator": {
      "name": "Juan García"
    }
  }
]

Create Template

POST /api/templates

Permission: config:manage | Plan: PRO

Creates a new quote template.

Request body:

{
  "name": "Premium Package",
  "description": "Standard quote for premium clients",
  "items": [
    {
      "productName": "Consulting service",
      "unitPrice": 5000,
      "quantity": 1,
      "discountPct": 0
    }
  ],
  "notes": "Includes priority support",
  "shippingCost": 150,
  "currency": "MXN"
}
Field Type Required Description
name string Yes Template name (1-100 characters)
description string No Description (max 500 characters)
items array Yes At least one product
notes string No Quote notes (max 2,000 characters)
shippingCost number No Shipping cost (default: 0)
currency string No Currency code (default: "MXN", max 10 characters)

Response 201 Created: Returns the created template.

Errors:

Status Error When
400 Validation message Invalid or missing data
403 "Sin permisos" User lacks config:manage permission
403 "Función disponible en plan PRO" Tenant is on FREE plan

Get a Template

GET /api/templates/:id

Gets a single template with the creator's name.

Response 200 OK: Returns the template object.

Errors:

Status Error When
404 "Plantilla no encontrada" Template not found in tenant

Update Template

PATCH /api/templates/:id

Permission: config:manage | Plan: PRO

Updates an existing template. All fields are optional.

Request body:

{
  "name": "Premium Package v2",
  "items": [
    {
      "productName": "Consulting service",
      "unitPrice": 6000,
      "quantity": 1,
      "discountPct": 10
    }
  ]
}

Response 200 OK: Returns the updated template.


Delete Template

DELETE /api/templates/:id

Permission: config:manage

Deactivates a template (soft delete — sets isActive to false). The template stops appearing in lists but is not removed from the database.

Response 200 OK:

{
  "ok": true
}

Zapier Usage

Templates integrate with Zapier through two additional endpoints:

  • Create quote from template: POST /api/zapier/actions/create-from-template — creates a quote using a template's products and configuration
  • List templates: GET /api/zapier/actions/list-templates — returns available templates for Zapier's dynamic dropdown

See the Zapier guide for details.

© 2026 Cotizera. All rights reserved.