Microsoft Dynamics NAV Sales Invoices API

Manage sales invoices and lines

Documentation

Specifications

Other Resources

OpenAPI Specification

navision-sales-invoices-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Business Central Administration Center Accounts Sales Invoices API
  description: REST API for programmatic administration of Dynamics 365 Business Central environments. Enables querying and managing production and sandbox environments, setting up administrative notifications, viewing tenant telemetry, managing apps, scheduling updates, and performing environment operations such as copy, rename, restore, and delete.
  version: '2.28'
  contact:
    name: Microsoft Dynamics Support
    email: bcsupport@microsoft.com
    url: https://dynamics.microsoft.com/support/
  license:
    name: Microsoft APIs Terms of Use
    url: https://learn.microsoft.com/en-us/legal/microsoft-apis/terms-of-use
  termsOfService: https://learn.microsoft.com/en-us/legal/microsoft-apis/terms-of-use
servers:
- url: https://api.businesscentral.dynamics.com/admin/v2.28
  description: Business Central Administration Center
security:
- oauth2: []
- bearerAuth: []
tags:
- name: Sales Invoices
  description: Manage sales invoices and lines
paths:
  /companies({company_id})/salesInvoices:
    get:
      summary: List Sales Invoices
      description: Returns a list of sales invoice objects.
      operationId: listSalesInvoices
      tags:
      - Sales Invoices
      parameters:
      - $ref: '#/components/parameters/company_id'
      - $ref: '#/components/parameters/top'
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/orderby'
      - $ref: '#/components/parameters/select'
      - $ref: '#/components/parameters/expand'
      responses:
        '200':
          description: Successfully retrieved sales invoices
          content:
            application/json:
              schema:
                type: object
                properties:
                  value:
                    type: array
                    items:
                      $ref: '#/components/schemas/SalesInvoice'
              examples:
                Listsalesinvoices200Example:
                  summary: Default listSalesInvoices 200 response
                  x-microcks-default: true
                  value:
                    value:
                    - id: abc123
                      number: example_value
                      externalDocumentNumber: example_value
                      invoiceDate: '2026-01-15'
                      postingDate: '2026-01-15'
                      dueDate: '2026-01-15'
                      customerId: '500123'
                      customerNumber: example_value
                      customerName: example_value
                      currencyCode: example_value
                      pricesIncludeTax: true
                      totalAmountExcludingTax: 42.5
                      totalTaxAmount: 42.5
                      totalAmountIncludingTax: 42.5
                      status: Draft
                      lastModifiedDateTime: '2026-01-15T10:30:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: Create a Sales Invoice
      description: Creates a new sales invoice in the specified company.
      operationId: createSalesInvoice
      tags:
      - Sales Invoices
      parameters:
      - $ref: '#/components/parameters/company_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SalesInvoiceCreate'
            examples:
              CreatesalesinvoiceRequestExample:
                summary: Default createSalesInvoice request
                x-microcks-default: true
                value:
                  externalDocumentNumber: example_value
                  invoiceDate: '2026-01-15'
                  customerId: '500123'
                  customerNumber: example_value
                  currencyCode: example_value
                  pricesIncludeTax: true
      responses:
        '201':
          description: Sales invoice created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesInvoice'
              examples:
                Createsalesinvoice201Example:
                  summary: Default createSalesInvoice 201 response
                  x-microcks-default: true
                  value:
                    id: abc123
                    number: example_value
                    externalDocumentNumber: example_value
                    invoiceDate: '2026-01-15'
                    postingDate: '2026-01-15'
                    dueDate: '2026-01-15'
                    customerId: '500123'
                    customerNumber: example_value
                    customerName: example_value
                    currencyCode: example_value
                    pricesIncludeTax: true
                    totalAmountExcludingTax: 42.5
                    totalTaxAmount: 42.5
                    totalAmountIncludingTax: 42.5
                    status: Draft
                    lastModifiedDateTime: '2026-01-15T10:30:00Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  parameters:
    filter:
      name: $filter
      in: query
      description: OData filter expression
      schema:
        type: string
    orderby:
      name: $orderby
      in: query
      description: OData order by expression
      schema:
        type: string
    expand:
      name: $expand
      in: query
      description: Related entities to expand inline
      schema:
        type: string
    skip:
      name: $skip
      in: query
      description: Number of items to skip
      schema:
        type: integer
        minimum: 0
    company_id:
      name: company_id
      in: path
      required: true
      description: The unique identifier of the company
      schema:
        type: string
        format: uuid
    select:
      name: $select
      in: query
      description: Comma-separated list of properties to include in the response
      schema:
        type: string
    top:
      name: $top
      in: query
      description: Maximum number of items to return
      schema:
        type: integer
        minimum: 0
  schemas:
    SalesInvoiceCreate:
      type: object
      properties:
        externalDocumentNumber:
          type: string
          maxLength: 35
          example: example_value
        invoiceDate:
          type: string
          format: date
          example: '2026-01-15'
        customerId:
          type: string
          format: uuid
          example: '500123'
        customerNumber:
          type: string
          maxLength: 20
          example: example_value
        currencyCode:
          type: string
          maxLength: 10
          example: example_value
        pricesIncludeTax:
          type: boolean
          example: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable error code
            message:
              type: string
              description: A human-readable error message
          example: example_value
    SalesInvoice:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: abc123
        number:
          type: string
          maxLength: 20
          example: example_value
        externalDocumentNumber:
          type: string
          maxLength: 35
          example: example_value
        invoiceDate:
          type: string
          format: date
          example: '2026-01-15'
        postingDate:
          type: string
          format: date
          example: '2026-01-15'
        dueDate:
          type: string
          format: date
          example: '2026-01-15'
        customerId:
          type: string
          format: uuid
          example: '500123'
        customerNumber:
          type: string
          maxLength: 20
          example: example_value
        customerName:
          type: string
          maxLength: 100
          example: example_value
        currencyCode:
          type: string
          maxLength: 10
          example: example_value
        pricesIncludeTax:
          type: boolean
          example: true
        totalAmountExcludingTax:
          type: number
          format: decimal
          readOnly: true
          example: 42.5
        totalTaxAmount:
          type: number
          format: decimal
          readOnly: true
          example: 42.5
        totalAmountIncludingTax:
          type: number
          format: decimal
          readOnly: true
          example: 42.5
        status:
          type: string
          enum:
          - Draft
          - In Review
          - Open
          - Paid
          - Canceled
          - Corrective
          readOnly: true
          example: Draft
        lastModifiedDateTime:
          type: string
          format: date-time
          readOnly: true
          example: '2026-01-15T10:30:00Z'
  responses:
    Unauthorized:
      description: Unauthorized - authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Bad request - invalid input
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 authentication via Microsoft Entra ID
      flows:
        authorizationCode:
          authorizationUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize
          tokenUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
          scopes:
            https://api.businesscentral.dynamics.com/.default: Access Business Central Admin APIs
        clientCredentials:
          tokenUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
          scopes:
            https://api.businesscentral.dynamics.com/.default: Access Business Central Admin APIs
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
externalDocs:
  description: Administration Center API Documentation
  url: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/administration-center-api