N1Developer docsv1

Quotes · v1

MUTATION

updateQuote

Mock

Mock. This operation is part of the approved contract but its module is not built yet. Run Core with N1_API_MODE=mock N1_DEV_AUTH=stub to get deterministic demo-shop data from it. The real server answers NOT_IMPLEMENTED until it ships; the schema and examples here will not change when it does.

Change a draft quote and re-price it

Change a DRAFT quote and re-price it. Owner, admin, accountant and supervisor. QUOTE_NOT_FOUND for an unknown id; QUOTE_NOT_EDITABLE once it is sent or converted; VALIDATION_FAILED when no field is given.

POST/graphqlapp audience

Who can call this. Owner, admin, accountant, supervisor.

Headers

  • AuthorizationstringRequired

    Bearer <token>, issued for this endpoint's audience. The token decides the shop and roles; nothing in the request body can change them.

    Example: Bearer eyJhbGciOiJFZERTQSJ9…

  • Content-TypestringRequired

    Always application/json. Only POST is accepted.

    Example: application/json

  • Idempotency-KeystringRequired

    A key you generate once per user action (a UUID). Retrying with the same key never applies the change twice.

    Example: 0192f0c1-9b2a-7d40-8c3e-1f5a6b7c8d9e

  • X-Request-IdstringOptional

    Your id for this request (8–128 characters of A–Z a–z 0–9 . _ : -). Echoed back in the response header and in every error, so you can quote it when reporting a problem. Core makes one if you send none.

    Example: app-7f3c2a9e-checkout

Arguments

  • idID!Required

    The quote id.

    Example: "0192f0c1-0000-7000-8000-000000b00002"

  • inputQuoteUpdateInput!Required

    The changes.

    Example: {"quantity":200,"gstRate":12}

    Show children
    • gstRateFloatOptional

      New GST percentage, 0–28.

    • lines[BillingLineInput!]Optional

      The full set of operations, 1–30 lines.

    • materialStringOptional

      New material.

    • partStringOptional

      New part name or number.

    • quantityIntOptional

      New quantity, 1–1,000,000.

Returns

  • updateQuoteQuote!Required

    Change a DRAFT quote and re-price it. Owner, admin, accountant and supervisor. QUOTE_NOT_FOUND for an unknown id; QUOTE_NOT_EDITABLE once it is sent or converted; VALIDATION_FAILED when no field is given.

    Show children
    • createdAtString!Required

      UTC time the quote was made.

      Example: "2026-08-29T04:30:00.000Z"

    • customerIdID!Required

      The customer (see customer).

      Example: "0192f0c1-0000-7000-8000-0000000c0002"

    • customerNameString!Required

      The customer’s name, so a list needs no second call.

      Example: "Bharat Hydraulics 2"

    • gstRateFloat!Required

      The GST percentage asked for. The rate applied is totals.gstRate.

      Example: 12

    • idID!Required

      Stable id (UUIDv7).

      Example: "0192f0c1-0000-7000-8000-000000b00002"

    • lines[BillingLine!]!Required

      The priced operations, in the order given.

      Example: [{"id":"0192f0c1-0000-7000-8000-000000b30015","operation":"Turning","description":"Pulley 90","minutesPerPiece":2.5,"setupMinutes":30,"ratePerMinute":800,"amount":424000},{"id":"0192f0c1-0000-7000-8000-000000b30016","operation":"Finishing","description":"","minutesPerPiece":0.5,"setupMinutes":0,"ratePerMinute":600,"amount":60000}]

      Show children
      • amountFloat!Required

        Integer paise: (quantity × minutesPerPiece + setupMinutes) × ratePerMinute, rounded half up to a whole paisa. Computed by the server.

        Example: 424000

      • descriptionString!Required

        Free text for the customer; empty when none was given.

        Example: "Pulley 90"

      • idID!Required

        Stable id (UUIDv7).

        Example: "0192f0c1-0000-7000-8000-000000b30015"

      • minutesPerPieceFloat!Required

        Machine minutes for one piece.

        Example: 2.5

      • operationString!Required

        The operation priced, such as Turning.

        Example: "Turning"

      • ratePerMinuteInt!Required

        Paise per machine minute.

        Example: 800

      • setupMinutesFloat!Required

        One-off machine minutes to set up, charged once per line.

        Example: 30

    • materialStringOptional

      Material to use.

      Example: "EN8"

    • numberString!Required

      The quote number, such as QTN/26-27/0001. Assigned by the server.

      Example: "QTN/26-27/0002"

    • orderIdIDOptional

      The order made from this quote; null until converted (see order).

      Example: null

    • partString!Required

      Part name or number.

      Example: "Pulley 90"

    • quantityInt!Required

      Pieces quoted.

      Example: 200

    • statusQuoteStatus!Required

      DRAFT or SENT. Whether it became an order is orderId.

      Example: "DRAFT"

      • DRAFTBeing prepared; it can still be edited.
      • SENTSent to the customer; no longer editable.
    • totalsTotals!Required

      Subtotal, GST and total, all in paise, worked out by the server.

      Example: {"subtotal":484000,"discount":0,"taxable":484000,"gstRate":12,"supply":"INTER","cgst":0,"sgst":0,"igst":58080,"gst":58080,"total":542080}

      Show children
      • cgstFloat!Required

        Central GST; 0 unless supply is INTRA.

        Example: 0

      • discountFloat!Required

        The discount applied. Never more than the subtotal.

        Example: 0

      • gstFloat!Required

        Total GST: cgst + sgst + igst.

        Example: 58080

      • gstRateFloat!Required

        The GST percentage applied; 0 when supply is NONE.

        Example: 12

      • igstFloat!Required

        Integrated GST; 0 unless supply is INTER.

        Example: 58080

      • sgstFloat!Required

        State GST; 0 unless supply is INTRA.

        Example: 0

      • subtotalFloat!Required

        Sum of the line amounts.

        Example: 484000

      • supplyGstSupply!Required

        Whether CGST + SGST or IGST applies.

        Example: "INTER"

        • INTERDifferent states: IGST.
        • INTRAShop and customer are in the same state: CGST + SGST.
        • NONEThe shop has no GSTIN, so no GST is charged.
      • taxableFloat!Required

        Subtotal less discount.

        Example: 484000

      • totalFloat!Required

        Taxable plus GST.

        Example: 542080

    • updatedAtString!Required

      UTC time of the last change.

      Example: "2026-10-12T04:30:00.000Z"

Errors

CodeHTTPWhen
QUOTE_NOT_FOUND404The id is unknown in this shop (another shop's quote answers the same).
QUOTE_NOT_EDITABLE409updateQuote on a quote that is already sent or has become an order.
VALIDATION_FAILED400Input failed Zod or route schema validation. details lists each field path and problem.
FORBIDDEN403Signed in, but the role or tenant does not allow the action.

Every error has the same body. See Errors.

Rate limit tier

Tier: per user. Over the limit you get RATE_LIMITED (HTTP 429) with a Retry-After header. See Response handling.

Search documentation

Search operations, types and errors from the generated contract.