N1Developer docsv1

Orders · v1

MUTATION

dispatchOrder

Live

Dispatch final production to Billing

Dispatch production after every machining and QC step passes. Owner, admin and supervisor. Moves IN_PROGRESS or PAUSED to PAYMENT_DUE (Billing). Idempotent and audited. ORDER_NOT_READY_FOR_DISPATCH if production is not final; ORDER_STATUS_STEP for an invalid status; ORDER_NOT_FOUND outside this shop.

POST/graphqlapp audience

Who can call this. Owner, admin, 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 work order.

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

Returns

  • dispatchOrderOrder!Required

    Dispatch production after every machining and QC step passes. Owner, admin and supervisor. Moves IN_PROGRESS or PAUSED to PAYMENT_DUE (Billing). Idempotent and audited. ORDER_NOT_READY_FOR_DISPATCH if production is not final; ORDER_STATUS_STEP for an invalid status; ORDER_NOT_FOUND outside this shop.

    Show children
    • canCreateJobCardBoolean!Required

      Whether to offer Create job card: no card exists, the order is not finished, and this caller can open job cards. Opening still needs the raw material grade and size (updateOrder(openJobCard: true)).

    • createdAtString!Required

      UTC time the order was entered.

    • customerEmailStringOptional

      The customer’s email, for the order screen.

    • customerIdID!Required

      The customer (see customer).

    • customerNameString!Required

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

    • dcDateStringOptional

      Delivery challan date, YYYY-MM-DD.

    • dcNoStringOptional

      Delivery challan number.

    • descriptionStringOptional

      Description.

    • designFileAppFileReferenceOptional

      The design file.

      Show children
      • idID!Required

        File id; obtain authorised download URL from files API.

      • kindStringOptional

        Document category.

      • nameString!Required

        Display filename.

      • sizeBytesFloat!Required

        Size in bytes, safe integer.

    • documents[AppFileReference!]!Required

      Attached documents.

      Show children
      • idID!Required

        File id; obtain authorised download URL from files API.

      • kindStringOptional

        Document category.

      • nameString!Required

        Display filename.

      • sizeBytesFloat!Required

        Size in bytes, safe integer.

    • drawingNumberStringOptional

      Drawing number.

    • dueDateString!Required

      Promised delivery date, YYYY-MM-DD in the shop’s timezone.

    • heatNumberStringOptional

      Heat number.

    • idID!Required

      Stable id (UUIDv7).

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

    • jobCardIdIDOptional

      The job card of this order (open it with jobCard); null until it is opened with updateOrder(openJobCard: true), which needs the raw material grade and size.

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

    • jobNameStringOptional

      Job name.

    • materialStringOptional

      Material to use.

    • materialSourceMaterialSourceOptional

      Where the material comes from; null until chosen.

      • BOUGHT_OUTBought from a supplier.
      • IN_HOUSECut from the shop’s own stock.
    • notesStringOptional

      Notes.

    • numberStringOptional

      Permanent per-shop work-order number (WO-<n>).

    • partNameString!Required

      Part name.

    • partNumberStringOptional

      Part number.

    • poAmountFloatOptional

      PO value in paise (integer). Not on the app’s type; shown when entered.

    • poNumberString!Required

      The customer’s PO number.

    • priorityOrderPriority!Required

      How urgently to take it.

      • HIGHAhead of other orders.
      • LOWFill gaps in the schedule.
      • MEDIUMThe default.
    • projectIdStringOptional

      Project id.

    • quantityInt!Required

      Pieces ordered.

    • quoteIdIDOptional

      The quote this order was converted from, if any (see quote).

    • rawMaterialGradeStringOptional

      Raw material grade.

    • rawMaterialSizeStringOptional

      Raw material size.

    • rmPartNumberStringOptional

      Raw material part number.

    • routeCardNoStringOptional

      Route card no.

    • shopOrderNumberStringOptional

      Shop order number.

    • statusOrderStatus!Required

      Worked out from the job card and invoice.

      Example: "PAYMENT_DUE"

      • COMPLETEDProduction is complete and the invoice is paid.
      • IN_PROGRESSAt least one operation is running or finished, and not all are.
      • NEWEntered; work is not ready to start (design or material not cleared, nobody assigned).
      • PAUSEDWork is paused.
      • PAYMENT_DUEProduction is complete and the invoice is not paid (or not yet raised).
      • YET_TO_STARTReady to start: cleared for work or an operator is assigned, nothing running.
    • statusHistory[ActivityEntry!]!Required

      What happened to the order, oldest first.

      Show children
      • atString!Required

        UTC ISO timestamp.

      • detailStringOptional

        Additional context.

      • idID!Required

        Event id.

      • labelString!Required

        Activity label.

      • toneActivityTone!Required

        Badge tone.

        • DANGERFailure.
        • INFOInformation.
        • NEUTRALNeutral.
        • SUCCESSSuccess.
        • WARNINGWarning.
    • updatedAtString!Required

      UTC time of the last change.

Errors

CodeHTTPWhen
FORBIDDEN403Signed in, but the role or tenant does not allow the action.
ORDER_NOT_FOUND404The id is unknown in this shop (another shop's ids answer the same).

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.