openapi: 3.0.4
info:
  title: RamBase API
  description: Limited set of API resources from RamBase API. Add query parameter 'clientId' to retrieve API resources your API client has permission to.
  contact:
    email: support@rambase.net
  license:
    name: RamBase Licence
  version: 1.0.0
servers:
  - url: https://api.rambase.net
    description: Production server
paths:
  '/sales/orders/{salesOrderId}/items/{itemId}':
    get:
      tags:
        - sales
      summary: Details about a specific item of an order
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=155&version=135
      operationId: sales_GetItemByIdForOrderById
      parameters:
        - $ref: '#/components/parameters/salesOrderId'
        - $ref: '#/components/parameters/itemId'
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
        - $ref: '#/components/parameters/showDomainValues'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/select'
        - name: $expand
          in: query
          description: Used to add fields to the response
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - HasStockAssignmentsWithRevisionMismatch
                - EndCustomer
                - PriceConverted
                - TotalsConverted
                - Location.LocationId
                - Location.LocationLink
                - Seller.FirstName
                - Seller.LastName
                - Product.Manufacturer.Name
                - Product.LatestProductRevision
                - LandedCostConverted
                - Accounting.VATCodeDefinition.Description
                - ForwardedTo
                - HighlightedNotification
                - RecurringInvoicing
                - ProjectOrder
                - ProjectOrderItem
                - IntercompanySalesOrderReference
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  salesOrderItem:
                    type: object
                    properties:
                      salesOrderItemId:
                        type: integer
                        description: Sales order item identifier
                        format: int32
                      type:
                        type: integer
                        description: Item type
                        format: int32
                      status:
                        type: integer
                        description: Status of the sales order item (0-9).
                        format: int32
                      createdAt:
                        type: string
                        description: Date and time of creation
                        format: date-time
                      lineNumber:
                        type: integer
                        description: 'Line- or sequence number of the item. The LineNumber is used for sorting items in applications, prints, reports etc.'
                        format: int32
                      requestedDeliveryDate:
                        type: string
                        description: The delivery date as requested by the customer.
                        format: date
                      confirmedDeliveryDate:
                        type: string
                        description: Confirmed date of delivery. Date of which the customer can expect the arriving goods
                        format: date
                      isConfirmedDeliveryDateLocked:
                        type: boolean
                        description: 'If confirmed delivery date in sales order item (COA) is locked, this date should not be re-calculated automatically.'
                      scheduledShippingDate:
                        type: string
                        description: Date when the goods was/will be shipped from the warehouse.
                        format: date
                      customersReferenceNumber:
                        type: string
                        description: Customers item reference number. Typically to the customers internal system.
                      customersProductName:
                        type: string
                        description: Customers internal name of the product. Retrieved from the product.
                      equivalentProductName:
                        type: string
                        description: 'Name of product with equivalent behavior and attributes. Can be used for same purpose. '
                      requestedProductStructureRevision:
                        type: string
                        description: 'The revision will typically be a major change, as opposed to minor changes stored in the version of the product structure.'
                      hasStockAssignmentsWithRevisionMismatch:
                        type: boolean
                        description: Is linked to a stock assignment (SAR) with a product structure revision that mismatches the requested product structure revision on the sales order item.
                      productDescription:
                        type: string
                        description: 'Description of the item. If not specified, the description is by default copied from the product.'
                      note:
                        type: string
                        description: Additional information regarding the item (free text). Might be visible to customers/suppliers.
                      grossMargin:
                        type: number
                        description: 'Gross margin of the item. An eventual approval of GM is triggered if this percentage is lower than the highest value of minimum gross margin set up in Customer, Product and  GM in COM'
                        format: double
                      vATPercent:
                        type: number
                        description: Value added tax percent
                        format: double
                      discountPercent:
                        type: number
                        description: The discount in percent for this item.
                        format: double
                      quantity:
                        type: number
                        description: Number of units ordered
                        format: double
                      remainingQuantity:
                        type: number
                        description: Remaining number of units to be forwarded.
                        format: double
                      shippedQuantity:
                        type: number
                        description: Quantity forwarded to one or more shipping advices
                        format: double
                      allocatedStockQuantity:
                        type: number
                        description: The quantity of this item which do have assignments from stock
                        format: double
                      requireSerialNumberBeforeShipping:
                        type: boolean
                        description: 'True if serial number is required before shipping. Note that if the product has set this value to true, this can not be overridden.'
                      isBlockedForProduction:
                        type: boolean
                        description: True if a new production is not to be started automatically based on this sales order item.
                      endCustomer:
                        $ref: '#/components/schemas/EndCustomer'
                      warranty:
                        type: object
                        properties:
                          warrantyExpirationDate:
                            type: string
                            description: Date of warranty expiration.
                            format: date
                          isPaymentCoveredByWarranty:
                            type: boolean
                            description: 'True if payment of item will be covered by warranty. For sales order items that are a part of the repair process, it means that these will not be invoiced.'
                      price:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          grossPrice:
                            type: number
                            description: Represents the price per unit before any discounting is applied.
                            format: double
                          discount:
                            type: number
                            description: 'Discount for each unit in the item, in document currency.  Will be calculated based on Discount percentage, or can be set manually.'
                            format: double
                          netPrice:
                            type: number
                            description: Final price per unit after deducting all discounts etc.
                            format: double
                          expectedPrice:
                            type: number
                            description: The expected price from the sales order request item this sales order item was forwarded from.
                            format: double
                      priceConverted:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          grossPrice:
                            type: number
                            description: Represents the price per unit before any discounting is applied.
                            format: double
                          netPrice:
                            type: number
                            description: Final price per unit after deducting all discounts.
                            format: double
                      totals:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          grossAmount:
                            type: number
                            description: Represents the item amount before any discounts etc. is applied.
                            format: double
                          discountAmount:
                            type: number
                            description: The items discount amount.
                            format: double
                          netAmount:
                            type: number
                            description: Final item amount after deducting all discounts etc.
                            format: double
                          remainingAmount:
                            type: number
                            description: 'Total remaining value of item in document currency. The sum of remaining quantity and open forwarded quantity, multiplied with netprice'
                            format: double
                          grossMarginAmount:
                            type: number
                            description: Profit amount in sales/document currency
                            format: double
                      totalsConverted:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          grossAmount:
                            type: number
                            description: Total gross amount in company currency.
                            format: double
                          netAmount:
                            type: number
                            description: Total net amount in company currency.
                            format: double
                          remainingAmount:
                            type: number
                            description: Total remaining amount in company currency.
                            format: double
                          grossMarginAmount:
                            type: number
                            description: Profit amount in local/converted currency
                            format: double
                      location:
                        type: object
                        properties:
                          locationId:
                            type: integer
                            description: Location identifier
                            format: int32
                          shortName:
                            type: string
                            description: Unique abbreviation/short name of the location
                          locationLink:
                            type: string
                            description: Location reference
                      seller:
                        type: object
                        properties:
                          employeeId:
                            type: integer
                            description: Employee identifier
                            format: int32
                          firstName:
                            type: string
                            description: First name of employee
                          lastName:
                            type: string
                            description: Last name of employee
                          employeeLink:
                            type: string
                            description: Employee reference
                        description: Reference to the seller of the item
                      measurementUnit:
                        type: object
                        properties:
                          measurementUnitId:
                            type: integer
                            description: Measurement unit identifier
                            format: int32
                          unit:
                            type: string
                            description: 'Measurement unit (ex. mm, km, dl, kg)'
                          precision:
                            type: integer
                            description: The precision/accuracy of the measurement (number of decimals)
                            format: int32
                          measurementUnitLink:
                            type: string
                            description: Material unit reference
                      product:
                        type: object
                        properties:
                          productId:
                            type: integer
                            description: Product identifier
                            format: int32
                          name:
                            type: string
                            description: Name of the product
                          type:
                            type: string
                            description: Type of product
                          countryOfOriginCode:
                            type: string
                            description: 'Two-character code (ISO 3166) identifying the default country where the product is produced. This value is inherrited from the assigned goods reception(s). If not country of origin is specified for the goods reception(s), country of origin is retrieved from the product. If assigned to multiple goods receptions with different origin, the field will be empty.'
                          customField1:
                            type: string
                            description: 'Custom field for grouping, sorting, categorizing and other purposes.'
                          customField2:
                            type: string
                            description: 'Custom field for grouping, sorting, categorizing and other purposes.'
                          standardLeadTime:
                            type: integer
                            description: 'The expected lead time, in number of days, from ordering from supplier to goods reception. Used in different purchase processes, typically when supplier is unknown. Note that this might differ from the standard lead times defined on the different suppliers.'
                            format: int32
                          weight:
                            type: number
                            description: The weight of the product in kilograms.
                            format: double
                          manufacturer:
                            type: object
                            properties:
                              manufacturerId:
                                type: integer
                                description: Manufacturer identifier
                                format: int32
                              name:
                                type: string
                                description: Company name of the manufacturer.
                              shortName:
                                type: string
                                description: 'Shortname/code of the manufacturer '
                              manufacturerLink:
                                type: string
                                description: Manufacturer reference
                          productClassification:
                            type: object
                            properties:
                              productClassificationId:
                                type: string
                                description: Product classification identifier
                              productClassificationLink:
                                type: string
                                description: Product classification reference
                          stock:
                            type: object
                            properties:
                              isNonStock:
                                type: boolean
                                description: True if this is a non-physical product which are no using assignments from the assignment archive
                          latestProductRevision:
                            type: object
                            properties:
                              revision:
                                type: string
                                description: Revision number
                          productLink:
                            type: string
                            description: Product reference
                      productStructure:
                        type: object
                        properties:
                          productStructureId:
                            type: integer
                            description: Product structure reference
                            format: int32
                          productStructureLink:
                            type: string
                            description: Product structure reference
                      landedCost:
                        type: object
                        properties:
                          purchaseCurrency:
                            type: string
                            description: Purchase currency is the currency this product normally is purchased in. This is also the base currency used in the gross margin calculation. By default the purchase currency is retrieved from the product.
                          purchasePrice:
                            type: number
                            description: Purchase price for each unit
                            format: double
                          freight:
                            type: number
                            description: Estimated freight cost of getting each unit in stock. Used for calculating landed cost.
                            format: double
                          duty:
                            type: number
                            description: Duty cost of getting each unit in stock. Used for calculating landed cost.
                            format: double
                          charge:
                            type: number
                            description: Other costs of getting each unit in stock. Used for calculating landed cost.
                            format: double
                          grossPrice:
                            type: number
                            description: 'Total cost (landed cost or true cost) of getting each unit in stock, including purchase price, duties, charges, freight etc.'
                            format: double
                          purchaseExchangeRate:
                            type: number
                            description: Exchange rate between document currency and purchase currency. Used in landed cost calculations.
                            format: double
                          isDerivedFromUserInput:
                            type: boolean
                            description: True if landed cost is derived from manual user input. Landed cost can only be manually updated for products without assignments
                          isDerivedFromPreferredPurchasePrice:
                            type: boolean
                            description: 'True if the landed cost for this item is derived from preferred purchase price. This means that parts (or all) of the item has not reserved goods in stock, nor incoming goods (supplier backlog or production backlog).'
                          isDerivedFromAssignedSupplierBacklog:
                            type: boolean
                            description: True if landed cost for this item is derived from assigned supplier backlog. This means that the item has reserved incoming goods (supplier backlog or production backlog).
                          isDerivedFromAssignedStock:
                            type: boolean
                            description: True if landed cost for this item is derived from assigned stock. This means that the item has reserved goods in stock.
                          derivedFrom:
                            type: object
                            properties:
                              purchaseQuoteItemId:
                                type: integer
                                description: Purchase quote item identifier
                                format: int32
                              purchaseQuote:
                                type: object
                                properties:
                                  database:
                                    type: string
                                    description: Database of the object
                                  purchaseQuoteId:
                                    type: integer
                                    description: Purchase quote identifier
                                    format: int32
                                  purchaseQuoteLink:
                                    type: string
                                    description: Purchase quote reference
                              purchaseQuoteItemLink:
                                type: string
                                description: Purchase quote item link
                      landedCostConverted:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          purchasePrice:
                            type: number
                            description: Purchase price in sales currency.
                            format: double
                          freight:
                            type: number
                            description: Freigth cost in sales currency.
                            format: double
                          duty:
                            type: number
                            description: Duty costs in sales currency.
                            format: double
                          charge:
                            type: number
                            description: Other cost in sales currency
                            format: double
                          grossPrice:
                            type: number
                            description: Total cost (landed cost or true cost) in sales currency
                            format: double
                      accounting:
                        type: object
                        properties:
                          vATCodeDefinition:
                            type: object
                            properties:
                              vATCode:
                                type: string
                                description: Code that determines VAT rules used for VAT calculations.
                              description:
                                type: string
                                description: Description of VAT Code definition
                          generalLedgerAccount:
                            type: object
                            properties:
                              generalLedgerAccountId:
                                type: integer
                                description: General ledger account identifier
                                format: int32
                              generalLedgerAccountLink:
                                type: string
                                description: General ledger account reference
                          department:
                            type: object
                            properties:
                              departmentId:
                                type: integer
                                description: Department identifier
                                format: int32
                              departmentLink:
                                type: string
                                description: Finance department reference
                            description: The department related to the item. One of the system/fixed account dimensions.
                          financeProject:
                            type: object
                            properties:
                              financeProjectId:
                                type: integer
                                description: Finance project identifier
                                format: int32
                              financeProjectLink:
                                type: string
                                description: Finance project reference
                            description: The finance project related to the item. One of the system/fixed account dimensions.
                          asset:
                            type: object
                            properties:
                              assetId:
                                type: integer
                                description: Asset identifier
                                format: int32
                              assetLink:
                                type: string
                                description: Asset reference
                            description: The asset related to the item. One of the system/fixed account dimensions.
                        description: 'Accounting details for the item, including fixed/system dimensions. For all dimensions, see seperate resource. '
                      initialSalesOrderItem:
                        $ref: '#/components/schemas/InitialSalesOrderItem'
                      forwardedFrom:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          forwardedNetAmount:
                            type: number
                            description: The net amount forwarded to this item.
                            format: double
                          forwardedQuantity:
                            type: number
                            description: The quantity forwarded to this item.
                            format: double
                          causedBy:
                            type: string
                            description: States who has requested the change of the sales order.
                          changeReason:
                            type: string
                            description: States the reason why the sales order item was forwarded
                          forwardedFromItem:
                            type: object
                            properties:
                              itemId:
                                type: integer
                                description: Identifier of the object
                                format: int32
                              object:
                                $ref: '#/components/schemas/Object'
                              ramBaseKey:
                                type: string
                                description: Internal RamBase identifier of the object/item
                              itemLink:
                                type: string
                                description: API reference to the item
                        description: The preceding/previous/source item.
                      forwardedTo:
                        type: object
                        properties:
                          openForwardedQuantity:
                            type: number
                            description: When items are forwarded they end up in one or more open items. Open items in this context means items that are not registered (status 0 or 1). OpenForwardedQuantity will be the sum of ForwardedQuantity of all items this item has been forwarded to.
                            format: double
                          forwardedToItems:
                            type: array
                            items:
                              type: object
                              properties:
                                itemId:
                                  type: integer
                                  description: Identifier of the object
                                  format: int32
                                object:
                                  $ref: '#/components/schemas/Object'
                                ramBaseKey:
                                  type: string
                                  description: Internal RamBase identifier of the object/item
                                itemLink:
                                  type: string
                                  description: API reference to the item
                              description: Item this item was forwarded to.
                      highlightedNotification:
                        $ref: '#/components/schemas/HighlightedNotification'
                      deviation:
                        type: object
                        properties:
                          deviationId:
                            type: integer
                            description: Deviation identifier
                            format: int32
                          deviationType:
                            type: object
                            properties:
                              database:
                                type: string
                                description: Database of the object
                              deviationTypeId:
                                type: integer
                                description: Deviation definition identifier
                                format: int32
                              category:
                                type: integer
                                description: Type of deviation
                                format: int32
                              goodsHandling:
                                type: integer
                                description: 'Specifies how the goods should be handled '
                                format: int32
                              accountingHandling:
                                type: integer
                                description: Specifies how accounting should handle the deviation
                                format: int32
                              interCompanyHandling:
                                type: integer
                                description: Specifies how the deviation should be handled in the inter company trading.
                                format: int32
                              landedCostCalculation:
                                type: integer
                                description: Specifies how landed cost should be calculated.
                                format: int32
                              deviationTypeLink:
                                type: string
                                description: Deviation definition reference
                          deviationLink:
                            type: string
                            description: Deviation reference
                      salesForecast:
                        type: object
                        properties:
                          salesForecastId:
                            type: integer
                            description: Sales forecast identifier
                            format: int32
                          salesForecastLink:
                            type: string
                            description: Sales forecast reference
                      recurringInvoicing:
                        type: object
                        properties:
                          startDate:
                            type: string
                            description: Start date of subscription or rental item
                            format: date
                          expectedEndDate:
                            type: string
                            description: Expected end date of subscription or rental item
                            format: date
                          priceChangeAgreement:
                            type: integer
                            description: Defines if and how the recurring price can be updated
                            format: int32
                          estimatedAmount:
                            type: number
                            description: Estimated amount of rental or subscription item
                            format: double
                          recurringPrice:
                            type: object
                            properties:
                              recurringPriceId:
                                type: integer
                                description: Recurring price indentifier
                                format: int32
                              currency:
                                type: string
                                description: Three character code following the ISO 4217 standard
                              priceInterval:
                                type: integer
                                description: Interval of recurring price
                                format: int32
                              hasOneTimeFee:
                                type: boolean
                                description: Boolean indicating if the recurring price has a one-time fee.
                              hasUsageStep:
                                type: boolean
                                description: Boolean indicating if the recurring price has any usage steps.
                              recurringPriceLink:
                                type: string
                                description: Recurring price reference
                          currentPriceStep:
                            type: object
                            properties:
                              price:
                                type: number
                                description: Value of a price step
                                format: double
                      projectOrder:
                        type: object
                        properties:
                          projectOrderId:
                            type: integer
                            description: Project order identifier
                            format: int32
                          projectOrderLink:
                            type: string
                            description: Project order reference
                      projectOrderItem:
                        type: object
                        properties:
                          projectOrderItemId:
                            type: integer
                            description: Project order item identifier
                            format: int32
                          projectOrderItemLink:
                            type: string
                            description: Reference to the project order item.
                      intercompanySalesOrderReference:
                        type: object
                        properties:
                          field:
                            type: string
                            description: Field to get value from in the other company sales order
                          value:
                            type: string
                            description: Value for the field from the sales order in the other company
                          salesOrderId:
                            type: integer
                            description: Sales order identifier
                            format: int32
                        description: 'If this sales order is created based on a purchase order from another company, these fields will be referencing the sales order which is assigned to the purchase order in the other company.'
  '/sales/customers/{customerId}':
    get:
      tags:
        - sales
      summary: Customer details for the provided identifier
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=156&version=101
      operationId: sales_GetCustomerById
      parameters:
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
        - $ref: '#/components/parameters/showDomainValues'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/select'
        - name: $expand
          in: query
          description: Used to add fields to the response
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - CustomerLegalEntity
                - Shipment.ShippingService.Carrier
                - Shipment.DefaultShippingAddress
                - Invoicing.DefaultInvoiceAddress
                - Auction
                - Service
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  customer:
                    type: object
                    properties:
                      customerId:
                        type: integer
                        description: Customer identifier
                        format: int32
                      status:
                        type: integer
                        description: 'Status of the customer. 1:New, 2:Pending internal approvement, 4:Active, 9:Obsolete'
                        format: int32
                      name:
                        type: string
                        description: Name of customer (name of company or surname/familyname/lastname of a person)
                      isCompany:
                        type: boolean
                        description: Indicator if a customer is private entity or a company
                      firstName:
                        type: string
                        description: Secondary name of a company or firstname of a person
                      preferredLanguage:
                        type: string
                        description: "Preferred language for the customer. Is used in prints etc.\r\n"
                      website:
                        type: string
                        description: Customers website/homepage/webpage
                      phone:
                        type: string
                        description: Customers main phone number
                      fax:
                        type: string
                        description: Customers main fax number
                      email:
                        type: string
                        description: Customers main email
                      externalReference:
                        type: string
                        description: External customer reference/identifier. Can be used in external systems.
                      internalNote:
                        type: string
                        description: Internal note/notice of the customer. Should not be visible to the customer.
                      isRelatedBusinessEntity:
                        type: boolean
                        description: Identify if a customer is related business entity to the company
                      legalEntityIdentifier:
                        type: string
                        description: The customers unique enterprise/organization number.
                      vATRegistrationNumber:
                        type: string
                        description: Unique number assigned by the relevant tax authority to identify a party for use in relation to value added tax (VAT).
                      useStandardVATNumberRules:
                        type: boolean
                        description: Do not automatically replace the VAT number based on the location configuration
                      eORINumber:
                        type: string
                        description: An EORI (Economic Operator Registration and Identification number) number is required of any party intending to import into the EU or export from the EU.
                      classification:
                        type: string
                        description: Classification of the customer
                      updatedAt:
                        type: string
                        description: Date and time of update
                        format: date-time
                      createdAt:
                        type: string
                        description: Date and time of creation
                        format: date-time
                      createdBy:
                        type: object
                        properties:
                          userId:
                            type: integer
                            description: User identifier
                            format: int32
                          name:
                            type: string
                            description: Name of the user
                          firstName:
                            type: string
                            description: First name of the user
                          userLink:
                            type: string
                            description: User reference
                        description: The employee (might be RamBase-server) that created the customer
                      intercompany:
                        $ref: '#/components/schemas/Intercompany'
                      currencies:
                        type: array
                        items:
                          $ref: '#/components/schemas/Currency'
                        description: Currencies used by the customer
                      sales:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          backlogAmount:
                            type: number
                            description: 'Total amount of sales orders, excluding value added tax, that not yet has been fulfilled. '
                            format: double
                          backlogAmountIncludingVAT:
                            type: number
                            description: 'Total amount of sales orders, including value added tax, that not yet has been fulfilled'
                            format: double
                          salesDistrict:
                            type: string
                            description: A geographic district for which an individual salesperson or sales team holds responsibility
                          sector:
                            type: string
                            description: The sector the customer belongs to.
                          marketSegment:
                            type: string
                            description: Market segment of the customer
                          minimumGrossMargin:
                            type: number
                            description: The minimum gross margin in percent for the customer
                            format: double
                          vATHandling:
                            type: string
                            description: 'Specifies how value added tax (VAT) should be calculated. Either always include VAT, always exclude VAT or use standard/default VAT rules.'
                          warrantyPeriod:
                            type: integer
                            description: 'Agreement of default warranty period in months '
                            format: int32
                          feeAmount:
                            type: number
                            description: 'This is an amount, in the companies local currency, that by default will be added as fee when a sales order is created for this customer.'
                            format: double
                          volumePriceAgreement:
                            type: string
                            description: 'Special price agreement related to the quantity beeing ordered. '
                          exchangeRateFluctuationAgreement:
                            type: string
                            description: 'When a sales order is issued, RamBase stores the current exchange rate and the currency the product normally is purchased in. The exchange rate might have changed when the invoice is issued. The exchange rate fluctuation agreement specifies how to handle these differences. The agreement has the format AAA/BBB, where AAA is a percentage of the total invoice, and BBB is the exchange rate fluctuation percentage. E.g. 100/3.0 means that if the rate of exchange on the date a sales order is forwarded to an invoice has changed more than +/- 3% from the rate of exchange, 100% of the invoice amount will be adjusted.'
                          blockSalesOrderRegistration:
                            type: boolean
                            description: True if sales orders for this customer should be blocked/denied/rejected registration. A notification of type "Stop" will also be added to sales orders for this customer.
                          blockSalesQuoteRegistration:
                            type: boolean
                            description: True if sales quotes for this customer should be blocked/denied/rejected registration. A notification of type "Stop" will also be added to sales quotes for this customer.
                          latestSalesOrderDate:
                            type: string
                            description: Date of latest sales order or sales order request registration.
                            format: date
                          priceList:
                            $ref: '#/components/schemas/PriceList'
                          salesAssistant:
                            $ref: '#/components/schemas/SalesAssistant'
                          accountManager:
                            $ref: '#/components/schemas/AccountManager'
                      customerLegalEntity:
                        $ref: '#/components/schemas/CustomerLegalEntity'
                      shipment:
                        type: object
                        properties:
                          deliveryTerms:
                            type: string
                            description: 'Default delivery terms for the customer. The delivery terms is based on the Incoterms rules from ICC (International Chamber of Commerce). '
                          deliveryTermPlace:
                            type: string
                            description: Named place related to delivery terms (Incoterms)
                          onlyShipEntireSalesOrders:
                            type: boolean
                            description: 'True if all items of a sales order should be shipped together. The items of a sales order should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                          onlyShipEntireSalesOrderItems:
                            type: boolean
                            description: 'True if the total quantity of a sales order item always should be shipped together. The quantity should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                          avoidMultipleShipmentsOnSameDate:
                            type: boolean
                            description: 'True if all items of a sales order with the same sheduled delivery date should be shipped together. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                          shipBasedOnConfirmedDeliveryDate:
                            type: boolean
                            description: 'If true, will sheduled shipping date on each item be calculated based on confirmed date rather than requested date.'
                          freightForEachShipment:
                            type: boolean
                            description: If unchecked there will only be calculated freight on one shipping advice if the particular sales order has serveral shipments.
                          shippingDay:
                            type: string
                            description: Specifies when the goods should be shipped. This is used to calculate the scheduled shipping date for each item.
                          consolidateShippingAdvices:
                            type: boolean
                            description: 'If true, sales orders will be consolidated when creating shipping advices via the "Prepare for picking" process  the . If false, each sales order will result in seperate shipping advice. The field to use when consolidating is specified in the ShippingAdviceConsolidationField. '
                          shippingAdviceConsolidationField:
                            type: string
                            description: Field to use when consolidating sales order items into shipping advices in the "Prepare for picking" process.
                          shippingAdviceItemSortBy:
                            type: string
                            description: Items in consolidated shipping advices will be sorted by this fields when they are created in the 'Prepare for picking' process
                          requireApprovalIfOverdue:
                            type: boolean
                            description: 'True if  shipments need approval if there are sales invoices with overdue amount. Default value is retireved from setting: DefaultCreateValueCUSFieldDUEAPPROVE'
                          blockShipping:
                            type: boolean
                            description: True if shipping advices for this customer should be blocked/denied/rejected registration. A notification of type "Stop" will also be added to shipping advices for this customer.
                          specialHandling:
                            $ref: '#/components/schemas/SpecialHandling'
                          shippingService:
                            $ref: '#/components/schemas/ShippingService'
                          defaultShippingAddress:
                            type: object
                            properties:
                              addressId:
                                type: integer
                                description: Address identifier
                                format: int32
                              attention:
                                type: string
                                description: Attention note.
                              addressLine1:
                                type: string
                                description: First address line
                              addressLine2:
                                type: string
                                description: Second address line
                              postalCode:
                                type: string
                                description: Postalcode/Postcode/ZIP
                              city:
                                type: string
                                description: City/town/village
                              region:
                                type: string
                                description: Region/province/state
                              countryCode:
                                type: string
                                description: Two-character code (ISO 3166) identifying the country.
                              country:
                                type: string
                                description: English name of country.
                              addressLink:
                                type: string
                                description: Address reference
                      invoicing:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          interestRate:
                            type: number
                            description: Interest rate used for sales invoices past duedate
                            format: double
                          interestFeeAmount:
                            type: number
                            description: Fixed interest fee used for the customer.
                            format: double
                          salesInvoiceConsolidation:
                            type: string
                            description: Specifies whether or how often shipping advices that origins from this sales order will be consolidated when creating sales invoices.
                          salesInvoiceConsolidationField:
                            type: string
                            description: Field name to group by when consolidating shipping advice items into sales invoices.
                          salesInvoiceItemSortBy:
                            type: string
                            description: Field name to sort by when creating sales invoice items.
                          sendReminders:
                            type: boolean
                            description: 'Set to false if reminder are not be sent to this customer. Default value is retireved from setting: DefaultCreateValueCUSFieldREMINDER'
                          latestSalesInvoiceDate:
                            type: string
                            description: Date last sales invoice was registered.
                            format: date
                          sendToFactoring:
                            type: boolean
                            description: 'Identify which customer, invoices ands credit notes, will be send to factoring'
                          defaultInvoiceAddress:
                            type: object
                            properties:
                              addressId:
                                type: integer
                                description: Address identifier
                                format: int32
                              attention:
                                type: string
                                description: Attention note.
                              addressLine1:
                                type: string
                                description: First address line
                              addressLine2:
                                type: string
                                description: Second address line
                              postalCode:
                                type: string
                                description: Postalcode/Postcode/ZIP
                              city:
                                type: string
                                description: City/town/village
                              region:
                                type: string
                                description: Region/province/state
                              countryCode:
                                type: string
                                description: Two-character code (ISO 3166) identifying the country.
                              country:
                                type: string
                                description: English name of country.
                              addressLink:
                                type: string
                                description: Address reference
                      payment:
                        type: object
                        properties:
                          paymentTerms:
                            type: string
                            description: Default payment terms to use in new documents.
                          paymentMethod:
                            type: string
                            description: Default payment method for the customer
                          latestPaymentDate:
                            type: string
                            description: Date last payment was registered
                            format: date
                      accounting:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Three character code following the ISO 4217 standard
                          balance:
                            type: number
                            description: 'Total balance for the customer, without value added tax'
                            format: double
                          balanceIncludingVAT:
                            type: number
                            description: Total balance for the customer. Positive amount indicates how much the customer owes. Negative amount indicates that the customer has a credit balance.
                            format: double
                          billingYTDAmount:
                            type: number
                            description: Total amount of invoices and credit notes that has been invoiced this year (to current date)
                            format: double
                          overdueAmount:
                            type: number
                            description: Total amount of unpaid invoices which has passed due date
                            format: double
                          creditLimit:
                            type: number
                            description: The maximum amount that the customer may charge on a credit card or borrow from a financial institution.
                            format: double
                          creditInsuranceAmount:
                            type: number
                            description: Credit amount insured for the customer
                            format: double
                          creditInsuranceCompany:
                            type: string
                            description: Insurance company used by the customer for credit insurance
                      auction:
                        type: object
                        properties:
                          feePercent:
                            type: number
                            description: The commission paid by the customer when purchasing LOTs
                            format: double
                          latestBidDate:
                            type: string
                            description: Last date the customer placed a bid.
                            format: date
                          crossReference:
                            type: object
                            properties:
                              supplier:
                                type: object
                                properties:
                                  supplierId:
                                    type: integer
                                    description: RamBase supplier identifier
                                    format: int32
                                  supplierLink:
                                    type: string
                                    description: Supplier reference
                                description: Every customer in auction companies has a cross-reference to a supplier.
                              totalBalance:
                                type: number
                                description: 'Sum of customer and cross referenced supplier balances '
                                format: double
                              totalOverdueAmount:
                                type: number
                                description: Sum of customer and cross referenced supplier overdued amounts
                                format: double
                      service:
                        $ref: '#/components/schemas/Service'
                      rental:
                        $ref: '#/components/schemas/Rental'
    put:
      tags:
        - sales
      summary: Saves/stores details about a customer
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=202&version=61
      operationId: sales_UpdateCustomerById
      parameters:
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                customer:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Name of customer (name of company or surname/familyname/lastname of a person)
                    isCompany:
                      type: boolean
                      description: Indicator if a customer is private entity or a company
                    firstName:
                      type: string
                      description: Secondary name of a company or firstname of a person
                    preferredLanguage:
                      pattern: '^[a-z]{3}$'
                      type: string
                      description: "Preferred language for the customer. Is used in prints etc.\r\n"
                    website:
                      type: string
                      description: Customers website/homepage/webpage
                    phone:
                      type: string
                      description: Customers main phone number
                    fax:
                      type: string
                      description: Customers main fax number
                    email:
                      pattern: '^\w+([-+.'']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$'
                      type: string
                      description: Customers main email
                    externalReference:
                      type: string
                      description: External customer reference/identifier. Can be used in external systems.
                    internalNote:
                      type: string
                      description: Internal note/notice of the customer. Should not be visible to the customer.
                    isRelatedBusinessEntity:
                      type: boolean
                      description: Identify if a customer is related business entity to the company
                    legalEntityIdentifier:
                      type: string
                      description: The customers unique enterprise/organization number.
                    vATRegistrationNumber:
                      type: string
                      description: Unique number assigned by the relevant tax authority to identify a party for use in relation to value added tax (VAT).
                    useStandardVATNumberRules:
                      type: boolean
                      description: Do not automatically replace the VAT number based on the location configuration
                    eORINumber:
                      type: string
                      description: An EORI (Economic Operator Registration and Identification number) number is required of any party intending to import into the EU or export from the EU.
                    classification:
                      type: string
                      description: Classification of the customer
                    intercompany:
                      $ref: '#/components/schemas/Intercompany'
                    currencies:
                      type: array
                      items:
                        $ref: '#/components/schemas/Currency'
                      description: Currencies used by the customer
                    sales:
                      type: object
                      properties:
                        salesDistrict:
                          type: string
                          description: A geographic district for which an individual salesperson or sales team holds responsibility
                        sector:
                          type: string
                          description: The sector the customer belongs to.
                        marketSegment:
                          type: string
                          description: Market segment of the customer
                        minimumGrossMargin:
                          maxLength: 99
                          minLength: 0
                          type: number
                          description: The minimum gross margin in percent for the customer
                          format: double
                        vATHandling:
                          type: string
                          description: 'Specifies how value added tax (VAT) should be calculated. Either always include VAT, always exclude VAT or use standard/default VAT rules.'
                        warrantyPeriod:
                          minimum: 0
                          type: integer
                          description: 'Agreement of default warranty period in months '
                          format: int32
                        feeAmount:
                          minLength: 0
                          type: number
                          description: 'This is an amount, in the companies local currency, that by default will be added as fee when a sales order is created for this customer.'
                          format: double
                        volumePriceAgreement:
                          type: string
                          description: 'Special price agreement related to the quantity beeing ordered. '
                        exchangeRateFluctuationAgreement:
                          type: string
                          description: 'When a sales order is issued, RamBase stores the current exchange rate and the currency the product normally is purchased in. The exchange rate might have changed when the invoice is issued. The exchange rate fluctuation agreement specifies how to handle these differences. The agreement has the format AAA/BBB, where AAA is a percentage of the total invoice, and BBB is the exchange rate fluctuation percentage. E.g. 100/3.0 means that if the rate of exchange on the date a sales order is forwarded to an invoice has changed more than +/- 3% from the rate of exchange, 100% of the invoice amount will be adjusted.'
                        blockSalesOrderRegistration:
                          type: boolean
                          description: True if sales orders for this customer should be blocked/denied/rejected registration. A notification of type "Stop" will also be added to sales orders for this customer.
                        blockSalesQuoteRegistration:
                          type: boolean
                          description: True if sales quotes for this customer should be blocked/denied/rejected registration. A notification of type "Stop" will also be added to sales quotes for this customer.
                        priceList:
                          type: object
                          properties:
                            priceListId:
                              minimum: 100000
                              type: integer
                              description: Price list identifier
                              format: int32
                        salesAssistant:
                          $ref: '#/components/schemas/SalesAssistant1'
                        accountManager:
                          $ref: '#/components/schemas/AccountManager1'
                    shipment:
                      type: object
                      properties:
                        deliveryTerms:
                          type: string
                          description: 'Default delivery terms for the customer. The delivery terms is based on the Incoterms rules from ICC (International Chamber of Commerce). '
                        deliveryTermPlace:
                          type: string
                          description: Named place related to delivery terms (Incoterms)
                        onlyShipEntireSalesOrders:
                          type: boolean
                          description: 'True if all items of a sales order should be shipped together. The items of a sales order should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                        onlyShipEntireSalesOrderItems:
                          type: boolean
                          description: 'True if the total quantity of a sales order item always should be shipped together. The quantity should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                        avoidMultipleShipmentsOnSameDate:
                          type: boolean
                          description: 'True if all items of a sales order with the same sheduled delivery date should be shipped together. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                        shipBasedOnConfirmedDeliveryDate:
                          type: boolean
                          description: 'If true, will sheduled shipping date on each item be calculated based on confirmed date rather than requested date.'
                        freightForEachShipment:
                          type: boolean
                          description: If unchecked there will only be calculated freight on one shipping advice if the particular sales order has serveral shipments.
                        shippingDay:
                          type: string
                          description: Specifies when the goods should be shipped. This is used to calculate the scheduled shipping date for each item.
                        consolidateShippingAdvices:
                          type: boolean
                          description: 'If true, sales orders will be consolidated when creating shipping advices via the "Prepare for picking" process  the . If false, each sales order will result in seperate shipping advice. The field to use when consolidating is specified in the ShippingAdviceConsolidationField. '
                        shippingAdviceConsolidationField:
                          type: string
                          description: Field to use when consolidating sales order items into shipping advices in the "Prepare for picking" process.
                        shippingAdviceItemSortBy:
                          type: string
                          description: Items in consolidated shipping advices will be sorted by this fields when they are created in the 'Prepare for picking' process
                        requireApprovalIfOverdue:
                          type: boolean
                          description: 'True if  shipments need approval if there are sales invoices with overdue amount. Default value is retireved from setting: DefaultCreateValueCUSFieldDUEAPPROVE'
                        blockShipping:
                          type: boolean
                          description: True if shipping advices for this customer should be blocked/denied/rejected registration. A notification of type "Stop" will also be added to shipping advices for this customer.
                        specialHandling:
                          $ref: '#/components/schemas/SpecialHandling1'
                        shippingService:
                          type: object
                          properties:
                            shippingServiceId:
                              minimum: 100000
                              type: integer
                              description: Shipping service identifier
                              format: int32
                    invoicing:
                      type: object
                      properties:
                        interestRate:
                          maxLength: 1000
                          minLength: 0
                          type: number
                          description: Interest rate used for sales invoices past duedate
                          format: double
                        interestFeeAmount:
                          minLength: 0
                          type: number
                          description: Fixed interest fee used for the customer.
                          format: double
                        salesInvoiceConsolidation:
                          type: string
                          description: Specifies whether or how often shipping advices that origins from this sales order will be consolidated when creating sales invoices.
                        salesInvoiceConsolidationField:
                          type: string
                          description: Field name to group by when consolidating shipping advice items into sales invoices.
                        salesInvoiceItemSortBy:
                          type: string
                          description: Field name to sort by when creating sales invoice items.
                        sendReminders:
                          type: boolean
                          description: 'Set to false if reminder are not be sent to this customer. Default value is retireved from setting: DefaultCreateValueCUSFieldREMINDER'
                        sendToFactoring:
                          type: boolean
                          description: 'Identify which customer, invoices ands credit notes, will be send to factoring'
                    payment:
                      $ref: '#/components/schemas/Payment'
                    accounting:
                      $ref: '#/components/schemas/Accounting'
                    auction:
                      type: object
                      properties:
                        feePercent:
                          maxLength: 100
                          minLength: 0
                          type: number
                          description: The commission paid by the customer when purchasing LOTs
                          format: double
                    service:
                      $ref: '#/components/schemas/Service'
                    rental:
                      $ref: '#/components/schemas/Rental'
      responses:
        '200':
          description: OK
    delete:
      tags:
        - sales
      summary: Deletes specified customer
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=1855&version=3
      operationId: sales_DeleteCustomerById
      parameters:
        - $ref: '#/components/parameters/customerId'
        - $ref: '#/components/parameters/db'
      responses:
        '202':
          description: OK
  /sales/customers:
    get:
      tags:
        - sales
      summary: List of all customers
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=293&version=60
      operationId: sales_ListCustomers
      parameters:
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
        - $ref: '#/components/parameters/showDomainValues'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/select'
        - $ref: '#/components/parameters/pagekey'
        - $ref: '#/components/parameters/inlineCount'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/orderBy'
        - $ref: '#/components/parameters/top'
        - name: $expand
          in: query
          description: Used to add fields to the response
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - Customer.Sales.PriceList
                - Customer.Sales.AccountManager
                - Customer.Invoicing
                - Customer.Shipment
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  customers:
                    type: array
                    items:
                      type: object
                      properties:
                        customerId:
                          type: integer
                          description: Customer identifier
                          format: int32
                        status:
                          type: integer
                          description: 'Status of the customer. 1:New, 2:Pending internal approvement, 4:Active, 9:Obsolete'
                          format: int32
                        name:
                          type: string
                          description: Name of customer (name of company or surname/familyname/lastname of a person)
                        isCompany:
                          type: boolean
                          description: Indicator if a customer is private entity or a company
                        firstName:
                          type: string
                          description: Secondary name of a company or firstname of a person
                        internalNote:
                          type: string
                          description: Internal note/notice of the customer. Should not be visible to the customer.
                        externalReference:
                          type: string
                          description: External customer reference/identifier. Can be used in external systems.
                        legalEntityIdentifier:
                          type: string
                          description: The customers unique enterprise/organization number.
                        vATRegistrationNumber:
                          type: string
                          description: Unique number assigned by the relevant tax authority to identify a party for use in relation to value added tax (VAT).
                        useStandardVATNumberRules:
                          type: boolean
                          description: Do not automatically replace the VAT number based on the location configuration
                        createdAt:
                          type: string
                          description: Date and time of creation
                          format: date-time
                        updatedAt:
                          type: string
                          description: Date and time of update
                          format: date-time
                        classification:
                          type: string
                          description: Classification of the customer
                        accounting:
                          type: object
                          properties:
                            billingYTDAmount:
                              type: number
                              description: Total amount of invoices and credit notes that has been invoiced this year (to current date)
                              format: double
                        sales:
                          type: object
                          properties:
                            blockSalesOrderRegistration:
                              type: boolean
                              description: True if sales orders for this customer should be blocked/denied/rejected registration. A notification of type "Stop" will also be added to sales orders for this customer.
                            priceList:
                              $ref: '#/components/schemas/PriceList'
                            accountManager:
                              $ref: '#/components/schemas/AccountManager'
                        invoicing:
                          type: object
                          properties:
                            defaultInvoiceAddress:
                              type: object
                              properties:
                                addressId:
                                  type: integer
                                  description: Address identifier
                                  format: int32
                                addressLine1:
                                  type: string
                                  description: First address line
                                addressLine2:
                                  type: string
                                  description: Second address line
                                postalCode:
                                  type: string
                                  description: Postalcode/Postcode/ZIP
                                city:
                                  type: string
                                  description: City/town/village
                                region:
                                  type: string
                                  description: Region/province/state
                                countryCode:
                                  type: string
                                  description: Two-character code (ISO 3166) identifying the country.
                                country:
                                  type: string
                                  description: English name of country.
                                addressLink:
                                  type: string
                                  description: Address reference
                        shipment:
                          type: object
                          properties:
                            defaultShippingAddress:
                              type: object
                              properties:
                                addressId:
                                  type: integer
                                  description: Address identifier
                                  format: int32
                                addressLine1:
                                  type: string
                                  description: First address line
                                addressLine2:
                                  type: string
                                  description: Second address line
                                postalCode:
                                  type: string
                                  description: Postalcode/Postcode/ZIP
                                city:
                                  type: string
                                  description: City/town/village
                                region:
                                  type: string
                                  description: Region/province/state
                                countryCode:
                                  type: string
                                  description: Two-character code (ISO 3166) identifying the country.
                                country:
                                  type: string
                                  description: English name of country.
                                addressLink:
                                  type: string
                                  description: Address reference
                        customerLink:
                          type: string
                          description: Customer reference
                  paging:
                    $ref: '#/components/schemas/Paging'
    post:
      tags:
        - sales
      summary: Creates a new customer
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=1820&version=21
      operationId: sales_PostCustomers
      parameters:
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                customer:
                  required:
                    - name
                  type: object
                  properties:
                    name:
                      pattern: ''
                      type: string
                      description: Name of customer (name of company or surname/familyname/lastname of a person)
                    isCompany:
                      pattern: ''
                      type: boolean
                      description: Indicator if a customer is private entity or a company
                    firstName:
                      pattern: ''
                      type: string
                      description: Secondary name of a company or firstname of a person
                    preferredLanguage:
                      pattern: '^[a-z]{3}$'
                      type: string
                      description: "Preferred language for the customer. Is used in prints etc.\r\n"
                    website:
                      pattern: ''
                      type: string
                      description: Customers website/homepage/webpage
                    phone:
                      pattern: ''
                      type: string
                      description: Customers main phone number
                    fax:
                      pattern: ''
                      type: string
                      description: Customers main fax number
                    email:
                      pattern: '^\w+([-+.'']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$'
                      type: string
                      description: Customers main email
                    externalReference:
                      pattern: ''
                      type: string
                      description: External customer reference/identifier. Can be used in external systems.
                    internalNote:
                      pattern: ''
                      type: string
                      description: Internal note/notice of the customer. Should not be visible to the customer.
                    isRelatedBusinessEntity:
                      pattern: ''
                      type: boolean
                      description: Identify if a customer is related business entity to the company
                    legalEntityIdentifier:
                      pattern: ''
                      type: string
                      description: The customers unique enterprise/organization number.
                    vATRegistrationNumber:
                      pattern: ''
                      type: string
                      description: Unique number assigned by the relevant tax authority to identify a party for use in relation to value added tax (VAT).
                    currencies:
                      type: array
                      items:
                        $ref: '#/components/schemas/Currency'
                      description: Currencies used by the customer
                    sales:
                      type: object
                      properties:
                        salesDistrict:
                          pattern: ''
                          type: string
                          description: A geographic district for which an individual salesperson or sales team holds responsibility
                        sector:
                          pattern: ''
                          type: string
                          description: The sector the customer belongs to.
                        marketSegment:
                          pattern: ''
                          type: string
                          description: Market segment of the customer
                        minimumGrossMargin:
                          maxLength: 99
                          minLength: 0
                          pattern: ''
                          type: number
                          description: The minimum gross margin in percent for the customer
                          format: double
                        vATHandling:
                          pattern: ''
                          type: string
                          description: 'Specifies how value added tax (VAT) should be calculated. Either always include VAT, always exclude VAT or use standard/default VAT rules.'
                        warrantyPeriod:
                          minimum: 0
                          pattern: ''
                          type: integer
                          description: 'Agreement of default warranty period in months '
                          format: int32
                        feeAmount:
                          minLength: 0
                          pattern: ''
                          type: number
                          description: 'This is an amount, in the companies local currency, that by default will be added as fee when a sales order is created for this customer.'
                          format: double
                        volumePriceAgreement:
                          pattern: ''
                          type: string
                          description: 'Special price agreement related to the quantity beeing ordered. '
                        exchangeRateFluctuationAgreement:
                          pattern: ''
                          type: string
                          description: 'When a sales order is issued, RamBase stores the current exchange rate and the currency the product normally is purchased in. The exchange rate might have changed when the invoice is issued. The exchange rate fluctuation agreement specifies how to handle these differences. The agreement has the format AAA/BBB, where AAA is a percentage of the total invoice, and BBB is the exchange rate fluctuation percentage. E.g. 100/3.0 means that if the rate of exchange on the date a sales order is forwarded to an invoice has changed more than +/- 3% from the rate of exchange, 100% of the invoice amount will be adjusted.'
                        salesAssistant:
                          $ref: '#/components/schemas/SalesAssistant1'
                        accountManager:
                          $ref: '#/components/schemas/AccountManager1'
                    shipment:
                      type: object
                      properties:
                        onlyShipEntireSalesOrders:
                          pattern: ''
                          type: boolean
                          description: 'True if all items of a sales order should be shipped together. The items of a sales order should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                        onlyShipEntireSalesOrderItems:
                          pattern: ''
                          type: boolean
                          description: 'True if the total quantity of a sales order item always should be shipped together. The quantity should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                        shipBasedOnConfirmedDeliveryDate:
                          pattern: ''
                          type: boolean
                          description: 'If true, will sheduled shipping date on each item be calculated based on confirmed date rather than requested date.'
                        freightForEachShipment:
                          pattern: ''
                          type: boolean
                          description: If unchecked there will only be calculated freight on one shipping advice if the particular sales order has serveral shipments.
                        shippingDay:
                          pattern: ''
                          type: string
                          description: Specifies when the goods should be shipped. This is used to calculate the scheduled shipping date for each item.
                        consolidateShippingAdvices:
                          pattern: ''
                          type: boolean
                          description: 'If true, sales orders will be consolidated when creating shipping advices via the "Prepare for picking" process  the . If false, each sales order will result in seperate shipping advice. The field to use when consolidating is specified in the ShippingAdviceConsolidationField. '
                        shippingAdviceConsolidationField:
                          pattern: ''
                          type: string
                          description: Field to use when consolidating sales order items into shipping advices in the "Prepare for picking" process.
                        shippingAdviceItemSortBy:
                          pattern: ''
                          type: string
                          description: Items in consolidated shipping advices will be sorted by this fields when they are created in the 'Prepare for picking' process
                        requireApprovalIfOverdue:
                          pattern: ''
                          type: boolean
                          description: 'True if  shipments need approval if there are sales invoices with overdue amount. Default value is retireved from setting: DefaultCreateValueCUSFieldDUEAPPROVE'
                        specialHandling:
                          $ref: '#/components/schemas/SpecialHandling1'
                    invoicing:
                      type: object
                      properties:
                        interestRate:
                          maxLength: 1000
                          minLength: 0
                          pattern: ''
                          type: number
                          description: Interest rate used for sales invoices past duedate
                          format: double
                        interestFeeAmount:
                          minLength: 0
                          pattern: ''
                          type: number
                          description: Fixed interest fee used for the customer.
                          format: double
                        salesInvoiceConsolidation:
                          pattern: ''
                          type: string
                          description: Specifies whether or how often shipping advices that origins from this sales order will be consolidated when creating sales invoices.
                        salesInvoiceConsolidationField:
                          pattern: ''
                          type: string
                          description: Field name to group by when consolidating shipping advice items into sales invoices.
                        salesInvoiceItemSortBy:
                          pattern: ''
                          type: string
                          description: Field name to sort by when creating sales invoice items.
                        sendReminders:
                          pattern: ''
                          type: boolean
                          description: 'Set to false if reminder are not be sent to this customer. Default value is retireved from setting: DefaultCreateValueCUSFieldREMINDER'
                    payment:
                      type: object
                      properties:
                        paymentMethod:
                          pattern: ''
                          type: string
                          description: Default payment method for the customer
                    accounting:
                      $ref: '#/components/schemas/Accounting'
      responses:
        '201':
          description: OK
  /sales/orders:
    get:
      tags:
        - sales
      summary: List of sales orders
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=604&version=54
      operationId: sales_ListOrders
      parameters:
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
        - $ref: '#/components/parameters/showDomainValues'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/select'
        - $ref: '#/components/parameters/pagekey'
        - $ref: '#/components/parameters/inlineCount'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/orderBy'
        - $ref: '#/components/parameters/top'
        - name: $expand
          in: query
          description: Used to add fields to the response
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - SalesOrder.Location.LocationId
                - SalesOrder.Location.Address
                - SalesOrder.Location.LocationLink
                - SalesOrder.Assignee
                - SalesOrder.Customer.Sales.AccountManager
                - SalesOrder.Management
                - SalesOrder.Payment
                - SalesOrder.TotalsConverted
                - SalesOrder.HighlightedNotification
                - SalesOrder.SalesDeliveryProject.Name
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  salesOrders:
                    type: array
                    items:
                      type: object
                      properties:
                        salesOrderId:
                          type: integer
                          description: Sales order identifier
                          format: int32
                        status:
                          type: integer
                          description: Status of sales order
                          format: int32
                        type:
                          type: string
                          description: 'Type of sales order. '
                        createdAt:
                          type: string
                          description: Date and time of creation
                          format: date-time
                        registrationDate:
                          type: string
                          description: Date of registration
                          format: date
                        sellersReferenceNumber:
                          type: string
                          description: 'Sellers reference number. '
                        customersReference:
                          type: string
                          description: Customers reference. Typically a person.
                        customersReferenceNumber:
                          type: string
                          description: Customers reference number. E.g. the internal sales order id the customer use in their own system.
                        netWeight:
                          type: number
                          description: 'Total weight  (excluding packing material) in kilograms, calculated based on weight of all included products.'
                          format: double
                        location:
                          $ref: '#/components/schemas/Location'
                        assignee:
                          $ref: '#/components/schemas/Assignee'
                        customer:
                          type: object
                          properties:
                            customerId:
                              type: integer
                              description: Customer identifier
                              format: int32
                            name:
                              type: string
                              description: Name of customer (name of company or surname/familyname/lastname of a person)
                            firstname:
                              type: string
                              description: Secondary name of a company or firstname of a person
                            sales:
                              type: object
                              properties:
                                accountManager:
                                  $ref: '#/components/schemas/AccountManager'
                            customerLink:
                              type: string
                              description: Customer reference
                        initialSalesOrder:
                          $ref: '#/components/schemas/InitialSalesOrder'
                        management:
                          $ref: '#/components/schemas/Management'
                        payment:
                          $ref: '#/components/schemas/Payment'
                        totals:
                          $ref: '#/components/schemas/Totals'
                        totalsConverted:
                          type: object
                          properties:
                            currency:
                              type: string
                              description: Currency used in conversion. Default is company accounting currency. Three character code following the ISO 4217 standard.
                            subTotalAmount:
                              type: number
                              description: 'Total amount of the object in company currency, excluding VAT.'
                              format: double
                            totalAmount:
                              type: number
                              description: 'The total amount in company currency, including VAT.'
                              format: double
                            grossMarginAmount:
                              type: number
                              description: Gross margin of sale presented in local currency. This is calculated as an average of gross margin of all items at the time the document is registered. Will not be recalculated if gross margin in items change afterwards.
                              format: double
                        highlightedNotification:
                          $ref: '#/components/schemas/HighlightedNotification'
                        salesDeliveryProject:
                          $ref: '#/components/schemas/SalesDeliveryProject'
                        salesOrderLink:
                          type: string
                          description: Sales order reference
                  paging:
                    $ref: '#/components/schemas/Paging'
  '/sales/orders/{salesOrderId}':
    get:
      tags:
        - sales
      summary: Sales order details for the provided identifier
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=605&version=86
      operationId: sales_GetOrderById
      parameters:
        - $ref: '#/components/parameters/salesOrderId'
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
        - $ref: '#/components/parameters/showDomainValues'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/select'
        - name: $expand
          in: query
          description: Used to add fields to the response
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - Location.LocationId
                - Location.Address
                - Location.LocationLink
                - Customer.Phone
                - Customer.Email
                - Customer.Sales.SalesAssistant
                - Customer.Sales.AccountManager
                - Management
                - InvoiceAddress.AddressId
                - TotalsConverted
                - Shipment.ShippingService.Carrier.Name
                - HighlightedNotification
                - SalesDeliveryProject.Name
                - Service
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  salesOrder:
                    type: object
                    properties:
                      salesOrderId:
                        type: integer
                        description: Sales order identifier
                        format: int32
                      status:
                        type: integer
                        description: Status of sales order
                        format: int32
                      type:
                        type: string
                        description: 'Type of sales order. '
                      createdAt:
                        type: string
                        description: Date and time of creation
                        format: date-time
                      registrationDate:
                        type: string
                        description: Date of registration
                        format: date
                      sellersReferenceNumber:
                        type: string
                        description: 'Sellers reference number. '
                      customersReference:
                        type: string
                        description: Customers reference. Typically a person.
                      customersReferenceNumber:
                        type: string
                        description: Customers reference number. E.g. the internal sales order id the customer use in their own system.
                      volumePriceAgreement:
                        type: string
                        description: 'Special price agreement related to the quantity beeing ordered. '
                      exchangeRateFluctuationAgreement:
                        type: string
                        description: 'When a sales order is issued, RamBase stores the current exchange rate and the currency the product normally is purchased in. The exchange rate might have changed when the invoice is issued. The exchange rate fluctuation agreement specifies how to handle these differences. The agreement has the format AAA/BBB, where AAA is a percentage of the total invoice, and BBB is the exchange rate fluctuation percentage. E.g. 100/3.0 means that if the rate of exchange on the date a sales order is forwarded to an invoice has changed more than +/- 3% from the rate of exchange, 100% of the invoice amount will be adjusted.'
                      netWeight:
                        type: number
                        description: 'Total weight  (excluding packing material) in kilograms, calculated based on weight of all included products.'
                        format: double
                      grossMargin:
                        type: number
                        description: 'Gross margin of sale, calculated as an average of gross margin of all items at the time items are created and when the document is registered. Will not be recalculated if gross margin in items change afterwards'
                        format: double
                      currency:
                        type: string
                        description: Three character code following the ISO 4217 standard
                      hasAttachmentsToForward:
                        type: boolean
                        description: Has attachements that will be included when forwarded to other transaction documents.
                      note:
                        type: string
                        description: Additional information regarding the object (free text). This note might be visible to customers/suppliers.
                      shippingAddressAttention:
                        type: string
                        description: 'Attention of the shipping address. When changing shipping address, the ShippingAddressAttention will be overridden by the attention of the new shipping address.'
                      shippingAddressPhone:
                        type: string
                        description: 'Phone number of the shipping address. When changing shipping address, the ShippingAddressPhone will be overridden by the phone number of the new shipping address.'
                      shippingAddressEmail:
                        type: string
                        description: 'Email address of the shipping address. When changing shipping address, the ShippingAddressEmail will be overridden by the email of the new shipping address.'
                      invoiceAddressAttention:
                        type: string
                        description: 'Attention of the invoice address. When changing invoice address, the InvoiceAddressAttention will be overridden by the attention of the new invoice address.'
                      locationCountryCode:
                        type: string
                        description: Country code of the location. Inherits from the location.
                      location:
                        $ref: '#/components/schemas/Location'
                      assignee:
                        $ref: '#/components/schemas/Assignee'
                      customer:
                        type: object
                        properties:
                          customerId:
                            type: integer
                            description: Customer identifier
                            format: int32
                          name:
                            type: string
                            description: Name of customer (name of company or surname/familyname/lastname of a person)
                          firstname:
                            type: string
                            description: Secondary name of a company or firstname of a person
                          phone:
                            type: string
                            description: Customers main phone number
                          email:
                            type: string
                            description: Customers main email
                          sales:
                            type: object
                            properties:
                              salesDistrict:
                                type: string
                                description: A geographic district for which an individual salesperson or sales team holds responsibility
                              marketSegment:
                                type: string
                                description: Market segment of the customer
                              salesAssistant:
                                $ref: '#/components/schemas/SalesAssistant'
                              accountManager:
                                $ref: '#/components/schemas/AccountManager'
                          customerLegalEntity:
                            $ref: '#/components/schemas/CustomerLegalEntity'
                          customerLink:
                            type: string
                            description: Customer reference
                      initialSalesOrder:
                        $ref: '#/components/schemas/InitialSalesOrder'
                      management:
                        $ref: '#/components/schemas/Management'
                      shippingAddress:
                        type: object
                        properties:
                          addressId:
                            type: integer
                            description: Address identifier
                            format: int32
                          name:
                            type: string
                            description: Name of receiver (Name of company or last name of a person). Note that default invoice address must have the same name as the customer.
                          firstname:
                            type: string
                            description: Firstname if the receiver is a person. Note that default invoice address must have the same firstname as the customer.
                          addressLine1:
                            type: string
                            description: First address line
                          addressLine2:
                            type: string
                            description: Second address line
                          postalCode:
                            type: string
                            description: Postalcode/Postcode/ZIP
                          city:
                            type: string
                            description: City/town/village
                          region:
                            type: string
                            description: Region/province/state
                          countryCode:
                            type: string
                            description: Two-character code (ISO 3166) identifying the country.
                          country:
                            type: string
                            description: English name of country.
                          externalReference:
                            type: string
                            description: External address identifier. Normally defined by the customer.
                      invoiceAddress:
                        type: object
                        properties:
                          addressId:
                            type: integer
                            description: Address identifier
                            format: int32
                          name:
                            type: string
                            description: Name of receiver (Name of company or last name of a person). Note that default invoice address must have the same name as the customer.
                          firstname:
                            type: string
                            description: Firstname if the receiver is a person. Note that default invoice address must have the same firstname as the customer.
                          addressLine1:
                            type: string
                            description: First address line
                          addressLine2:
                            type: string
                            description: Second address line
                          postalCode:
                            type: string
                            description: Postalcode/Postcode/ZIP
                          city:
                            type: string
                            description: City/town/village
                          region:
                            type: string
                            description: Region/province/state
                          countryCode:
                            type: string
                            description: Two-character code (ISO 3166) identifying the country.
                          country:
                            type: string
                            description: English name of country.
                      totals:
                        $ref: '#/components/schemas/Totals'
                      totalsConverted:
                        type: object
                        properties:
                          currency:
                            type: string
                            description: Currency used in conversion. Default is company accounting currency. Three character code following the ISO 4217 standard.
                          exchangeRate:
                            type: number
                            description: The exchange rate used in convertion
                            format: double
                          freightAmount:
                            type: number
                            description: Freight amount in company currency.
                            format: double
                          feeAmount:
                            type: number
                            description: Fee amount in company currency
                            format: double
                          subTotalAmount:
                            type: number
                            description: 'Total amount of the object in company currency, excluding VAT.'
                            format: double
                          vATAmount:
                            type: number
                            description: Value added tax amount in company currency.
                            format: double
                          totalAmount:
                            type: number
                            description: 'The total amount in company currency, including VAT.'
                            format: double
                          grossMarginAmount:
                            type: number
                            description: Gross margin of sale presented in local currency. This is calculated as an average of gross margin of all items at the time the document is registered. Will not be recalculated if gross margin in items change afterwards.
                            format: double
                      shipment:
                        type: object
                        properties:
                          deliveryTerms:
                            type: string
                            description: Delivery terms when shipping the goods. The delivery terms is based on the Incoterms rules from ICC (International Chamber of Commerce). The delivery terms is by default retrieved from the customer.
                          deliveryTermPlace:
                            type: string
                            description: Named place related to delivery terms (Incoterms)
                          onlyShipEntireSalesOrder:
                            type: boolean
                            description: 'True if all items of a sales order should be shipped together. The items of a sales order should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                          onlyShipEntireSalesOrderItems:
                            type: boolean
                            description: 'True if the total quantity of a sales order item always should be shipped together. The quantity should never be split into several shipments. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                          avoidMultipleShipmentsOnSameDate:
                            type: boolean
                            description: 'True if all items of a sales order with the same sheduled delivery date should be shipped together. If sales order is forwarded to shipping advice by bulk handling, this will be controlled by RamBase. Manually forward requires that the users controls this themselves.'
                          shipBasedOnConfirmedDeliveryDate:
                            type: boolean
                            description: 'If true, will sheduled shipping date on each item be calculated based on confirmed date rather than requested date.'
                          freightForEachShipment:
                            type: boolean
                            description: If unchecked there will only be calculated freight on one shipping advice if the particular sales order has serveral shipments.
                          shippingDay:
                            type: string
                            description: Specifies when the goods should be shipped. This is used to calculate the scheduled shipping date for each item.
                          consolidateShippingAdvices:
                            type: boolean
                            description: 'If true, sales orders will be consolidated when creating shipping advices via the "Prepare for picking" process  the . If false, each sales order will result in seperate shipping advice. The field to use when consolidating is specified in the ShippingAdviceConsolidationField. '
                          shippingAdviceConsolidationField:
                            type: string
                            description: Field to use when consolidating sales order items into shipping advices in the "Prepare for picking" process.
                          shippingAdviceItemSortBy:
                            type: string
                            description: Items in consolidated shipping advices will be sorted by this fields when they are created in the 'Prepare for picking' process
                          specialHandling:
                            $ref: '#/components/schemas/SpecialHandling'
                          shippingService:
                            $ref: '#/components/schemas/ShippingService'
                      invoicing:
                        type: object
                        properties:
                          salesInvoiceConsolidation:
                            type: string
                            description: Specifies whether or how often shipping advices that origins from this sales order will be consolidated when creating sales invoices.
                          salesInvoiceConsolidationField:
                            type: string
                            description: Field name to group by when consolidating shipping advice items into sales invoices.
                          salesInvoiceItemSortBy:
                            type: string
                            description: Field name to sort by when creating sales invoice items.
                      payment:
                        type: object
                        properties:
                          paymentTerms:
                            type: string
                            description: Terms of payment. Defaut value is retrieved from the customer. The due date of the sales order and sales invoice is calculated based on this field.
                          paymentMethod:
                            type: string
                            description: 'Method of payment. Default value is retrieved from the customer. '
                          dueDate:
                            type: string
                            description: Date the sales order is due to be paid. Only relevant for pre-paid orders.
                            format: date
                          creditCardTransaction:
                            type: object
                            properties:
                              creditCardTransactionId:
                                type: integer
                                description: Credit card transaction identifier
                                format: int32
                              creditCardTransactionLink:
                                type: string
                                description: Credit card transaction reference
                      vATDetails:
                        type: object
                        properties:
                          vATType:
                            type: string
                            description: 'Type of value added tax '
                          vATHandling:
                            type: string
                            description: 'Specifies how value added tax (VAT) should be calculated. Either always include VAT, always exclude VAT or use standard/default VAT rules.'
                          defaultVATPercent:
                            type: number
                            description: Value added tax percent.
                            format: double
                          useStandardVATNumberRules:
                            type: boolean
                            description: Do not automatically replace the VAT number based on the location configuration
                      highlightedNotification:
                        $ref: '#/components/schemas/HighlightedNotification'
                      salesDeliveryProject:
                        $ref: '#/components/schemas/SalesDeliveryProject'
                      service:
                        $ref: '#/components/schemas/Service'
  '/sales/orders/{salesOrderId}/items':
    get:
      tags:
        - sales
      summary: List of all order items for specified sales order
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=1811&version=44
      operationId: sales_ListItemsForOrderById
      parameters:
        - $ref: '#/components/parameters/salesOrderId'
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
        - $ref: '#/components/parameters/showDomainValues'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/select'
        - $ref: '#/components/parameters/pagekey'
        - $ref: '#/components/parameters/inlineCount'
        - $ref: '#/components/parameters/filter'
        - $ref: '#/components/parameters/orderBy'
        - $ref: '#/components/parameters/top'
        - name: $expand
          in: query
          description: Used to add fields to the response
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - SalesOrderItem.EndCustomer
                - SalesOrderItem.TotalsConverted
                - SalesOrderItem.InitialSalesOrderItem
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  salesOrderItems:
                    type: array
                    items:
                      type: object
                      properties:
                        salesOrderItemId:
                          type: integer
                          description: Sales order item identifier
                          format: int32
                        type:
                          type: integer
                          description: Item type
                          format: int32
                        lineNumber:
                          type: integer
                          description: 'Line- or sequence number of the item. The LineNumber is used for sorting items in applications, prints, reports etc.'
                          format: int32
                        status:
                          type: integer
                          description: Status of the sales order item (0-9).
                          format: int32
                        requestedDeliveryDate:
                          type: string
                          description: The delivery date as requested by the customer.
                          format: date
                        confirmedDeliveryDate:
                          type: string
                          description: Confirmed date of delivery. Date of which the customer can expect the arriving goods
                          format: date
                        isConfirmedDeliveryDateLocked:
                          type: boolean
                          description: 'If confirmed delivery date in sales order item (COA) is locked, this date should not be re-calculated automatically.'
                        customersReferenceNumber:
                          type: string
                          description: Customers item reference number. Typically to the customers internal system.
                        customersProductName:
                          type: string
                          description: Customers internal name of the product. Retrieved from the product.
                        productDescription:
                          type: string
                          description: 'Description of the item. If not specified, the description is by default copied from the product.'
                        note:
                          type: string
                          description: Additional information regarding the item (free text). Might be visible to customers/suppliers.
                        discountPercent:
                          type: number
                          description: The discount in percent for this item.
                          format: double
                        quantity:
                          type: number
                          description: Number of units ordered
                          format: double
                        remainingQuantity:
                          type: number
                          description: Remaining number of units to be forwarded.
                          format: double
                        endCustomer:
                          $ref: '#/components/schemas/EndCustomer'
                        price:
                          type: object
                          properties:
                            currency:
                              type: string
                              description: Three character code following the ISO 4217 standard
                            grossPrice:
                              type: number
                              description: Represents the price per unit before any discounting is applied.
                              format: double
                            netPrice:
                              type: number
                              description: Final price per unit after deducting all discounts etc.
                              format: double
                        totals:
                          type: object
                          properties:
                            currency:
                              type: string
                              description: Three character code following the ISO 4217 standard
                            grossAmount:
                              type: number
                              description: Represents the item amount before any discounts etc. is applied.
                              format: double
                            netAmount:
                              type: number
                              description: Final item amount after deducting all discounts etc.
                              format: double
                            grossMarginAmount:
                              type: number
                              description: Profit amount in sales/document currency
                              format: double
                        totalsConverted:
                          type: object
                          properties:
                            grossMarginAmount:
                              type: number
                              description: Profit amount in local/converted currency
                              format: double
                        product:
                          type: object
                          properties:
                            productId:
                              type: integer
                              description: Product identifier
                              format: int32
                            name:
                              type: string
                              description: Name of the product
                            type:
                              type: string
                              description: Type of product
                            manufacturer:
                              type: object
                              properties:
                                manufacturerId:
                                  type: integer
                                  description: Manufacturer identifier
                                  format: int32
                                manufacturerLink:
                                  type: string
                                  description: Manufacturer reference
                            productLink:
                              type: string
                              description: Product reference
                        initialSalesOrderItem:
                          $ref: '#/components/schemas/InitialSalesOrderItem'
                        recurringInvoicing:
                          type: object
                          properties:
                            priceChangeAgreement:
                              type: integer
                              description: Defines if and how the recurring price can be updated
                              format: int32
                            startDate:
                              type: string
                              description: Start date of subscription or rental item
                              format: date
                            expectedEndDate:
                              type: string
                              description: Expected end date of subscription or rental item
                              format: date
                            recurringPrice:
                              type: object
                              properties:
                                recurringPriceId:
                                  type: integer
                                  description: Recurring price indentifier
                                  format: int32
                                recurringPriceLink:
                                  type: string
                                  description: Recurring price reference
                        salesOrderItemLink:
                          type: string
                          description: Reference to the sales order item.
                  paging:
                    $ref: '#/components/schemas/Paging'
    post:
      tags:
        - sales
      summary: "Creates a new item in provided sales order.\r\n\r\nNote that Discount will be ignored when DiscountPercent is provided. \r\nNote also that Discount, DiscountPercent and GrossPrice will be ignored when GrossMargin is provided."
      externalDocs:
        url: https://api.rambase.net/documentation?resourceno=1903&version=27
      operationId: sales_PostItemsForOrderById
      parameters:
        - $ref: '#/components/parameters/salesOrderId'
        - $ref: '#/components/parameters/db'
        - $ref: '#/components/parameters/showCustomFields'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                salesOrderItem:
                  required:
                    - quantity
                  type: object
                  properties:
                    type:
                      pattern: ''
                      type: integer
                      description: Item type
                      format: int32
                    requestedDeliveryDate:
                      pattern: ''
                      type: string
                      description: The delivery date as requested by the customer.
                      format: date
                    customersReferenceNumber:
                      pattern: ''
                      type: string
                      description: Customers item reference number. Typically to the customers internal system.
                    customersProductName:
                      pattern: ''
                      type: string
                      description: Customers internal name of the product. Retrieved from the product.
                    equivalentProductName:
                      pattern: ''
                      type: string
                      description: 'Name of product with equivalent behavior and attributes. Can be used for same purpose. '
                    requestedProductStructureRevision:
                      pattern: ''
                      type: string
                      description: 'The revision will typically be a major change, as opposed to minor changes stored in the version of the product structure.'
                    productDescription:
                      pattern: ''
                      type: string
                      description: 'Description of the item. If not specified, the description is by default copied from the product.'
                    note:
                      pattern: ''
                      type: string
                      description: Additional information regarding the item (free text). Might be visible to customers/suppliers.
                    grossMargin:
                      maxLength: 100
                      pattern: ''
                      type: number
                      description: 'Gross margin of the item. An eventual approval of GM is triggered if this percentage is lower than the highest value of minimum gross margin set up in Customer, Product and  GM in COM'
                      format: double
                    discountPercent:
                      maxLength: 100
                      minLength: 0
                      pattern: ''
                      type: number
                      description: The discount in percent for this item.
                      format: double
                    quantity:
                      minLength: 0
                      pattern: ''
                      type: number
                      description: Number of units ordered
                      format: double
                    warranty:
                      type: object
                      properties:
                        warrantyExpirationDate:
                          pattern: ''
                          type: string
                          description: Date of warranty expiration.
                          format: date
                    price:
                      type: object
                      properties:
                        grossPrice:
                          pattern: ''
                          type: number
                          description: Represents the price per unit before any discounting is applied.
                          format: double
                        discount:
                          minLength: 0
                          pattern: ''
                          type: number
                          description: 'Discount for each unit in the item, in document currency.  Will be calculated based on Discount percentage, or can be set manually.'
                          format: double
                    location:
                      type: object
                      properties:
                        locationId:
                          minimum: 10000
                          pattern: ''
                          type: integer
                          description: Location identifier
                          format: int32
                    seller:
                      type: object
                      properties:
                        employeeId:
                          minimum: 100
                          pattern: ''
                          type: integer
                          description: Employee identifier
                          format: int32
                      description: Reference to the seller of the item
                    product:
                      required:
                        - productId
                      type: object
                      properties:
                        productId:
                          minimum: 10000
                          pattern: ''
                          type: integer
                          description: Product identifier
                          format: int32
                    landedCost:
                      type: object
                      properties:
                        purchaseCurrency:
                          pattern: ''
                          type: string
                          description: Purchase currency is the currency this product normally is purchased in. This is also the base currency used in the gross margin calculation. By default the purchase currency is retrieved from the product.
                        purchaseExchangeRate:
                          pattern: ''
                          type: number
                          description: Exchange rate between document currency and purchase currency. Used in landed cost calculations.
                          format: double
                        derivedFrom:
                          type: object
                          properties:
                            purchaseQuoteItemId:
                              minimum: 1
                              pattern: ''
                              type: integer
                              description: Purchase quote item identifier
                              format: int32
                            purchaseQuote:
                              type: object
                              properties:
                                purchaseQuoteId:
                                  minimum: 100000
                                  pattern: ''
                                  type: integer
                                  description: Purchase quote identifier
                                  format: int32
                    recurringInvoicing:
                      type: object
                      properties:
                        startDate:
                          pattern: ''
                          type: string
                          description: Start date of subscription or rental item
                          format: date
                        estimatedEndDate:
                          pattern: ''
                          type: string
                          description: Expected end date of subscription or rental item
                          format: date
                        priceChangeAgreement:
                          pattern: ''
                          type: integer
                          description: Defines if and how the recurring price can be updated
                          format: int32
                        recurringPrice:
                          type: object
                          properties:
                            recurringPriceId:
                              minimum: 100000
                              pattern: ''
                              type: integer
                              description: Recurring price indentifier
                              format: int32
      responses:
        '201':
          description: OK
