N1Developer docsv1

Orders · v1

QUERY

orders

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.

The shop’s orders, paged, filterable and searchable

The shop’s orders, paged. Search matches PO number, customer name and part. Owner, admin, accountant and supervisor.

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

  • 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

  • afterStringOptional

    endCursor of the previous page.

  • beforeStringOptional

    startCursor of the next page, when paging backwards.

  • filterOrderFilterOptional

    Narrow by status, customer or due date.

    Show children
    • customerIdIDOptional

      Only this customer’s orders.

    • dueFromStringOptional

      Due on or after this date, YYYY-MM-DD.

    • dueToStringOptional

      Due on or before this date, YYYY-MM-DD.

    • statusOrderStatusOptional

      Only orders in this state.

  • firstIntOptional

    Page size, 1–100 (default 20).

    Example: 3

  • lastIntOptional

    Page size when paging backwards, 1–100.

  • searchStringOptional

    Free text, 1–100 characters.

  • sortOrderSortOptional

    Order (default: due date, soonest first).

    Show children

Returns

  • ordersOrderConnection!Required

    The shop’s orders, paged. Search matches PO number, customer name and part. Owner, admin, accountant and supervisor.

    Show children
    • edges[OrderEdge!]!Required

      The rows on this page, in order.

      Example: [{"cursor":"WyIyMDI2LTA5LTMwIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDAwMDAxIl0","node":{"id":"0192f0c1-0000-7000-8000-000000d00001","poNumber":"PO-2026-0001","customerName":"Alpha Auto Components 1","status":"IN_PRODUCTION","priority":"HIGH","dueDate":"2026-09-30","lines":[{"lineNo":1,"part":"Bush 25x30","quantity":40},{"lineNo":2,"part":"Pulley 90","quantity":60}]}},{"cursor":"WyIyMDI2LTEwLTAyIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDAwMDAyIl0","node":{"id":"0192f0c1-0000-7000-8000-000000d00002","poNumber":"PO-2026-0002","customerName":"Bharat Hydraulics 2","status":"IN_PRODUCTION","priority":"NORMAL","dueDate":"2026-10-02","lines":[{"lineNo":1,"part":"Pulley 90","quantity":60},{"lineNo":2,"part":"Spindle Nut","quantity":100},{"lineNo":3,"part":"Valve Body","quantity":140}]}},{"cursor":"WyIyMDI2LTEwLTA0IiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDAwMDAzIl0","node":{"id":"0192f0c1-0000-7000-8000-000000d00003","poNumber":"PO-2026-0003","customerName":"Cauvery Pumps 3","status":"COMPLETED","priority":"LOW","dueDate":"2026-10-04","lines":[{"lineNo":1,"part":"Spindle Nut","quantity":80}]}}]

      Show children
      • cursorString!Required

        Opaque position of this row in the list.

        Example: "WyIyMDI2LTA5LTMwIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDAwMDAxIl0"

      • nodeOrder!Required

        The Order.

        Example: {"id":"0192f0c1-0000-7000-8000-000000d00001","poNumber":"PO-2026-0001","customerName":"Alpha Auto Components 1","status":"IN_PRODUCTION","priority":"HIGH","dueDate":"2026-09-30","lines":[{"lineNo":1,"part":"Bush 25x30","quantity":40},{"lineNo":2,"part":"Pulley 90","quantity":60}]}

        Show children
        • createdAtString!Required

          UTC time the order was entered.

        • customerIdID!Required

          The customer (see customer).

        • customerNameString!Required

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

          Example: "Alpha Auto Components 1"

        • dueDateString!Required

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

          Example: "2026-09-30"

        • idID!Required

          Stable id (UUIDv7).

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

        • lines[OrderLine!]!Required

          The parts ordered, in line order.

          Example: [{"lineNo":1,"part":"Bush 25x30","quantity":40},{"lineNo":2,"part":"Pulley 90","quantity":60}]

          Show children
          • drawingRefStringOptional

            The customer’s drawing reference. The drawing file itself comes with N1C-049.

          • idID!Required

            Stable id (UUIDv7).

          • jobCardIdIDOptional

            The job card made for this line (open it with jobCard).

          • lineNoInt!Required

            Position on the order, from 1.

            Example: 1

          • materialStringOptional

            Material to use.

          • partString!Required

            Part name or number.

            Example: "Bush 25x30"

          • quantityInt!Required

            Pieces ordered.

            Example: 40

        • poNumberString!Required

          The customer’s PO number.

          Example: "PO-2026-0001"

        • priorityOrderPriority!Required

          How urgently to take it.

          Example: "HIGH"

          • HIGHAhead of normal orders.
          • LOWFill gaps in the schedule.
          • NORMALThe default.
          • URGENTDrop other work for it.
        • quoteIdIDOptional

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

        • statusOrderStatus!Required

          Worked out from the job cards.

          Example: "IN_PRODUCTION"

          • COMPLETEDEvery job card is done.
          • IN_PRODUCTIONAt least one job card has started and not every one is done.
          • OPENAccepted; no job card has started.
        • updatedAtString!Required

          UTC time of the last change.

    • pageInfoPageInfo!Required

      Whether more pages exist, and the cursors to reach them.

      Example: {"hasNextPage":true,"hasPreviousPage":false,"endCursor":"WyIyMDI2LTEwLTA0IiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDAwMDAzIl0"}

      Show children
      • endCursorStringOptional

        Cursor of the last row; pass it as after to get the next page. Null when the page is empty.

        Example: "WyIyMDI2LTEwLTA0IiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDAwMDAzIl0"

      • hasNextPageBoolean!Required

        Whether another page follows this one.

        Example: true

      • hasPreviousPageBoolean!Required

        Whether another page comes before this one.

        Example: false

      • startCursorStringOptional

        Cursor of the first row; pass it as before to page backwards. Null when the page is empty.

    • totalCountInt!Required

      All rows matching the filter and search, not just this page.

      Example: 24

Errors

CodeHTTPWhen
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.