Skip to content

Quotes API

Create, list, retrieve, update, and delete quotations.

Authentication

All quote endpoints require a valid PASETO token:

http
Authorization: Bearer <token>

Endpoints

MethodPathDescription
POST/api/quote/:orgId/createCreate a new quote
GET/api/quote/:orgId/listList quotes (paginated)
GET/api/quote/:orgId/by-code/:codeGet quote by code
GET/api/quote/:orgId/:quoteIdGet quote by ID
PUT/api/quote/:orgId/:quoteId/updateUpdate a quote
DELETE/api/quote/:orgId/:quoteId/deleteDelete a quote

Common Path Parameters

ParameterTypeDescription
orgIdstringOrganisation ID
quoteIdstringQuote document ID
codestringHuman-readable quote code (e.g. QT-0015)

POST /api/quote/:orgId/create

Create a new quotation.

Request Body

json
{
  "guestId": "guest_abc123",
  "guestName": "Jane Smith",
  "guestEmail": "jane@example.com",
  "guestPhone": "+919876543210",
  "guestAddress": "42 MG Road, Bengaluru 560001",
  "quoteDate": "2026-03-10",
  "validUntil": "2026-03-20",
  "checkIn": "2026-03-15",
  "checkOut": "2026-03-18",
  "items": [
    {
      "description": "Deluxe Room — 3 nights",
      "quantity": 3,
      "rate": 3500,
      "amount": 10500,
      "hsnCode": "9963"
    },
    {
      "description": "Airport pickup",
      "quantity": 1,
      "rate": 1500,
      "amount": 1500
    }
  ],
  "taxes": [
    { "name": "CGST", "rate": 6, "amount": 720 },
    { "name": "SGST", "rate": 6, "amount": 720 }
  ],
  "summary": {
    "subtotal": 12000,
    "taxTotal": 1440,
    "discountAmount": 500,
    "grandTotal": 12940
  },
  "notes": "Prices valid for the mentioned dates only",
  "terms": "50% advance required to confirm booking"
}
FieldTypeRequiredDescription
guestIdstringNoExisting guest ID
guestNamestringYesGuest / client name
guestEmailstringNoGuest email
guestPhonestringNoGuest phone
guestAddressstringNoBilling address
quoteDatestringYesQuote date (YYYY-MM-DD)
validUntilstringNoExpiry date for the quote
checkInstringNoProposed check-in date
checkOutstringNoProposed check-out date
itemsarrayYesLine items
items[].descriptionstringYesItem description
items[].quantitynumberYesQuantity
items[].ratenumberYesUnit rate
items[].amountnumberYesLine total
items[].hsnCodestringNoHSN/SAC code
taxesarrayNoApplied taxes
taxes[].namestringYesTax name
taxes[].ratenumberYesTax percentage
taxes[].amountnumberYesTax amount
summaryobjectYesQuote totals
summary.subtotalnumberYesSum of item amounts
summary.taxTotalnumberYesSum of taxes
summary.discountAmountnumberNoDiscount applied
summary.grandTotalnumberYesGrand total
notesstringNoNotes on the quote
termsstringNoTerms and conditions

Response — 201 Created

json
{
  "success": true,
  "message": "Quote created successfully",
  "data": {
    "quoteId": "qt_stu012",
    "code": "QT-0015",
    "guestName": "Jane Smith",
    "grandTotal": 12940,
    "status": "draft",
    "quoteDate": "2026-03-10",
    "validUntil": "2026-03-20",
    "createdAt": "2026-03-10T09:00:00.000Z"
  }
}

Error — 400 Bad Request

json
{
  "success": false,
  "message": "Validation failed: items array is required"
}

GET /api/quote/:orgId/list

List quotes with pagination and optional filters.

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber20Items per page
statusstringFilter by status (draft, sent, accepted, expired, cancelled)
fromstringQuote date from (YYYY-MM-DD)
tostringQuote date to (YYYY-MM-DD)
searchstringSearch by guest name, code, or phone

Response — 200 OK

