{
 "openapi": "3.1.0",
 "info": {
  "title": "Quotations (CRM)",
  "version": "20261030b",
  "description": "Read and maintain quotations records (crm.quotations)."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "quotations": {
    "type": "object",
    "required": [
     "account_id",
     "currency"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "quote_no": {
      "type": "string",
      "description": "Quote no",
      "readOnly": true
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Account id"
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact"
     },
     "opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Opportunity id"
     },
     "quote_date": {
      "type": "string",
      "format": "date",
      "description": "Quote date"
     },
     "valid_until": {
      "type": "string",
      "format": "date",
      "description": "Valid until"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "status": {
      "type": "string",
      "description": "Status"
     },
     "subtotal": {
      "type": "string",
      "format": "decimal",
      "description": "Subtotal",
      "readOnly": true
     },
     "tax_total": {
      "type": "string",
      "format": "decimal",
      "description": "Tax total",
      "readOnly": true
     },
     "total": {
      "type": "string",
      "format": "decimal",
      "description": "Total",
      "readOnly": true
     },
     "payment_terms_days": {
      "type": "integer",
      "description": "Payment terms (days)"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Location",
      "readOnly": true
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ships from warehouse",
      "readOnly": true
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center id",
      "readOnly": true
     },
     "profit_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Profit center id",
      "readOnly": true
     },
     "cancelled_at": {
      "type": "string",
      "format": "date-time",
      "description": "Cancelled at",
      "readOnly": true
     },
     "cancelled_by": {
      "type": "string",
      "format": "uuid",
      "description": "Cancelled by",
      "readOnly": true
     },
     "cancel_reason": {
      "type": "string",
      "description": "Cancel reason",
      "readOnly": true
     },
     "reversed_by_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reversed by id",
      "readOnly": true
     },
     "reverses_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reverses id",
      "readOnly": true
     },
     "exchange_rate": {
      "type": "string",
      "format": "decimal",
      "description": "Exchange rate"
     },
     "base_total": {
      "type": "string",
      "format": "decimal",
      "description": "Base total",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "accepted_via": {
      "type": "string",
      "description": "Accepted via",
      "readOnly": true
     },
     "accepted_by_portal_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Accepted by portal user id",
      "readOnly": true
     },
     "supplier_gstin": {
      "type": "string",
      "description": "Supplier gstin",
      "readOnly": true
     },
     "buyer_gstin": {
      "type": "string",
      "description": "Buyer gstin",
      "readOnly": true
     },
     "place_of_supply": {
      "type": "string",
      "description": "Place of supply",
      "readOnly": true
     },
     "is_interstate": {
      "type": "boolean",
      "description": "Is interstate",
      "readOnly": true
     },
     "is_reverse_charge": {
      "type": "boolean",
      "description": "Is reverse charge",
      "readOnly": true
     },
     "export_type": {
      "type": "string",
      "description": "Export type",
      "readOnly": true
     },
     "cgst_total": {
      "type": "string",
      "format": "decimal",
      "description": "Cgst total",
      "readOnly": true
     },
     "sgst_total": {
      "type": "string",
      "format": "decimal",
      "description": "Sgst total",
      "readOnly": true
     },
     "igst_total": {
      "type": "string",
      "format": "decimal",
      "description": "Igst total",
      "readOnly": true
     },
     "cess_total": {
      "type": "string",
      "format": "decimal",
      "description": "Cess total",
      "readOnly": true
     },
     "charges_total": {
      "type": "string",
      "format": "decimal",
      "description": "Charges total",
      "readOnly": true
     },
     "accrued_charges_total": {
      "type": "string",
      "format": "decimal",
      "description": "Accrued charges total",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/crm/quotations": {
   "get": {
    "summary": "list quotations",
    "operationId": "list_quotations_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create quotations",
    "operationId": "create_quotations_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}": {
   "get": {
    "summary": "get quotations",
    "operationId": "get_quotations_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change quotations",
    "operationId": "change_quotations_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete quotations",
    "operationId": "delete_quotations_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/approvals": {
   "get": {
    "summary": "Approvals",
    "operationId": "action_quotations_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/submit-for-approval": {
   "post": {
    "summary": "Submit for approval",
    "operationId": "action_quotations_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/config-lines/template": {
   "get": {
    "summary": "Config lines template",
    "operationId": "action_quotations_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/config-lines/import": {
   "post": {
    "summary": "Config lines import",
    "operationId": "action_quotations_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_quotations_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{parentId}/lines": {
   "get": {
    "summary": "Lines",
    "operationId": "action_quotations_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Lines",
    "operationId": "action_quotations_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{parentId}/lines/{lineId}": {
   "put": {
    "summary": "Lines",
    "operationId": "action_quotations_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Lines",
    "operationId": "action_quotations_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/create": {
   "post": {
    "summary": "Create",
    "operationId": "action_quotations_0_5",
    "description": "Body keys: shipTo, shipToSiteId, shipFrom, quoteNo, accountId*, contactId, opportunityId, validUntil, currency, exchangeRate, costCenterId, warehouseId, locationId, notes; lines: [{ itemId, uom, currency, exchangeRate, description, quantity, unitPrice, discountPct, costCenterId, configId, configUnitPrice, configUnitCost }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/send": {
   "post": {
    "summary": "Send",
    "operationId": "action_quotations_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/accept": {
   "post": {
    "summary": "Accept",
    "operationId": "action_quotations_0_6",
    "description": "Body keys: requestedDate, customerPoRef",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/quotations/{id}/reject": {
   "post": {
    "summary": "Reject",
    "operationId": "action_quotations_0_6",
    "description": "Body keys: reason",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}