N1Developer docsv1

QC · v1

MUTATION

recordQc

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.

Record a quality check; the operation leaves the queue

Record a check on a job operation; it leaves the queue. Owner, admin, supervisor and QC. VALIDATION_FAILED for a FAIL without a reason, for a step that is not finished, or for a stage other than the one the step is due (raw material on the first step, final on the last, in process between). JOB_OPERATION_NOT_FOUND for an unknown step.

POST/graphqlapp audience

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

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

  • inputQcRecordInput!Required

    The check.

    Example: {"jobOperationId":"0192f0c1-0000-7000-8000-000000d3058d","stage":"RAW_MATERIAL","result":"PASS","measurements":[{"name":"Outer diameter","value":40.01,"unit":"mm"}]}

    Show children
    • jobOperationIdID!Required

      The step checked (JobOperation.id).

    • measurements[QcMeasurementInput!]Optional

      The readings taken, up to 30.

    • reasonStringOptional

      Why it failed. Required when the result is FAIL.

    • resultQcResult!Required

      The outcome.

    • stageQcStage!Required

      When the check was made.

Returns

  • recordQcQcRecord!Required

    Record a check on a job operation; it leaves the queue. Owner, admin, supervisor and QC. VALIDATION_FAILED for a FAIL without a reason, for a step that is not finished, or for a stage other than the one the step is due (raw material on the first step, final on the last, in process between). JOB_OPERATION_NOT_FOUND for an unknown step.

    Show children
    • idID!Required

      Stable id (UUIDv7).

      Example: "0192f0c1-0000-7000-8000-e00000000001"

    • jobCardIdID!Required

      The job card checked.

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

    • jobOperationIdID!Required

      The step checked.

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

    • measurements[QcMeasurement!]!Required

      The readings taken.

      Example: [{"name":"Outer diameter","value":40.01,"unit":"mm"}]

      Show children
      • nameString!Required

        What was measured, such as “Bore diameter”.

        Example: "Outer diameter"

      • unitString!Required

        The unit, such as “mm”.

        Example: "mm"

      • valueFloat!Required

        The reading.

        Example: 40.01

    • operationNameString!Required

      What the step does.

      Example: "Drilling"

    • qrValueString!Required

      The job card’s QR text.

      Example: "JC-00028"

    • reasonStringOptional

      Why it failed. Always set for FAIL.

      Example: null

    • recordedAtString!Required

      UTC time the check was recorded.

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

    • recordedByIdID!Required

      Who made the check (User.id).

      Example: "0192f0c1-0000-7000-8000-0000000000a1"

    • recordedByNameString!Required

      That person’s name.

      Example: "Asha Demo"

    • resultQcResult!Required

      The outcome.

      Example: "PASS"

      • FAILOut of tolerance. A reason is required.
      • PASSWithin tolerance.
    • stageQcStage!Required

      When the check was made.

      Example: "RAW_MATERIAL"

      • FINALOn the finished part.
      • IN_PROCESSBetween operations.
      • RAW_MATERIALOn the material before work starts.

Errors

CodeHTTPWhen
VALIDATION_FAILED400Input failed Zod or route schema validation. details lists each field path and problem.
JOB_OPERATION_NOT_FOUND404The operation id is unknown in this shop (another shop's ids answer the same).
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.