> ## Documentation Index
> Fetch the complete documentation index at: https://docs.smartcp.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Find by number

> Searches for the first matching order using the provided order number fragment.



## OpenAPI

````yaml https://logistics.api.smartcp.org/openapi/orders.openapi.json GET /orders/by-nr
openapi: 3.0.3
info:
  title: SmartCP Logistics Orders API
  version: 1.0.0
  description: >-
    Order lookup and file attachment endpoints for the SmartCP Logistics public
    REST API.
servers:
  - url: https://logistics.api.smartcp.org/v1
    description: Production
security:
  - bearerAuth: []
    directoryHeader: []
paths:
  /orders/by-nr:
    get:
      summary: Find by number
      description: >-
        Searches for the first matching order using the provided order number
        fragment.
      operationId: findOrderByNumber
      parameters:
        - name: nr
          in: query
          required: true
          description: Order number or fragment to search for.
          schema:
            type: string
          example: '4036230'
      responses:
        '200':
          description: Matching order found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseSuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/OrderLookupResult'
              example:
                status: 200
                message: OK
                data:
                  id: 4036230
                  nr: Tour 4036230
                  ownnr: CP-2026-001
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '404':
          description: No matching order found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringErrorResponse'
              example:
                status: 404
                message: Order with given nr (4036230) not found
                data: null
        '422':
          $ref: '#/components/responses/ValidationErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
components:
  schemas:
    BaseSuccessResponse:
      type: object
      required:
        - status
        - message
        - data
      properties:
        status:
          type: integer
          example: 200
        message:
          type: string
          example: OK
        data:
          nullable: true
    OrderLookupResult:
      type: object
      required:
        - id
        - nr
      properties:
        id:
          type: integer
          description: Order ID.
          example: 4036230
        nr:
          type: string
          description: Order number.
          example: Tour 4036230
        ownnr:
          type: string
          nullable: true
          description: Internal reference number.
          example: CP-2026-001
    StringErrorResponse:
      type: object
      required:
        - status
        - message
        - data
      properties:
        status:
          type: integer
          example: 401
        message:
          type: string
          example: Authentication failed
        data:
          nullable: true
          example: null
  responses:
    UnauthorizedResponse:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 401
            message: Authentication failed
            data: null
    ValidationErrorResponse:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 422
            message: The nr field is required.
            data: null
    TooManyRequestsResponse:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 429
            message: Too Many Attempts.
            data: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Client API key sent as a bearer token.
    directoryHeader:
      type: apiKey
      in: header
      name: X-Client-Directory
      description: >-
        Client directory identifier. Legacy `directory` header is still accepted
        for backward compatibility.

````