Basware PurchaseOrders API

The PurchaseOrders API from Basware — 2 operation(s) for purchaseorders.

OpenAPI Specification

basware-purchaseorders-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Basware OAUTH2 authentication APIs AccountingDocuments PurchaseOrders API
  description: "**Using OAUTH2.0 authentication:**\n\nGet API access token from api.basware.com/tokens\n1. Using client id and client secret, which you can obtain from Basware. \n2. Specify which APIs can be accessed by using the token e.g. Read only access to vendors API only (these are called scopes). Available scopes are listed at <https://developer.basware.com/api/p2p/manual#AccessRights>. \n3. Each token has an expiration time, until which it can be used to call APIs.\n\nWhen using OAUTH2 authentication, you need to pass the OAUTH2 authentication token when calling Basware API endpoints. Available Basware API operations are documented at <https://api.basware.com/swagger>. \n\nSee the Basware API developer site at <https://developer.basware.com/api/p2p/manual#Authentication> for more details on API authentication."
  version: 1.0.0
  x-logo:
    url: https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png
tags:
- name: PurchaseOrders
paths:
  /v1/purchaseOrders:
    get:
      tags:
      - PurchaseOrders
      summary: Returns imported purchase orders.
      description: "Note: This GET operation returns a HTTP redirect, which the API client needs to follow. \r\n* 'Authorization' header must not be included in the redirected request (the second request after receiving a redirect). \r\n* 'Host' header needs to be included."
      parameters:
      - name: processingStatus
        in: query
        description: Document status filter. Returns items by purchase order status.
        schema:
          enum:
          - Uncompleted
          - ReadyForImport
          - ImportInProgress
          - Imported
          - ImportFailed
          type: string
      - name: pageSize
        in: query
        description: A limit for the number of items to be returned for one request. Limit can range between 1 and 100 items.
        schema:
          type: integer
          format: int32
          default: 100
      - name: lastUpdated
        in: query
        description: Date filter. Returns items that have been updated after specified date.
        schema:
          type: string
          format: date-time
      - name: x-amz-meta-continuationtoken
        in: header
        description: Used to get next page of results when item count indicated by 'pageSize' is exceeded. A token is returned in header (not body) parameter 'X-amz-meta-continuationToken' of the response whenever there are more records to fetch. Post the received value here in a new HEADER parameter on the next GET request to receive the next page of results. When getting the next page of results, you must include the same query parameters that were used when getting the first page.
        schema:
          type: string
        example: ac0108a2-5ade-4b78-8d57-1e4d5999cb83
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PurchaseOrdersResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrdersResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrdersResponse'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          description: Unexpected error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
    post:
      tags:
      - PurchaseOrders
      summary: Creates new purchase order(s), fully overwrites previous record if exists. P2P Purchase does not allow updates to purchase orders after import.
      description: "Notes: \r\n1. Any referenced vendors, users, payment terms, purchasing categories, quantity units, etc. need to exist in P2P when the purchase order is posted.\r\n2. Orders are technically handled as auto-approved requisitions resulting in a corresponding order being created. If you don't find the order in P2P UI, try looking for it as a requisition. It might have invalid data (see above) or the requisition approval process may be configured in a way to block automatic order creation.\r\n3. Field 'processingStatus' requires a value from API user in POST and PATCH request. If you need to import an order with more than 200 lines, this can be done by setting 'processingStatus' to 'Uncompleted' when POSTing the purchaseOrder and then adding additional lines to it using the PATCH method. ProcessingStaus: 'Uncompleted' prevents the order from being set to P2P so that more lines can be added. When all lines have been added, set 'processingStaus' = 'ReadyForImport' using PATCH method and the order will be imported to P2P.  \r\n\r\nPlease see section \"[Usage scenario 4: Import and export procurement data](https://developer.basware.com/api/p2p/manual#usage4)\" for details on implementing this API. Check out also the [example JSONs using a minimal feasible set of fields](https://developer.basware.com/api/p2p/templates) from the developer site."
      parameters:
      - name: Content-Type
        in: header
        description: Specifies the media type of the resource. Value application/json is supported.
        schema:
          type: string
        example: application/json
      requestBody:
        content:
          application/json-patch+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PurchaseOrderEntity'
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PurchaseOrderEntity'
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PurchaseOrderEntity'
          application/*+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PurchaseOrderEntity'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PurchaseOrderEntity'
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrderEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrderEntity'
        '400':
          description: Bad request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
        '401':
          description: Unauthorized
        '409':
          description: Conflict
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
        '500':
          description: Unexpected error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
    delete:
      tags:
      - PurchaseOrders
      summary: Deletes data from Basware API. For manual one-time operations.
      description: "For manual one-time operations only, such as a manual clean-up to remove test data generated during API integration development. Only removes records from API layer. \r\nDeletion in target systems needs to be done separately using the data deletion mechanisms available in each of the target system in addition to deleting the data in Basware API."
      requestBody:
        description: "Contains the body of the request.\r\n            Either externalCode or lastUpdated -field is required. If both values are provided, externalCode will have the priority."
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/DeleteRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/DeleteRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/DeleteRequest'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '202':
          description: RequestAccepted
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '400':
          description: BadRequest
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
        '401':
          description: Unauthorized
        '500':
          description: Unexpected error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
  /v1/purchaseOrders/{externalCode}:
    get:
      tags:
      - PurchaseOrders
      summary: Returns single imported purchase order by orderId - identifier.
      description: "Note: This GET operation returns a HTTP redirect, which the API client needs to follow. \r\n* 'Authorization' header must not be included in the redirected request (the second request after receiving a redirect). \r\n* 'Host' header needs to be included."
      parameters:
      - name: externalCode
        in: path
        description: The externalCode of the purchaseOrder to be fetched
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PurchaseOrdersResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrdersResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/PurchaseOrdersResponse'
        '401':
          description: Unauthorized
        '404':
          description: Not found. Request was successful and no records were found.
        '500':
          description: Unexpected error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
    patch:
      tags:
      - PurchaseOrders
      summary: Updates fields on specified order line. Can be used for adding new goods receipts to existing order lines when order is in 'Uncompleted' state. Preserves existing values in fields, which were not updated.
      description: "Notes: \r\n1) Field 'processingStatus' requires a value from API user in POST and PATCH request. If you need to import an order with more than 200 lines, this can be done by setting 'processingStatus' to 'Uncompleted' when POSTing the purchaseOrder and then adding additional lines to it using the PATCH method. ProcessingStaus: 'Uncompleted' prevents the order from being set to P2P so that more lines can be added. When all lines have been added, set 'processingStaus' = 'ReadyForImport' using PATCH method and the order will be imported to P2P. \r\n2) Basware API considers 'null' value in field(s) equivalent to the field(s) not being sent. For this reason patch method does not support setting field values to 'null'. \r\n\r\nPlease see section \"[Usage scenario 4: Import and export procurement data](https://developer.basware.com/api/p2p/manual#usage4)\" for details on implementing this API. Check out also the [example JSONs using a minimal feasible set of fields](https://developer.basware.com/api/p2p/templates) from the developer site."
      parameters:
      - name: externalCode
        in: path
        description: The externalCode of the imported purchase order to be updated
        required: true
        schema:
          type: string
      requestBody:
        description: Entity to be updated
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PurchaseOrderEntity'
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseOrderEntity'
          text/json:
            schema:
              $ref: '#/components/schemas/PurchaseOrderEntity'
          application/*+json:
            schema:
              $ref: '#/components/schemas/PurchaseOrderEntity'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/OrderLineEntity'
            application/json:
              schema:
                $ref: '#/components/schemas/OrderLineEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/OrderLineEntity'
        '400':
          description: Bad request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
        '401':
          description: Unauthorized
        '404':
          description: Not found. Record to update not found.
        '500':
          description: Unexpected error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
        '503':
          description: Service Unavailable
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
components:
  schemas:
    PurchaseOrderEntity:
      required:
      - externalCode
      - extOrderNumber
      - extRequisitionNumber
      type: object
      properties:
        externalCode:
          maxLength: 100
          minLength: 1
          type: string
          description: External identifier that is used as a key in API.
          example: 4847-31231212-212121-1212
        extOrderNumber:
          maxLength: 100
          minLength: 1
          type: string
          description: Order number in external system
          example: PO1235876123
        extRequisitionNumber:
          maxLength: 100
          minLength: 1
          type: string
          description: Requisition number of related requisition in external system (for imported requisitions).
          example: REQ21037756
        processingStatus:
          enum:
          - Uncompleted
          - ReadyForImport
          - ImportInProgress
          - Imported
          - ImportFailed
          type: string
          description: 'Processing status of the order in Basware API. Enables importing orders with > 200 lines. Possible values to POST by API user: 1) ''Uncompleted'' - Order will not be imported to P2P and more lines can be added using PATCH method. 2) ''ReadyForImport'' - Order will now be imported to P2P, no more lines can be sent. Default Value: ''Uncompleted''. After starting import, processingStatus changes automatically to ''ImportInProgress'' and ''Imported'' / ''ImportFailed'' to indicate updated import status.'
          nullable: true
          example: ReadyForImport
        organizationUnitCode:
          maxLength: 32
          minLength: 0
          type: string
          description: P2P company code for buyer organisation unit. Either 'organizationUnitCode' or 'organizationIdentifier' is required.
          nullable: true
          example: BE100
        organizationIdentifier:
          maxLength: 32
          minLength: 0
          type: string
          description: Organization identifier for buyer organisation unit. Needs to match with what is configured on the organization unit in P2P. Either 'organizationUnitCode' or 'organizationIdentifier' is required.
          nullable: true
          example: 0037321832176
        purchasingGroupCode:
          maxLength: 25
          minLength: 0
          type: string
          description: Purchasing group code.
          nullable: true
          example: ''
        purchasingGroupName:
          maxLength: 250
          minLength: 0
          type: string
          description: Purchasing group name.
          nullable: true
          example: ''
        purpose:
          maxLength: 2000
          minLength: 0
          type: string
          description: Reason why order is placed.
          nullable: true
          example: Goods for Project X
        noteToSupplier:
          maxLength: 2000
          minLength: 0
          type: string
          description: This note is included when order is sent to supplier.
          nullable: true
          example: ''
        validityPeriodStartDate:
          type: string
          description: 'Used only if the order type is blanket to specify the start date for blanket purchase order validity period (date format: yyyy-MM-dd).'
          format: date-time
          nullable: true
          example: ''
        validityPeriodEndDate:
          type: string
          description: 'Used only if the order type is blanket to specify the end date for blanket purchase order validity period (date format: yyyy-MM-dd).'
          format: date-time
          nullable: true
          example: ''
        desiredDeliveryDate:
          type: string
          description: Delivery date requested by buyer.
          format: date-time
          nullable: true
          example: '2020-10-24T00:00:00'
        desiredDeliveryEndDate:
          type: string
          description: Buyer requested latest delivery date.
          format: date-time
          nullable: true
          example: '2020-10-24T00:00:00'
        deliveryInstruction:
          maxLength: 250
          minLength: 0
          type: string
          description: Delivery instruction to supplier (shown on header). Here users can provide free-text information in addition to deliveryTerm and deliveryLocation.
          nullable: true
          example: ''
        classification:
          maxLength: 250
          minLength: 0
          type: string
          description: '"Order classification code. Values can be specified by customer. Often used to group orders and assign different groups to be handled to different persons.'
          nullable: true
          example: ''
        contractNumber:
          maxLength: 255
          minLength: 0
          type: string
          description: Specifies contract which this order relates to.
          nullable: true
          example: CON2198763
        orderType:
          enum:
          - Standard
          - Blanket
          type: string
          nullable: true
        supplierCode:
          maxLength: 32
          minLength: 1
          type: string
          description: Supplier code to whom the order is addressed.
          nullable: true
          example: '321687'
        supplierName:
          maxLength: 255
          minLength: 0
          type: string
          description: Supplier name to whom the order is addressed.
          nullable: true
          example: ACME supplier ltd.
        ownerOrderingEmail:
          maxLength: 1800
          minLength: 0
          pattern: ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*)@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$
          type: string
          description: 'Contact email to which supplier can send questions about the order. Note: When order is sent to supplier, it is not sent to this email. Note: Fields visible on the order sent to supplier are configured in P2P Purchase.'
          nullable: true
          example: john.smith@buyer.com
        supplierOrderingEmail:
          maxLength: 1800
          minLength: 0
          pattern: ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*)@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$
          type: string
          description: The email address(es) where the order is sent to when sending order to supplier. Can contain multiple email addresses separated by semicolon.
          nullable: true
          example: Mark@supplier.com
        otherOrderingEmail:
          pattern: ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*)@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$
          type: string
          description: The email address(es) where the order is sent by P2P purchase. Can contain multiple email addresses separated by semicolon. The order is sent to these addresses when orderRecipientType is 'Owner' or 'Both'.
          nullable: true
          example: Mark@supplier.com
        paymentTermCode:
          maxLength: 250
          minLength: 0
          type: string
          description: Order payment term code.
          nullable: true
          example: 30N
        paymentTermName:
          maxLength: 2000
          minLength: 0
          type: string
          description: Order payment term name.
          nullable: true
          example: 30 Days Net
        releaseOrdersRequired:
          type: boolean
          description: Used only if the order type is blanket to specify, if the blanket order requires release orders.
          nullable: true
          example: false
        hidePricesFromSupplier:
          type: boolean
          description: Specifies, if all price information is hidden from the supplier in the outgoing order.
          nullable: true
          example: false
        attachPdfToNetworkOrder:
          type: boolean
          description: Specifies if order is attached as pdf file when order is sent to supplier through Basware network.
          example: true
        orderRecipientType:
          enum:
          - Supplier
          - Owner
          - SupplierAndOwner
          type: string
          description: "Determines who order is sent to.\r\n-Supplier(0) : Order is sent only to supplier.\r\n-If orderingMethod is email, order is sent to the email indicated by 'supplierOrderingEmail'. -If orderingMethod is network, the order is sent through Basware network.\r\n-Owner (1): Order is sent only to email address(es) indicated by field 'otherOrderingEmail'. Used for example when goods were picked up from a store and no order needs to be sent to supplier.\r\n-Both (2): Order is sent to both supplier and email addresses indicated by field 'otherOrderingEmail'. Order delivery method to supplier is determined by orderingMethod, same as above."
          nullable: true
          example: Supplier
        deliveryLocation:
          maxLength: 250
          minLength: 0
          type: string
          description: Details on Delivery
          nullable: true
          example: ''
        deliveryTerm:
          maxLength: 100
          minLength: 0
          type: string
          description: Delivery term. Generally Incoterms (International Commercial Terms) are used here, however customer and supplier can also agree to use different sets of delivery terms.
          nullable: true
          example: Supplier to Buyer via Post
        deliveryReceivers:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseOrderUserEntity'
          description: 'List of people who will get GR -task in Purchase for this order. The users specified needs to have appropriate permission to P2P to receive goods. Each entry must uniquely identify a user. Identifiers are applied in following order: 1) externalCode, 2) loginAccount, 3) emailAddress. This is a list with max. 20 items.'
          nullable: true
        purchaseCurrency:
          maxLength: 25
          minLength: 1
          type: string
          description: Currency code for currency in which the order is placed.
          nullable: true
          example: USD
        headerDataDate1:
          type: string
          description: 'HeaderDataDate1-5: Can be used for customer-specific date fields.'
          format: date-time
          nullable: true
          example: ''
        headerDataDate2:
          type: string
          format: date-time
          nullable: true
          example: ''
        headerDataDate3:
          type: string
          format: date-time
          nullable: true
          example: ''
        headerDataDate4:
          type: string
          format: date-time
          nullable: true
          example: ''
        headerDataDate5:
          type: string
          format: date-time
          nullable: true
          example: ''
        headerDataNum1:
          type: number
          description: 'HeaderDataNum1-5: Can be used for customer-specific numeric fields.'
          format: double
          nullable: true
        headerDataNum2:
          type: number
          format: double
          nullable: true
        headerDataNum3:
          type: number
          format: double
          nullable: true
        headerDataNum4:
          type: number
          format: double
          nullable: true
        headerDataNum5:
          type: number
          format: double
          nullable: true
        headerDataText1:
          maxLength: 250
          minLength: 0
          type: string
          description: 'HeaderDataText1-5: Can be used for customer-specific numeric fields.'
          nullable: true
          example: ''
        headerDataText2:
          maxLength: 250
          minLength: 0
          type: string
          nullable: true
          example: ''
        headerDataText3:
          maxLength: 250
          minLength: 0
          type: string
          nullable: true
          example: ''
        headerDataText4:
          maxLength: 250
          minLength: 0
          type: string
          nullable: true
          example: ''
        headerDataText5:
          maxLength: 250
          minLength: 0
          type: string
          nullable: true
          example: ''
        lastUpdated:
          type: string
          description: Timestamp when the record was last sent to API. Set automatically.
          format: date-time
        owner:
          $ref: '#/components/schemas/PurchaseOrderUserEntity'
        receiverToContact:
          $ref: '#/components/schemas/PurchaseOrderUserEntity'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/PurchaseOrderLineEntity'
          description: "Purchase order lines. Notes: \r\n1. Row count needs to be min 1 and max 200. At least one of the rows needs to have quantity > 0. \r\n2. An order needs to have at least non-refund line. \r\n3. If you need to import an order with more than 100 lines, this can be done by setting ‘processingStatus’ to ‘Uncompleted’ when POSTing the purchaseOrder and then adding additional lines to it using the PATCH method."
          nullable: true
        deliveryAddress:
          $ref: '#/components/schemas/DeliveryAddress'
      additionalProperties: false
    PurchaseOrderUserEntity:
      type: object
      properties:
        externalCode:
          maxLength: 36
          minLength: 0
          type: string
          description: ExternalCode of user.
          nullable: true
          example: 4847-31231212-212121-1212
        loginAccount:
          maxLength: 100
          minLength: 0
          type: string
          description: Login account of user.
          nullable: true
          example: basware\\jyrik
        emailAddress:
          maxLength: 320
          minLength: 0
          pattern: ^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*)@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$
          type: string
          description: Email address of user.
          nullable: true
          example: testmail1@mailtest.com
      additionalProperties: false
    PurchaseOrderLineEntity:
      required:
      - categoryCode
      - externalCode
      - extOrderLineNumber
      - priceType
      - unitPrice
      type: object
      properties:
        externalCode:
          maxLength: 100
          minLength: 1
          type: string
          description: Unique external identifier that is used as a key in API. Identifies order line for updates through API.
          example: 060cb8ea-5464-11ea-a38b-2e728ce88123"
        extOrderLineNumber:
          maxLength: 100
          minLength: 1
          type: string
          description: Order line number in customer system.
          example: '1'
        categoryCode:
          maxLength: 100
          minLength: 0
          type: string
          description: Category code linked to product
          example: '007'
        buyerProductCode:
          maxLength: 250
          minLength: 0
          type: string
          description: Product code used by buyer.
          nullable: true
          example: ProjectLaptops100
        supplierProductCode:
          maxLength: 50
          minLength: 0
          type: string
          description:

# --- truncated at 32 KB (111 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/basware/refs/heads/main/openapi/basware-purchaseorders-api-openapi.yml