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

# Get order

> Returns the order with its lines.

Returns the order with its lines (in line order), the discounts of each line and each line's main unit quantity. Orders the user cannot see because of their [sharing codes](/en/v1/guides/sharing-codes) return 404.

## Error codes

Codes this endpoint can return. The [general errors](/en/v1/guides/result-codes) that apply to every endpoint (authentication, permissions, request headers, daily limit) are not repeated here.

| Code   | HTTP | Meaning         |
| ------ | ---- | --------------- |
| `6000` | 404  | Order not found |


## OpenAPI

````yaml api-reference/openapi.json GET /api/v1/orders/{orderId}
openapi: 3.1.1
info:
  title: Noyax API
  description: Server-to-server API for integrations to access Noyax data.
  version: '1.0'
servers:
  - url: https://dev.noyax.com/services/noyax_api
security:
  - Bearer: []
tags:
  - name: Sections
  - name: Warehouses
  - name: Quotes
  - name: Product Critical Stock
  - name: Product groups
  - name: Product Parameter Definitions
  - name: Product Parameters
  - name: Product Prices
  - name: Products
  - name: Orders
  - name: Cities
  - name: Countries
  - name: Currencies
  - name: Districts
  - name: Line Groups
  - name: Shipment Definitions
  - name: Units
  - name: VAT rates
  - name: Customer Addresses
  - name: Customer Bank Accounts
  - name: Customer Definitions
  - name: Customer Group Members
  - name: Customer Links
  - name: Customer Parameters
  - name: Customer Representatives
  - name: Customers
  - name: Customer Statement
  - name: Customer Telephones
paths:
  /api/v1/orders/{orderId}:
    get:
      tags:
        - Orders
      summary: Get order
      description: Returns the order with its lines and their discounts.
      parameters:
        - name: orderId
          in: path
          description: Order ID.
          required: true
          schema:
            type: string
            format: uuid
        - name: X-UserID
          in: header
          description: >-
            ID of the Noyax user the request is made on behalf of. Written to
            the audit fields of created, updated and deleted records.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-CompanyID
          in: header
          description: >-
            ID of the company. The user must be assigned to this company. All
            reads and writes are limited to this company.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-PeriodID
          in: header
          description: >-
            ID of the accounting period. Optional for customer endpoints; if
            sent, it is written to created records.
          schema:
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResultOfOrderDetailDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0201'
                Message: X-UserID header is required.
                Errors:
                  - Code: '0201'
                    Message: X-UserID header is required.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0102'
                Message: Token has expired. Obtain a new token using the refresh token.
                Errors:
                  - Code: '0102'
                    Message: >-
                      Token has expired. Obtain a new token using the refresh
                      token.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0110'
                Message: You do not have permission for this operation.
                Errors:
                  - Code: '0110'
                    Message: You do not have permission for this operation.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '6000'
                Message: Order not found.
                Errors:
                  - Code: '6000'
                    Message: Order not found.
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0120'
                Message: Daily request limit (10000) exceeded.
                Errors:
                  - Code: '0120'
                    Message: Daily request limit (10000) exceeded.
