openapi: 3.1.0
info:
  version: '2.0'
  title: Aident WebConnect
  description: |
    This is the API documentation for the Aident WebConnect app designed for Microsoft Dynamics 365 Business Central.
servers:
  - url: https://api.businesscentral.dynamics.com/v2.0
security:
  - oAuthSample:
      - default_scope
tags:
  - name: Item
    description: Export Items
  - name: Stock
    description: Export Stock
  - name: Price
    description: Export Prices
  - name: Customer
    description: Import / Export Customer
  - name: Order
    description: Import (Return) Order / Export Order Status
paths:
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/customers:
    get:
      operationId: exportCustomer
      summary: Exports customer information associated with the specified webshop tenant
      description: Exports customer information associated with the specified webshop tenant.
      tags:
        - Customer
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - $ref: '#/components/parameters/customerFilter'
        - $ref: '#/components/parameters/schemaVersion'
        - in: query
          name: $expand
          required: true
          schema:
            type: string
            enum:
              - shipToAddresses
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  '@odata.context':
                    type: string
                    readOnly: true
                    description: Only given in responses from BC
                    example: https://api.businesscentral.dynamics.com/{{environment}}/api/aident/webConnect/v2.0/$metadata#companies({{companyId}})/customers
                  value:
                    type: array
                    readOnly: true
                    items:
                      $ref: '#/components/schemas/CustomerExport'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/wsCustomers:
    post:
      operationId: importCustomer
      summary: Creates a new customer in Business Central
      description: Creates a new customer in Business Central.
      tags:
        - Customer
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - $ref: '#/components/parameters/schemaVersion'
        - in: query
          name: $expand
          schema:
            type: string
            enum:
              - wsShipToAddresses
      requestBody:
        description: New Customer in Business Central
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerImport'
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerImport'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/orders:
    post:
      operationId: importOrder
      summary: Creates a new sales order in Business Central
      description: Creates a new sales order in Business Central.
      tags:
        - Order
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - in: query
          name: $expand
          required: true
          schema:
            type: string
            enum:
              - lines
      requestBody:
        description: New Order in Business Central
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Order'
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/ordersWithPayment:
    post:
      operationId: importOrderWithPayment
      summary: Creates new Sales Order in Business Central with Payment Details
      description: Creates new Sales Order in Business Central with Payment Details. This API is available only if Aident WebConnect Pay app is installed.
      tags:
        - Order
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - in: query
          name: $expand
          required: true
          schema:
            type: string
            enum:
              - lines
      requestBody:
        description: New Order in Business Central
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderWithPayment'
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderWithPayment'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/returnOrders:
    post:
      operationId: importReturnOrder
      summary: Creates a new sales return order in Business Central
      description: Creates a new sales return order in Business Central.
      tags:
        - Order
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - in: query
          name: $expand
          required: true
          schema:
            type: string
            enum:
              - returnLines
      requestBody:
        description: New Return Order in Business Central
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnOrder'
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReturnOrder'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/items:
    get:
      operationId: exportItem
      summary: Exports a list of items associated with the specified webshop tenant
      description: Exports a list of items associated with the specified webshop tenant.
      tags:
        - Item
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - $ref: '#/components/parameters/itemFilter'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  '@odata.context':
                    type: string
                    readOnly: true
                    description: Only given in responses from BC
                    example: https://api.businesscentral.dynamics.com/{{environment}}/api/aident/webConnect/v2.0/$metadata#companies({{companyId}})/items
                  value:
                    type: array
                    readOnly: true
                    items:
                      $ref: '#/components/schemas/Item'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/stock:
    get:
      operationId: exportStock
      summary: Exports a list of stock quantities per warehouse for items associated with the specified webshop tenant
      description: Exports a list of stock quantities per warehouse for items associated with the specified webshop tenant.
      tags:
        - Stock
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - $ref: '#/components/parameters/stockFilter'
        - in: query
          name: $expand
          required: true
          schema:
            type: string
            enum:
              - stockPerLocations
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  '@odata.context':
                    type: string
                    readOnly: true
                    description: Only given in responses from BC
                    example: https://api.businesscentral.dynamics.com/{{environment}}/api/aident/webConnect/v2.0/$metadata#companies({{companyId}})/stock
                  value:
                    type: array
                    readOnly: true
                    items:
                      $ref: '#/components/schemas/Stock'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/orderStatuses:
    get:
      operationId: exportOrderStatus
      summary: Exports a list of line statuses within an order
      description: Exports a list of line statuses within an order.
      tags:
        - Order
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - $ref: '#/components/parameters/orderStatusFilter'
        - $ref: '#/components/parameters/schemaVersion'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  '@odata.context':
                    type: string
                    readOnly: true
                    description: Only given in responses from BC
                    example: https://api.businesscentral.dynamics.com/{{environment}}/api/aident/webConnect/v2.0/$metadata#companies({{companyId}})/orderStatuses
                  value:
                    type: array
                    readOnly: true
                    items:
                      $ref: '#/components/schemas/OrderStatus'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
  /{environment}/api/aident/webConnect/v2.0/companies({companyId})/prices:
    get:
      operationId: exportPrice
      summary: Exports webshop sales prices associated with the specified webshop tenant
      description: Exports webshop sales prices associated with the specified webshop tenant.
      tags:
        - Price
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/tenantId'
        - $ref: '#/components/parameters/priceFilter'
        - $ref: '#/components/parameters/schemaVersion'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  '@odata.context':
                    type: string
                    readOnly: true
                    description: Only given in responses from BC
                    example: https://api.businesscentral.dynamics.com/{{environment}}/api/aident/webConnect/v2.0/$metadata#companies({{companyId}})/salesPrices
                  value:
                    type: array
                    readOnly: true
                    items:
                      $ref: '#/components/schemas/PriceExport'
        '400':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
