Microsoft Dynamics 365 Business Central SalesOrders API

Sales order documents

OpenAPI Specification

microsoft-dynamics-365-business-central-salesorders-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Microsoft Dynamics 365 Business Central API v2.0 Companies SalesOrders API
  description: 'Standard REST API (v2.0) for Microsoft Dynamics 365 Business Central.

    Exposes Business Central entities such as companies, customers, vendors,

    items, sales documents, purchase documents, and journals via an OData v4

    interface. Authentication uses OAuth 2.0 (Microsoft Entra ID) bearer

    tokens supporting both delegated user and service-to-service flows.


    URLs follow the pattern:

    https://api.businesscentral.dynamics.com/v2.0/{environment}/api/v2.0

    '
  version: v2.0
  contact:
    name: Kin Lane
    email: kin@apievangelist.com
  license:
    name: Microsoft Terms of Use
    url: https://www.microsoft.com/en-us/legal/terms-of-use
servers:
- url: https://api.businesscentral.dynamics.com/v2.0/{environment}/api/v2.0
  description: Business Central production environment
  variables:
    environment:
      default: production
      description: Business Central environment name
security:
- oauth2: []
tags:
- name: SalesOrders
  description: Sales order documents
paths:
  /companies({companyId})/salesOrders:
    get:
      tags:
      - SalesOrders
      summary: List sales orders
      operationId: salesOrders_list
      parameters:
      - $ref: '#/components/parameters/companyId'
      responses:
        '200':
          description: OK
    post:
      tags:
      - SalesOrders
      summary: Create a sales order
      operationId: salesOrders_create
      parameters:
      - $ref: '#/components/parameters/companyId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '201':
          description: Created
  /companies({companyId})/salesOrders({id}):
    get:
      tags:
      - SalesOrders
      summary: Get a sales order
      operationId: salesOrders_get
      parameters:
      - $ref: '#/components/parameters/companyId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: OK
    patch:
      tags:
      - SalesOrders
      summary: Update a sales order
      operationId: salesOrders_update
      parameters:
      - $ref: '#/components/parameters/companyId'
      - $ref: '#/components/parameters/id'
      - $ref: '#/components/parameters/ifMatch'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: OK
    delete:
      tags:
      - SalesOrders
      summary: Delete a sales order
      operationId: salesOrders_delete
      parameters:
      - $ref: '#/components/parameters/companyId'
      - $ref: '#/components/parameters/id'
      - $ref: '#/components/parameters/ifMatch'
      responses:
        '204':
          description: No Content
components:
  parameters:
    ifMatch:
      name: If-Match
      in: header
      description: ETag for optimistic concurrency
      schema:
        type: string
    companyId:
      name: companyId
      in: path
      required: true
      description: Company GUID
      schema:
        type: string
        format: uuid
    id:
      name: id
      in: path
      required: true
      description: GUID identifier
      schema:
        type: string
        format: uuid
  securitySchemes:
    oauth2:
      type: oauth2
      description: Microsoft Entra ID OAuth 2.0
      flows:
        authorizationCode:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
          tokenUrl: https://login.microsoftonline.com/common/oauth2/v2.0/token
          scopes:
            https://api.businesscentral.dynamics.com/.default: Business Central API access