json
{
  "success": true,
  "data": [
    {
      "quoteId": "qt_stu012",
      "code": "QT-0015",
      "guestName": "Jane Smith",
      "grandTotal": 12940,
      "status": "draft",
      "quoteDate": "2026-03-10",
      "validUntil": "2026-03-20"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 25,
    "totalPages": 2
  }
}

GET /api/quote/:orgId/by-code/:code

Retrieve a quote by its human-readable code.

Path Parameters

ParameterTypeDescription
codestringQuote code (e.g. QT-0015)

Response — 200 OK

json
{
  "success": true,
  "data": {
    "quoteId": "qt_stu012",
    "code": "QT-0015",
    "guestName": "Jane Smith",
    "guestEmail": "jane@example.com",
    "guestPhone": "+919876543210",
    "guestAddress": "42 MG Road, Bengaluru 560001",
    "quoteDate": "2026-03-10",
    "validUntil": "2026-03-20",
    "checkIn": "2026-03-15",
    "checkOut": "2026-03-18",
    "items": [
      {
        "description": "Deluxe Room — 3 nights",
        "quantity": 3,
        "rate": 3500,
        "amount": 10500
      },
      {
        "description": "Airport pickup",
        "quantity": 1,
        "rate": 1500,
        "amount": 1500
      }
    ],
    "taxes": [
      { "name": "CGST", "rate": 6, "amount": 720 },
      { "name": "SGST", "rate": 6, "amount": 720 }
    ],
    "summary": {
      "subtotal": 12000,
      "taxTotal": 1440,
      "discountAmount": 500,
      "grandTotal": 12940
    },
    "status": "draft",
    "notes": "Prices valid for the mentioned dates only",
    "terms": "50% advance required to confirm booking",
    "createdAt": "2026-03-10T09:00:00.000Z"
  }
}

Error — 404 Not Found

json
{
  "success": false,
  "message": "Quote not found"
}

GET /api/quote/:orgId/:quoteId

Retrieve full quote details by ID. Response format is identical to the by-code endpoint above.

Response — 200 OK

json
{
  "success": true,
  "data": {
    "quoteId": "qt_stu012",
    "code": "QT-0015",
    "guestName": "Jane Smith",
    "quoteDate": "2026-03-10",
    "validUntil": "2026-03-20",
    "items": [],
    "taxes": [],
    "summary": {
      "subtotal": 12000,
      "taxTotal": 1440,
      "discountAmount": 500,
      "grandTotal": 12940
    },
    "status": "draft",
    "createdAt": "2026-03-10T09:00:00.000Z",
    "updatedAt": "2026-03-10T09:00:00.000Z"
  }
}

PUT /api/quote/:orgId/:quoteId/update

Update an existing quote.

Request Body

json
{
  "items": [
    {
      "description": "Suite Room — 3 nights",
      "quantity": 3,
      "rate": 6000,
      "amount": 18000,
      "hsnCode": "9963"
    },
    {
      "description": "Airport pickup + drop",
      "quantity": 2,
      "rate": 1500,
      "amount": 3000
    }
  ],
  "taxes": [
    { "name": "CGST", "rate": 6, "amount": 1260 },
    { "name": "SGST", "rate": 6, "amount": 1260 }
  ],
  "summary": {
    "subtotal": 21000,
    "taxTotal": 2520,
    "discountAmount": 1000,
    "grandTotal": 22520
  },
  "validUntil": "2026-03-25",
  "notes": "Upgraded to suite per guest request",
  "status": "sent"
}
FieldTypeRequiredDescription
itemsarrayNoUpdated line items (replaces all)
taxesarrayNoUpdated taxes
summaryobjectNoUpdated totals
validUntilstringNoUpdated expiry date
checkInstringNoUpdated check-in date
checkOutstringNoUpdated check-out date
notesstringNoUpdated notes
termsstringNoUpdated terms
statusstringNoStatus (draft, sent, accepted, expired, cancelled)

Response — 200 OK

json
{
  "success": true,
  "message": "Quote updated successfully",
  "data": {
    "quoteId": "qt_stu012",
    "code": "QT-0015",
    "grandTotal": 22520,
    "status": "sent",
    "updatedAt": "2026-03-12T11:45:00.000Z"
  }
}

Error — 404 Not Found

json
{
  "success": false,
  "message": "Quote not found"
}

DELETE /api/quote/:orgId/:quoteId/delete

Permanently delete a quote. Only quotes in draft status can be deleted.

Response — 200 OK

json
{
  "success": true,
  "message": "Quote deleted successfully"
}

Error — 400 Bad Request

json
{
  "success": false,
  "message": "Only draft quotes can be deleted"
}

Error — 404 Not Found

json
{
  "success": false,
  "message": "Quote not found"
}

Released under the MIT License.