components:
  securitySchemes:
    oAuthSample:
      type: oauth2
      description: This API uses OAuth2 with the implicit grant flow.
      flows:
        clientCredentials:
          tokenUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
          scopes:
            default_scope: https://api.businesscentral.dynamics.com/.default
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      example: 52964077-d04a-ef11-bfe7-6045bdaca5ca
      schema:
        type: string
    tenantId:
      name: environment
      in: path
      required: true
      example: Sandbox
      schema:
        type: string
    customerFilter:
      name: $filter
      in: query
      required: true
      schema:
        type: string
        example: webshopTenantCode eq 'B2B' and customerNo eq 'D00010'
    schemaVersion:
      name: $schemaversion
      in: query
      schema:
        type: string
        example: '1.0'
    itemFilter:
      name: $filter
      in: query
      required: true
      schema:
        type: string
        example: webshopTenantCode eq 'B2B'
    stockFilter:
      name: $filter
      in: query
      required: true
      schema:
        type: string
        example: webshopTenantCode eq 'B2B'
    orderStatusFilter:
      name: $filter
      in: query
      required: true
      schema:
        type: string
        example: webshopTenantCode eq 'B2B' and originalOrderNo eq '1000001'
    priceFilter:
      name: $filter
      in: query
      required: true
      schema:
        type: string
        example: webshopTenantCode eq 'B2B'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
    odataetag:
      type: string
      readOnly: true
      description: Only given in responses from BC
      example: W/"JzE5OzYzNDI3NzIwNTQyMzM3MTAwNTMxOzAwOyc="
    systemId:
      type: string
      readOnly: true
      example: 9b9bf8c9-f65e-ef11-b923-e03d91645473
    ShipToAddressExport:
      type: object
      properties:
        '@odata.etag':
          $ref: '#/components/schemas/odataetag'
        systemId:
          $ref: '#/components/schemas/systemId'
        shipToCode:
          type: string
          maxLength: 10
          example: SHIP001
          description: Specifies Code of Ship-to Address.
        shipToName:
          type: string
          maxLength: 100
          example: Max Müller
          description: Specifies the Customer Name for Ship-to Address.
        shipToName2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Customer Name 2 for Ship-to Address.
        shipToAddress:
          type: string
          maxLength: 100
          example: Musterstraße 12
          description: Specifies the Customer Address for Ship-to Address.
        shipToAddress2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Customer Address 2 for Ship-to Address.
        shipToPostCode:
          type: string
          maxLength: 20
          example: 10115
          description: Specifies the Customer Post Code for Ship-to Address.
        shipToCity:
          type: string
          maxLength: 30
          example: Berlin
          description: Specifies the Customer City for Ship-to Address.
        shipToCounty:
          type: string
          maxLength: 30
          example: ''
          description: Specifies the Customer County for Ship-to Address.
        shipToCountry:
          type: string
          maxLength: 10
          example: DE
          description: Specifies the Customer Country/Region Code for Ship-to Address.
        shipToPhoneNo:
          type: string
          maxLength: 30
          example: +49 30 12345678
          description: Specifies the Customer Phone No. for Ship-to Address.
        shipToEmail:
          type: string
          maxLength: 80
          example: max.mueller@example.com
          description: Specifies the Customer E-Mail for Ship-to Address.
    CustomerExport:
      type: object
      properties:
        '@odata.etag':
          $ref: '#/components/schemas/odataetag'
        systemId:
          $ref: '#/components/schemas/systemId'
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code.
        customerNo:
          type: string
          maxLength: 20
          example: C-000001
          description: Specifies the No. of existing Customer or for new Customer.
        customerType:
          type: string
          enum:
            - ' '
            - B2B
            - B2C
            - Employee
          example: B2B
          description: Specifies the type of Webshop Customer.
        name:
          type: string
          maxLength: 100
          example: Max Müller
          description: Specifies the Name of Customer.
        name2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Name 2 of Customer.
        address:
          type: string
          maxLength: 100
          example: Musterstraße 12
          description: Specifies the Address of Customer.
        address2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Address 2 of Customer.
        postCode:
          type: string
          maxLength: 20
          example: 10115
          description: Specifies the Post Code of Customer.
        city:
          type: string
          maxLength: 30
          example: Berlin
          description: Specifies the City of Customer.
        county:
          type: string
          maxLength: 30
          example: ''
          description: Specifies the County of Customer.
        country:
          type: string
          maxLength: 10
          example: DE
          description: Specifies the Country/Region Code of Customer.
        phoneNo:
          type: string
          maxLength: 30
          example: +49 30 12345678
          description: Specifies the Phone No. of Customer.
        email:
          type: string
          maxLength: 80
          example: max.mueller@example.com
          description: Specifies the E-Mail of Customer.
        languageCode:
          type: string
          maxLength: 10
          example: DEU
          description: Specifies the Language Code of Customer.
        currencyCode:
          type: string
          maxLength: 10
          example: EUR
          description: Specifies the Currency Code of Customer.
        balanceLCY:
          type: number
          format: float
          example: 0
          description: Specifies the payment amount that the customer owes for completed sales.
        creditLimitLCY:
          type: number
          format: float
          example: 0
          description: Specifies the maximum amount for customer to exceed the payment balance before warnings are issued.
        blocked:
          type: string
          enum:
            - ' '
            - All
            - Invoice
            - Ship
          example: ' '
          description: Specifies wheather the customer is blocked.
        shipToAddresses:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/ShipToAddressExport'
    ShipToAddressImport:
      type: object
      properties:
        shipToCode:
          type: string
          maxLength: 10
          example: SHIP001
          description: Specifies Code of Ship-to Address.
        shipToName:
          type: string
          maxLength: 100
          example: Max Müller
          description: Specifies the Customer Name for Ship-to Address.
        shipToName2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Customer Name 2 for Ship-to Address.
        shipToAddress:
          type: string
          maxLength: 100
          example: Musterstraße 12
          description: Specifies the Customer Address for Ship-to Address.
        shipToAddress2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Customer Address 2 for Ship-to Address.
        shipToPostCode:
          type: string
          maxLength: 20
          example: 10115
          description: Specifies the Customer Post Code for Ship-to Address.
        shipToCity:
          type: string
          maxLength: 30
          example: Berlin
          description: Specifies the Customer City for Ship-to Address.
        shipToCounty:
          type: string
          maxLength: 30
          example: ''
          description: Specifies the Customer County for Ship-to Address.
        shipToCountry:
          type: string
          maxLength: 10
          example: DE
          description: Specifies the Customer Country/Region Code for Ship-to Address.
        shipToPhoneNo:
          type: string
          maxLength: 30
          example: +49 30 12345678
          description: Specifies the Customer Phone No. for Ship-to Address.
        shipToEmail:
          type: string
          maxLength: 80
          example: max.mueller@example.com
          description: Specifies the Customer E-Mail for Ship-to Address.
    CustomerImport:
      type: object
      properties:
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code from which Customer is imported.
        customerNo:
          type: string
          maxLength: 20
          example: C-000001
          description: Specifies the No. of existing Customer or for new Customer.
        customerType:
          type: string
          enum:
            - ' '
            - B2B
            - B2C
            - Employee
          example: B2B
          description: Specifies the type of imported Webshop Customer.
        name:
          type: string
          maxLength: 100
          example: Max Müller
          description: Specifies the Name of Customer.
        name2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Name 2 of Customer.
        address:
          type: string
          maxLength: 100
          example: Musterstraße 12
          description: Specifies the Address of Customer.
        address2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Address 2 of Customer.
        postCode:
          type: string
          maxLength: 20
          example: 10115
          description: Specifies the Post Code of Customer.
        city:
          type: string
          maxLength: 30
          example: Berlin
          description: Specifies the City of Customer.
        county:
          type: string
          maxLength: 30
          example: ''
          description: Specifies the County of Customer.
        country:
          type: string
          maxLength: 10
          example: DE
          description: Specifies the Country/Region Code of Customer.
        phoneNo:
          type: string
          maxLength: 30
          example: +49 30 12345678
          description: Specifies the Phone No. of Customer.
        email:
          type: string
          maxLength: 80
          example: max.mueller@example.com
          description: Specifies the E-Mail of Customer.
        languageCode:
          type: string
          maxLength: 10
          example: DEU
          description: Specifies the Language Code of Customer.
        currencyCode:
          type: string
          maxLength: 10
          example: EUR
          description: Specifies the Currency Code of Customer.
        wsShipToAddresses:
          type: array
          items:
            $ref: '#/components/schemas/ShipToAddressImport'
    OrderLine:
      type: object
      properties:
        lineNo:
          type: integer
          example: 1
          description: Specifies the unique No. of imported Webshop Order Line.
        type:
          type: string
          enum:
            - ' '
            - G/L Account
            - Item
            - Resource
          example: Item
          description: Specifies the Type of imported Webshop Order Line.
        'no':
          type: string
          maxLength: 20
          example: 1900-S
          description: Specifies the No. of product in imported Webshop Order Line.
        variantCode:
          type: string
          maxLength: 10
          example: 1
          description: Specifies the Variant Code of product in imported Webshop Order Line.
        description:
          type: string
          maxLength: 100
          example: PARIS Beistellstuhl, schwarz
          description: Specifies the Description of imported Webshop Order Line.
        description2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Description 2 of imported Webshop Order Line.
        quantity:
          type: number
          format: float
          example: 1
          description: Specifies the Quantity of product imported in Webshop Order Line.
        unitPrice:
          type: number
          format: float
          example: 100
          description: Specifies the Unit Price of product imported in Webshop Order Line.
        discountAmount:
          type: number
          format: float
          example: 10
          description: Specifies the Discount Amount  of product imported in Webshop Order Line.
        lineAmount:
          type: number
          format: float
          example: 100
          description: Specifies the Line Amount of product imported in webshop order lines.
        discountedLineAmount:
          type: number
          format: float
          example: 90
          description: Specifies the Discounted Line Amount of product imported in webshop order lines.
    Order:
      type: object
      properties:
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code from which Order is imported.
        orderNo:
          type: string
          maxLength: 20
          example: '000001'
          description: Specifies the unique No. of imported Webshop Order.
        orderDateTime:
          type: string
          format: date
          example: '2024-08-15T08:51:00Z'
          description: Specifies the Date/Time when imported Webshop Order was created in Webshop.
        registeredCustomer:
          type: boolean
          example: true
          description: Specifies if Customer ordered in Webshop as guest or registered user.
        languageCode:
          type: string
          maxLength: 10
          example: DEU
          description: Specifies the Language Code of imported Webshop Order.
        currencyCode:
          type: string
          maxLength: 10
          example: EUR
          description: Specifies the Currency Code of imported Webshop Order.
        shipmentMethodCode:
          type: string
          maxLength: 10
          example: CIF
          description: Specifies the Shipment Method Code of imported Webshop Order.
        shipmentCosts:
          type: number
          format: float
          example: 2.3
          description: Specifies the Shipment Costs of imported Webshop Order.
        paymentMethodCode:
          type: string
          maxLength: 10
          example: BANK
          description: Specifies the Payment Method Code of imported Webshop Order.
        customerNo:
          type: string
          maxLength: 20
          example: 1000
          description: Specifies the No. of Customer of imported Webshop Order.
        shipToAddressCode:
          type: string
          maxLength: 10
          example: ''
          description: Specifies the Ship-to Code of imported Webshop Order in case that Ship-to Address is different from Bill-to Address in Order.
        subtotal:
          type: number
          format: float
          example: 90
          description: Specifies the Subtotal of all lines in imported Webshop Order.
        totalAmount:
          type: number
          format: float
          example: 92.3
          description: Specifies the Total Amount in imported Webshop Order. Total Amount equals sum of all lines in order and additional costs like Shipment Costs.
        lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
    OrderWithPayment:
      type: object
      properties:
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code from which Order is imported.
        orderNo:
          type: string
          maxLength: 20
          example: '000001'
          description: Specifies the unique No. of imported Webshop Order.
        orderDateTime:
          type: string
          format: date
          example: '2024-08-15T08:51:00Z'
          description: Specifies the Date/Time when imported Webshop Order was created in Webshop.
        registeredCustomer:
          type: boolean
          example: true
          description: Specifies if Customer ordered in Webshop as guest or registered user.
        languageCode:
          type: string
          maxLength: 10
          example: DEU
          description: Specifies the Language Code of imported Webshop Order.
        currencyCode:
          type: string
          maxLength: 10
          example: EUR
          description: Specifies the Currency Code of imported Webshop Order.
        shipmentMethodCode:
          type: string
          maxLength: 10
          example: CIF
          description: Specifies the Shipment Method Code of imported Webshop Order.
        shipmentCosts:
          type: number
          format: float
          example: 2.3
          description: Specifies the Shipment Costs of imported Webshop Order.
        paymentMethodCode:
          type: string
          maxLength: 10
          example: BANK
          description: Specifies the Payment Method Code of imported Webshop Order.
        customerNo:
          type: string
          maxLength: 20
          example: 1000
          description: Specifies the No. of Customer of imported Webshop Order.
        shipToAddressCode:
          type: string
          maxLength: 10
          example: ''
          description: Specifies the Ship-to Code of imported Webshop Order in case that Ship-to Address is different from Bill-to Address in Order.
        subtotal:
          type: number
          format: float
          example: 90
          description: Specifies the Subtotal of all lines in imported Webshop Order.
        totalAmount:
          type: number
          format: float
          example: 92.3
          description: Specifies the Total Amount in imported Webshop Order. Total Amount equals sum of all lines in order and additional costs like Shipment Costs.
        transactionID:
          type: string
          maxLength: 40
          example: a14c57e7-3ab9-49dc-9cd5-1d16f7d346a4
          description: Specifies the transaction ID. This key is used to uniquely identify the complete payment process for all data.
        reference1:
          type: string
          maxLength: 40
          example: '8515748691833060'
          description: Specifies the tracking number (PSP reference) of the importer process.
        reference2:
          type: string
          maxLength: 40
          example: ''
          description: Specifies the tracking number from the importer process. This field allows the use of two references, as some payment service providers (PSPs) only require one number to identify the transaction, while other PSPs require two numbers.
        lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
    ReturnOrderLine:
      type: object
      properties:
        lineNo:
          type: integer
          example: 1
          description: Specifies the unique No. of imported Webshop Order Line.
        type:
          type: string
          enum:
            - ' '
            - G/L Account
            - Item
            - Resource
          example: Item
          description: Specifies the Type of imported Webshop Order Line.
        'no':
          type: string
          maxLength: 20
          example: 1900-S
          description: Specifies the No. of product in imported Webshop Order Line.
        variantCode:
          type: string
          maxLength: 10
          example: 1
          description: Specifies the Variant Code of product in imported Webshop Order Line.
        description:
          type: string
          maxLength: 100
          example: PARIS Beistellstuhl, schwarz
          description: Specifies the Description of imported Webshop Order Line.
        description2:
          type: string
          maxLength: 50
          example: ''
          description: Specifies the Description 2 of imported Webshop Order Line.
        quantity:
          type: number
          format: float
          example: 1
          description: Specifies the Quantity of product imported in Webshop Order Line
        unitPrice:
          type: number
          format: float
          example: 100
          description: Specifies the Unit Price of product imported in Webshop Order Line.
        discountAmount:
          type: number
          format: float
          example: 10
          description: Specifies the Discount Amount  of product imported in Webshop Order Line.
        returnReason:
          type: string
          maxLength: 10
          example: Defect
          description: Specifies the Return Reason Code of imported Webshop Return Order Line.
        orderLineNo:
          type: integer
          example: 1
          description: Specifies the Webshop Order Line No. of original Webshop Order.
        lineAmount:
          type: number
          format: float
          example: 100
          description: Specifies the Line Amount of product imported in webshop order lines.
        discountedLineAmount:
          type: number
          format: float
          example: 90
          description: Specifies the Discounted Line Amount of product imported in webshop order lines.
    ReturnOrder:
      type: object
      properties:
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code from which Order is imported.
        returnOrderNo:
          type: string
          maxLength: 20
          example: R-100000001
          description: Specifies the unique No. of imported Webshop Order.
        returnOrderDateTime:
          type: string
          format: date
          example: '2024-08-20T08:51:00Z'
          description: Specifies the Date/Time when imported Webshop Order was created in Webshop.
        orderNo:
          type: string
          maxLength: 20
          example: '000001'
          description: Specifies the No. of Order that will be returned.
        registeredCustomer:
          type: boolean
          example: true
          description: Specifies if Customer ordered in Webshop as guest or registered user.
        languageCode:
          type: string
          maxLength: 10
          example: DEU
          description: Specifies the Language Code of imported Webshop Order.
        currencyCode:
          type: string
          maxLength: 10
          example: EUR
          description: Specifies the Currency Code of imported Webshop Order.
        customerNo:
          type: string
          maxLength: 20
          example: C-000001
          description: Specifies the No. of Customer of imported Webshop Order.
        returnedShipmentCosts:
          type: number
          format: float
          example: 2.3
          description: Specifies the Shipment Costs of imported Webshop Order.
        subtotal:
          type: number
          format: float
          example: 90
          description: Specifies the Subtotal of all lines in imported Webshop Order.
        totalAmount:
          type: number
          format: float
          example: 92.3
          description: Specifies the Total Amount in imported Webshop Order. Total Amount equals sum of all lines in order and additional costs like Shipment Costs.
        returnLines:
          type: array
          items:
            $ref: '#/components/schemas/ReturnOrderLine'
    Item:
      type: object
      properties:
        '@odata.etag':
          $ref: '#/components/schemas/odataetag'
        systemId:
          $ref: '#/components/schemas/systemId'
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code to which the Item is assigned.
        itemNo:
          type: string
          maxLength: 20
          example: 1900-S
          description: Specifies the No. of Item.
        itemVariantCode:
          type: string
          maxLength: 10
          example: '01'
          description: Specifies the Code of Item Variant.
        description:
          type: string
          maxLength: 100
          example: PARIS Gästestuhl, schwarz
          description: Specifies the Description of Item.
        vendorNo:
          type: string
          maxLength: 20
          example: 10000
          description: Specifies the vendor code of who supplies this item by default.
        vendorItemNo:
          type: string
          maxLength: 50
          example: 123
          description: Specifies the number that the vendor uses for this item.
        itemCategoryCode:
          type: string
          maxLength: 20
          example: STUHL
          description: Specifies the category that the item belongs to.
    StockPerLocations:
      type: object
      properties:
        '@odata.etag':
          $ref: '#/components/schemas/odataetag'
        systemId:
          $ref: '#/components/schemas/systemId'
        locationCode:
          type: string
          maxLength: 10
          example: MAIN
          description: Specifies the Code of the Location.
        stock:
          type: number
          format: float
          example: 10
          description: Specifies the available stock for the Location.
    Stock:
      type: object
      properties:
        '@odata.etag':
          $ref: '#/components/schemas/odataetag'
        systemId:
          $ref: '#/components/schemas/systemId'
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code to which the Item is assigned.
        itemNo:
          type: string
          maxLength: 20
          example: 1900-S
          description: Specifies the No. of Item.
        itemVariantCode:
          type: string
          maxLength: 10
          example: '01'
          description: Specifies the Code of Item Variant.
        totalAvailableStock:
          type: number
          format: float
          example: 10
          description: Specifies the Total Available Stock for the Item.
        stockPerLocations:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/StockPerLocations'
    OrderStatus:
      type: object
      properties:
        '@odata.etag':
          $ref: '#/components/schemas/odataetag'
        systemId:
          $ref: '#/components/schemas/systemId'
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Webshop Tenant Code of Webshop Order Line.
        orderType:
          type: string
          enum:
            - Order
            - Return
          example: Order
          description: Specifies the Type of Webshop Order.
        orderNo:
          type: string
          maxLength: 20
          example: '1000001'
          description: Specifies the No. of Webshop (Return) Order.
        lineNo:
          type: integer
          example: 1
          description: Specifies the No. of Webshop (Return) Order Line.
        originalOrderNo:
          type: string
          maxLength: 20
          example: '1000001'
          description: Specifies the original No. of Webshop Order in case of Return.
        originalLineNo:
          type: integer
          example: 1
          description: Specifies the original No. of Webshop Order Line in case of Return.
        itemNo:
          type: string
          maxLength: 20
          example: 1900-S
          description: Specifies the Item No. from Webshop Order Line.
        itemVariantCode:
          type: string
          maxLength: 10
          example: 111
          description: Specifies the Item Variant Code from Webshop Order Line.
        quantity:
          type: number
          example: 2
          description: Specifies Quantity from Webshop Order Line.
        processedQuantity:
          type: number
          format: decimal
          example: 0
          description: Specifies Quantity that was Shipped in case of Order or Received in case of Return, out of requested Quantity.
        status:
          type: string
          enum:
            - Imported
            - Created
            - Partially Shipped
            - Shipped
            - Partially Received
            - Received
            - Completed
          example: Imported
          description: Specifies the Status of Webshop (Return) Order Line.
    PriceExport:
      type: object
      properties:
        '@odata.etag':
          $ref: '#/components/schemas/odataetag'
        systemId:
          $ref: '#/components/schemas/systemId'
        webshopTenantCode:
          type: string
          maxLength: 10
          example: B2B
          description: Specifies the Code of Webshop Tenant.
        countryRegionCode:
          type: string
          maxLength: 20
          example: DE
          description: Specifies the Code of Webshop Country/Region.
        customerType:
          type: string
          enum:
            - ' '
            - B2B
            - B2C
            - Employee
          example: B2B
          description: Specifies the type of Webshop Customer.
        itemNo:
          type: string
          maxLength: 20
          example: 1900-S
          description: Specifies the No. of Item.
        itemVariantCode:
          type: string
          maxLength: 20
          example: '01'
          description: Specifies the Code of Item Varinat.
        currencyCode:
          type: string
          maxLength: 10
          example: EUR
          description: Specifies the Currency Code of Item Sales Price.
        unitPrice:
          type: number
          format: float
          example: 100
          description: Specifies the Unit Price of Item.
        allowLineDiscount:
          type: boolean
          example: true
          description: Specifies if line discount is allowed.
        lineDiscountPercent:
          type: number
          format: float
          example: 10
          description: Specifies the Line Discount % for Item.
        priceInclVAT:
          type: boolean
          example: true
          description: Specifies if price includes VAT.
  responses:
    Error:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
