Basware AccountingDocuments API

The AccountingDocuments API from Basware — 9 operation(s) for accountingdocuments.

OpenAPI Specification

basware-accountingdocuments-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Basware OAUTH2 authentication APIs AccountingDocuments 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: AccountingDocuments
paths:
  /v1/accountingDocuments:
    get:
      tags:
      - AccountingDocuments
      summary: Returns invoices approved for transfer to accounting.
      description: "Notes: \r\n1) This API supports sending webhook based  [push notifications](https://developer.basware.com/api/p2p/manual#PushNotifications) when new data is available to be exported. \r\n2) This GET operation returns a HTTP redirect, which the API client needs to follow. \r\nPlease see section \"[Usage scenario 3: Prebook and transfer invoice to Accounting](https://developer.basware.com/api/p2p/manual#usage3)\" of Basware Purchase-to-Pay API manual for details on implementing invoice transfer process with Basware API."
      parameters:
      - name: ProcessingStatus
        in: query
        description: "Document status filter. Returns items by accounting document status.\r\n            \n To get new invoices waiting for transfer, use filter 'WaitingForTransfer'. See [diagram on developer site](https://developer.basware.com/api/p2p/manual#ProcessingStatusDiagram) for details on available status transitions.\r\n            \n⚠️ Important: Enrichment-related statuses (e.g. 'WaitingForEnrichmentTransfer', 'EnrichmentTransferInProgress', 'EnrichmentTransferred', 'EnrichmentTransferFailed') are only applicable when 'p2pProcessingMode=InvoiceEnrichment' is used.\r\n            \nIf these statuses are used without setting 'p2pProcessingMode=InvoiceEnrichment', no results will be returned.\n"
        schema:
          enum:
          - WaitingForPrebook
          - PrebookInProgress
          - Prebooked
          - PrebookFailed
          - WaitingForTransfer
          - TransferInProgress
          - Transferred
          - TransferFailed
          - WaitingForPrebookCancelation
          - PrebookCancelationInProgress
          - PrebookCanceled
          - PrebookCancelFailed
          - WaitingToBeRemoved
          - Removed
          - RemoveFailed
          - WaitingToBeReturned
          - Returned
          - ReturnFailed
          - WaitingToBeCompleted
          - CompletionInProgress
          - Completed
          - CompletionFailed
          - Paid
          - New
          - WaitingForEnrichmentTransfer
          - EnrichmentTransferInProgress
          - EnrichmentTransferred
          - EnrichmentTransferFailed
          - InDocumentFilter
          - DocumentFilterReleased
          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. For invoices with large numbers of coding rows, number of invoices returned will be less in order to limit response message size.
        schema:
          type: integer
          format: int32
          default: 100
      - name: companyCode
        in: query
        description: Company filter. Returns items for specific company.
        schema:
          type: string
          default: ''
      - name: lastUpdated
        in: query
        description: Date filter. Returns items that have been updated after specified date.
        schema:
          type: string
          format: date-time
      - name: p2pProcessingMode
        in: query
        description: "Defines the P2P flow type for which invoices are being returned. 'Standard' refers to the standard P2P flow where transferred invoices are already approved for payment. 'InvoiceEnrichment' refers to using P2P to only validate and enrich invoice contents - in this case the approval for payment is expected to be done in another system. Default: Standard. Both types of documents are not returned in the same request.\r\n            \n⚠️ Note: To retrieve documents in enrichment-related ProcessingStatus values, this parameter must be set to 'InvoiceEnrichment'.\n"
        schema:
          enum:
          - Standard
          - InvoiceEnrichment
          type: string
          default: Standard
      - 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: e799fdb7-222c-4e0f-af2f-881f4beae654
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/AccountingDocumentResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingDocumentResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/AccountingDocumentResponse'
        '302':
          description: Redirect
        '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'
    delete:
      tags:
      - AccountingDocuments
      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/accountingDocuments/{invoiceId}:
    get:
      tags:
      - AccountingDocuments
      summary: Returns single approved invoice by invoiceId -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.\r\n\r\nPlease see section \"[Usage scenario 3: Prebook and transfer invoice to Accounting](https://developer.basware.com/api/p2p/manual#usage3)\" of Basware Purchase-to-Pay API manual for details on implementing invoice transfer process with Basware API."
      parameters:
      - name: invoiceId
        in: path
        description: The Invoice Id of the entity to be fetched
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/AccountingDocumentResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingDocumentResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/AccountingDocumentResponse'
        '302':
          description: Redirect
        '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'
  /v1/accountingDocuments/{invoiceId}/acknowledge:
    post:
      tags:
      - AccountingDocuments
      summary: Acknowledged invoices are no longer offered for next GET operation. Done right after GET, before transferResponse.
      description: "Notes: \r\n1) Updates 'processingStatus' -field on the invoice to allow filtering out the invoice on the next GET operation. \r\n2) For an invoice which is already acknowledged (processingStatus: 'TransferInProgress' or 'PrebookInProgress'), API will return 405 'Method not allowed' if acknowledge is attempted again on the invoice.\r\n      \r\nPlease see section \"[Usage scenario 3: Prebook and transfer invoice to Accounting](https://developer.basware.com/api/p2p/manual#usage3)\" of Basware Purchase-to-Pay API manual for details on implementing invoice transfer process with Basware API."
      parameters:
      - name: invoiceId
        in: path
        description: Invoice Id of the accountingDocument to be acknowledged.
        required: true
        schema:
          type: string
      - name: Content-Type
        in: header
        description: Specifies the media type of the resource. Value application/json is supported.
        schema:
          type: string
        example: application/json
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                type: string
            application/json:
              schema:
                type: string
            text/json:
              schema:
                type: string
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not found. Record to acknowledge not found.
        '405':
          description: Method Not allowed. This generally happens when trying to acknowledge an accountingDocument that is already acknowledged.
        '500':
          description: Unexpected error
  /v1/accountingDocuments/{invoiceId}/enrichmentResponses:
    post:
      tags:
      - AccountingDocuments
      summary: Marks invoice transfer P2P as accepted / rejected by receiving system. Used with invoices having 'p2pProcessingMode' = 'InvoiceEnrichment' which are not approved for payment.
      description: "Notes: \r\n1) Enrichment responses for already enrichment transferred invoices are not allowed.\r\n2) Please do not send acknowledge and enrichmentResponse for at the same time for the same invoice. If acknowledge is used, please wait for acknowledge to complete before sending the enrichmentResponse.\r\n3) Only latest 100 responses will be saved per invoice.\r\n\r\nPlease see section \"[Usage scenario 3: Prebook and transfer invoice to Accounting](https://developer.basware.com/api/p2p/manual#usage3)\" of Basware Purchase-to-Pay API manual for details on implementing invoice transfer process with Basware API."
      parameters:
      - name: invoiceId
        in: path
        description: Invoice Id of the accountingDocument to be updated
        required: true
        schema:
          type: string
      - 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:
        description: Transfer response to be added to accountingDocument
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/EnrichmentResponseEntity'
          application/json:
            schema:
              $ref: '#/components/schemas/EnrichmentResponseEntity'
          text/json:
            schema:
              $ref: '#/components/schemas/EnrichmentResponseEntity'
          application/*+json:
            schema:
              $ref: '#/components/schemas/EnrichmentResponseEntity'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/EnrichmentResponseEntity'
            application/json:
              schema:
                $ref: '#/components/schemas/EnrichmentResponseEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/EnrichmentResponseEntity'
        '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'
  /v1/accountingDocuments/{invoiceId}/prebookResponses:
    post:
      tags:
      - AccountingDocuments
      summary: Marks invoice prebooking as accepted / rejected by receiving system.
      description: "Notes: \r\n1. Prebook responses for already prebooked invoices (where processingStatus = 'Prebooked') are not allowed.\r\n2. Saving voucher numbers and payment block -information to the invoice in P2P requires a succesful prebook response from ERP ('success' = 'true'). The responseMessage gets saved also when success = false.\r\n3. Please do not send acknowledge and prebookResponse at the same time for the same invoice. If acknowledge is used, please wait for acknowledge to complete before sending the transferResponse.\r\n4. Prebook failed -invoices (success = false) are processed manually in P2P.\r\n5. Only latest 100 responses will be saved per invoice.\r\n\r\nPlease see section \"[Usage scenario 3: Prebook and transfer invoice to Accounting](https://developer.basware.com/api/p2p/manual#usage3)\" of Basware Purchase-to-Pay API manual for details on implementing invoice transfer process with Basware API."
      parameters:
      - name: invoiceId
        in: path
        description: Invoice Id of the accountingDocument to be updated
        required: true
        schema:
          type: string
      - 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:
        description: Prebook responses to be added to accountingDocument
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PrebookResponseEntity'
          application/json:
            schema:
              $ref: '#/components/schemas/PrebookResponseEntity'
          text/json:
            schema:
              $ref: '#/components/schemas/PrebookResponseEntity'
          application/*+json:
            schema:
              $ref: '#/components/schemas/PrebookResponseEntity'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PrebookResponseEntity'
            application/json:
              schema:
                $ref: '#/components/schemas/PrebookResponseEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/PrebookResponseEntity'
        '401':
          description: Unauthorized
        '404':
          description: Not Found. Record to update not found.
        '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'
        '400':
          description: Bad request
  /v1/accountingDocuments/{invoiceId}/transferResponses:
    post:
      tags:
      - AccountingDocuments
      summary: Marks invoice transfer as accepted / rejected by receiving system. Used with invoices having 'p2pProcessingMode' = 'Standard' which are approved for payment.
      description: "Notes: \r\n1) Transfer responses for already transferred invoices (where processingStatus = 'Transferred') are not allowed. \r\n2) Saving voucher numbers and payment block -information to the invoice in P2P requires a succesful transfer to ERP ('success' = 'true'). The responseMessage gets saved also when success = false. \r\n3) Please do not send acknowledge and transferResponse for at the same time for the same invoice. If acknowledge is used, please wait for acknowledge to complete before sending the transferResponse. \r\n4) Only latest 100 responses will be saved per invoice.\r\n\r\nPlease see section \"[Usage scenario 3: Prebook and transfer invoice to Accounting](https://developer.basware.com/api/p2p/manual#usage3)\" of Basware Purchase-to-Pay API manual for details on implementing invoice transfer process with Basware API."
      parameters:
      - name: invoiceId
        in: path
        description: Invoice Id of the accountingDocument to be updated
        required: true
        schema:
          type: string
      - 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:
        description: Transfer response to be added to accountingDocument
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/TransferResponseEntity'
          application/json:
            schema:
              $ref: '#/components/schemas/TransferResponseEntity'
          text/json:
            schema:
              $ref: '#/components/schemas/TransferResponseEntity'
          application/*+json:
            schema:
              $ref: '#/components/schemas/TransferResponseEntity'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/TransferResponseEntity'
            application/json:
              schema:
                $ref: '#/components/schemas/TransferResponseEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/TransferResponseEntity'
        '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'
  /v1/accountingDocuments/{invoiceId}/paymentResponses:
    post:
      tags:
      - AccountingDocuments
      summary: Updates invoice payment information, including payment date.
      description: "Notes: \r\n1) Payment response can be sent multiple times for the same invoice (for example when updating partial payments). When sending multiple payment responses to the same invoice, externalCode needs to be different on each of the paymentResponse updates. \r\n2) Please post a payment response only when data related to it on the invoice has changed (do not post same contents repeatedly).\r\n3) Fields not included on the payment response will be cleared (e.g. paymentMethod). \r\n4) Current date is defaulted as payment date if payment date is empty. \r\n5) Only latest 100 responses will be saved per invoice.\r\n\r\nPlease see section \"[Usage scenario 3: Prebook and transfer invoice to Accounting](https://developer.basware.com/api/p2p/manual#usage3)\" of Basware Purchase-to-Pay API manual for details on implementing invoice transfer process with Basware API."
      parameters:
      - name: invoiceId
        in: path
        description: Invoice Id of the accountingDocument to be updated
        required: true
        schema:
          type: string
      - 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:
        description: Payment response to be added to accountingDocument
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PaymentResponseEntity'
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentResponseEntity'
          text/json:
            schema:
              $ref: '#/components/schemas/PaymentResponseEntity'
          application/*+json:
            schema:
              $ref: '#/components/schemas/PaymentResponseEntity'
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PaymentResponseEntity'
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponseEntity'
            text/json:
              schema:
                $ref: '#/components/schemas/PaymentResponseEntity'
        '401':
          description: Unauthorized
        '404':
          description: Not found. Record to update not found.
        '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'
        '400':
          description: Bad request
  /v1/accountingDocuments/status:
    get:
      tags:
      - AccountingDocuments
      summary: Returns high level invoice status by search criteria such as company code, invoice number and invoice date.
      description: "This API receives search criteria such as company code, invoice number, invoice date and gross sum and returns the status, i.e. ‘In Approval Process’, ‘Ready For Payment’, ‘Paid’ or ‘Rejected’. This API can return data also for invoices transferred to ERP outside of Basware API using a webservice or file based integration (Anyerp transferred invoices). \r\n\r\nFollowing high-level statuses are returned. \r\n* InApprovalProcess - Invoice has been received in Basware P2P and is being processed. This includes all invoice statuses before succesful transfer to ERP.\r\n* ReadyForPayment - Invoice is approved for payment and has been transferred to ERP system.\r\n* Paid - Invoice has been paid.\r\n* Rejected - Invoice has been rejected.\r\n\r\nNotes:\r\n1) The API returns only status information and the invoiceId(s). If more information regarding the returned invoice(s) is required, doing a GET accountingDocuments/{invoiceId} query will return the full invoice details.\r\n2) To enable this feature for your organization, please contact your Basware consultant or Basware Support. Before the API is enabled, it will return no results. \r\n\r\nPlease see section \"[Usage scenario 7: Retrieve invoice status](https://developer.basware.com/api/p2p/manual#usage8)\" of Basware Purchase-to-Pay API manual for details on retrieving invoice status through Basware API."
      parameters:
      - name: companyCode
        in: query
        description: Company filter. Returns invoices for specified company.
        required: true
        schema:
          type: string
      - name: invoiceNumber
        in: query
        description: Invoice number filter. Returns invoices having specified invoice number.
        required: true
        schema:
          type: string
      - name: invoiceDate
        in: query
        description: Invoice date filter. Returns invoices having specified invoice date.
        required: true
        schema:
          type: string
          format: date-time
      - name: grossSum
        in: query
        description: Gross sum filter. Returns invoices having specified gross sum.
        schema:
          type: number
          format: double
      - name: pageSize
        in: query
        description: Page size filter. A limit for the number of items to be returned for one request. Limit can range between 1 and 500 items.
        schema:
          type: integer
          format: int32
          default: 500
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountingDocumentsStatusResponseEntity'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountingDocumentsStatusResponseEntity'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountingDocumentsStatusResponseEntity'
        '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'
  /v1/accountingDocuments/{invoiceId}/attachments/{attachmentExternalCode}:
    get:
      tags:
      - AccountingDocuments
      summary: Returns invoice attachment(s) by attachmentExternalCode identifier.
      description: "This API returns invoice attachments(s) by invoiceId and attachmentExternalCode identifiers. The attachmentExternalCode identifiers are available on the attachments block in main accountingDocuments API. \r\n\r\nNotes: \r\n 1) The API response redirects to a pre-signed URL. Make sure your API client will follow the '302' redirect to the returned new URL. The pre-signed URL will be valid for 15min.\r\n 2) This API is enabled manually through CMN_TENANT_SETTINGS parameter 'OpenApi.SendInvoiceAttachments' in P2P."
      parameters:
      - name: invoiceId
        in: path
        required: true
        schema:
          type: string
      - name: attachmentExternalCode
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
        '302':
          description: Found
        '401':
          description: Unauthorized
        '404':
          description: Not found. No attachment found by given attachmentExternalCode.
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseEntityList'
compone

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