components:
  schemas:
    DataResultOfOrderDetailDto:
      required:
        - Success
        - ResultCode
        - Data
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: true
        ResultCode:
          type: string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
          example: '0000'
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Data:
          $ref: '#/components/schemas/OrderDetailDto'
    ErrorResult:
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: false
        ResultCode:
          type:
            - 'null'
            - string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Errors:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ResultError'
          description: All errors with their codes. Only present when Success is false.
    OrderDetailDto:
      type: object
      properties:
        Id:
          type: string
          description: Order ID.
          format: uuid
        CustomerId:
          type:
            - 'null'
            - string
          description: Customer ID.
          format: uuid
        CurrencyId:
          type:
            - 'null'
            - string
          description: Currency ID.
          format: uuid
        StatusId:
          type:
            - 'null'
            - string
          description: >-
            ID of the current order status. Assigned on create from the
            company's default status; the API never changes it.
          format: uuid
        StatusName:
          type:
            - 'null'
            - string
          description: Name of the current order status.
        CustomerName:
          type:
            - 'null'
            - string
          description: Customer name.
        OrderType:
          type: integer
          description: >-
            Required. 1: Purchase order (placed with a supplier), 2: Sales order
            (received from a customer). Cannot be changed after the order is
            created.
          format: int32
          example: 2
        OrderNumber:
          type:
            - 'null'
            - string
          description: >-
            Required. Order number, unique within the company for the same
            OrderType. Send "Next" on create to generate it from the company's
            order number series for the type. At most 10 characters.
          example: 9446A4D834
        DocumentNumber:
          type:
            - 'null'
            - string
          description: Document number (free text). At most 20 characters.
          example: 2026-15
        Date:
          type:
            - 'null'
            - string
          description: >-
            Required. Order date. The date part is stored as the order date; if
            a time is sent it is stored as the order time, otherwise the current
            time is used.
          format: date-time
          example: '2026-09-21T10:30:00'
        Description:
          type:
            - 'null'
            - string
          description: Description. At most 1000 characters.
        CustomerCode:
          type:
            - 'null'
            - string
          description: >-
            Required. Customer code (the customer's CustomerCode from GET
            /api/v1/customers). The order is written with the customer's
            address: the invoice address when the customer has one, otherwise
            the first address.
          example: C-0001
        CurrencyCode:
          type:
            - 'null'
            - string
          description: >-
            Required. Currency code from GET /api/v1/definitions/currencies. It
            is also the currency of the customer movement when
            CreateCustomerMovement is true.
          example: TRY
        DueDays:
          type: integer
          description: >-
            Payment term in days. Cannot be less than 0. When
            CreateCustomerMovement is true, the customer movement is due Date +
            DueDays (no due date when 0).
          format: int32
          example: 30
        DeliveryDate:
          type:
            - 'null'
            - string
          description: Delivery date.
          format: date-time
        SharingCode:
          type:
            - 'null'
            - string
          description: >-
            Sharing code that limits who can see the order. Empty means visible
            to everyone; otherwise it must be one of the user's sharing codes.
        DiscountTotal:
          type: number
          description: >-
            Total discount amount. Sent by the integrator, not calculated by the
            API.
          format: double
          example: 0
        SubTotal:
          type: number
          description: >-
            Subtotal (sum of the line amounts excluding taxes). Sent by the
            integrator, not calculated by the API.
          format: double
          example: 1000
        VatTotal:
          type: number
          description: Total VAT amount. Sent by the integrator, not calculated by the API.
          format: double
          example: 200
        AdditionalTaxTotal:
          type: number
          description: >-
            Total additional tax amount. Sent by the integrator, not calculated
            by the API.
          format: double
          example: 0
        WithholdingTotal:
          type: number
          description: >-
            Total withholding (tevkifat) amount. Sent by the integrator, not
            calculated by the API.
          format: double
          example: 0
        GrandTotal:
          type: number
          description: >-
            Grand total. Sent by the integrator, not calculated by the API. When
            CreateCustomerMovement is true, it is the amount of the customer
            movement.
          format: double
          example: 1200
        AverageExchangeRate:
          type: number
          description: >-
            Weighted average exchange rate of the lines. Sent by the integrator,
            not calculated by the API. Use 1 when everything is in the company's
            default currency. It is also the exchange rate of the customer
            movement when CreateCustomerMovement is true.
          format: double
          example: 1
        CreateCustomerMovement:
          type: boolean
          description: >-
            Whether the order has a customer movement. When true, a purchase
            order creates a credit (alacak) and a sales order creates a debit
            (borç) movement on the customer for GrandTotal, kept in sync on
            every update. When false the order has no customer movement; on
            update, false removes an existing movement. Movements that were
            already closed by a collection or payment cannot be changed or
            removed.
          example: true
        CreateDate:
          type:
            - 'null'
            - string
          description: Creation date.
          format: date-time
        ModifyDate:
          type:
            - 'null'
            - string
          description: Last modification date.
          format: date-time
        Lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLineDto'
          description: Order lines, in line order.
      description: Response data. Null when Success is false.
    ResultError:
      required:
        - Code
        - Message
      type: object
      properties:
        Code:
          type: string
          description: Error code. See the result codes page for the full list.
        Message:
          type: string
          description: Error description.
    OrderLineDto:
      type: object
      properties:
        ProductId:
          type:
            - 'null'
            - string
          description: Product ID.
          format: uuid
        UnitId:
          type:
            - 'null'
            - string
          description: Unit ID.
          format: uuid
        CurrencyId:
          type:
            - 'null'
            - string
          description: Currency ID of the line.
          format: uuid
        LineGroupId:
          type:
            - 'null'
            - string
          description: Line group ID.
          format: uuid
        WarehouseId:
          type:
            - 'null'
            - string
          description: Warehouse ID.
          format: uuid
        ProductName:
          type:
            - 'null'
            - string
          description: Product name.
        UnitName:
          type:
            - 'null'
            - string
          description: Unit name.
          example: ADET
        MainUnitQuantity:
          type: number
          description: >-
            Quantity converted to the product's main unit. Calculated by the API
            when the order is saved: the quantity itself when UnitId is the main
            unit, otherwise Quantity divided by the unit's multiplier (the
            product's quantity for the unit divided by its counter quantity,
            counter quantity 0 counts as 1).
          format: double
          example: 10
        ProductCode:
          type:
            - 'null'
            - string
          description: >-
            Required. Product code (the product's Code from GET
            /api/v1/products).
          example: URN-0001
        UnitCode:
          type:
            - 'null'
            - string
          description: >-
            Required. Unit code: the unit's universal code (for example C62 for
            ADET) or, when the unit has no universal code, its name (for example
            KOLİ). It must be one of the product's own units (its main unit or
            its second/third unit). The quantity in the product's main unit is
            calculated by the API.
          example: C62
        Quantity:
          type: number
          description: Quantity, in the line unit. Must be greater than 0.
          format: double
          example: 10
        UnitPrice:
          type: number
          description: >-
            Unit price, in the line currency. When VatIncluded is true the price
            includes VAT. Cannot be negative.
          format: double
          example: 100
        CurrencyCode:
          type:
            - 'null'
            - string
          description: Currency code of the line. Defaults to the order's currency.
          example: TRY
        ExchangeRate:
          type: number
          description: Exchange rate of the line currency. Cannot be negative.
          format: double
          example: 1
        DiscountRate:
          type: number
          description: >-
            Cumulative line discount rate (%) resulting from Discounts, between
            0 and 100. Sent by the integrator, not calculated by the API.
          format: double
          example: 0
        DiscountAmount:
          type: number
          description: >-
            Line discount amount. Sent by the integrator, not calculated by the
            API.
          format: double
          example: 0
        Discounts:
          type: array
          items:
            $ref: '#/components/schemas/OrderDiscountRequestDto'
          description: >-
            Discounts applied to the line one after another. Leave empty when
            the line has no discount.
        VatRate:
          type: integer
          description: VAT rate (%), between 0 and 100.
          format: int32
          example: 20
        VatIncluded:
          type: boolean
          description: Whether UnitPrice includes VAT.
          example: false
        VatAmount:
          type: number
          description: >-
            VAT amount of the line. Sent by the integrator, not calculated by
            the API.
          format: double
        AmountExcludingTax:
          type: number
          description: >-
            Line amount excluding taxes. Sent by the integrator, not calculated
            by the API.
          format: double
        AmountIncludingTax:
          type: number
          description: >-
            Line amount including taxes. Sent by the integrator, not calculated
            by the API.
          format: double
        VatBase:
          type: number
          description: >-
            VAT base of the line. Sent by the integrator, not calculated by the
            API.
          format: double
        VatExemptionCode:
          type:
            - 'null'
            - string
          description: VAT exemption code. At most 10 characters.
        LineGroupName:
          type:
            - 'null'
            - string
          description: Name of a line group from GET /api/v1/definitions/line-groups.
        WarehouseName:
          type:
            - 'null'
            - string
          description: >-
            Name of the warehouse the line is delivered from or to, from GET
            /api/v1/stock/warehouses.
        Description:
          type:
            - 'null'
            - string
          description: Line description. At most 255 characters.
        Description2:
          type:
            - 'null'
            - string
          description: Second line description. At most 255 characters.
        DeliveryDate:
          type:
            - 'null'
            - string
          description: Delivery date of the line.
          format: date-time
        AdditionalTaxCode1:
          type:
            - 'null'
            - string
          description: Additional tax 1 code. At most 15 characters.
        AdditionalTaxRate1:
          type: number
          description: Additional tax 1 rate (%).
          format: double
        AdditionalTaxAmount1:
          type: number
          description: >-
            Additional tax 1 amount. Sent by the integrator, not calculated by
            the API.
          format: double
        AdditionalTaxBase1:
          type: number
          description: >-
            Additional tax 1 base. Sent by the integrator, not calculated by the
            API.
          format: double
        AdditionalTaxCode2:
          type:
            - 'null'
            - string
          description: Additional tax 2 code. At most 15 characters.
        AdditionalTaxRate2:
          type: number
          description: Additional tax 2 rate (%).
          format: double
        AdditionalTaxAmount2:
          type: number
          description: >-
            Additional tax 2 amount. Sent by the integrator, not calculated by
            the API.
          format: double
        AdditionalTaxBase2:
          type: number
          description: >-
            Additional tax 2 base. Sent by the integrator, not calculated by the
            API.
          format: double
        AdditionalTaxCode3:
          type:
            - 'null'
            - string
          description: Additional tax 3 code. At most 15 characters.
        AdditionalTaxRate3:
          type: number
          description: Additional tax 3 rate (%).
          format: double
        AdditionalTaxAmount3:
          type: number
          description: >-
            Additional tax 3 amount. Sent by the integrator, not calculated by
            the API.
          format: double
        AdditionalTaxBase3:
          type: number
          description: >-
            Additional tax 3 base. Sent by the integrator, not calculated by the
            API.
          format: double
        WithholdingCode:
          type:
            - 'null'
            - string
          description: Withholding (tevkifat) code. At most 10 characters.
        WithholdingNumerator:
          type: integer
          description: Numerator of the withholding share (e.g. 9 in 9/10).
          format: int32
        WithholdingDenominator:
          type: integer
          description: Denominator of the withholding share (e.g. 10 in 9/10).
          format: int32
        WithheldVatAmount:
          type: number
          description: >-
            Withheld VAT amount. Sent by the integrator, not calculated by the
            API.
          format: double
    OrderDiscountRequestDto:
      type: object
      properties:
        Rate:
          type: number
          description: >-
            Discount rate (%), between 0 and 100. Discounts of a line are
            applied one after another in list order: 10, 10 and 10 give a 27.1%
            line discount.
          format: double
          example: 10
  securitySchemes:
    Bearer:
      type: http
      description: Access token obtained from the Noyax auth service with your API key.
      scheme: bearer
      bearerFormat: JWT

````