components:
  schemas:
    Object:
      type: object
      properties:
        objectId:
          type: integer
          description: Identifier of the object
          format: int32
        objectType:
          type: string
          description: Type of object
        objectLink:
          type: string
          description: API reference to the object
    SpecialHandling:
      type: object
      properties:
        specialHandlingId:
          type: integer
          description: 'The special handling code used for this customer. '
          format: int32
        specialHandlingLink:
          type: string
          description: 'The special handling code used for this customer. '
    Intercompany:
      type: object
      properties:
        code:
          type: string
          description: Intercompany database the customer belongs to.
    Currency:
      type: object
      properties:
        currencyCode:
          type: string
          description: Three character code following the ISO 4217 standard
    Service:
      type: object
      properties:
        specialHandling:
          $ref: '#/components/schemas/SpecialHandling'
    Rental:
      type: object
      properties:
        discountPercentage:
          type: number
          description: The discount percentage that should be used when the customer creates a new rental or subscription item in a rental contract
          format: double
    PriceList:
      type: object
      properties:
        priceListId:
          type: integer
          description: Price list identifier
          format: int32
        name:
          type: string
          description: Name of the price list
        priceListLink:
          type: string
          description: Price list reference
    AccountManager:
      type: object
      properties:
        employeeId:
          type: integer
          description: Employee identifier
          format: int32
        lastName:
          type: string
          description: Last name of employee
        firstName:
          type: string
          description: First name of employee
        employeeLink:
          type: string
          description: Employee reference
      description: 'Reference to the employee who is responsible for the management of sales, and relationship with the customer.'
    Payment:
      type: object
      properties:
        paymentTerms:
          type: string
          description: Default payment terms to use in new documents.
        paymentMethod:
          type: string
          description: Default payment method for the customer
    HighlightedNotification:
      type: object
      properties:
        notificationId:
          type: integer
          description: Notification identifier
          format: int32
        status:
          type: integer
          description: Status of the notification
          format: int32
        createdAt:
          type: string
          description: Date and time of creation
          format: date-time
        message:
          type: string
          description: 'The message from the notification definition, expanded with parameters.'
        translatedMessage:
          type: string
          description: 'The translated message from the notification definition, expanded with parameters.'
        notificationType:
          type: object
          properties:
            notificationTypeId:
              type: string
              description: Notification type identifier
            category:
              type: string
              description: 'Category of notification type (warning, information etc)'
            notificationTypeLink:
              type: string
              description: Notification type reference
        notificationLink:
          type: string
          description: Notification reference
    Paging:
      type: object
      properties:
        pageSize:
          type: integer
          description: 'Number of elements in the list, as defined in $top. Default is 10.'
          format: int32
        position:
          type: integer
          description: Position of the first element in the list
          format: int32
        page:
          type: integer
          description: Page index
          format: int32
        firstPageKey:
          type: string
          description: Page key to use for navigating to the first page in the list
        firstPage:
          type: string
          description: Link to the first page in the list. $pageKey is set to FirstPageKey.
        previousPageKey:
          type: string
          description: Page key to use for navigating to previous page in the list
        previousPage:
          type: string
          description: Link to the previous page in the list. $pageKey is set to PreviousPageKey.
        nextPageKey:
          type: string
          description: Page key to use for navigating to next page in the list
        nextPage:
          type: string
          description: Link to the next page in the list. $pageKey is set to NextPageKey.
        lastPageKey:
          type: string
          description: Page key to use for navigating to last page in the list
        lastPage:
          type: string
          description: Link to the last page in the list. $pageKey is set to LastPageKey.
        size:
          type: integer
          description: Total number of records in the list. Use $inlinecount=allpages in the request uri to include this
          format: int32
      description: Detailed paging information for this list.
    Location:
      type: object
      properties:
        locationId:
          type: integer
          description: Location identifier
          format: int32
        shortName:
          type: string
          description: Unique abbreviation/short name of the location
        address:
          type: object
          properties:
            countryCode:
              type: string
              description: Two-character code (ISO 3166) identifying the country.
        locationLink:
          type: string
          description: Location reference
    Assignee:
      type: object
      properties:
        userId:
          type: integer
          description: User identifier
          format: int32
        name:
          type: string
          description: Name of the user
        firstName:
          type: string
          description: First name of the user
        userLink:
          type: string
          description: User reference
      description: The user who has been assigned to work with this object.
    SalesAssistant:
      type: object
      properties:
        employeeId:
          type: integer
          description: Employee identifier
          format: int32
        lastName:
          type: string
          description: Last name of employee
        firstName:
          type: string
          description: First name of employee
        employeeLink:
          type: string
          description: Employee reference
      description: Reference to the employee who is sales assistant for the customer.
    CustomerLegalEntity:
      type: object
      properties:
        customerLegalEntityId:
          type: integer
          description: Customer legal entity identifier
          format: int32
        customerLegalEntityLink:
          type: string
          description: Reference to customer legal entity
    InitialSalesOrder:
      type: object
      properties:
        salesOrderId:
          type: integer
          description: Sales order identifier
          format: int32
        salesOrderLink:
          type: string
          description: Sales order reference
      description: Reference to initial sales order
    Management:
      type: object
      properties:
        planner:
          type: object
          properties:
            employeeId:
              type: integer
              description: Employee identifier
              format: int32
            lastName:
              type: string
              description: Last name of employee
            firstName:
              type: string
              description: First name of employee
            employeeLink:
              type: string
              description: Employee reference
          description: Reference to the employee who is a production management planner.
        projectLeader:
          type: object
          properties:
            employeeId:
              type: integer
              description: Employee identifier
              format: int32
            lastName:
              type: string
              description: Last name of employee
            firstName:
              type: string
              description: First name of employee
            employeeLink:
              type: string
              description: Employee reference
          description: Reference to the employee who is a production management project leader.
        documentController:
          type: object
          properties:
            employeeId:
              type: integer
              description: Employee identifier
              format: int32
            lastName:
              type: string
              description: Last name of employee
            firstName:
              type: string
              description: First name of employee
            employeeLink:
              type: string
              description: Employee reference
          description: Reference to the employee who is a production management document controller.
      description: 'Represents a group of users, which are assigned to particular management roles.'
    Totals:
      type: object
      properties:
        currency:
          type: string
          description: Three character code following the ISO 4217 standard
        freightAmount:
          type: number
          description: Freight amount in transaction document's currency
          format: double
        feeAmount:
          type: number
          description: Fee amount in transaction document's currency
          format: double
        subTotalAmount:
          type: number
          description: 'Total amount of the object in object currency, excluding VAT.'
          format: double
        vATAmount:
          type: number
          description: Total value added tax in object currency.
          format: double
        totalAmount:
          type: number
          description: 'The total amount in object currency, including VAT'
          format: double
        grossMarginAmount:
          type: number
          description: Gross margin of sale presented in sales currency. This is calculated as an average of gross margin of all items at the time the document is registered. Will not be recalculated if gross margin in items change afterwards.
          format: double
    ShippingService:
      type: object
      properties:
        shippingServiceId:
          type: integer
          description: Shipping service identifier
          format: int32
        name:
          type: string
          description: Name of shipping service
        carrier:
          type: object
          properties:
            carrierId:
              type: integer
              description: Carrier identifier
              format: int32
            name:
              type: string
              description: Name of carrier
            carrierLink:
              type: string
              description: Carrier reference
        shippingServiceLink:
          type: string
          description: Shipping service reference
    SalesDeliveryProject:
      type: object
      properties:
        salesDeliveryProjectId:
          type: integer
          description: Sales delivery project identifier
          format: int32
        name:
          type: string
          description: Name of sales delivery project
        salesDeliveryProjectLink:
          type: string
          description: Sales delivery project reference
    EndCustomer:
      type: object
      properties:
        customerId:
          type: integer
          description: Customer identifier
          format: int32
        name:
          type: string
          description: Name of customer (name of company or surname/familyname/lastname of a person)
        firstName:
          type: string
          description: Secondary name of a company or firstname of a person
        vATRegistrationNumber:
          type: string
          description: Unique number assigned by the relevant tax authority to identify a party for use in relation to value added tax (VAT).
        customerLink:
          type: string
          description: Customer reference
      description: End customer
    InitialSalesOrderItem:
      type: object
      properties:
        salesOrderItemId:
          type: integer
          description: Sales order item identifier
          format: int32
        salesOrder:
          type: object
          properties:
            salesOrderId:
              type: integer
              description: Sales order identifier
              format: int32
            salesOrderLink:
              type: string
              description: Sales order reference
        salesOrderItemLink:
          type: string
          description: Reference to the sales order item.
      description: Reference to the initial/first/original sales order item in the document flow for this item.
    SalesAssistant1:
      type: object
      properties:
        employeeId:
          minimum: 100
          type: integer
          description: Employee identifier
          format: int32
      description: Reference to the employee who is sales assistant for the customer.
    AccountManager1:
      type: object
      properties:
        employeeId:
          minimum: 100
          type: integer
          description: Employee identifier
          format: int32
      description: 'Reference to the employee who is responsible for the management of sales, and relationship with the customer.'
    SpecialHandling1:
      type: object
      properties:
        specialHandlingId:
          minimum: 0
          type: integer
          description: 'The special handling code used for this customer. '
          format: int32
    Accounting:
      type: object
      properties:
        creditLimit:
          minLength: 0
          type: number
          description: The maximum amount that the customer may charge on a credit card or borrow from a financial institution.
          format: double
        creditInsuranceAmount:
          minLength: 0
          type: number
          description: Credit amount insured for the customer
          format: double
        creditInsuranceCompany:
          type: string
          description: Insurance company used by the customer for credit insurance
  parameters:
    select:
      name: $select
      in: query
      description: Limit the number of fields in the response
      style: form
      explode: false
      schema:
        type: array
        items:
          type: string
    pagekey:
      name: $pageKey
      in: query
      description: 'Navigate to first-, previous, next- or last page in list'
      schema:
        type: string
    db:
      name: $db
      in: query
      description: Database of the company to request
      schema:
        maximum: 5
        type: string
    useMinimumVersion:
      name: $useMinimumVersion
      in: query
      description: Used to run a new version of an API resource when your API client is running a deprecated API resource.
      schema:
        type: integer
    inlineCount:
      name: $inlineCount
      in: query
      description: Set to 'allpages' to include total number of rows in the response.
      schema:
        enum:
          - none
          - allpages
        type: string
    top:
      name: $top
      in: query
      description: Specifies number of rows to return in each page.
      schema:
        type: integer
        format: int32
    filter:
      name: $filter
      in: query
      description: Filter the result
      schema:
        type: string
    orderBy:
      name: $orderBy
      in: query
      description: Order the result
      schema:
        type: string
    format:
      name: $format
      in: query
      description: Format of the response
      required: true
      schema:
        enum:
          - json
          - xml
        type: string
    lang:
      name: $lang
      in: query
      description: Language to use in the response. 3-letter language code.
      schema:
        maximum: 3
        type: string
    showCustomFields:
      name: $showCustomFields
      in: query
      description: Set to true to include/use custom fields. Default value is false.
      schema:
        type: boolean
    showDomainValues:
      name: $showDomainValues
      in: query
      description: Set to true to include domain descriptions for fields using domain values. Default value is false.
      schema:
        type: boolean
    salesOrderId:
      name: salesOrderId
      in: path
      description: Sales order identifier
      required: true
      schema:
        minimum: 100000
        pattern: ''
        type: integer
        format: int32
    itemId:
      name: itemId
      in: path
      description: Sales order item identifier
      required: true
      schema:
        minimum: 1
        pattern: ''
        type: integer
        format: int32
    customerId:
      name: customerId
      in: path
      description: Customer identifier
      required: true
      schema:
        minimum: 10000
        pattern: ''
        type: integer
        format: int32
  securitySchemes:
    api_key:
      type: apiKey
      description: API key to authorize requests
      name: $accessToken
      in: query
    oauth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.rambase.net/oauth2
          tokenUrl: https://api.rambase.net/oauth2/access_token
          refreshUrl: https://api.rambase.net/oauth2/access_token
          scopes: { }
security:
  - api_key: [ ]
    oauth: [ ]