NAV
http

Introduction

Basware Network REST API is your doorway to interacting with a network of over a million business users all over the globe. With our REST API, you can:

You will find detailed descriptions of each of our APIs in this section along with code examples. To get step by step instructions on some of the most commonly used features, have a look at our Guides section.

Business document flows

Sending invoices

The following diagram shows how to send invoices with attachments. Note that the similar flow also applies to credit notes.

Send invoices flow

Receiving invoices

The following diagram shows how to receive invoices. Note that the similar flow also applies to credit notes.

Receive invoices flow

Confirming received documents

Delivery of the received invoices and other business document can be confirmed.

If you are part of the delivery process (typically an operator on the behalf of the customer), you must send one of the following notifications:

In addition, you can send business confirmation of the received business documents. Business confirmation has to be agreed upon with the sender. The following notifications can be sent for business confirmations:

The following diagram shows how to confirm received business documents.

Accept or reject received business documents

Upload invoices to Basware value added services

The following diagram shows you how you can upload invoices to Basware Network. You only need to upload invoices in the following scenario:

Upload invoices to Basware Network flow

Topics

Default formats

JSON is the default data format used by Basware Network REST APIs.

Basware Network REST APIs use UTF-8 character encoding by default. If other encodings are must be used as part of transfers, they will be wrapped in a Base64 encoded data fields.

Authentication

Basware Network REST API uses basic HTTP authentication to authenticate API clients.

All communication is secured by using the HTTPS protocol (HTTP over SSL). You must make all API requests over HTTPS. API requests made without authentication will fail.

Unique identifiers

A universally unique identifier (UUID) is commonly used in REST API interfaces for identifiers.

For example, each invoice has a unique identifier (Basware Unique Message Identifier, BUMID) which must follow the UUID format. BUMID must be given in lowercase format.

Similarly, each request sent to REST API has a unique request identifier X-BW-REQUEST-ID which uses the UUID format.

Recipient endpoints

When you send business documents using the Basware Network REST API, you must identify the recipient’s address. The recipient’s electronic delivery address is called an endpoint.

Note that the recipient chooses which endpoint(s) they want to use to receive business documents. Large corporations that have multiple automated workflows may use different endpoints to identify the workflow.

The sender of a business document must use endpoints provided by the receipient organization. Endpoints are published in Basware Network’s business directory. The business directory is accessible to registered Basware Network users.

An endpoint consists of the following fields:

The following rules apply when determining the endpoint:

The endpoint’s scheme identifiers are group to the following categories:

The following table lists the most common endpoints’ scheme identifiers:

Endpoint schemeId Description Example of endpoint
Recommended, globally unique scheme identifiers
“ISO6523-ACTORID-UPIS” Electronic eInvoicing address which follows country specific format. “003701018798”
“VAT” European VAT number. For more information about VAT, see European country specific VAT number format (see especially question Q11) and VAT format validator. “FI12345678”
“EMAIL-RFC2822” Email address [email protected]
Commercial and common scheme identifiers
“IBAN” International Bank Account Number, without space characters “BE11143061182348”
“DUNS” The Data Universal Numbering System, (DUNS or D-U-N-S) number. The value must contain 9 digits. “123456789”
“GLN” The Global Location Number (GS1) is a unique identifier for locations. The value must contain 13 digits. “1568784515459”
Local tax identifiers and national trade registry identifiers (few selected ones below)
“FI:ORGNR” “FR:ORGNR” etc.  National register number. The scheme identifier consists of a two-letter country identifier (ISO-3166-1 alpha 2) and ‘ORGNR’. This endpoint value must contain numbers only.  "12345678" (Finland)

Note! There are non-EU countries that have VAT-numbers. For Norway, the schemeId is NO:VAT.

The following table lists examples for local tax identifiers and national trade registry identifiers:

schemeId Common name Common format Registry holder + registry links
FI:ORGNR Y-tunnus 1234567-8 Agency: PRH – YTJ / PRH / Virre-tietopalvelu
DE:ORGNR Steuernummer 123/123/12345 Agency: Regional “Bundesland” specific tax office, each of the 16 states in Germany have their own.
SE:ORGNR Organisationsnummer 1234567890 Agency: Bolagsverket
FR:ORGNR SIREN numéro 123 456 789 Agency: Insee
AT:ORGNR Firmenbuchnummer 123456 x Agency: Das Firmenbuch
BE:ORGNR Ondernemingsnummer 0123456789 Agency: Kruispuntbank van Ondernemingen (KBO) - Banque-Carrefour des Entreprises (BCE)
DK:ORGNR CVR 12345678 Agency: Det Centrale Virksomhedsregister (CVR)
NL:KVK KvK Nummer 12345678 Agency: Kamer van Koophandel (KvK). Search KvK numbers (in Dutch)
NO:ORGNR Organisasjonsnummer 123456789 Agency: Enhetsregisteret ved Brønnøysundregistrene
NO:VAT VAT number in Norway NO123456789MVA

Note! There is a separate trade registry in Germany, but Basware has chosen to use the tax number, which is different from the trade registry number. It’s more common to use the Steuernummer than the trade registry number, especially in the context of invoicing.

This is an explicit choice that Basware has made, but it may not be self explanatory by referring to a “local registry number” alone. Note that the common format varies between the German states, even though all call it a Steuernummer. Steuernummer is clearly understood across Germany.

Release notes

Release notes

API v2 - Summary of changes

API v1 continues to be available for use. The documentation can be accessed from API v1 Reference.

API v2 for Invoice and Credit Note API - Structural changes

The field documentCurrencyCode changed from optional to mandatory in Invoice and Credit Note

Field name changes for partyIdentifications in Invoice and Credit Note

The partyIdentification array field in the party element in v1 has been renamed to partyIdentifications in v2 to better reflect the array content. These changes affect the following elements:

Field names changes from singular form to plural form in Invoice and Credit Note

The following array fields file line items in v1 has been renamed in v2 to better reflect the array content. These changes affect the following elements:

Similar renaming has been done for tax total elements:

Similar renaming has been done for financial account elements:

Field name changes for contractDocumentReference in Invoice and Credit Note

The contractDocumentReference field in the data element in v1 has been renamed to contractDocumentReferences in v2 to support multiple references and changed to an array. These changes affect the following element:

Field name changes for externalDocumentIdentifier in Invoice and Credit Note

Invoice identifier field provided by invoice issuer has been renamed:

Content changes for allowanceCharges in Invoice and Credit Note

The allowanceCharge field in v1 has been changed to allowanceCharges array in v2 to better reflect the array content. The fields in allowanceCharges are also changed to allow different types of allowance charges. These changes affect the following elements:

New ‘processingPreference’ element in Invoice and Credit Note

Added endpoint outside “data” to new “processingPreference” element (applied to POST methods only)

Note! Endpoint still exists for accountingCustomerParty for backwards compatilibity reasons. The preferred way is to provide endpoint in processPreference.sentTo element.

More details about the endpoint values are available in Topics / Recipient endpoints.

Field deliveryChannelPreference changed to printingPreference

Changed the field deliveryChannelPreference to processingPreference

The values for printingPreference are the following:

Field serviceProviderId changed to operator

Changed the intermediate service provider field serviceProviderId to operator

API v2 for Invoice and Credit Note API - New features

New optional buyerCustomerParty and sellerSupplierParty in Invoice and CreditNote

Added the following optional fields to have more party elements for business document:

New optional taxCategory element in Invoice and Credit Note

Added optional element data.taxSubtotals.taxCategory. This element has been added to both data element and line items:

New optional addressLine3 field to Invoice and Credit Note

Added optional field addressLine3 to postalAddress element in the party:

New optional isIssuedAgainstOrder field to Invoice and Credit Note

New optional customFields field added to Invoice and Credit Note

Custom fields will have only effect if both the sending and receiving parties agree on the specific custom field names. Basware must be notified beforehand about the custom field usage.

New optional paymentReferenceMessage field added to Invoice and Credit Note

Remove 'internalId’ and 'amountUninvoiced’ fields from Invoice and Credit Note

Remove billingReference from Invoice

Remove version from Invoice and Credit Note

GET /invoices and /creditNotes returns origin in the response

GET /invoices and /creditNotes returns bumId in the response

Upload invoices feature for Invoice

API v2 for File

Support for base64 encoding has been added to File API

File API support by default binary upload and download. Support for base64 has been added to both File API v1 and File API v2.

base64 in POST method

base64 in GET method

File API returns response header fields

2016-09-21 New fields added to Invoices and Credit Notes v1

New fields to postalAddress in Invoice and Credit Note

New fields to paymentMeans in Invoice and Credit Note

New fields to paymentIdentifier in Invoice and Credit Note

2016-09-21 API for Notifications v1.1 released

GET /notifications

POST /notifications

API versioning

Basware Network API has two types of versions

Your application using Basware Network API should be flexible enough to handle backwards compatible changes:

Major version

The endpoint for major version has the format https://api.basware.com/v1.

Major version can include one or more of the following changes:

Minor version

The endpoint for minor version has the format like https://api.basware.com/v1.1.

You can update to higher minor versions without code changes as long as your API usage can handle the mappings. There is no mandatory requirement to update to the higher minor version.

Minor version can include one or more of the following changes:

Error codes

Basware Network REST API uses HTTP response codes to indicate the success or the failure of an API request. In general, REST API returns the following HTTP response codes:

In addition, the response may include additional details about the error situation. The following fields will appear in the error response:

Error response type indicates the type of the error situation:

Business error codes

Type Code Action to solve the error situation
BUSINESS Error.001.0001 Receiver organization does not exist in Basware Network, or registration is not available for receiver organization. No action needed from API caller. Basware Support will take action to solve the issue.
BUSINESS Error.001.0012 The API client requests a service which requires that the service is enabled in Basware Network. For example, in order to use Notification API, notifications must be enabled in Basware Network.

Validation error codes

Type Code Action to solve the error situation
VALIDATION Error.003.0001 The API client requests a business document using a BUMID (business document identifier) that cannot be found from Basware Network. Verify that BUMID references a valid business document.
VALIDATION Error.003.0020 The file type of an attachment that the API client has sent is invalid. Valid file type for attachments are: ‘imageFile’, 'attachmentFile’ and 'dataFile’. Verify that a valid file type is used in the REST API request.
VALIDATION Error.003.0038 The API client requests to create a new business document using a BUMID (business document identifier) that already exists. Verify that the BUMID is unique.
VALIDATION Error.004.0002 Required field is missing from the request sent by the API client, or a field in the request does not match the expected pattern. For example, a date is given in a false format. Verify that a valid request format is used in the REST API request.
VALIDATION Error.004.0003 The format of the BUMID that the API consumer has given is invalid. The supported pattern of the BUMID is: [0-9a-f]{8}- [0-9a-f]{4}-[1-5][0-9a-f] {3}-[89ab][0-9a-f]{3}- [0-9a-f]{12}. Verify that a valid BUMID is referenced in the REST API request.
VALIDATION Error.004.0004 The request that the API client has sent is not in valid JSON format, or a required field like X-BW-REQUEST-ID has incorrect format or is missing from the request. Verify that a valid request format is used in the REST API request.
VALIDATION Error.004.0005 The API client is trying to upload an unsupported file type. Basware Network supports the following file types: CSV, DOC, DOCX, HTM, HTML, JPEG, JPG, ODT, PDF, PNG, PPT, PPTX, RTF, TIF, TIFF, TXT, XLS, XLSX, XML, ZIP. Verify that a valid file type is used in the REST API request.
VALIDATION Error.004.0012 The API client is trying to upload a too large a file to Basware Network.
VALIDATION Error.004.0013 Party identification is not valid. Verify that scheme identifier is valid and the actual identifier follows the pattern expected by the scheme.
VALIDATION Error.004.0014 IBAN format is not valid. Verify that the content is valid and follows the expected pattern.

Technical error codes

Type Code Action to solve the error situation
TECHNICAL Error.001.0006 Basware Network has encountered an unexpected system error. No action needed from API caller. Basware Support will take action to solve the issue.
TECHNICAL Error.001.0010 Basware Network has encountered a technical error. No action needed from API caller. Basware Support will take action to solve the issue.
TECHNICAL Error.003.0032 The API client tries to download or upload a business document attachment, but the operation fails due to a technical error on the Basware Network side. No action needed from API caller. Basware Support will take action to solve the issue.

Security error codes

Type Code Action to solve the error situation
SECURITY Error.002.0004 The API client tries to upload a business document attachment, but the operation fails due to a security violation. For example, the attachment may contain a virus. Make sure that the contents of the business document attachment meets the security requirements.

Notification details

Basware Network communicates changes in business documents’ statuses and possible errors related to business document delivery using notifications. You can receive notification from Basware Network using the Notification API.

Parameter: responseCode

The responseCode parameter tells you the the delivery status of a business document:

Parameter: actionCode

The actionCode parameter provides you with more detailed information about a business document’s processing status. The following tables describe the cases in which Basware Network will post a notification posted to you.

Clients that send business documents

Response Code Action Code The reason behind the action code
TechnicalAccept Delivered The business document has been delivered to the recipient.

This is a final status with a time reservation; some interoperability channels may return a rejection after several days.
TechnicalAccept ReceivedForProcessing Basware Network has received the business document for processing.

This is a temporary status.
TechnicalInformation DeliveryDelayed A temporary delivery failure has occurred. Basware Network will automatically retry the delivery. No action is required from your side.

This is a temporary status.
TechnicalReject Undelivered The business document cannot be delivered to the recipient.

This is a final status.
TechnicalReject InvalidContent The business document has been rejected because its content invalid. This can be caused by, for example, if the bank reference number user on the business document is in invalid format. This action code is also used if the service encounters PEPPOL validation errors.
BusinessAccept DocumentAccepted The recipient has accepted the business document.

Note: This notification applies to invoices and credit notes.
BusinessReject DocumentRejected The recipient has rejected the business document.

Note: This notification applies to invoices and credit notes.

Clients that receive business documents

Response Code Action Code The reason behind the action code Can be sent by API client in POST?
TechnicalInformation Received The recipient has received the business document. No
TechnicalAccept DeliveryConfirmed The recipient has received the business document, and confirmed the receipt. Yes
TechnicalReject Undelivered The business document cannot be delivered to the intended recipient. Yes
BusinessAccept DocumentAccepted The recipient has accepted the business document.

Note: This notification applies to invoices and credit notes.
Yes
BusinessReject DocumentRejected The recipient has rejected the business document.

Note: This notification applies to invoices and credit notes.
Yes

Clients that use Basware value added services

Response Code Action Code The reason behind the action code
BusinessInformation  EligibleForEarlyPayment The invoice is eligible for early payment. Note: This notification applies to Basware value added services.
BusinessInformation  NotEligibleForEarlyPayment The invoice is not eligible for early payment. Note: This notification applies to Basware value added services.
BusinessAccept  RequestForEarlyPayment The supplier requests invoice to be paid. Note: This notification applies to Basware value added services.
BusinessInformation DiscountCreditNoteAvailable A discount credit note is available for download. Note: This notification applies to customers who have opted for API delivery of Basware Discount Credit Notes.

Parameter: additionalActionProperties

Some action codes can contain additional properties, which will be included in the additionalActionProperties. All the additional properties are optional.

Action code Property name of additional action Property value of additional action Remarks
Delivered DeliveryMeansCode ElectronicDelivery, EmailDelivery or MailDelivery Notifications can include the delivery channel of a business document to help estimate the delivery time. However, this information cannot be used for billing purposes.
InvalidContent or Delivered ValidationFileReference <file reference> Notifications can include a reference to a validation file. The validation file will contain more information about why the business document’s validation failed. The validation file can be retrieved using the GET /files/{fileReference} method. Currently, the API only returns results from PEPPOL validation.

The validation file can also be returned in successful cases, where the business document’s actionCode is Delivered. Currently, the API only returns results from PEPPOL validation.

API for Notifications v1.1

Notifications

API client sends and fetches a list of notifications related to a business document. Each notification is linked to an event in the business document’s lifecycle. Basware Network raises events as it processes the business document.

If you send or receive business documents, you can notify Basware Network about a change in a business document’s status. If you send business documents, you can fetch notifications about the business documents that you have sent.

POST

POST /notifications HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Request example

{
  "bumid" : "7de91997-70de-51b8-84e1-41cc473eeee7",
  "documentType": "Invoice",
  "acknowledgementId" : "7de91997-70de-51b8-84e1-41cc473ebeef",
  "responseCode" : "TechnicalAccept",
  "responseType" : "BCN:responsecode-v1",
  "actionCode" : "Delivered",
  "actionType" : "BCN:actioncode-v1",
  "notificationCreated" : "1334578485000",
  "description" : "The business document has been delivered to the recipient"
}

Request schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Notification",
  "type": "object",
  "properties": {
    "bumid": {
      "description": "Unique UUID for business document",
      "type": "string",
      "pattern" : "^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
    },
    "documentType": {
      "description": "Document type the notification relates to. Possible values: Invoice|CreditNode|Order|Catalogue",
      "type": "string"
    },
    "acknowledgementId": {
      "description": "Acknowledgement identifier. Format is UUID",
      "type": "string",
      "pattern" : "^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
    },
    "responseCode": {
      "description": "Response code. Possible codes: TechnicalAccept|TechnicalReject|TechnicalInformation|BusinessAccept|BusinessReject|BusinessInformation",
      "type": "string",
      "default": "TechnicalAccept"
    },
    "responseType": {
      "description": "Type for response code. Possible values: BCN:responsecode-v1",
      "type": "string",
      "default": "BCN:responsecode-v1"
    },
    "actionType": {
      "description": "Type for action code. Possible values: BCN:actioncode-v1",
      "type": "string",
      "default": "BCN:actioncode-v1"
    },
    "actionCode": {
      "description": "Action code. Possible values are described in Notification details",
      "type": "string",
      "default": "Delivered"
    },
    "additionalActionProperties": {
      "description": "Additional properties for the notification",
      "type": "array",
      "items" : {
        "type" : "object",
        "properties" : {
          "name" : {
            "type" : "string",
            "description" : "Type of the additional information related to actionCode"
          },
          "value" : {
            "type" : "string",
            "description" : "The actual value for the additional information"
          }
        }
      }
    },
    "notificationCreated": {
      "description": "Notification creation time. The format is Unix time (Epoch time)",
      "type": "string"
    },
    "description": {
      "description": "Description for the notification",
      "type": "string"
    }
  },
  "required":[
    "bumid",
    "responseCode",
    "notificationCreated"
  ],
  "additionalProperties": false
}

You can notify Basware Network about a change in a business document’s status by using the POST notification method.

Request URI

https://api.basware.com/v1.1/notifications

Request Headers

Param Name Required Example Description
Content-Type true application/json Specifies media types which are acceptable for the request. Value application/json is supported.
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Responses

Response code Description
201 The request has been fulfilled and resulted in a new resource being created.
400 Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
415 Unsupported Media Type. The server is refusing to service the request because the payload is in a format not supported.

GET

GET /notifications HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Response code 200 - The request has been completed successfully.

Response example for the response code above

{
  "hasMoreItems": false,
  "notifications": [
    {
      "bumid": "7de91997-70de-51b8-84e1-41cc473eeee7",
      "documentType": "Invoice",
      "acknowledgementId": "7de91997-70de-51b8-84e1-41cc473ebeef",
      "responseCode": "TechnicalAccept",
      "responseType": "BCN:responsecode-v1",
      "actionCode": "Delivered",
      "actionType": "BCN:actioncode-v1",
      "additionalActionProperties": [
        {
        "name": "DeliveryMeansCode",
        "value": "ElectronicDelivery"
        }
      ],
      "notificationCreated": "1334578485000",
      "description": "Document delivered successfully",
      "links": [
        {
          "rel": "businessDocument",
          "href": "https://api.basware.com/v1/invoices/7de91997-70de-51b8-84e1-41cc473eeee7",
          "method": "GET"
        },
        {
          "rel": "notification",
          "href": "https://api.basware.com/v1.1/notifications/7de91997-70de-51b8-84e1-41cc473ebeef",
          "method": "DELETE"
        }
      ]
    },
    {
      "bumid": "19757736-6ddb-47d3-8d35-79b3eb18c20a",
      "documentType": "Invoice",
      "acknowledgementId": "78a25143-68de-5131-a4e2-56756756eeee",
      "responseCode": "BusinessReject",
      "responseType": "BCN:responsecode-v1",
      "actionCode": "RepaymentFailed",
      "actionType": "BCN:actioncode-v1",
      "notificationCreated": "1334578587000",
      "description": "Repayment has failed",
      "links": [
        {
          "rel": "businessDocument",
          "href": "https://api.basware.com/v1.1/invoices/19757736-6ddb-47d3-8d35-79b3eb18c20a",
          "method": "GET"
        },
        {
          "rel": "notification",
          "href": "https://api.basware.com/v1.1/notifications/78a25143-68de-5131-a4e2-56756756eeee",
          "method": "DELETE"
        }
      ]
    }
  ]
}

Response schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Notifications",
  "type": "object",
  "description": "Notifications are related to business document",
  "properties": {
    "hasMoreItems": {
      "type": "boolean",
      "description": "Indicates whether there are additional notifications to return"
    },
    "notifications": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "bumid": {
            "description": "Unique UUID for business document",
            "type": "string",
            "pattern" : "^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
          },
          "documentType": {
            "description": "Document type the notification relates to. Possible values: Invoice|CreditNode|Order|OrderCancellation|OrderChange|Catalogue",
            "type": "string",
            "default": "Invoice"
          },
          "acknowledgementId": {
            "description": "Acknowledgement identifier. Format is UUID",
            "type": "string",
            "pattern" : "^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
          },
          "responseCode": {
            "description": "Response code. Possible codes: TechnicalAccept|TechnicalReject|TechnicalInformation|BusinessAccept|BusinessReject|BusinessInformation",
            "type": "string",
            "default": "TechnicalAccept"
          },
          "responseType": {
            "description": "Type for response code. Possible values: BCN:responsecode-v1",
            "type": "string",
            "default": "BCN:responsecode-v1"
          },
          "actionType": {
            "description": "Type for action code. Possible values: BCN:actioncode-v1",
            "type": "string",
            "default": "BCN:actioncode-v1"
          },
          "actionCode": {
            "description": "Action code. Possible values described in Notification details",
            "type": "string",
            "default": "Delivered"
          },
          "additionalActionProperties": {
            "description": "Additional properties for the notification",
            "type": "array",
            "items" : {
              "type" : "object",
              "properties" : {
                "name" : {
                  "type" : "string",
                  "description" : "Type of the additional information related to actionCode"
                },
                "value" : {
                  "type" : "string",
                  "description" : "The actual value for the additional information"
                }
              }
            }
          },
          "notificationCreated": {
            "description": "Notification creation time. The format is Unix time (Epoch time)",
            "type": "string"
          },
          "description": {
            "description": "Description for the notification",
            "type": "string"
          },
          "links": {
            "type": "array",
            "description": "Links related to the notification",
            "items": {
              "type": "object",
              "description": "Links related to the notification",
              "properties": {
                "rel": {
                  "type": "string",
                  "description": "Relation type for the URL in question. Possible values are notification (default), validationFile or businessDocument.",
                  "default": "notification"
                },
                "href": {
                  "type": "string",
                  "description": "Link between the completed call and a future call. The URI is a fully formed URI, which needs also the method field"
                },
                "method": {
                  "type": "string",
                  "enum": ["GET", "POST", "DELETE"],
                  "description": "HTTP methods required to interact with the provided URL",
                  "default": "GET"
                }
              }
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "bumid",
          "documentType",
          "acknowledgementId",
          "responseCode",
          "actionCode",
          "notificationCreated"
        ]
      }
    }
  },
  "required":[
    "hasMoreItems",
    "notifications"
  ],
  "additionalProperties": false
}

Response code 400 - Bad Request. The server cannot or will not process the request. Request failed due to invalid request syntax or invalid request message framing.

Response example for the response code above

{
  "error": {
    "id": "c842c9c3-75e5-4c32-ae3f-c1fe250fc186",
    "type": "VALIDATION",
    "message": "Business document identifier bumId does not match the pattern :[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
    "code": "Error.004.0003",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

You can fetch a list of notifications related to a business document using the GET notification method.

When you fetch notifications, note that you must acknowledge each notification by deleting it with the DELETE notification method. If the notification is not acknowledged, it will appear again when fetching the notifications the next time. Each notification has a unique acknowledgement identifier (acknowledgementId) that you can use to identify the notification.

Request URI

https://api.basware.com/v1.1/notifications

Request Headers

Param Name Required Example Description
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Query Parameters

Param Name Required Example Description
documentType false Invoice Type of documents to fetch notifications for. This parameter can be used to restrict the notification search to a particular document type. Possible values are Invoice, CreditNode, Order, OrderCancellation, OrderChange, Catalogue.
page true 1 A cursor for pagination. The first request must have value 1. If the response indicated that there are additional notifications to fetch, the subsequent GET method should use value 2.
pageSize true 50 A limit for the number of items to be returned during one request. Limit can range between 1 and 5000 items.

Responses

Response code Description
200 The request has been completed successfully.
400 Bad Request. The server cannot or will not process the request. Request failed due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
415 Unsupported Media Type. The server is refusing to service the request because the payload is in a format not supported.
500 Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

DELETE

DELETE /notifications/{id} HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Use the DELETE notification method to delete notifications related to a business document. Note that you must acknowledge each notification that you receive by deleting it. If the notification is not acknowledged, it will appear again when fetching the notifications the next time.

Request URI

https://api.basware.com/v1.1/notifications/{id}

URI Parameters

Param Name Type Required Example Description
id string true ee52202e-680e-4e55-b8a4-0d9daa7c3ee0 Identifier of the notification to be acknowledged.

Request Headers

Param Name Required Example Description
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Responses

Response code Description
200 The notification has been acknowledged successfully.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
404 Resource could not be found. The server has not found anything matching the request URI.

API for Invoices v2

Invoices

The Invoices API lets you send invoices through Basware Network to a recipient. If you need to add attachments to your invoice, you can deliver those, too, using the Files API. The Files API returns a file identifier (fileId) for each file that you send. You can use this identifier to link the invoices sent using the Invoices API to the files delivered using the Files API.

GET

GET /invoices/{bumId} HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Response code 200 - The request has been completed successfully.

Response example for the response code above

{
  "bumId": "c6d7067f-eb67-4289-89ec-819446078a3a",
  "fileRefs": [
        {
            "refId": "539a78446842ed4025464947d",
            "fileType": "imageFile"
        },
        {
            "refId": "539a785684edd4025415947d",
            "fileType": "attachmentFile"
        }
    ],
    "links": [
        {
            "rel": "file",
            "href": "https://api.basware.com/v2/files/539a78446842ed4025464947d",
            "method": "GET"
        },
        {
            "rel": "file",
            "href": "https://api.basware.com/v2/files/539a785684edd4025415947d",
            "method": "GET"
        }
    ],
    "origin": {
        "source": "SendingCustomer",
        "sourceContentCategory": "StructuredData",
        "sourceChannelCategory": "Electronic",
        "processQualityIndicators": [
            "ContentValidation",
            "StructuralValidation"
        ]
    },
    "data": {
        "externalDocumentIdentifier": {
          "id": "56328230"
        },
        "accountingCustomerParty": {
            "endpoint": {
                "id": "114612065012",
                "schemeId": "BE:ORGNR"
            },
            "partyName": "Acme Buyer N.V.",
            "postalAddress": {
                "addressLine": "Sint Gummarusstraat 53",
                "cityName": "Antwerpen",
                "countryId": "BE",
                "postalZone": "2060"
            }
        },
        "accountingSupplierParty": {
            "endpoint": {
                "id": "114823943023440",
                "schemeId": "ISO6523-ACTORID-UPIS"
            },
            "partyName": "Acme Supplier Inc.",
            "postalAddress": {
                "addressLine": "1800 Main Street",
                "cityName": "Dallas",
                "countryId": "US",
                "countrySubentity": "TX",
                "postalZone": "75201"
            }
        },
        "deliveryParty": {
            "partyName": "Parcels United",
            "postalAddress": {
                "addressLine": "1 Back Lane",
                "locality": "Clayton West",
                "cityName": "HUDDERSFIELD",
                "postalZone": "HD8 9PP",
                "countryId": "UK"
            }
        },
        "buyerReference": {
            "id": "PO-15653345"
        },
        "documentCurrencyCode": "EUR",
        "invoiceLines": [
            {
                "id": "1",
                "item": {
                    "description": [
                        "Basic High-Speed HDMI Cable - 25 Feet",
                        "Supports Ethernet, 3D, 4K and Audio Return"
                    ],
                    "name": "High-Speed HDMI Cable",
                    "sellersItem": {
                        "id": "B-341"
                    },
                    "taxPercent": 10
                },
                "lineExtension": {
                    "amount": 72,
                    "currencyId": "EUR"
                },
                "quantity": {
                    "amount": 2,
                    "unitCode": "PCE"
                },
                "taxTotals": [
                    {
                        "amount": 17.28,
                        "currencyId": "EUR",
                        "taxSubtotals": [
                            {
                                "amount": 17.28,
                                "currencyId": "EUR",
                                "percent": 24
                            }
                        ],
                        "transactionCurrencyTax": {
                            "amount": 0.9
                        }
                    }
                ]
            },
            {
                "id": "2",
                "item": {
                    "sellersItem": {
                        "id": "A-532"
                    },
                    "taxPercent": 10
                },
                "lineExtension": {
                    "amount": 23.1,
                    "currencyId": "EUR"
                },
                "quantity": {
                    "amount": 1,
                    "unitCode": "PCE"
                },
                "taxTotals": [
                    {
                        "amount": 5.54,
                        "currencyId": "EUR",
                        "taxSubtotals": [
                            {
                                "amount": 5.54,
                                "currencyId": "EUR",
                                "percent": 24
                            }
                        ],
                        "transactionCurrencyTax": {
                            "amount": 0.9
                        }
                    }
                ]
            }
        ],
        "issueDate": "2015-05-01",
        "legalMonetaryTotal": {
            "payableAmount": {
                "amount": 462.8,
                "currencyId": "EUR"
            }
        },
        "paymentMeans": {
            "financialAccounts": [
                {
                    "financialInstitutionName": "BARCGB22",
                    "ids": [
                        {
                            "id": "GB54BARC20992012345678",
                            "schemeId": "IBAN"
                        }
                    ]
                }
            ],
            "paymentDueDate": "2017-06-01",
            "paymentIdentifier": {
                "id": "63156783578924",
                "schemeId": "SPY"
            },
            "paymentMeansCode": "31"
        },
        "taxTotal": {
            "amount": 89.56,
            "currencyId": "EUR",
            "taxSubtotals": [
                {
                    "amount": 89.56,
                    "currencyId": "EUR",
                    "percent": 24,
                    "taxableAmount": 373.24
                }
            ]
        }
    }
}

Response schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Schema for GET /invoices",
  "description": "Invoice is a business document which can contain attachments.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "bumId": {
      "description": "Identifies the business document (Basware Unique Message Identifier). It is an unique identifier (UUID) that can be used by external systems to identify a business document.",
      "pattern" : "^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
    },
    "fileRefs": {
      "items" : {
        "type" : "object",
        "additionalProperties" : false,
        "properties" : {
          "refId" : {
            "type" : "string",
            "description" : "Unique file identifier received after storing file into Basware Network."
          },
          "fileType" : {
            "type" : "string",
            "description" : "File type. Possible values are imageFile, attachmentFile and dataFile."
          }
        },
        "required" : [ "refId", "fileType" ]
      }
    },
    "links": {
      "items" : {
        "type" : "object",
        "description" : "Links related to the business document",
        "properties" : {
          "rel" : {
            "type" : "string",
            "description" : "Relation type for the URL in question. Possible values are file.",
            "default" : "file"
          },
          "href" : {
            "type" : "string",
            "description" : "Link between the completed call and a future call. The URI is a fully formed URI, which needs also the method field"
          },
          "method" : {
            "type" : "string",
            "enum" : [ "GET", "POST" ],
            "description" : "HTTP methods required to interact with the provided URL",
            "default" : "GET"
          }
        }
      }
    },
    "origin": {
      "additionalProperties" : false,
      "properties" : {
        "source" : {
          "type" : "string",
          "description" : "The originating source of the document. Possible values: SendingCustomer, ReceivingCustomer, ServiceProvider"
        },
        "sourceContentCategory" : {
          "type" : "string",
          "description" : "Indicates the source content. If the content is structured data, the data quality is higher. Possible values: Image, StructuredData, UnstructuredData"
        },
        "sourceChannelCategory" : {
          "type" : "string",
          "description" : "Indicates the source channel of the business document. Possible values: PostalMail, ElectronicMail, Electronic"
        },
        "processQualityIndicators" : {
          "type" : "array",
          "description" : "The quality phases the document has gone through",
          "items" : {
            "type" : "string",
            "description" : "Possible values: HumanSelfValidation, HumanValidation, StructuralValidation, ContentValidation"
          }
        }
      }
    },
    "data": {
      "type": "object",
      "additionalProperties": false,
      "description": "Object holding the business content of the Invoice. Content is at some level based on Universal Business Language (UBL) standard version 2.1. It has also been extended by Basware so it is not strictly UBL.",
      "properties": {
        "externalDocumentIdentifier": {
            "description": "External system identifier of the business document. Serial number that is issued once only by invoice issuer to identify the invoice.",
            "properties" : {
              "id" : {
                "type" : "string",
                "description" : "Identifies the value."
              },
              "schemeId" : {
                "type" : "string",
                "description" : "Identifies the namespace of the id."
              }
            },
            "required" : [ "id" ],
            "additionalProperties" : false
        },
        "issueDate": {
          "type": "string",
          "description": "The date when the Invoice was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
          "pattern": "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
        },
        "documentCurrencyCode": {
          "type": "string",
          "description": "Currency presentation of the Invoice document. Valid values must be ISO 4217 Alpha format."
        },
        "note": {
          "type": "string",
          "description": "Free-form text pertinent to this document, conveying information that is not contained explicitly in other structures."
        },
        "allowanceCharges": {
          "additionalProperties" : false,
          "items" : {
            "type" : "object",
            "properties" : {
              "changeIndicator" : {
                "type" : "boolean",
                "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
              },
              "allowanceChargeReasonCode" : {
                "type" : "string",
                "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
              },
              "allowanceChargeReason" : {
                "type" : "string",
                "description" : "The reason for this allowance or charge."
              },
              "multiplierFactorNumeric" : {
                "type" : "number",
                "description" : "The factor applied to the base amount to calculate the allowance charge."
              },
              "amount" : {
                "type" : "number",
                "description" : "The allowance charge amount."
              }
            },
            "required" : [ "changeIndicator", "amount" ]
          }
        },
        "isIssuedAgainstOrder": {
            "type": "boolean",
            "description": "Indicates whether the business document is issued against an order."
        },
        "orderReference": {
          "description": "Order reference on the business document.",
          "additionalProperties" : false,
          "properties" : {
            "id" : {
              "type" : "string",
              "description" : "Order number reference on the business document. Identifies the referenced order assigned by the buyer."
            },
            "schemeId" : {
              "type" : "string",
              "description" : "External system specific identifier of the order system identifier element. If the source business document has any matching element, it should be used."
            },
            "customerReference" : {
              "type" : "string",
              "description" : "Customer Reference Identifier (CRI) when using a purchasing card."
            },
            "salesOrderId" : {
              "type" : "string",
              "description" : "Sales order identifier."
            }
          },
          "required" : [ "id" ]
        },
        "contractDocumentReferences": {
          "description": "External system identifiers for the contracts referenced by the business document.",
          "items" : {
            "type" : "object",
            "additionalProperties" : false,
            "properties" : {
              "id" : {
                "type" : "string",
                "description" : "External system identifier of the contract referenced by the Business Document (i.e. buyers contract number). Mandatory field if the customer demands that the goods or services invoiced refer to a contract number defined by the customer to which he wants to assign the Business Document. Is demanded for example in service and maintenance agreements for which there is generally no explicit order."
              },
              "schemeId" : {
                "type" : "string",
                "description" : "External system specific identifier of the contract system identifier element. If the source business document has any matching element, it should be used."
              }
            },
            "required" : [ "id" ]
          }
        },
        "additionalDocumentReference": {
          "description": "A reference to an additional document associated with this document. Used for example to reference to an Invoice from Credit Note.",
          "additionalProperties" : false,
          "properties" : {
            "id" : {
              "type" : "string",
              "description" : "An identifier for the referenced document (i.e. bumid)."
            },
            "schemeId" : {
              "type" : "string",
              "description" : "External system specific identifier of the invoicing system identifier element. If the source business document has any matching element, it should be used."
            },
            "issueDate" : {
              "type" : "string",
              "description" : "Date when the referenced document was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
              "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            },
            "typeCode" : {
              "type" : "string",
              "description" : "The type of document being referenced, expressed as a code, for example to reference to an Invoice document, code is 380."
            }
          },
          "required" : [ "id" ]
        },
        "accountingSupplierParty": {
          "description": "Party that is the accountable supplier of the goods/services in the referred business document.",
          "properties" : {
            "endpoint" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                }
              },
              "required" : [ "id" ]
            },
            "partyIdentifications" : {
              "type" : "array",
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "items" : {
                "type" : "object",
                "description" : "An object holding a party identification.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "An object holding the external system identifier of the party."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              }
            },
            "partyName" : {
              "type" : "string",
              "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
            },
            "postalAddress" : {
              "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
              "properties" : {
                "cityName" : {
                  "type" : "string",
                  "description" : "The name of the city, town or village in the postal address of the party."
                },
                "postalZone" : {
                  "type" : "string",
                  "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                },
                "addressLine" : {
                  "type" : "string",
                  "description" : "The address line of the postal address of the party."
                },
                "addressLine2" : {
                  "type" : "string",
                  "description" : "The second address line of the postal address of the party."
                },
                "addressLine3" : {
                  "type" : "string",
                  "description" : "The third address line of the postal address of the party."
                },
                "locality" : {
                  "type" : "string",
                  "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                },
                "countrySubentity" : {
                  "type" : "string",
                  "description" : "The sub-entity of the area in the postal address."
                },
                "countryId" : {
                  "type" : "string",
                  "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                }
              },
              "additionalProperties" : false
            },
            "partyTaxScheme" : {
              "type" : "object",
              "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
              "properties" : {
                "company" : {
                  "type" : "object",
                  "description" : "Information about the company taxes.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                    }
                  },
                  "additionalProperties" : false
                }
              },
              "additionalProperties" : false
            },
            "contact" : {
              "type" : "object",
              "description" : "An object containing information about contacts. Used for defining the company contact data",
              "properties" : {
                "name" : {
                  "type" : "string",
                  "description" : "A contact name of the party."
                },
                "telephone" : {
                  "type" : "string",
                  "description" : "A telephone number of the contact of the party."
                },
                "telefax" : {
                  "type" : "string",
                  "description" : "A fax number of the contact of the party."
                },
                "electronicMail" : {
                  "type" : "string",
                  "description" : "An email of the contact of the party."
                }
              },
              "additionalProperties" : false
            }
          },
          "required" : [ "partyName" ],
          "additionalProperties" : false
        },
        "accountingCustomerParty": {
          "description": "Party that is the accountable buyer of the goods/services in the referred business document.",
          "properties" : {
            "endpoint" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                }
              },
              "required" : [ "id" ]
            },
            "partyIdentifications" : {
              "type" : "array",
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "items" : {
                "type" : "object",
                "description" : "An object holding a party identification.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "An object holding the external system identifier of the party."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              }
            },
            "partyName" : {
              "type" : "string",
              "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
            },
            "postalAddress" : {
              "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
              "properties" : {
                "cityName" : {
                  "type" : "string",
                  "description" : "The name of the city, town or village in the postal address of the party."
                },
                "postalZone" : {
                  "type" : "string",
                  "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                },
                "addressLine" : {
                  "type" : "string",
                  "description" : "The address line of the postal address of the party."
                },
                "addressLine2" : {
                  "type" : "string",
                  "description" : "The second address line of the postal address of the party."
                },
                "addressLine3" : {
                  "type" : "string",
                  "description" : "The third address line of the postal address of the party."
                },
                "locality" : {
                  "type" : "string",
                  "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                },
                "countrySubentity" : {
                  "type" : "string",
                  "description" : "The sub-entity of the area in the postal address."
                },
                "countryId" : {
                  "type" : "string",
                  "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                }
              },
              "additionalProperties" : false
            },
            "partyTaxScheme" : {
              "type" : "object",
              "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
              "properties" : {
                "company" : {
                  "type" : "object",
                  "description" : "Information about the company taxes.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                    }
                  },
                  "additionalProperties" : false
                }
              },
              "additionalProperties" : false
            },
            "contact" : {
              "type" : "object",
              "description" : "An object containing information about contacts. Used for defining the company contact data",
              "properties" : {
                "name" : {
                  "type" : "string",
                  "description" : "A contact name of the party."
                },
                "telephone" : {
                  "type" : "string",
                  "description" : "A telephone number of the contact of the party."
                },
                "telefax" : {
                  "type" : "string",
                  "description" : "A fax number of the contact of the party."
                },
                "electronicMail" : {
                  "type" : "string",
                  "description" : "An email of the contact of the party."
                }
              },
              "additionalProperties" : false
            }
          },
          "required" : [ "partyName" ],
          "additionalProperties" : false
        },
        "buyerCustomerParty": {
            "description": "Party that is the buyer of the goods/services in the referred business document.",
            "properties" : {
              "endpoint" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                  }
                },
                "required" : [ "id" ]
              },
              "partyIdentifications" : {
                "type" : "array",
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "items" : {
                  "type" : "object",
                  "description" : "An object holding a party identification.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "An object holding the external system identifier of the party."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the id identifier element."
                    }
                  },
                  "required" : [ "id" ],
                  "additionalProperties" : false
                }
              },
              "partyName" : {
                "type" : "string",
                "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
              },
              "postalAddress" : {
                "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                "properties" : {
                  "cityName" : {
                    "type" : "string",
                    "description" : "The name of the city, town or village in the postal address of the party."
                  },
                  "postalZone" : {
                    "type" : "string",
                    "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                  },
                  "addressLine" : {
                    "type" : "string",
                    "description" : "The address line of the postal address of the party."
                  },
                  "addressLine2" : {
                    "type" : "string",
                    "description" : "The second address line of the postal address of the party."
                  },
                  "addressLine3" : {
                    "type" : "string",
                    "description" : "The third address line of the postal address of the party."
                  },
                  "locality" : {
                    "type" : "string",
                    "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                  },
                  "countrySubentity" : {
                    "type" : "string",
                    "description" : "The sub-entity of the area in the postal address."
                  },
                  "countryId" : {
                    "type" : "string",
                    "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                  }
                },
                "additionalProperties" : false
              },
              "partyTaxScheme" : {
                "type" : "object",
                "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                "properties" : {
                  "company" : {
                    "type" : "object",
                    "description" : "Information about the company taxes.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                      }
                    },
                    "additionalProperties" : false
                  }
                },
                "additionalProperties" : false
              },
              "contact" : {
                "type" : "object",
                "description" : "An object containing information about contacts. Used for defining the company contact data",
                "properties" : {
                  "name" : {
                    "type" : "string",
                    "description" : "A contact name of the party."
                  },
                  "telephone" : {
                    "type" : "string",
                    "description" : "A telephone number of the contact of the party."
                  },
                  "telefax" : {
                    "type" : "string",
                    "description" : "A fax number of the contact of the party."
                  },
                  "electronicMail" : {
                    "type" : "string",
                    "description" : "An email of the contact of the party."
                  }
                },
                "additionalProperties" : false
              }
            },
            "required" : [ "partyName" ],
            "additionalProperties" : false
        },
        "sellerSupplierParty": {
            "description": "Party that is the supplier of the goods/services in the referred business document.",
            "properties" : {
              "endpoint" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                  }
                },
                "required" : [ "id" ]
              },
              "partyIdentifications" : {
                "type" : "array",
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "items" : {
                  "type" : "object",
                  "description" : "An object holding a party identification.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "An object holding the external system identifier of the party."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the id identifier element."
                    }
                  },
                  "required" : [ "id" ],
                  "additionalProperties" : false
                }
              },
              "partyName" : {
                "type" : "string",
                "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
              },
              "postalAddress" : {
                "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                "properties" : {
                  "cityName" : {
                    "type" : "string",
                    "description" : "The name of the city, town or village in the postal address of the party."
                  },
                  "postalZone" : {
                    "type" : "string",
                    "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                  },
                  "addressLine" : {
                    "type" : "string",
                    "description" : "The address line of the postal address of the party."
                  },
                  "addressLine2" : {
                    "type" : "string",
                    "description" : "The second address line of the postal address of the party."
                  },
                  "addressLine3" : {
                    "type" : "string",
                    "description" : "The third address line of the postal address of the party."
                  },
                  "locality" : {
                    "type" : "string",
                    "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                  },
                  "countrySubentity" : {
                    "type" : "string",
                    "description" : "The sub-entity of the area in the postal address."
                  },
                  "countryId" : {
                    "type" : "string",
                    "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                  }
                },
                "additionalProperties" : false
              },
              "partyTaxScheme" : {
                "type" : "object",
                "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                "properties" : {
                  "company" : {
                    "type" : "object",
                    "description" : "Information about the company taxes.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                      }
                    },
                    "additionalProperties" : false
                  }
                },
                "additionalProperties" : false
              },
              "contact" : {
                "type" : "object",
                "description" : "An object containing information about contacts. Used for defining the company contact data",
                "properties" : {
                  "name" : {
                    "type" : "string",
                    "description" : "A contact name of the party."
                  },
                  "telephone" : {
                    "type" : "string",
                    "description" : "A telephone number of the contact of the party."
                  },
                  "telefax" : {
                    "type" : "string",
                    "description" : "A fax number of the contact of the party."
                  },
                  "electronicMail" : {
                    "type" : "string",
                    "description" : "An email of the contact of the party."
                  }
                },
                "additionalProperties" : false
              }
            },
            "required" : [ "partyName" ],
            "additionalProperties" : false
        },
        "delivery": {
          "description": "Delivery details.",
          "additionalProperties" : false,
          "properties" : {
            "actualDeliveryDate" : {
              "type" : "string",
              "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
              "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            }
          }
        },
        "deliveryParty": {
          "description": "Party that is responsible for the delivery of the goods/services in the referred business document.",
          "properties" : {
            "endpoint" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                }
              },
              "required" : [ "id" ]
            },
            "partyIdentifications" : {
              "type" : "array",
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "items" : {
                "type" : "object",
                "description" : "An object holding a party identification.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "An object holding the external system identifier of the party."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              }
            },
            "partyName" : {
              "type" : "string",
              "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
            },
            "postalAddress" : {
              "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
              "properties" : {
                "cityName" : {
                  "type" : "string",
                  "description" : "The name of the city, town or village in the postal address of the party."
                },
                "postalZone" : {
                  "type" : "string",
                  "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                },
                "addressLine" : {
                  "type" : "string",
                  "description" : "The address line of the postal address of the party."
                },
                "addressLine2" : {
                  "type" : "string",
                  "description" : "The second address line of the postal address of the party."
                },
                "addressLine3" : {
                  "type" : "string",
                  "description" : "The third address line of the postal address of the party."
                },
                "locality" : {
                  "type" : "string",
                  "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                },
                "countrySubentity" : {
                  "type" : "string",
                  "description" : "The sub-entity of the area in the postal address."
                },
                "countryId" : {
                  "type" : "string",
                  "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                }
              },
              "additionalProperties" : false
            },
            "partyTaxScheme" : {
              "type" : "object",
              "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
              "properties" : {
                "company" : {
                  "type" : "object",
                  "description" : "Information about the company taxes.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                    }
                  },
                  "additionalProperties" : false
                }
              },
              "additionalProperties" : false
            },
            "contact" : {
              "type" : "object",
              "description" : "An object containing information about contacts. Used for defining the company contact data",
              "properties" : {
                "name" : {
                  "type" : "string",
                  "description" : "A contact name of the party."
                },
                "telephone" : {
                  "type" : "string",
                  "description" : "A telephone number of the contact of the party."
                },
                "telefax" : {
                  "type" : "string",
                  "description" : "A fax number of the contact of the party."
                },
                "electronicMail" : {
                  "type" : "string",
                  "description" : "An email of the contact of the party."
                }
              },
              "additionalProperties" : false
            }
          },
          "required" : [ "partyName" ],
          "additionalProperties" : false
        },
        "paymentMeans": {
          "description": "An object holding the available payment means.",
          "additionalProperties" : false,
          "properties" : {
            "paymentMeansCode" : {
              "type" : "string",
              "description" : "A code that identifies how the payment can be done. Valid values: UN/ECE 4461 code represented as string."
            },
            "paymentDueDate" : {
              "type" : "string",
              "description" : "Date when the business document is due for the payment means. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
              "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            },
            "paymentReferenceMessage" : {
              "type" : "string",
              "description" : "A payment reference message. This can be a free text describing the payment."
            },
            "paymentIdentifier" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An identifier for a payment made using this means of payment.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "The id value of payment identifier."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "Scheme which identifies the type of payment identifier. Possible values are SPY, ISO."
                }
              },
              "required" : [ "id" ]
            },
            "financialAccounts" : {
              "type" : "array",
              "description" : "Array holding the financial account data",
              "items" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "Object holding the financial account data",
                "properties" : {
                  "financialInstitutionName" : {
                    "type" : "string",
                    "description" : "The name of financial institution."
                  },
                  "financialInstitutionId" : {
                    "type" : "string",
                    "description" : "Identifier of financial institution."
                  },
                  "financialInstitutionIdSchemeId" : {
                    "type" : "string",
                    "description" : "The external identifier of the financial institution id identifier element."
                  },
                  "financialInstitutionBranchId" : {
                    "type" : "string",
                    "description" : "The identifier of financial institution branch, for example 342-085. This field is typically used by institutions in Australia and New Zealand."
                  },
                  "financialInstitutionBranchSchemeId" : {
                    "type" : "string",
                    "description" : "The scheme identifier of financial institution branch. For example for an Australian institutions, possible scheme is BSB."
                  },
                  "ids" : {
                    "type" : "array",
                    "description" : "Array holding ids",
                    "items" : {
                      "type" : "object",
                      "additionalProperties" : false,
                      "description" : "Object holding identifier data",
                      "properties" : {
                        "id" : {
                          "type" : "string",
                          "description" : "Identifier."
                        },
                        "schemeId" : {
                          "type" : "string",
                          "description" : "External identifier."
                        }
                      },
                      "required" : [ "id" ]
                    }
                  },
                  "accounting" : {
                    "type" : "object",
                    "title" : "Accounting",
                    "description" : "Accounting related content.",
                    "properties" : {
                      "virtualBankBarcode" : {
                        "type" : "object",
                        "title" : "VirtualBankBarcode",
                        "description" : "Virtual bar code can be added to the business document that should be printed.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "title" : "Virtual bank bar code",
                            "description" : "Identifier of the virtual bar code. "
                          },
                          "schemeId" : {
                            "type" : "string",
                            "title" : "SchemeId for virtual bank bar code",
                            "description" : "Scheme identifier of the virtual bank bar code, typically country code according to ISO3166-1 alpha-2. Possible values: FI"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required" : [ "paymentMeansCode" ]
        },
        "paymentTerms": {
          "description": "Available payment terms.",
          "additionalProperties" : false,
          "properties" : {
            "settlementPeriod" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An object holding the settlement period dates.",
              "properties" : {
                "startDate" : {
                  "type" : "string",
                  "description" : "Date when the payment terms starts. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                  "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                },
                "endDate" : {
                  "type" : "string",
                  "description" : "Date when the payment terms ends. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                  "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                }
              }
            },
            "note" : {
              "type" : "string",
              "description" : "Free-form text applying to the payment terms. This field may contain notes or any other similar information that is not contained explicitly in another structure."
            },
            "penaltySurchargePercent" : {
              "type" : "number",
              "description" : "Penalty surcharge percent amount."
            }
          }
        },
        "taxTotal": {
          "additionalProperties" : false,
          "properties" : {
            "currencyId" : {
              "type" : "string",
              "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
            },
            "amount" : {
              "type" : "number",
              "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
            },
            "taxSubtotals" : {
              "items" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "An object holding the information about tax.",
                "properties" : {
                  "currencyId" : {
                    "type" : "string",
                    "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                  },
                  "amount" : {
                    "type" : "number",
                    "description" : "Total amount of the taxes."
                  },
                  "percent" : {
                    "type" : "number",
                    "description" : "The tax rate for the category, expressed as a percentage."
                  },
                  "taxableAmount" : {
                    "type" : "number",
                    "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                  },
                  "taxCategory" : {
                    "type" : "object",
                    "description" : "External identifier of tax category.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Identifies the tax category identifier."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "Identifies the namespace of the tax category identifier."
                      },
                      "name" : {
                        "type" : "string",
                        "description" : "Tax category description."
                      }
                    },
                    "required" : [ "id" ],
                    "additionalProperties" : false
                  }
                },
                "required" : [ "currencyId", "amount" ]
              }
            }
          },
          "required" : [ "currencyId", "amount" ]
        },
        "legalMonetaryTotal": {
          "additionalProperties" : false,
          "properties" : {
            "lineExtensionAmount" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An object holding total amount of line extensions.",
              "properties" : {
                "currencyId" : {
                  "type" : "string",
                  "description" : "A code that identifies the currency of the total line extension amount. Valid values: ISO 4217 code represented as string."
                },
                "amount" : {
                  "type" : "number",
                  "description" : "Total amount of line extensions."
                }
              },
              "required" : [ "currencyId", "amount" ]
            },
            "payableAmount" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An object holding total payable amount of line extensions.",
              "properties" : {
                "currencyId" : {
                  "type" : "string",
                  "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                },
                "amount" : {
                  "type" : "number",
                  "description" : "The total amount to be paid."
                }
              },
              "required" : [ "currencyId", "amount" ]
            }
          },
          "required" : [ "payableAmount" ]
        },
        "buyerReference": {
          "description": "Buyer reference in the business document.",
          "additionalProperties" : false,
          "properties" : {
            "id" : {
              "type" : "string",
              "description" : "The id value of the buyer reference"
            }
          },
          "required" : [ "id" ]
        },
        "customFields": {
          "items" : {
            "type" : "object",
            "description" : "Custom fields in the business document",
            "properties" : {
              "name" : {
                "type" : "string",
                "description" : "Name of the custom field",
                "default" : "file"
              },
              "value" : {
                "type" : "string",
                "description" : "Value of the custom field"
              },
              "description" : {
                "type" : "string",
                "description" : "The purpose of this field"
              }
            },
            "required" : [ "name", "value" ]
          }
        },
        "invoiceLines": {
          "type": "array",
          "description": "An array holding the Invoice lines.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "description": "An invoice line",
            "properties": {
              "id": {
                "type": "string",
                "description": "External system identifier for the Invoice line."
              },
              "quantity": {
                "additionalProperties" : false,
                "properties" : {
                  "amount" : {
                    "type" : "number",
                    "description" : "The quantity of the target Business Document line items."
                  },
                  "unitCode" : {
                    "type" : "string",
                    "description" : "The unit code of the quantity of the target Business Document line item. Valid values: UN/ECE CEFACT Trade Facilitation Recommendation No.20 common code value represented as string."
                  }
                }
              },
              "serviceIndicator": {
                "type": "boolean",
                "description": "Flag indicating whether the line represents goods or services (true if services, false if goods)."
              },
              "lineExtension": {
                "additionalProperties" : false,
                "properties" : {
                  "currencyId" : {
                    "type" : "string",
                    "description" : "The currency of the amount."
                  },
                  "amount" : {
                    "type" : "number",
                    "description" : "The total amount for the line item, including allowance charges but net of taxes."
                  }
                },
                "required" : [ "currencyId", "amount" ]
              },
              "item": {
                "additionalProperties" : false,
                "properties" : {
                  "description" : {
                    "type" : "array",
                    "description" : "An array holding the descriptions of the Business Document line items.",
                    "items" : {
                      "type" : "string",
                      "description" : "Description of the Business Document line item."
                    }
                  },
                  "name" : {
                    "type" : "string",
                    "description" : "Name of the Business Document line item.  A short name optionally given to an item, such as a name from a catalogue, as distinct from a description."
                  },
                  "taxPercent" : {
                    "type" : "number",
                    "description" : "Tax amount for the item"
                  },
                  "sellersItem" : {
                    "type" : "object",
                    "additionalProperties" : false,
                    "description" : "An object holding a identification of the Business Documents line item as it is in sellers system.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Id of the Business Document line item as it is in sellers system."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External system specific identifier of the sellers item identifier element. If the source business document has any matching element, it should be used."
                      }
                    },
                    "required" : [ "id" ]
                  }
                }
              },
              "taxTotals": {
                "items" : {
                  "type" : "object",
                  "additionalProperties" : false,
                  "description" : "An object holding the information about tax.",
                  "properties" : {
                    "amount" : {
                      "type" : "number",
                      "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
                    },
                    "currencyId" : {
                      "type" : "string",
                      "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                    },
                    "transactionCurrencyTax" : {
                      "type" : "object",
                      "additionalProperties" : false,
                      "description" : "An object holding transaction tax.",
                      "properties" : {
                        "amount" : {
                          "type" : "number",
                          "description" : "Amount of tax for the transaction."
                        }
                      },
                      "required" : [ "amount" ]
                    },
                    "taxSubtotals" : {
                      "items" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding the information about tax.",
                        "properties" : {
                          "currencyId" : {
                            "type" : "string",
                            "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                          },
                          "amount" : {
                            "type" : "number",
                            "description" : "Total amount of the taxes."
                          },
                          "percent" : {
                            "type" : "number",
                            "description" : "The tax rate for the category, expressed as a percentage."
                          },
                          "taxableAmount" : {
                            "type" : "number",
                            "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                          },
                          "taxCategory" : {
                            "type" : "object",
                            "description" : "External identifier of tax category.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "Identifies the tax category identifier."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "Identifies the namespace of the tax category identifier."
                              },
                              "name" : {
                                "type" : "string",
                                "description" : "Tax category description."
                              }
                            },
                            "required" : [ "id" ],
                            "additionalProperties" : false
                          }
                        },
                        "required" : [ "currencyId", "amount" ]
                      }
                    }
                  },
                  "required" : [ "amount", "currencyId" ]
                }
              },
              "price": {
                "additionalProperties" : false,
                "properties" : {
                  "amount" : {
                    "type" : "number",
                    "description" : "The price of the line item."
                  },
                  "currencyId" : {
                    "type" : "string",
                    "description" : "A code that identifies the currency of the line item price. Valid values: ISO 4217 code represented as string."
                  }
                },
                "required" : [ "amount", "currencyId" ]
              },
              "delivery": {
                "additionalProperties" : false,
                "properties" : {
                  "actualDeliveryDate" : {
                    "type" : "string",
                    "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
                    "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                  }
                }
              },
              "orderLineReference": {
                "additionalProperties" : false,
                "properties" : {
                  "lineId" : {
                    "type" : "string",
                    "description" : "An identifier for the referenced order line, assigned by the buyer."
                  },
                  "orderReference" : {
                    "type" : "string",
                    "description" : "A reference to the order containing the referenced order line."
                  }
                },
                "required" : [ "lineId" ]
              },
              "allowanceCharges": {
                "additionalProperties" : false,
                "items" : {
                  "type" : "object",
                  "properties" : {
                    "changeIndicator" : {
                      "type" : "boolean",
                      "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
                    },
                    "allowanceChargeReasonCode" : {
                      "type" : "string",
                      "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
                    },
                    "allowanceChargeReason" : {
                      "type" : "string",
                      "description" : "The reason for this allowance or charge."
                    },
                    "multiplierFactorNumeric" : {
                      "type" : "number",
                      "description" : "The factor applied to the base amount to calculate the allowance charge."
                    },
                    "amount" : {
                      "type" : "number",
                      "description" : "The allowance charge amount."
                    }
                  },
                  "required" : [ "changeIndicator", "amount" ]
                }
              },
              "customFields": {
                "items" : {
                  "type" : "object",
                  "description" : "Custom fields in the business document",
                  "properties" : {
                    "name" : {
                      "type" : "string",
                      "description" : "Name of the custom field",
                      "default" : "file"
                    },
                    "value" : {
                      "type" : "string",
                      "description" : "Value of the custom field"
                    },
                    "description" : {
                      "type" : "string",
                      "description" : "The purpose of this field"
                    }
                  },
                  "required" : [ "name", "value" ]
                }
              }
            },
            "required": [
              "id",
              "lineExtension",
              "item"
            ]
          }
        }
      },
      "required": [
        "externalDocumentIdentifier",
        "issueDate",
        "accountingSupplierParty",
        "accountingCustomerParty",
        "legalMonetaryTotal",
        "invoiceLines"
      ]
    }
  },
  "required": [
    "bumId",
    "data"
  ]
}

Response code 400 - Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.

Response example for the response code above

{
  "error": {
    "id": "c842c9c3-75e5-4c32-ae3f-c1fe250fc186",
    "type": "VALIDATION",
    "message": "Business document identifier bumId does not match the pattern :[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
    "code": "Error.004.0003",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Response code 500 - Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

Response example for the response code above

{
  "error": {
    "id": "a312a9b3-35e5-1a32-be3f-a5fe250fc121",
    "type": "TECHNICAL",
    "message": "BCN encountered an unexpected system error",
    "code": "Error.001.0006",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

You can retrieve the invoice contents using GET /invoices method. Basware Unique Message Identifier (bumId) defines which invoice you want to retrieve.

Request URI

https://api.basware.com/v2/invoices/{bumId}

URI Parameters

Param Name Type Required Example Description
bumId string true 6741ecc7-848a-443c-83ad-ea95e4df06fa Unique UUID for invoice

Request Headers

Param Name Required Example Description
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Responses

Response code Description
200 The request has been completed successfully.
400 Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
500 Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

POST

POST /invoices/{bumId} HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Request example

{
  "clientToken": "3ee9b55f-9b08-4936-8c8c-87c7d0ae4114",
  "fileRefs": [
    {
      "refId": "34a9a23ff33e42a6bc674f1a"
    }
  ],
  "processingPreference": {
    "sendTo": {
      "id": "114612065012",
      "schemeId": "BE:ORGNR"
    },
    "receiveFrom": {
      "id": "114823943023440",
      "schemeId": "ISO6523-ACTORID-UPIS"
    },
    "printingPreference": "PrintingAllowed"
  },
  "data": {
    "externalDocumentIdentifier": {
      "id": "56328230"
    },
    "issueDate": "2017-05-01",
    "documentCurrencyCode": "EUR",
    "isIssuedAgainstOrder": false,
    "contractDocumentReferences": [
      {
        "id": "147217"
      }
    ],
    "accountingSupplierParty": {
      "partyName": "Acme Supplier Inc.",
      "postalAddress": {
        "addressLine": "1800 Main Street",
        "cityName": "Dallas",
        "postalZone": "75201",
        "countrySubentity": "TX",
        "countryId": "US"
      }
    },
    "accountingCustomerParty": {
      "partyIdentifications": [
        {
          "id": "BE4612065012",
          "schemeId": "VAT"
        }
      ],
      "partyName": "Acme Buyer N.V.",
      "postalAddress": {
        "addressLine": "Sint Gummarusstraat 53",
        "cityName": "Antwerpen",
        "postalZone": "2060",
        "countryId": "BE"
      }
    },
    "deliveryParty": {
      "partyName": "Parcels United",
      "postalAddress": {
        "addressLine": "1 Back Lane",
        "locality": "Clayton West",
        "cityName": "HUDDERSFIELD",
        "postalZone": "HD8 9PP",
        "countryId": "UK"
      }
    },
    "paymentMeans": {
      "financialAccounts": [
        {
          "financialInstitutionName": "BARCGB22",
          "ids": [
            {
              "id": "GB54BARC20992012345678",
              "schemeId": "IBAN"
            }
          ]
        }
      ],
      "paymentDueDate": "2016-06-30",
      "paymentIdentifier": {
        "id": "63156783578924",
        "schemeId": "SPY"
      },
      "paymentMeansCode": "31"
    },
    "buyerReference": {
      "id": "PO-1563224"
    },
    "taxTotal": {
      "amount": 89.56,
      "currencyId": "EUR",
      "taxSubtotals": [
        {
          "taxableAmount": 373.24,
          "amount": 89.56,
          "currencyId": "EUR",
          "percent": 24
        }
      ]
    },
    "legalMonetaryTotal": {
      "payableAmount": {
        "amount": 462.8,
        "currencyId": "EUR"
      }
    },
    "invoiceLines": [
      {
        "id": "1",
        "quantity": {
          "amount": 2,
          "unitCode": "PCE"
        },
        "lineExtension": {
          "currencyId": "EUR",
          "amount": 72
        },
        "item": {
          "description": [
            "Basic High-Speed HDMI Cable - 25 Feet",
            "Supports Ethernet, 3D, 4K and Audio Return"
          ],
          "name": "High-Speed HDMI Cable",
          "taxPercent": 10,
          "sellersItem": {
            "id": "B-341"
          }
        },
        "taxTotals": [
          {
            "currencyId": "EUR",
            "amount": 17.28,
            "transactionCurrencyTax": {
              "amount": 0.9
            },
            "taxSubtotals": [
              {
                "currencyId": "EUR",
                "amount": 17.28,
                "percent": 24
              }
            ]
          }
        ]
      },
      {
        "id": "2",
        "quantity": {
          "amount": 1,
          "unitCode": "PCE"
        },
        "lineExtension": {
          "currencyId": "EUR",
          "amount": 23.1
        },
        "item": {
          "sellersItem": {
            "id": "A-532"
          },
          "taxPercent": 10
        },
        "taxTotals": [
          {
            "currencyId": "EUR",
            "amount": 5.54,
            "transactionCurrencyTax": {
              "amount": 0.9
            },
            "taxSubtotals": [
              {
                "currencyId": "EUR",
                "amount": 5.54,
                "percent": 24
              }
            ]
          }
        ]
      }
    ]
  }
}

Request schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Schema for POST /invoices",
    "description": "Invoice is a business document which can contain attachments.",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "clientToken": {
            "type": "string",
            "description": "Token generated by client (uuid). Used to verify that specific Invoice is only sent and processed once, if response time-outs, retry should be executed with the same clientToken."
        },
        "fileRefs": {
            "type": "array",
            "description": "Invoice file/attachment reference identifiers.",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "refId": {
                        "type": "string",
                        "description": "Unique file identifier received after storing file into Basware Network."
                    }
                },
                "required": [
                    "refId"
                ]
            }
        },
        "processingPreference": {
            "additionalProperties" : false,
            "properties" : {
              "sendTo" : {
                "description" : "Identifier for the recipient endpoint. See API documentation for more details about recipient endpoints.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifies the value."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "Identifies the namespace of the id."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              },
              "receiveFrom" : {
                "description" : "Identifier for the sender endpoint.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifies the value."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "Identifies the namespace of the id."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              },
              "replyTo" : {
                "description" : "Identifier for the reply to endpoint.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifies the value."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "Identifies the namespace of the id."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              },
              "sendToServiceProvider" : {
                "type" : "string",
                "description" : "Identifier for the intermediate service provider."
              },
              "printingPreference" : {
                "type" : "string",
                "enum" : [ "PrintingAllowed", "PrintingAlways", "NoPrinting" ],
                "description" : "Indicates the printing preference. This optional field can be specified to allow printing delivery with PrintingAllowed or force the document to be delived by printing with PrintingAlways. If this field is not specified, delivery will be by eInvoicing. Note that this field cannot be used together with sendToServiceProvider. Only one of these two fields can be given at the same time."
              },
              "recipientNotificationPreference" : {
                "type" : "string",
                "description" : "Indicates how the recipient is notified about the business document delivery. Possible values are EmailWithLoginLink, EmailWithSecuredLink, EmailWithContent, NotificationViaThirdParty."
              },
              "isConsumerRecipient" : {
                "type" : "boolean",
                "description" : "Indicates whether the recipient is a consumer recipient."
              }
            },
            "required" : [ "sendTo" ]
        },
        "data": {
            "type": "object",
            "additionalProperties": false,
            "description": "Object holding the business content of the Invoice. Content is at some level based on Universal Business Language (UBL) standard version 2.1. It has also been extended by Basware so it is not strictly UBL.",
            "properties": {
                "externalDocumentIdentifier": {
                    "description": "External system identifier of the business document. Serial number that is issued once only by invoice issuer to identify the invoice.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Identifies the value."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "Identifies the namespace of the id."
                      }
                    },
                    "required" : [ "id" ],
                    "additionalProperties" : false
                },
                "issueDate": {
                    "type": "string",
                    "description": "The date when the Invoice was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                    "pattern": "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                },
                "documentCurrencyCode": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3,
                    "description": "Currency presentation of the Invoice document. Valid values must be ISO 4217 Alpha format."
                },
                "note": {
                    "type": "string",
                    "description": "Free-form text pertinent to this document, conveying information that is not contained explicitly in other structures."
                },
                "allowanceCharges": {
                    "additionalProperties" : false,
                    "items" : {
                      "type" : "object",
                      "properties" : {
                        "changeIndicator" : {
                          "type" : "boolean",
                          "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
                        },
                        "allowanceChargeReasonCode" : {
                          "type" : "string",
                          "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
                        },
                        "allowanceChargeReason" : {
                          "type" : "string",
                          "description" : "The reason for this allowance or charge."
                        },
                        "multiplierFactorNumeric" : {
                          "type" : "number",
                          "description" : "The factor applied to the base amount to calculate the allowance charge."
                        },
                        "amount" : {
                          "type" : "number",
                          "description" : "The allowance charge amount."
                        }
                      },
                      "required" : [ "changeIndicator", "amount" ]
                    }
                },
                "isIssuedAgainstOrder": {
                    "type": "boolean",
                    "description": "Indicates whether the business document is issued against an order."
                },
                "orderReference": {
                    "description": "Order reference on the business document.",
                    "additionalProperties" : false,
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Order number reference on the business document. Identifies the referenced order assigned by the buyer."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External system specific identifier of the order system identifier element. If the source business document has any matching element, it should be used."
                      },
                      "customerReference" : {
                        "type" : "string",
                        "description" : "Customer Reference Identifier (CRI) when using a purchasing card."
                      },
                      "salesOrderId" : {
                        "type" : "string",
                        "description" : "Sales order identifier."
                      }
                    },
                    "required" : [ "id" ]
                },
                "contractDocumentReferences": {
                    "description": "External system identifier objects for the contract referenced by the business document.",
                    "items" : {
                      "type" : "object",
                      "additionalProperties" : false,
                      "properties" : {
                        "id" : {
                          "type" : "string",
                          "description" : "External system identifier of the contract referenced by the Business Document (i.e. buyers contract number). Mandatory field if the customer demands that the goods or services invoiced refer to a contract number defined by the customer to which he wants to assign the Business Document. Is demanded for example in service and maintenance agreements for which there is generally no explicit order."
                        },
                        "schemeId" : {
                          "type" : "string",
                          "description" : "External system specific identifier of the contract system identifier element. If the source business document has any matching element, it should be used."
                        }
                      },
                      "required" : [ "id" ]
                    }
                },
                "additionalDocumentReference": {
                    "description": "A reference to an additional document associated with this document. Used for example to reference to an Invoice from Credit Note.",
                    "additionalProperties" : false,
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "An identifier for the referenced document (i.e. bumid)."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External system specific identifier of the invoicing system identifier element. If the source business document has any matching element, it should be used."
                      },
                      "issueDate" : {
                        "type" : "string",
                        "description" : "Date when the referenced document was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                        "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                      },
                      "typeCode" : {
                        "type" : "string",
                        "description" : "The type of document being referenced, expressed as a code, for example to reference to an Invoice document, code is 380."
                      }
                    },
                    "required" : [ "id" ]
                },
                "accountingSupplierParty": {
                    "description": "Party that is the accountable supplier of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "accountingCustomerParty": {
                    "description": "Party that is the accountable buyer of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "buyerCustomerParty": {
                    "description": "Party that is the buyer of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "sellerSupplierParty": {
                    "description": "Party that is the supplier of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "delivery": {
                    "description": "Delivery details.",
                    "additionalProperties" : false,
                    "properties" : {
                      "actualDeliveryDate" : {
                        "type" : "string",
                        "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
                        "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                      }
                    }
                },
                "deliveryParty": {
                    "description": "Party that is responsible for the delivery of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "paymentMeans": {
                    "description": "An object holding the available payment means.",
                    "additionalProperties" : false,
                    "properties" : {
                      "paymentMeansCode" : {
                        "type" : "string",
                        "description" : "A code that identifies how the payment can be done. Valid values: UN/ECE 4461 code represented as string."
                      },
                      "paymentDueDate" : {
                        "type" : "string",
                        "description" : "Date when the business document is due for the payment means. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                        "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                      },
                      "paymentReferenceMessage" : {
                        "type" : "string",
                        "description" : "A payment reference message. This can be a free text describing the payment."
                      },
                      "paymentIdentifier" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An identifier for a payment made using this means of payment.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "The id value of payment identifier."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "Scheme which identifies the type of payment identifier. Possible values are SPY, ISO."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "financialAccounts" : {
                        "type" : "array",
                        "description" : "Array holding the financial account data",
                        "items" : {
                          "type" : "object",
                          "additionalProperties" : false,
                          "description" : "Object holding the financial account data",
                          "properties" : {
                            "financialInstitutionName" : {
                              "type" : "string",
                              "description" : "The name of financial institution."
                            },
                            "financialInstitutionId" : {
                              "type" : "string",
                              "description" : "Identifier of financial institution."
                            },
                            "financialInstitutionIdSchemeId" : {
                              "type" : "string",
                              "description" : "The external identifier of the financial institution id identifier element."
                            },
                            "financialInstitutionBranchId" : {
                              "type" : "string",
                              "description" : "The identifier of financial institution branch, for example 342-085. This field is typically used by institutions in Australia and New Zealand."
                            },
                            "financialInstitutionBranchSchemeId" : {
                              "type" : "string",
                              "description" : "The scheme identifier of financial institution branch. For example for an Australian institutions, possible scheme is BSB."
                            },
                            "ids" : {
                              "type" : "array",
                              "description" : "Array holding ids",
                              "items" : {
                                "type" : "object",
                                "additionalProperties" : false,
                                "description" : "Object holding identifier data",
                                "properties" : {
                                  "id" : {
                                    "type" : "string",
                                    "description" : "Identifier."
                                  },
                                  "schemeId" : {
                                    "type" : "string",
                                    "description" : "External identifier."
                                  }
                                },
                                "required" : [ "id" ]
                              }
                            },
                            "accounting" : {
                              "type" : "object",
                              "title" : "Accounting",
                              "description" : "Accounting related content.",
                              "properties" : {
                                "virtualBankBarcode" : {
                                  "type" : "object",
                                  "title" : "VirtualBankBarcode",
                                  "description" : "Virtual bar code can be added to the business document that should be printed.",
                                  "properties" : {
                                    "id" : {
                                      "type" : "string",
                                      "title" : "Virtual bank bar code",
                                      "description" : "Identifier of the virtual bar code. "
                                    },
                                    "schemeId" : {
                                      "type" : "string",
                                      "title" : "SchemeId for virtual bank bar code",
                                      "description" : "Scheme identifier of the virtual bank bar code, typically country code according to ISO3166-1 alpha-2. Possible values: FI"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "required" : [ "paymentMeansCode" ]
                },
                "paymentTerms": {
                    "description": "Available payment terms.",
                    "additionalProperties" : false,
                    "properties" : {
                      "settlementPeriod" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding the settlement period dates.",
                        "properties" : {
                          "startDate" : {
                            "type" : "string",
                            "description" : "Date when the payment terms starts. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                            "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                          },
                          "endDate" : {
                            "type" : "string",
                            "description" : "Date when the payment terms ends. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                            "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                          }
                        }
                      },
                      "note" : {
                        "type" : "string",
                        "description" : "Free-form text applying to the payment terms. This field may contain notes or any other similar information that is not contained explicitly in another structure."
                      },
                      "penaltySurchargePercent" : {
                        "type" : "number",
                        "description" : "Penalty surcharge percent amount."
                      }
                    }
                },
                "taxTotal": {
                    "additionalProperties" : false,
                    "properties" : {
                      "currencyId" : {
                        "type" : "string",
                        "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                      },
                      "amount" : {
                        "type" : "number",
                        "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
                      },
                      "taxSubtotals" : {
                        "items" : {
                          "type" : "object",
                          "additionalProperties" : false,
                          "description" : "An object holding the information about tax.",
                          "properties" : {
                            "currencyId" : {
                              "type" : "string",
                              "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                            },
                            "amount" : {
                              "type" : "number",
                              "description" : "Total amount of the taxes."
                            },
                            "percent" : {
                              "type" : "number",
                              "description" : "The tax rate for the category, expressed as a percentage."
                            },
                            "taxableAmount" : {
                              "type" : "number",
                              "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                            },
                            "taxCategory" : {
                              "type" : "object",
                              "description" : "External identifier of tax category.",
                              "properties" : {
                                "id" : {
                                  "type" : "string",
                                  "description" : "Identifies the tax category identifier."
                                },
                                "schemeId" : {
                                  "type" : "string",
                                  "description" : "Identifies the namespace of the tax category identifier."
                                },
                                "name" : {
                                  "type" : "string",
                                  "description" : "Tax category description."
                                }
                              },
                              "required" : [ "id" ],
                              "additionalProperties" : false
                            }
                          },
                          "required" : [ "currencyId", "amount" ]
                        }
                      }
                    },
                    "required" : [ "currencyId", "amount" ]
                },
                "legalMonetaryTotal": {
                    "additionalProperties" : false,
                    "properties" : {
                      "lineExtensionAmount" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding total amount of line extensions.",
                        "properties" : {
                          "currencyId" : {
                            "type" : "string",
                            "description" : "A code that identifies the currency of the total line extension amount. Valid values: ISO 4217 code represented as string."
                          },
                          "amount" : {
                            "type" : "number",
                            "description" : "Total amount of line extensions."
                          }
                        },
                        "required" : [ "currencyId", "amount" ]
                      },
                      "payableAmount" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding total payable amount of line extensions.",
                        "properties" : {
                          "currencyId" : {
                            "type" : "string",
                            "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                          },
                          "amount" : {
                            "type" : "number",
                            "description" : "The total amount to be paid."
                          }
                        },
                        "required" : [ "currencyId", "amount" ]
                      }
                    },
                    "required" : [ "payableAmount" ]
                },
                "buyerReference": {
                    "description": "Buyer reference in the business document.",
                    "additionalProperties" : false,
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "The id value of the buyer reference"
                      }
                    },
                    "required" : [ "id" ]
                },
                "customFields": {
                    "items" : {
                      "type" : "object",
                      "description" : "Custom fields in the business document",
                      "properties" : {
                        "name" : {
                          "type" : "string",
                          "description" : "Name of the custom field",
                          "default" : "file"
                        },
                        "value" : {
                          "type" : "string",
                          "description" : "Value of the custom field"
                        },
                        "description" : {
                          "type" : "string",
                          "description" : "The purpose of this field"
                        }
                      },
                      "required" : [ "name", "value" ]
                    }
                },
                "invoiceLines": {
                    "type": "array",
                    "description": "An array holding the invoice lines.",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "description": "An invoice line",
                        "properties": {
                            "id": {
                                "type": "string",
                                "description": "External system identifier for the Invoice line."
                            },
                            "quantity": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "amount" : {
                                    "type" : "number",
                                    "description" : "The quantity of the target Business Document line items."
                                  },
                                  "unitCode" : {
                                    "type" : "string",
                                    "description" : "The unit code of the quantity of the target Business Document line item. Valid values: UN/ECE CEFACT Trade Facilitation Recommendation No.20 common code value represented as string."
                                  }
                                }
                            },
                            "serviceIndicator": {
                                "type": "boolean",
                                "description": "Flag indicating whether the line represents goods or services (true if services, false if goods)."
                            },
                            "lineExtension": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "currencyId" : {
                                    "type" : "string",
                                    "description" : "The currency of the amount."
                                  },
                                  "amount" : {
                                    "type" : "number",
                                    "description" : "The total amount for the line item, including allowance charges but net of taxes."
                                  }
                                },
                                "required" : [ "currencyId", "amount" ]
                            },
                            "item": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "description" : {
                                    "type" : "array",
                                    "description" : "An array holding the descriptions of the Business Document line items.",
                                    "items" : {
                                      "type" : "string",
                                      "description" : "Description of the Business Document line item."
                                    }
                                  },
                                  "name" : {
                                    "type" : "string",
                                    "description" : "Name of the Business Document line item.  A short name optionally given to an item, such as a name from a catalogue, as distinct from a description."
                                  },
                                  "taxPercent" : {
                                    "type" : "number",
                                    "description" : "Tax amount for the item"
                                  },
                                  "sellersItem" : {
                                    "type" : "object",
                                    "additionalProperties" : false,
                                    "description" : "An object holding a identification of the Business Documents line item as it is in sellers system.",
                                    "properties" : {
                                      "id" : {
                                        "type" : "string",
                                        "description" : "Id of the Business Document line item as it is in sellers system."
                                      },
                                      "schemeId" : {
                                        "type" : "string",
                                        "description" : "External system specific identifier of the sellers item identifier element. If the source business document has any matching element, it should be used."
                                      }
                                    },
                                    "required" : [ "id" ]
                                  }
                                }
                            },
                            "taxTotals": {
                                "items" : {
                                  "type" : "object",
                                  "additionalProperties" : false,
                                  "description" : "An object holding the information about tax.",
                                  "properties" : {
                                    "amount" : {
                                      "type" : "number",
                                      "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
                                    },
                                    "currencyId" : {
                                      "type" : "string",
                                      "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                                    },
                                    "transactionCurrencyTax" : {
                                      "type" : "object",
                                      "additionalProperties" : false,
                                      "description" : "An object holding transaction tax.",
                                      "properties" : {
                                        "amount" : {
                                          "type" : "number",
                                          "description" : "Amount of tax for the transaction."
                                        }
                                      },
                                      "required" : [ "amount" ]
                                    },
                                    "taxSubtotals" : {
                                      "items" : {
                                        "type" : "object",
                                        "additionalProperties" : false,
                                        "description" : "An object holding the information about tax.",
                                        "properties" : {
                                          "currencyId" : {
                                            "type" : "string",
                                            "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                                          },
                                          "amount" : {
                                            "type" : "number",
                                            "description" : "Total amount of the taxes."
                                          },
                                          "percent" : {
                                            "type" : "number",
                                            "description" : "The tax rate for the category, expressed as a percentage."
                                          },
                                          "taxableAmount" : {
                                            "type" : "number",
                                            "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                                          },
                                          "taxCategory" : {
                                            "type" : "object",
                                            "description" : "External identifier of tax category.",
                                            "properties" : {
                                              "id" : {
                                                "type" : "string",
                                                "description" : "Identifies the tax category identifier."
                                              },
                                              "schemeId" : {
                                                "type" : "string",
                                                "description" : "Identifies the namespace of the tax category identifier."
                                              },
                                              "name" : {
                                                "type" : "string",
                                                "description" : "Tax category description."
                                              }
                                            },
                                            "required" : [ "id" ],
                                            "additionalProperties" : false
                                          }
                                        },
                                        "required" : [ "currencyId", "amount" ]
                                      }
                                    }
                                  },
                                  "required" : [ "amount", "currencyId" ]
                                }
                            },
                            "price": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "amount" : {
                                    "type" : "number",
                                    "description" : "The price of the line item."
                                  },
                                  "currencyId" : {
                                    "type" : "string",
                                    "description" : "A code that identifies the currency of the line item price. Valid values: ISO 4217 code represented as string."
                                  }
                                },
                                "required" : [ "amount", "currencyId" ]
                            },
                            "delivery": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "actualDeliveryDate" : {
                                    "type" : "string",
                                    "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
                                    "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                                  }
                                }
                            },
                            "orderLineReference": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "lineId" : {
                                    "type" : "string",
                                    "description" : "An identifier for the referenced order line, assigned by the buyer."
                                  },
                                  "orderReference" : {
                                    "type" : "string",
                                    "description" : "A reference to the order containing the referenced order line."
                                  }
                                },
                                "required" : [ "lineId" ]
                            },
                            "allowanceCharges": {
                                "additionalProperties" : false,
                                "items" : {
                                  "type" : "object",
                                  "properties" : {
                                    "changeIndicator" : {
                                      "type" : "boolean",
                                      "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
                                    },
                                    "allowanceChargeReasonCode" : {
                                      "type" : "string",
                                      "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
                                    },
                                    "allowanceChargeReason" : {
                                      "type" : "string",
                                      "description" : "The reason for this allowance or charge."
                                    },
                                    "multiplierFactorNumeric" : {
                                      "type" : "number",
                                      "description" : "The factor applied to the base amount to calculate the allowance charge."
                                    },
                                    "amount" : {
                                      "type" : "number",
                                      "description" : "The allowance charge amount."
                                    }
                                  },
                                  "required" : [ "changeIndicator", "amount" ]
                                }
                            },
                            "customFields": {
                              "items" : {
                                "type" : "object",
                                "description" : "Custom fields in the business document",
                                "properties" : {
                                  "name" : {
                                    "type" : "string",
                                    "description" : "Name of the custom field",
                                    "default" : "file"
                                  },
                                  "value" : {
                                    "type" : "string",
                                    "description" : "Value of the custom field"
                                  },
                                  "description" : {
                                    "type" : "string",
                                    "description" : "The purpose of this field"
                                  }
                                },
                                "required" : [ "name", "value" ]
                              }
                            }
                        },
                        "required": [
                            "id",
                            "lineExtension",
                            "item"
                        ]
                    }
                }
            },
            "required": [
                "externalDocumentIdentifier",
                "documentCurrencyCode",
                "issueDate",
                "accountingSupplierParty",
                "accountingCustomerParty",
                "legalMonetaryTotal",
                "invoiceLines"
            ]
        }
    },
    "required": [
        "clientToken",
        "data"
    ]
}

Response code 400 - Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.

Response example for the response code above

{
  "error": {
    "id": "c842c9c3-75e5-4c32-ae3f-c1fe250fc186",
    "type": "VALIDATION",
    "message": "Business document identifier bumId does not match the pattern :[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
    "code": "Error.004.0003",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Response code 500 - Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

Response example for the response code above

{
  "error": {
    "id": "a312a9b3-35e5-1a32-be3f-a5fe250fc121",
    "type": "TECHNICAL",
    "message": "BCN encountered an unexpected system error",
    "code": "Error.001.0006",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

You can send invoices to a recipient through Basware Commerce Network using the POST invoices method.

Request URI

https://api.basware.com/v2/invoices/{bumId}

URI Parameters

Param Name Type Required Example Description
bumId string true 6741ecc7-848a-443c-83ad-ea95e4df06fa Unique UUID for invoice

Request Headers

Param Name Required Example Description
Content-Type true application/json Specifies media types which are acceptable for the request. Value application/json is supported.
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Query Parameters

Param Name Required Example Description
action false Optional parameter to define what action will be performed. The default action is to the business document will be delivered immediately. Possible values are startDelivery (default), store.

Responses

Response code Description
201 The request has been fulfilled successfully and new resource is created on server.
400 Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
409 Conflict. The request could not be completed due to a conflict with the current state of the target resource.
415 Unsupported Media Type. The server is refusing to service the request because the payload is in an unsupported format.
500 Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

API for Credit Notes v2

CreditNotes

The Credit Note API lets you send credit notes through Basware Network to a recipient. If you need to add attachments to your credit note, you can deliver those, too, using the Files API.

GET

GET /creditNotes/{bumId} HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Response code 200 - The request has been completed successfully.

Response example for the response code above

{
  "bumId": "fedd8dec-af24-430e-8944-a056474816c2",
  "fileRefs": [
    {
      "refId": "539a583684aed4025464947d",
      "fileType": "imageFile"
    },
    {
      "refId": "516a255684aed4025464947d",
      "fileType": "attachmentFile"
    }
  ],
  "links": [
    {
      "rel": "file",
      "href": "https://api.basware.com/v2/files/539a78446842ed4025464947d",
      "method": "GET"
    },
    {
      "rel": "file",
      "href": "https://api.basware.com/v2/files/516a255684aed4025464947d",
      "method": "GET"
    }
  ],
  "origin": {
    "source": "SendingCustomer",
    "sourceContentCategory": "StructuredData",
    "sourceChannelCategory": "Electronic",
    "processQualityIndicators": [
      "ContentValidation",
      "StructuralValidation"
    ]
  },
  "data": {
    "externalDocumentIdentifier": {
      "id": "56328230"
    },
    "issueDate": "2017-05-01",
    "documentCurrencyCode": "EUR",
    "contractDocumentReferences": [
      {
      "id": "147217"
      }
    ],
    "accountingSupplierParty": {
      "partyName": "Acme Supplier Inc.",
      "postalAddress": {
        "addressLine": "1800 Main Street",
        "cityName": "Dallas",
        "postalZone": "75201",
        "countrySubentity": "TX",
        "countryId": "US"
      }
    },
    "accountingCustomerParty": {
      "partyName": "Acme Buyer N.V.",
      "postalAddress": {
        "addressLine": "Sint Gummarusstraat 53",
        "cityName": "Antwerpen",
        "postalZone": "2060",
        "countryId": "BE"
      }
    },
    "deliveryParty": {
      "partyName": "Parcels United",
      "postalAddress": {
        "addressLine": "1 Back Lane",
        "locality": "Clayton West",
        "cityName": "HUDDERSFIELD",
        "postalZone": "HD8 9PP",
        "countryId": "UK"
      }
    },
    "paymentMeans": {
      "financialAccounts": [
        {
          "financialInstitutionName": "OKOYFIHH",
          "ids": [
            {
              "id": "FI8650000110001238",
              "schemeId": "IBAN"
            }
          ]
        }
      ],
      "paymentDueDate": "2015-06-30",
      "paymentIdentifier": {
        "id": "63156783578924"
      },
      "paymentMeansCode": "31"
    },
    "taxTotal": {
      "amount": 89.56,
      "currencyId": "EUR",
      "taxSubtotals": [
        {
          "taxableAmount": 373.24,
          "amount": 89.56,
          "currencyId": "EUR",
          "percent": 24
        }
      ]
    },
    "buyerReference": {
      "id": "PO-15512324"
    },
    "legalMonetaryTotal": {
      "payableAmount": {
        "amount": 462.8,
        "currencyId": "EUR"
      }
    },
    "creditNoteLines": [
      {
        "id": "1",
        "quantity": {
          "amount": 2,
          "unitCode": "PCE"
        },
        "lineExtension": {
          "currencyId": "EUR",
          "amount": 93
        },
        "item": {
          "description": [
            "Basic High-Speed HDMI Cable - 25 Feet",
            "Supports Ethernet, 3D, 4K and Audio Return"
          ],
          "name": "High-Speed HDMI Cable",
          "taxPercent": 10,
          "sellersItem": {
            "id": "B-341"
          }
        },
        "taxTotals": [
          {
            "currencyId": "EUR",
            "amount": 17.28,
            "transactionCurrencyTax": {
              "amount": 0.9
            },
            "taxSubtotals": [
              {
                "currencyId": "EUR",
                "amount": 17.28,
                "percent": 24
              }
            ]
          }
        ]
      },
      {
        "id": "2",
        "quantity": {
          "amount": 1,
          "unitCode": "PCE"
        },
        "lineExtension": {
          "currencyId": "EUR",
          "amount": 23.1
        },
        "item": {
          "sellersItem": {
            "id": "A-532"
          },
          "taxPercent": 10
        },
        "taxTotals": [
          {
            "currencyId": "EUR",
            "amount": 5.54,
            "transactionCurrencyTax": {
              "amount": 0.9
            },
            "taxSubtotals": [
              {
                "currencyId": "EUR",
                "amount": 5.54,
                "percent": 24
              }
            ]
          }
        ]
      }
    ]
  }
}

Response schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Schema for GET /creditNotes",
  "description": "Credit note is a business document related to an invoice.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "bumId": {
      "description": "Identifies the business document (Basware Unique Message Identifier). It is an unique identifier (UUID) that can be used by external systems to identify a business document.",
      "pattern" : "^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$"
    },
    "fileRefs": {
      "items" : {
        "type" : "object",
        "additionalProperties" : false,
        "properties" : {
          "refId" : {
            "type" : "string",
            "description" : "Unique file identifier received after storing file into Basware Network."
          },
          "fileType" : {
            "type" : "string",
            "description" : "File type. Possible values are imageFile, attachmentFile and dataFile."
          }
        },
        "required" : [ "refId", "fileType" ]
      }
    },
    "links": {
      "items" : {
        "type" : "object",
        "description" : "Links related to the business document",
        "properties" : {
          "rel" : {
            "type" : "string",
            "description" : "Relation type for the URL in question. Possible values are file.",
            "default" : "file"
          },
          "href" : {
            "type" : "string",
            "description" : "Link between the completed call and a future call. The URI is a fully formed URI, which needs also the method field"
          },
          "method" : {
            "type" : "string",
            "enum" : [ "GET", "POST" ],
            "description" : "HTTP methods required to interact with the provided URL",
            "default" : "GET"
          }
        }
      }
    },
    "origin": {
      "additionalProperties" : false,
      "properties" : {
        "source" : {
          "type" : "string",
          "description" : "The originating source of the document. Possible values: SendingCustomer, ReceivingCustomer, ServiceProvider"
        },
        "sourceContentCategory" : {
          "type" : "string",
          "description" : "Indicates the source content. If the content is structured data, the data quality is higher. Possible values: Image, StructuredData, UnstructuredData"
        },
        "sourceChannelCategory" : {
          "type" : "string",
          "description" : "Indicates the source channel of the business document. Possible values: PostalMail, ElectronicMail, Electronic"
        },
        "processQualityIndicators" : {
          "type" : "array",
          "description" : "The quality phases the document has gone through",
          "items" : {
            "type" : "string",
            "description" : "Possible values: HumanSelfValidation, HumanValidation, StructuralValidation, ContentValidation"
          }
        }
      }
    },
    "data": {
      "type": "object",
      "additionalProperties": false,
      "description": "Object holding the business content of the Credit Note. Content is at some level based on Universal Business Language (UBL) standard version 2.1. It has also been extended by Basware so it is not strictly UBL.",
      "properties": {
        "externalDocumentIdentifier": {
            "description": "External system identifier of the business document. Serial number that is issued once only by invoice issuer to identify the credit note.",
            "properties" : {
              "id" : {
                "type" : "string",
                "description" : "Identifies the value."
              },
              "schemeId" : {
                "type" : "string",
                "description" : "Identifies the namespace of the id."
              }
            },
            "required" : [ "id" ],
            "additionalProperties" : false
        },
        "issueDate": {
          "type": "string",
          "description": "The date when the Credit Note was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
          "pattern": "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
        },
        "documentCurrencyCode": {
          "type": "string",
          "description": "Currency presentation of the Credit Note document. Valid values must be ISO 4217 Alpha format."
        },
        "note": {
          "type": "string",
          "description": "Free-form text pertinent to this document, conveying information that is not contained explicitly in other structures."
        },
        "allowanceCharges": {
          "additionalProperties" : false,
          "items" : {
            "type" : "object",
            "properties" : {
              "changeIndicator" : {
                "type" : "boolean",
                "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
              },
              "allowanceChargeReasonCode" : {
                "type" : "string",
                "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
              },
              "allowanceChargeReason" : {
                "type" : "string",
                "description" : "The reason for this allowance or charge."
              },
              "multiplierFactorNumeric" : {
                "type" : "number",
                "description" : "The factor applied to the base amount to calculate the allowance charge."
              },
              "amount" : {
                "type" : "number",
                "description" : "The allowance charge amount."
              }
            },
            "required" : [ "changeIndicator", "amount" ]
          }
        },
        "isIssuedAgainstOrder": {
            "type": "boolean",
            "description": "Indicates whether the business document is issued against an order."
        },
        "orderReference": {
          "description": "Order reference on the business document.",
          "additionalProperties" : false,
          "properties" : {
            "id" : {
              "type" : "string",
              "description" : "Order number reference on the business document. Identifies the referenced order assigned by the buyer."
            },
            "schemeId" : {
              "type" : "string",
              "description" : "External system specific identifier of the order system identifier element. If the source business document has any matching element, it should be used."
            },
            "customerReference" : {
              "type" : "string",
              "description" : "Customer Reference Identifier (CRI) when using a purchasing card."
            },
            "salesOrderId" : {
              "type" : "string",
              "description" : "Sales order identifier."
            }
          },
          "required" : [ "id" ]
        },
        "billingReference": {
          "description": "External system identifier object for the billing entity referenced by the business document.",
          "additionalProperties" : false,
          "properties" : {
            "id" : {
              "type" : "string",
              "description" : "External system identifier of the billing entity referenced by the Business Document."
            },
            "schemeId" : {
              "type" : "string",
              "description" : "External system specific identifier of the billing reference system identifier element. If the source business document has any matching element, it should be used."
            }
          },
          "required" : [ "id" ]
        },
        "contractDocumentReferences": {
          "description": "External system identifiers for the contracts referenced by the business document.",
          "items" : {
            "type" : "object",
            "additionalProperties" : false,
            "properties" : {
              "id" : {
                "type" : "string",
                "description" : "External system identifier of the contract referenced by the Business Document (i.e. buyers contract number). Mandatory field if the customer demands that the goods or services invoiced refer to a contract number defined by the customer to which he wants to assign the Business Document. Is demanded for example in service and maintenance agreements for which there is generally no explicit order."
              },
              "schemeId" : {
                "type" : "string",
                "description" : "External system specific identifier of the contract system identifier element. If the source business document has any matching element, it should be used."
              }
            },
            "required" : [ "id" ]
          }
        },
        "additionalDocumentReference": {
          "description": "A reference to an additional document associated with this document. Used for example to reference to an Invoice from Credit Note.",
          "additionalProperties" : false,
          "properties" : {
            "id" : {
              "type" : "string",
              "description" : "An identifier for the referenced document (i.e. bumid)."
            },
            "schemeId" : {
              "type" : "string",
              "description" : "External system specific identifier of the invoicing system identifier element. If the source business document has any matching element, it should be used."
            },
            "issueDate" : {
              "type" : "string",
              "description" : "Date when the referenced document was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
              "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            },
            "typeCode" : {
              "type" : "string",
              "description" : "The type of document being referenced, expressed as a code, for example to reference to an Invoice document, code is 380."
            }
          },
          "required" : [ "id" ]
        },
        "accountingSupplierParty": {
          "description": "Party that is the accountable supplier of the goods/services in the referred business document.",
          "properties" : {
            "endpoint" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                }
              },
              "required" : [ "id" ]
            },
            "partyIdentifications" : {
              "type" : "array",
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "items" : {
                "type" : "object",
                "description" : "An object holding a party identification.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "An object holding the external system identifier of the party."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              }
            },
            "partyName" : {
              "type" : "string",
              "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
            },
            "postalAddress" : {
              "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
              "properties" : {
                "cityName" : {
                  "type" : "string",
                  "description" : "The name of the city, town or village in the postal address of the party."
                },
                "postalZone" : {
                  "type" : "string",
                  "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                },
                "addressLine" : {
                  "type" : "string",
                  "description" : "The address line of the postal address of the party."
                },
                "addressLine2" : {
                  "type" : "string",
                  "description" : "The second address line of the postal address of the party."
                },
                "addressLine3" : {
                  "type" : "string",
                  "description" : "The third address line of the postal address of the party."
                },
                "locality" : {
                  "type" : "string",
                  "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                },
                "countrySubentity" : {
                  "type" : "string",
                  "description" : "The sub-entity of the area in the postal address."
                },
                "countryId" : {
                  "type" : "string",
                  "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                }
              },
              "additionalProperties" : false
            },
            "partyTaxScheme" : {
              "type" : "object",
              "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
              "properties" : {
                "company" : {
                  "type" : "object",
                  "description" : "Information about the company taxes.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                    }
                  },
                  "additionalProperties" : false
                }
              },
              "additionalProperties" : false
            },
            "contact" : {
              "type" : "object",
              "description" : "An object containing information about contacts. Used for defining the company contact data",
              "properties" : {
                "name" : {
                  "type" : "string",
                  "description" : "A contact name of the party."
                },
                "telephone" : {
                  "type" : "string",
                  "description" : "A telephone number of the contact of the party."
                },
                "telefax" : {
                  "type" : "string",
                  "description" : "A fax number of the contact of the party."
                },
                "electronicMail" : {
                  "type" : "string",
                  "description" : "An email of the contact of the party."
                }
              },
              "additionalProperties" : false
            }
          },
          "required" : [ "partyName" ],
          "additionalProperties" : false
        },
        "accountingCustomerParty": {
          "description": "Party that is the accountable buyer of the goods/services in the referred business document.",
          "properties" : {
            "endpoint" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                }
              },
              "required" : [ "id" ]
            },
            "partyIdentifications" : {
              "type" : "array",
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "items" : {
                "type" : "object",
                "description" : "An object holding a party identification.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "An object holding the external system identifier of the party."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              }
            },
            "partyName" : {
              "type" : "string",
              "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
            },
            "postalAddress" : {
              "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
              "properties" : {
                "cityName" : {
                  "type" : "string",
                  "description" : "The name of the city, town or village in the postal address of the party."
                },
                "postalZone" : {
                  "type" : "string",
                  "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                },
                "addressLine" : {
                  "type" : "string",
                  "description" : "The address line of the postal address of the party."
                },
                "addressLine2" : {
                  "type" : "string",
                  "description" : "The second address line of the postal address of the party."
                },
                "addressLine3" : {
                  "type" : "string",
                  "description" : "The third address line of the postal address of the party."
                },
                "locality" : {
                  "type" : "string",
                  "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                },
                "countrySubentity" : {
                  "type" : "string",
                  "description" : "The sub-entity of the area in the postal address."
                },
                "countryId" : {
                  "type" : "string",
                  "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                }
              },
              "additionalProperties" : false
            },
            "partyTaxScheme" : {
              "type" : "object",
              "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
              "properties" : {
                "company" : {
                  "type" : "object",
                  "description" : "Information about the company taxes.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                    }
                  },
                  "additionalProperties" : false
                }
              },
              "additionalProperties" : false
            },
            "contact" : {
              "type" : "object",
              "description" : "An object containing information about contacts. Used for defining the company contact data",
              "properties" : {
                "name" : {
                  "type" : "string",
                  "description" : "A contact name of the party."
                },
                "telephone" : {
                  "type" : "string",
                  "description" : "A telephone number of the contact of the party."
                },
                "telefax" : {
                  "type" : "string",
                  "description" : "A fax number of the contact of the party."
                },
                "electronicMail" : {
                  "type" : "string",
                  "description" : "An email of the contact of the party."
                }
              },
              "additionalProperties" : false
            }
          },
          "required" : [ "partyName" ],
          "additionalProperties" : false
        },
        "buyerCustomerParty": {
            "description": "Party that is the buyer of the goods/services in the referred business document.",
            "properties" : {
              "endpoint" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                  }
                },
                "required" : [ "id" ]
              },
              "partyIdentifications" : {
                "type" : "array",
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "items" : {
                  "type" : "object",
                  "description" : "An object holding a party identification.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "An object holding the external system identifier of the party."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the id identifier element."
                    }
                  },
                  "required" : [ "id" ],
                  "additionalProperties" : false
                }
              },
              "partyName" : {
                "type" : "string",
                "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
              },
              "postalAddress" : {
                "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                "properties" : {
                  "cityName" : {
                    "type" : "string",
                    "description" : "The name of the city, town or village in the postal address of the party."
                  },
                  "postalZone" : {
                    "type" : "string",
                    "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                  },
                  "addressLine" : {
                    "type" : "string",
                    "description" : "The address line of the postal address of the party."
                  },
                  "addressLine2" : {
                    "type" : "string",
                    "description" : "The second address line of the postal address of the party."
                  },
                  "addressLine3" : {
                    "type" : "string",
                    "description" : "The third address line of the postal address of the party."
                  },
                  "locality" : {
                    "type" : "string",
                    "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                  },
                  "countrySubentity" : {
                    "type" : "string",
                    "description" : "The sub-entity of the area in the postal address."
                  },
                  "countryId" : {
                    "type" : "string",
                    "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                  }
                },
                "additionalProperties" : false
              },
              "partyTaxScheme" : {
                "type" : "object",
                "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                "properties" : {
                  "company" : {
                    "type" : "object",
                    "description" : "Information about the company taxes.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                      }
                    },
                    "additionalProperties" : false
                  }
                },
                "additionalProperties" : false
              },
              "contact" : {
                "type" : "object",
                "description" : "An object containing information about contacts. Used for defining the company contact data",
                "properties" : {
                  "name" : {
                    "type" : "string",
                    "description" : "A contact name of the party."
                  },
                  "telephone" : {
                    "type" : "string",
                    "description" : "A telephone number of the contact of the party."
                  },
                  "telefax" : {
                    "type" : "string",
                    "description" : "A fax number of the contact of the party."
                  },
                  "electronicMail" : {
                    "type" : "string",
                    "description" : "An email of the contact of the party."
                  }
                },
                "additionalProperties" : false
              }
            },
            "required" : [ "partyName" ],
            "additionalProperties" : false
        },
        "sellerSupplierParty": {
            "description": "Party that is the supplier of the goods/services in the referred business document.",
            "properties" : {
              "endpoint" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                  }
                },
                "required" : [ "id" ]
              },
              "partyIdentifications" : {
                "type" : "array",
                "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                "items" : {
                  "type" : "object",
                  "description" : "An object holding a party identification.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "An object holding the external system identifier of the party."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the id identifier element."
                    }
                  },
                  "required" : [ "id" ],
                  "additionalProperties" : false
                }
              },
              "partyName" : {
                "type" : "string",
                "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
              },
              "postalAddress" : {
                "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                "properties" : {
                  "cityName" : {
                    "type" : "string",
                    "description" : "The name of the city, town or village in the postal address of the party."
                  },
                  "postalZone" : {
                    "type" : "string",
                    "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                  },
                  "addressLine" : {
                    "type" : "string",
                    "description" : "The address line of the postal address of the party."
                  },
                  "addressLine2" : {
                    "type" : "string",
                    "description" : "The second address line of the postal address of the party."
                  },
                  "addressLine3" : {
                    "type" : "string",
                    "description" : "The third address line of the postal address of the party."
                  },
                  "locality" : {
                    "type" : "string",
                    "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                  },
                  "countrySubentity" : {
                    "type" : "string",
                    "description" : "The sub-entity of the area in the postal address."
                  },
                  "countryId" : {
                    "type" : "string",
                    "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                  }
                },
                "additionalProperties" : false
              },
              "partyTaxScheme" : {
                "type" : "object",
                "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                "properties" : {
                  "company" : {
                    "type" : "object",
                    "description" : "Information about the company taxes.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                      }
                    },
                    "additionalProperties" : false
                  }
                },
                "additionalProperties" : false
              },
              "contact" : {
                "type" : "object",
                "description" : "An object containing information about contacts. Used for defining the company contact data",
                "properties" : {
                  "name" : {
                    "type" : "string",
                    "description" : "A contact name of the party."
                  },
                  "telephone" : {
                    "type" : "string",
                    "description" : "A telephone number of the contact of the party."
                  },
                  "telefax" : {
                    "type" : "string",
                    "description" : "A fax number of the contact of the party."
                  },
                  "electronicMail" : {
                    "type" : "string",
                    "description" : "An email of the contact of the party."
                  }
                },
                "additionalProperties" : false
              }
            },
            "required" : [ "partyName" ],
            "additionalProperties" : false
        },
        "delivery": {
          "description": "Delivery details.",
          "additionalProperties" : false,
          "properties" : {
            "actualDeliveryDate" : {
              "type" : "string",
              "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
              "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            }
          }
        },
        "deliveryParty": {
          "description": "Party that is responsible for the delivery of the goods/services in the referred business document.",
          "properties" : {
            "endpoint" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                }
              },
              "required" : [ "id" ]
            },
            "partyIdentifications" : {
              "type" : "array",
              "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
              "items" : {
                "type" : "object",
                "description" : "An object holding a party identification.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "An object holding the external system identifier of the party."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "External global identifier of the id identifier element."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              }
            },
            "partyName" : {
              "type" : "string",
              "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
            },
            "postalAddress" : {
              "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
              "properties" : {
                "cityName" : {
                  "type" : "string",
                  "description" : "The name of the city, town or village in the postal address of the party."
                },
                "postalZone" : {
                  "type" : "string",
                  "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                },
                "addressLine" : {
                  "type" : "string",
                  "description" : "The address line of the postal address of the party."
                },
                "addressLine2" : {
                  "type" : "string",
                  "description" : "The second address line of the postal address of the party."
                },
                "addressLine3" : {
                  "type" : "string",
                  "description" : "The third address line of the postal address of the party."
                },
                "locality" : {
                  "type" : "string",
                  "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                },
                "countrySubentity" : {
                  "type" : "string",
                  "description" : "The sub-entity of the area in the postal address."
                },
                "countryId" : {
                  "type" : "string",
                  "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                }
              },
              "additionalProperties" : false
            },
            "partyTaxScheme" : {
              "type" : "object",
              "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
              "properties" : {
                "company" : {
                  "type" : "object",
                  "description" : "Information about the company taxes.",
                  "properties" : {
                    "id" : {
                      "type" : "string",
                      "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                    },
                    "schemeId" : {
                      "type" : "string",
                      "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                    }
                  },
                  "additionalProperties" : false
                }
              },
              "additionalProperties" : false
            },
            "contact" : {
              "type" : "object",
              "description" : "An object containing information about contacts. Used for defining the company contact data",
              "properties" : {
                "name" : {
                  "type" : "string",
                  "description" : "A contact name of the party."
                },
                "telephone" : {
                  "type" : "string",
                  "description" : "A telephone number of the contact of the party."
                },
                "telefax" : {
                  "type" : "string",
                  "description" : "A fax number of the contact of the party."
                },
                "electronicMail" : {
                  "type" : "string",
                  "description" : "An email of the contact of the party."
                }
              },
              "additionalProperties" : false
            }
          },
          "required" : [ "partyName" ],
          "additionalProperties" : false
        },
        "paymentMeans": {
          "description": "An object holding the available payment means.",
          "additionalProperties" : false,
          "properties" : {
            "paymentMeansCode" : {
              "type" : "string",
              "description" : "A code that identifies how the payment can be done. Valid values: UN/ECE 4461 code represented as string."
            },
            "paymentDueDate" : {
              "type" : "string",
              "description" : "Date when the business document is due for the payment means. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
              "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            },
            "paymentReferenceMessage" : {
              "type" : "string",
              "description" : "A payment reference message. This can be a free text describing the payment."
            },
            "paymentIdentifier" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An identifier for a payment made using this means of payment.",
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "The id value of payment identifier."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "Scheme which identifies the type of payment identifier. Possible values are SPY, ISO."
                }
              },
              "required" : [ "id" ]
            },
            "financialAccounts" : {
              "type" : "array",
              "description" : "Array holding the financial account data",
              "items" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "Object holding the financial account data",
                "properties" : {
                  "financialInstitutionName" : {
                    "type" : "string",
                    "description" : "The name of financial institution."
                  },
                  "financialInstitutionId" : {
                    "type" : "string",
                    "description" : "Identifier of financial institution."
                  },
                  "financialInstitutionIdSchemeId" : {
                    "type" : "string",
                    "description" : "The external identifier of the financial institution id identifier element."
                  },
                  "financialInstitutionBranchId" : {
                    "type" : "string",
                    "description" : "The identifier of financial institution branch, for example 342-085. This field is typically used by institutions in Australia and New Zealand."
                  },
                  "financialInstitutionBranchSchemeId" : {
                    "type" : "string",
                    "description" : "The scheme identifier of financial institution branch. For example for an Australian institutions, possible scheme is BSB."
                  },
                  "ids" : {
                    "type" : "array",
                    "description" : "Array holding ids",
                    "items" : {
                      "type" : "object",
                      "additionalProperties" : false,
                      "description" : "Object holding identifier data",
                      "properties" : {
                        "id" : {
                          "type" : "string",
                          "description" : "Identifier."
                        },
                        "schemeId" : {
                          "type" : "string",
                          "description" : "External identifier."
                        }
                      },
                      "required" : [ "id" ]
                    }
                  },
                  "accounting" : {
                    "type" : "object",
                    "title" : "Accounting",
                    "description" : "Accounting related content.",
                    "properties" : {
                      "virtualBankBarcode" : {
                        "type" : "object",
                        "title" : "VirtualBankBarcode",
                        "description" : "Virtual bar code can be added to the business document that should be printed.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "title" : "Virtual bank bar code",
                            "description" : "Identifier of the virtual bar code. "
                          },
                          "schemeId" : {
                            "type" : "string",
                            "title" : "SchemeId for virtual bank bar code",
                            "description" : "Scheme identifier of the virtual bank bar code, typically country code according to ISO3166-1 alpha-2. Possible values: FI"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required" : [ "paymentMeansCode" ]
        },
        "paymentTerms": {
          "description": "Available payment terms.",
          "additionalProperties" : false,
          "properties" : {
            "settlementPeriod" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An object holding the settlement period dates.",
              "properties" : {
                "startDate" : {
                  "type" : "string",
                  "description" : "Date when the payment terms starts. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                  "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                },
                "endDate" : {
                  "type" : "string",
                  "description" : "Date when the payment terms ends. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                  "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                }
              }
            },
            "note" : {
              "type" : "string",
              "description" : "Free-form text applying to the payment terms. This field may contain notes or any other similar information that is not contained explicitly in another structure."
            },
            "penaltySurchargePercent" : {
              "type" : "number",
              "description" : "Penalty surcharge percent amount."
            }
          }
        },
        "taxTotal": {
          "additionalProperties" : false,
          "properties" : {
            "currencyId" : {
              "type" : "string",
              "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
            },
            "amount" : {
              "type" : "number",
              "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
            },
            "taxSubtotals" : {
              "items" : {
                "type" : "object",
                "additionalProperties" : false,
                "description" : "An object holding the information about tax.",
                "properties" : {
                  "currencyId" : {
                    "type" : "string",
                    "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                  },
                  "amount" : {
                    "type" : "number",
                    "description" : "Total amount of the taxes."
                  },
                  "percent" : {
                    "type" : "number",
                    "description" : "The tax rate for the category, expressed as a percentage."
                  },
                  "taxableAmount" : {
                    "type" : "number",
                    "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                  },
                  "taxCategory" : {
                    "type" : "object",
                    "description" : "External identifier of tax category.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Identifies the tax category identifier."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "Identifies the namespace of the tax category identifier."
                      },
                      "name" : {
                        "type" : "string",
                        "description" : "Tax category description."
                      }
                    },
                    "required" : [ "id" ],
                    "additionalProperties" : false
                  }
                },
                "required" : [ "currencyId", "amount" ]
              }
            }
          },
          "required" : [ "currencyId", "amount" ]
        },
        "legalMonetaryTotal": {
          "additionalProperties" : false,
          "properties" : {
            "lineExtensionAmount" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An object holding total amount of line extensions.",
              "properties" : {
                "currencyId" : {
                  "type" : "string",
                  "description" : "A code that identifies the currency of the total line extension amount. Valid values: ISO 4217 code represented as string."
                },
                "amount" : {
                  "type" : "number",
                  "description" : "Total amount of line extensions."
                }
              },
              "required" : [ "currencyId", "amount" ]
            },
            "payableAmount" : {
              "type" : "object",
              "additionalProperties" : false,
              "description" : "An object holding total payable amount of line extensions.",
              "properties" : {
                "currencyId" : {
                  "type" : "string",
                  "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                },
                "amount" : {
                  "type" : "number",
                  "description" : "The total amount to be paid."
                }
              },
              "required" : [ "currencyId", "amount" ]
            }
          },
          "required" : [ "payableAmount" ]
        },
        "buyerReference": {
          "description": "Buyer reference in the business document.",
          "additionalProperties" : false,
          "properties" : {
            "id" : {
              "type" : "string",
              "description" : "The id value of the buyer reference"
            }
          },
          "required" : [ "id" ]
        },
        "customFields": {
          "items" : {
            "type" : "object",
            "description" : "Custom fields in the business document",
            "properties" : {
              "name" : {
                "type" : "string",
                "description" : "Name of the custom field",
                "default" : "file"
              },
              "value" : {
                "type" : "string",
                "description" : "Value of the custom field"
              },
              "description" : {
                "type" : "string",
                "description" : "The purpose of this field"
              }
            },
            "required" : [ "name", "value" ]
          }
        },
        "creditNoteLines": {
          "type": "array",
          "description": "An array holding the Credit Note lines.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "description": "A credit note line",
            "properties": {
              "id": {
                "type": "string",
                "description": "External system identifier for the Credit Note line."
              },
              "quantity": {
                "additionalProperties" : false,
                "properties" : {
                  "amount" : {
                    "type" : "number",
                    "description" : "The quantity of the target Business Document line items."
                  },
                  "unitCode" : {
                    "type" : "string",
                    "description" : "The unit code of the quantity of the target Business Document line item. Valid values: UN/ECE CEFACT Trade Facilitation Recommendation No.20 common code value represented as string."
                  }
                }
              },
              "serviceIndicator": {
                "type": "boolean",
                "description": "Flag indicating whether the line represents goods or services (true if services, false if goods)."
              },
              "lineExtension": {
                "additionalProperties" : false,
                "properties" : {
                  "currencyId" : {
                    "type" : "string",
                    "description" : "The currency of the amount."
                  },
                  "amount" : {
                    "type" : "number",
                    "description" : "The total amount for the line item, including allowance charges but net of taxes."
                  }
                },
                "required" : [ "currencyId", "amount" ]
              },
              "item": {
                "additionalProperties" : false,
                "properties" : {
                  "description" : {
                    "type" : "array",
                    "description" : "An array holding the descriptions of the Business Document line items.",
                    "items" : {
                      "type" : "string",
                      "description" : "Description of the Business Document line item."
                    }
                  },
                  "name" : {
                    "type" : "string",
                    "description" : "Name of the Business Document line item.  A short name optionally given to an item, such as a name from a catalogue, as distinct from a description."
                  },
                  "taxPercent" : {
                    "type" : "number",
                    "description" : "Tax amount for the item"
                  },
                  "sellersItem" : {
                    "type" : "object",
                    "additionalProperties" : false,
                    "description" : "An object holding a identification of the Business Documents line item as it is in sellers system.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Id of the Business Document line item as it is in sellers system."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External system specific identifier of the sellers item identifier element. If the source business document has any matching element, it should be used."
                      }
                    },
                    "required" : [ "id" ]
                  }
                }
              },
              "taxTotals": {
                "items" : {
                  "type" : "object",
                  "additionalProperties" : false,
                  "description" : "An object holding the information about tax.",
                  "properties" : {
                    "amount" : {
                      "type" : "number",
                      "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
                    },
                    "currencyId" : {
                      "type" : "string",
                      "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                    },
                    "transactionCurrencyTax" : {
                      "type" : "object",
                      "additionalProperties" : false,
                      "description" : "An object holding transaction tax.",
                      "properties" : {
                        "amount" : {
                          "type" : "number",
                          "description" : "Amount of tax for the transaction."
                        }
                      },
                      "required" : [ "amount" ]
                    },
                    "taxSubtotals" : {
                      "items" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding the information about tax.",
                        "properties" : {
                          "currencyId" : {
                            "type" : "string",
                            "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                          },
                          "amount" : {
                            "type" : "number",
                            "description" : "Total amount of the taxes."
                          },
                          "percent" : {
                            "type" : "number",
                            "description" : "The tax rate for the category, expressed as a percentage."
                          },
                          "taxableAmount" : {
                            "type" : "number",
                            "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                          },
                          "taxCategory" : {
                            "type" : "object",
                            "description" : "External identifier of tax category.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "Identifies the tax category identifier."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "Identifies the namespace of the tax category identifier."
                              },
                              "name" : {
                                "type" : "string",
                                "description" : "Tax category description."
                              }
                            },
                            "required" : [ "id" ],
                            "additionalProperties" : false
                          }
                        },
                        "required" : [ "currencyId", "amount" ]
                      }
                    }
                  },
                  "required" : [ "amount", "currencyId" ]
                }
              },
              "price": {
                "additionalProperties" : false,
                "properties" : {
                  "amount" : {
                    "type" : "number",
                    "description" : "The price of the line item."
                  },
                  "currencyId" : {
                    "type" : "string",
                    "description" : "A code that identifies the currency of the line item price. Valid values: ISO 4217 code represented as string."
                  }
                },
                "required" : [ "amount", "currencyId" ]
              },
              "delivery": {
                "additionalProperties" : false,
                "properties" : {
                  "actualDeliveryDate" : {
                    "type" : "string",
                    "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
                    "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                  }
                }
              },
              "orderLineReference": {
                "additionalProperties" : false,
                "properties" : {
                  "lineId" : {
                    "type" : "string",
                    "description" : "An identifier for the referenced order line, assigned by the buyer."
                  },
                  "orderReference" : {
                    "type" : "string",
                    "description" : "A reference to the order containing the referenced order line."
                  }
                },
                "required" : [ "lineId" ]
              },
              "allowanceCharges": {
                "additionalProperties" : false,
                "items" : {
                  "type" : "object",
                  "properties" : {
                    "changeIndicator" : {
                      "type" : "boolean",
                      "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
                    },
                    "allowanceChargeReasonCode" : {
                      "type" : "string",
                      "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
                    },
                    "allowanceChargeReason" : {
                      "type" : "string",
                      "description" : "The reason for this allowance or charge."
                    },
                    "multiplierFactorNumeric" : {
                      "type" : "number",
                      "description" : "The factor applied to the base amount to calculate the allowance charge."
                    },
                    "amount" : {
                      "type" : "number",
                      "description" : "The allowance charge amount."
                    }
                  },
                  "required" : [ "changeIndicator", "amount" ]
                }
              },
              "customFields": {
                "items" : {
                  "type" : "object",
                  "description" : "Custom fields in the business document",
                  "properties" : {
                    "name" : {
                      "type" : "string",
                      "description" : "Name of the custom field",
                      "default" : "file"
                    },
                    "value" : {
                      "type" : "string",
                      "description" : "Value of the custom field"
                    },
                    "description" : {
                      "type" : "string",
                      "description" : "The purpose of this field"
                    }
                  },
                  "required" : [ "name", "value" ]
                }
              }
            },
            "required": [
              "id",
              "item"
            ]
          }
        }
      },
      "required": [
        "externalDocumentIdentifier",
        "issueDate",
        "accountingSupplierParty",
        "accountingCustomerParty",
        "legalMonetaryTotal",
        "creditNoteLines"
      ]
    }
  },
  "required": [
    "bumId",
    "data"
  ]
}

Response code 400 - Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.

Response example for the response code above

{
  "error": {
    "id": "c842c9c3-75e5-4c32-ae3f-c1fe250fc186",
    "type": "VALIDATION",
    "message": "Business document identifier bumId does not match the pattern :[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
    "code": "Error.004.0003",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Response code 500 - Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

Response example for the response code above

{
  "error": {
    "id": "a312a9b3-35e5-1a32-be3f-a5fe250fc121",
    "type": "TECHNICAL",
    "message": "BCN encountered an unexpected system error",
    "code": "Error.001.0006",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

You can retrieve the credit note contents using GET /creditNotes method. Basware Unique Message Identifier (bumid) defines which credit note you want to retrieve.

Request URI

https://api.basware.com/v2/creditNotes/{bumId}

URI Parameters

Param Name Type Required Example Description
bumId string true 8da06e38-6737-48ee-893b-741ff4b22354 Unique UUID for business document

Request Headers

Param Name Required Example Description
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Responses

Response code Description
200 The request has been completed successfully.
400 Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
500 Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

POST

POST /creditNotes/{bumId} HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Request example

{
  "clientToken": "1bs37857-64fr-34g4-67f0-32dd536fgj32",
  "fileRefs": [
    {
      "refId": "16a2a23ff75e42a6bc673fa3b"
    }
  ],
  "processingPreference": {
    "sendTo": {
      "id": "0612065012",
      "schemeId": "BE:ORGNR"
    },
    "receiveFrom": {
      "id": "114823943023440",
      "schemeId": "ISO6523-ACTORID-UPIS"
    },
    "printingPreference": "PrintingAllowed"
  },
  "data": {
    "externalDocumentIdentifier": {
      "id": "56328230"
    },
    "issueDate": "2017-05-09",
    "documentCurrencyCode": "EUR",
    "contractDocumentReferences": [
      {
        "id": "267212"
      }
    ],
    "accountingSupplierParty": {
      "partyName": "Acme Supplier Inc.",
      "postalAddress": {
        "addressLine": "1800 Main Street",
        "cityName": "Dallas",
        "postalZone": "75201",
        "countrySubentity": "TX",
        "countryId": "US"
      }
    },
    "accountingCustomerParty": {
      "partyName": "Acme Buyer N.V.",
      "postalAddress": {
        "addressLine": "Sint Gummarusstraat 53",
        "cityName": "Antwerpen",
        "postalZone": "2060",
        "countryId": "BE"
      }
    },
    "deliveryParty": {
      "partyName": "Parcels United",
      "postalAddress": {
        "addressLine": "1 Back Lane",
        "locality": "Clayton West",
        "cityName": "HUDDERSFIELD",
        "postalZone": "HD8 9PP",
        "countryId": "UK"
      }
    },
    "paymentMeans": {
      "paymentDueDate": "2017-06-30",
      "paymentIdentifier": {
        "id": "63156783578924"
      },
      "paymentMeansCode": "31",
      "financialAccounts": [
        {
          "financialInstitutionName": "BARCGB22",
          "ids": [
            {
              "id": "GB54BARC20992012345678",
              "schemeId": "IBAN"
            }
          ]
        }
      ]
    },
    "buyerReference": {
      "id": "PO-156345"
    },
    "taxTotal": {
      "amount": 89.56,
      "currencyId": "EUR",
      "taxSubtotals": [
        {
          "taxableAmount": 373.24,
          "amount": 89.56,
          "currencyId": "EUR",
          "percent": 24
        }
      ]
    },
    "legalMonetaryTotal": {
      "payableAmount": {
        "amount": 462.8,
        "currencyId": "EUR"
      }
    },
    "creditNoteLines": [
      {
        "id": "1",
        "quantity": {
          "amount": 2,
          "unitCode": "PCE"
        },
        "lineExtension": {
          "currencyId": "EUR",
          "amount": 93
        },
        "item": {
          "description": [
            "Basic High-Speed HDMI Cable - 25 Feet",
            "Supports Ethernet, 3D, 4K and Audio Return"
          ],
          "name": "High-Speed HDMI Cable",
          "taxPercent": 10,
          "sellersItem": {
            "id": "B-341"
          }
        },
        "taxTotals": [
          {
            "currencyId": "EUR",
            "amount": 17.28,
            "transactionCurrencyTax": {
              "amount": 0.9
            },
            "taxSubtotals": [
              {
                "currencyId": "EUR",
                "amount": 17.28,
                "percent": 24
              }
            ]
          }
        ]
      },
      {
        "id": "2",
        "quantity": {
          "amount": 1,
          "unitCode": "PCE"
        },
        "lineExtension": {
          "currencyId": "EUR",
          "amount": 23.1
        },
        "item": {
          "sellersItem": {
            "id": "A-532"
          },
          "taxPercent": 10
        },
        "taxTotals": [
          {
            "currencyId": "EUR",
            "amount": 5.54,
            "transactionCurrencyTax": {
              "amount": 0.9
            },
            "taxSubtotals": [
              {
                "currencyId": "EUR",
                "amount": 5.54,
                "percent": 24
              }
            ]
          }
        ]
      }
    ]
  }
}

Request schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Schema for POST /creditNotes",
    "description": "Credit note is a business document related to an invoice.",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "clientToken": {
            "type": "string",
            "description": "Token generated by client (uuid). Used to verify that specific Credit Note is only sent and processed once, if response time-outs, retry should be executed with the same clientToken."
        },
        "fileRefs": {
            "type": "array",
            "description": "Credit Note file/attachment reference identifiers.",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "refId": {
                        "type": "string",
                        "description": "Unique file identifier received after storing file into Basware Network."
                    }
                },
                "required": [
                    "refId"
                ]
            }
        },
        "processingPreference": {
            "additionalProperties" : false,
            "properties" : {
              "sendTo" : {
                "description" : "Identifier for the recipient endpoint. See API documentation for more details about recipient endpoints.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifies the value."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "Identifies the namespace of the id."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              },
              "receiveFrom" : {
                "description" : "Identifier for the sender endpoint.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifies the value."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "Identifies the namespace of the id."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              },
              "replyTo" : {
                "description" : "Identifier for the reply to endpoint.",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "Identifies the value."
                  },
                  "schemeId" : {
                    "type" : "string",
                    "description" : "Identifies the namespace of the id."
                  }
                },
                "required" : [ "id" ],
                "additionalProperties" : false
              },
              "sendToServiceProvider" : {
                "type" : "string",
                "description" : "Identifier for the intermediate service provider."
              },
              "printingPreference" : {
                "type" : "string",
                "enum" : [ "PrintingAllowed", "PrintingAlways", "NoPrinting" ],
                "description" : "Indicates the printing preference. This optional field can be specified to allow printing delivery with PrintingAllowed or force the document to be delived by printing with PrintingAlways. If this field is not specified, delivery will be by eInvoicing. Note that this field cannot be used together with sendToServiceProvider. Only one of these two fields can be given at the same time."
              },
              "recipientNotificationPreference" : {
                "type" : "string",
                "description" : "Indicates how the recipient is notified about the business document delivery. Possible values are EmailWithLoginLink, EmailWithSecuredLink, EmailWithContent, NotificationViaThirdParty."
              },
              "isConsumerRecipient" : {
                "type" : "boolean",
                "description" : "Indicates whether the recipient is a consumer recipient."
              }
            },
            "required" : [ "sendTo" ]
        },
        "data": {
            "type": "object",
            "additionalProperties": false,
            "description": "Object holding the business content of the Credit Note. Content is at some level based on Universal Business Language (UBL) standard version 2.1. It has also been extended by Basware so it is not strictly UBL.",
            "properties": {
                "externalDocumentIdentifier": {
                    "description": "External system identifier of the business document. Serial number that is issued once only by invoice issuer to identify the credit note.",
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Identifies the value."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "Identifies the namespace of the id."
                      }
                    },
                    "required" : [ "id" ],
                    "additionalProperties" : false
                },
                "issueDate": {
                    "type": "string",
                    "description": "The date when the Credit Note was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                    "pattern": "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                },
                "documentCurrencyCode": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3,
                    "description": "Currency presentation of the Credit Note document. Valid values must be ISO 4217 Alpha format."
                },
                "note": {
                    "type": "string",
                    "description": "Free-form text pertinent to this document, conveying information that is not contained explicitly in other structures."
                },
                "allowanceCharges": {
                    "additionalProperties" : false,
                    "items" : {
                      "type" : "object",
                      "properties" : {
                        "changeIndicator" : {
                          "type" : "boolean",
                          "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
                        },
                        "allowanceChargeReasonCode" : {
                          "type" : "string",
                          "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
                        },
                        "allowanceChargeReason" : {
                          "type" : "string",
                          "description" : "The reason for this allowance or charge."
                        },
                        "multiplierFactorNumeric" : {
                          "type" : "number",
                          "description" : "The factor applied to the base amount to calculate the allowance charge."
                        },
                        "amount" : {
                          "type" : "number",
                          "description" : "The allowance charge amount."
                        }
                      },
                      "required" : [ "changeIndicator", "amount" ]
                    }
                },
                "isIssuedAgainstOrder": {
                    "type": "boolean",
                    "description": "Indicates whether the business document is issued against an order."
                },
                "orderReference": {
                    "description": "Order reference on the business document.",
                    "additionalProperties" : false,
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "Order number reference on the business document. Identifies the referenced order assigned by the buyer."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External system specific identifier of the order system identifier element. If the source business document has any matching element, it should be used."
                      },
                      "customerReference" : {
                        "type" : "string",
                        "description" : "Customer Reference Identifier (CRI) when using a purchasing card."
                      },
                      "salesOrderId" : {
                        "type" : "string",
                        "description" : "Sales order identifier."
                      }
                    },
                    "required" : [ "id" ]
                },
                "billingReference": {
                    "description": "External system identifier object for the billing entity referenced by the business document.",
                    "additionalProperties" : false,
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "External system identifier of the billing entity referenced by the Business Document."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External system specific identifier of the billing reference system identifier element. If the source business document has any matching element, it should be used."
                      }
                    },
                    "required" : [ "id" ]
                },
                "contractDocumentReferences": {
                    "description": "External system identifiers for the contracts referenced by the business document.",
                    "items" : {
                      "type" : "object",
                      "additionalProperties" : false,
                      "properties" : {
                        "id" : {
                          "type" : "string",
                          "description" : "External system identifier of the contract referenced by the Business Document (i.e. buyers contract number). Mandatory field if the customer demands that the goods or services invoiced refer to a contract number defined by the customer to which he wants to assign the Business Document. Is demanded for example in service and maintenance agreements for which there is generally no explicit order."
                        },
                        "schemeId" : {
                          "type" : "string",
                          "description" : "External system specific identifier of the contract system identifier element. If the source business document has any matching element, it should be used."
                        }
                      },
                      "required" : [ "id" ]
                    }
                },
                "additionalDocumentReference": {
                  "description": "A reference to an additional document associated with this document. Used for example to reference to an Invoice from Credit Note.",
                    "additionalProperties" : false,
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "An identifier for the referenced document (i.e. bumid)."
                      },
                      "schemeId" : {
                        "type" : "string",
                        "description" : "External system specific identifier of the invoicing system identifier element. If the source business document has any matching element, it should be used."
                      },
                      "issueDate" : {
                        "type" : "string",
                        "description" : "Date when the referenced document was issued. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                        "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                      },
                      "typeCode" : {
                        "type" : "string",
                        "description" : "The type of document being referenced, expressed as a code, for example to reference to an Invoice document, code is 380."
                      }
                    },
                    "required" : [ "id" ]
                },
                "accountingSupplierParty": {
                    "description": "Party that is the accountable supplier of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "accountingCustomerParty": {
                    "description": "Party that is the accountable buyer of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "buyerCustomerParty": {
                    "description": "Party that is the buyer of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "sellerSupplierParty": {
                    "description": "Party that is the supplier of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "delivery": {
                    "description": "Delivery details.",
                    "additionalProperties" : false,
                    "properties" : {
                      "actualDeliveryDate" : {
                        "type" : "string",
                        "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
                        "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                      }
                    }
                },
                "deliveryParty": {
                    "description": "Party that is responsible for the delivery of the goods/services in the referred business document.",
                    "properties" : {
                      "endpoint" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "Identifier for the endpoint. See API documentation for more details about the endpoints."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "External global identifier of the id identifier element. See API documentation for more details about the endpoint scheme identifiers."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "partyIdentifications" : {
                        "type" : "array",
                        "description" : "An array holding the external system identifiers of the party. Used for defining customer, supplier and delivery party data.",
                        "items" : {
                          "type" : "object",
                          "description" : "An object holding a party identification.",
                          "properties" : {
                            "id" : {
                              "type" : "string",
                              "description" : "An object holding the external system identifier of the party."
                            },
                            "schemeId" : {
                              "type" : "string",
                              "description" : "External global identifier of the id identifier element."
                            }
                          },
                          "required" : [ "id" ],
                          "additionalProperties" : false
                        }
                      },
                      "partyName" : {
                        "type" : "string",
                        "description" : "A name of the party. Used for defining supplier, customer and delivery party names."
                      },
                      "postalAddress" : {
                        "description" : "An object containing address information. Used for defining supplier party, customer party and delivery party address data.",
                        "properties" : {
                          "cityName" : {
                            "type" : "string",
                            "description" : "The name of the city, town or village in the postal address of the party."
                          },
                          "postalZone" : {
                            "type" : "string",
                            "description" : "The postal code of the area in the postal address of the party. The identifier for an addressable group of properties according to the relevant national postal service, such as a ZIP code or Post Code."
                          },
                          "addressLine" : {
                            "type" : "string",
                            "description" : "The address line of the postal address of the party."
                          },
                          "addressLine2" : {
                            "type" : "string",
                            "description" : "The second address line of the postal address of the party."
                          },
                          "addressLine3" : {
                            "type" : "string",
                            "description" : "The third address line of the postal address of the party."
                          },
                          "locality" : {
                            "type" : "string",
                            "description" : "Neighbourhood or district within town or city. Required in UK if a similar road name exists within a post town area."
                          },
                          "countrySubentity" : {
                            "type" : "string",
                            "description" : "The sub-entity of the area in the postal address."
                          },
                          "countryId" : {
                            "type" : "string",
                            "description" : "The country of the postal address of party. Valid values: ISO3166-1 alpha-2 values can be used."
                          }
                        },
                        "additionalProperties" : false
                      },
                      "partyTaxScheme" : {
                        "type" : "object",
                        "description" : "Information about taxes. Notice that only one tax scheme is used, although there could be multiple.",
                        "properties" : {
                          "company" : {
                            "type" : "object",
                            "description" : "Information about the company taxes.",
                            "properties" : {
                              "id" : {
                                "type" : "string",
                                "description" : "A tax identifier for a company. The identifier assigned for tax purposes to a party by the taxation authority."
                              },
                              "schemeId" : {
                                "type" : "string",
                                "description" : "External global identifier of the endpoint identifier element. Valid values: Country specific agency schema, example DK:CVR for Denmark."
                              }
                            },
                            "additionalProperties" : false
                          }
                        },
                        "additionalProperties" : false
                      },
                      "contact" : {
                        "type" : "object",
                        "description" : "An object containing information about contacts. Used for defining the company contact data",
                        "properties" : {
                          "name" : {
                            "type" : "string",
                            "description" : "A contact name of the party."
                          },
                          "telephone" : {
                            "type" : "string",
                            "description" : "A telephone number of the contact of the party."
                          },
                          "telefax" : {
                            "type" : "string",
                            "description" : "A fax number of the contact of the party."
                          },
                          "electronicMail" : {
                            "type" : "string",
                            "description" : "An email of the contact of the party."
                          }
                        },
                        "additionalProperties" : false
                      }
                    },
                    "required" : [ "partyName" ],
                    "additionalProperties" : false
                },
                "paymentMeans": {
                    "description": "An object holding the available payment means.",
                    "additionalProperties" : false,
                    "properties" : {
                      "paymentMeansCode" : {
                        "type" : "string",
                        "description" : "A code that identifies how the payment can be done. Valid values: UN/ECE 4461 code represented as string."
                      },
                      "paymentDueDate" : {
                        "type" : "string",
                        "description" : "Date when the business document is due for the payment means. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                        "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                      },
                      "paymentReferenceMessage" : {
                        "type" : "string",
                        "description" : "A payment reference message. This can be a free text describing the payment."
                      },
                      "paymentIdentifier" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An identifier for a payment made using this means of payment.",
                        "properties" : {
                          "id" : {
                            "type" : "string",
                            "description" : "The id value of payment identifier."
                          },
                          "schemeId" : {
                            "type" : "string",
                            "description" : "Scheme which identifies the type of payment identifier. Possible values are SPY, ISO."
                          }
                        },
                        "required" : [ "id" ]
                      },
                      "financialAccounts" : {
                        "type" : "array",
                        "description" : "Array holding the financial account data",
                        "items" : {
                          "type" : "object",
                          "additionalProperties" : false,
                          "description" : "Object holding the financial account data",
                          "properties" : {
                            "financialInstitutionName" : {
                              "type" : "string",
                              "description" : "The name of financial institution."
                            },
                            "financialInstitutionId" : {
                              "type" : "string",
                              "description" : "Identifier of financial institution."
                            },
                            "financialInstitutionIdSchemeId" : {
                              "type" : "string",
                              "description" : "The external identifier of the financial institution id identifier element."
                            },
                            "financialInstitutionBranchId" : {
                              "type" : "string",
                              "description" : "The identifier of financial institution branch, for example 342-085. This field is typically used by institutions in Australia and New Zealand."
                            },
                            "financialInstitutionBranchSchemeId" : {
                              "type" : "string",
                              "description" : "The scheme identifier of financial institution branch. For example for an Australian institutions, possible scheme is BSB."
                            },
                            "ids" : {
                              "type" : "array",
                              "description" : "Array holding ids",
                              "items" : {
                                "type" : "object",
                                "additionalProperties" : false,
                                "description" : "Object holding identifier data",
                                "properties" : {
                                  "id" : {
                                    "type" : "string",
                                    "description" : "Identifier."
                                  },
                                  "schemeId" : {
                                    "type" : "string",
                                    "description" : "External identifier."
                                  }
                                },
                                "required" : [ "id" ]
                              }
                            },
                            "accounting" : {
                              "type" : "object",
                              "title" : "Accounting",
                              "description" : "Accounting related content.",
                              "properties" : {
                                "virtualBankBarcode" : {
                                  "type" : "object",
                                  "title" : "VirtualBankBarcode",
                                  "description" : "Virtual bar code can be added to the business document that should be printed.",
                                  "properties" : {
                                    "id" : {
                                      "type" : "string",
                                      "title" : "Virtual bank bar code",
                                      "description" : "Identifier of the virtual bar code. "
                                    },
                                    "schemeId" : {
                                      "type" : "string",
                                      "title" : "SchemeId for virtual bank bar code",
                                      "description" : "Scheme identifier of the virtual bank bar code, typically country code according to ISO3166-1 alpha-2. Possible values: FI"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "required" : [ "paymentMeansCode" ]
                },
                "paymentTerms": {
                    "description": "Available payment terms.",
                    "additionalProperties" : false,
                    "properties" : {
                      "settlementPeriod" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding the settlement period dates.",
                        "properties" : {
                          "startDate" : {
                            "type" : "string",
                            "description" : "Date when the payment terms starts. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                            "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                          },
                          "endDate" : {
                            "type" : "string",
                            "description" : "Date when the payment terms ends. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
                            "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                          }
                        }
                      },
                      "note" : {
                        "type" : "string",
                        "description" : "Free-form text applying to the payment terms. This field may contain notes or any other similar information that is not contained explicitly in another structure."
                      },
                      "penaltySurchargePercent" : {
                        "type" : "number",
                        "description" : "Penalty surcharge percent amount."
                      }
                    }
                },
                "taxTotal": {
                    "additionalProperties" : false,
                    "properties" : {
                      "currencyId" : {
                        "type" : "string",
                        "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                      },
                      "amount" : {
                        "type" : "number",
                        "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
                      },
                      "taxSubtotals" : {
                        "items" : {
                          "type" : "object",
                          "additionalProperties" : false,
                          "description" : "An object holding the information about tax.",
                          "properties" : {
                            "currencyId" : {
                              "type" : "string",
                              "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                            },
                            "amount" : {
                              "type" : "number",
                              "description" : "Total amount of the taxes."
                            },
                            "percent" : {
                              "type" : "number",
                              "description" : "The tax rate for the category, expressed as a percentage."
                            },
                            "taxableAmount" : {
                              "type" : "number",
                              "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                            },
                            "taxCategory" : {
                              "type" : "object",
                              "description" : "External identifier of tax category.",
                              "properties" : {
                                "id" : {
                                  "type" : "string",
                                  "description" : "Identifies the tax category identifier."
                                },
                                "schemeId" : {
                                  "type" : "string",
                                  "description" : "Identifies the namespace of the tax category identifier."
                                },
                                "name" : {
                                  "type" : "string",
                                  "description" : "Tax category description."
                                }
                              },
                              "required" : [ "id" ],
                              "additionalProperties" : false
                            }
                          },
                          "required" : [ "currencyId", "amount" ]
                        }
                      }
                    },
                    "required" : [ "currencyId", "amount" ]
                },
                "legalMonetaryTotal": {
                    "additionalProperties" : false,
                    "properties" : {
                      "lineExtensionAmount" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding total amount of line extensions.",
                        "properties" : {
                          "currencyId" : {
                            "type" : "string",
                            "description" : "A code that identifies the currency of the total line extension amount. Valid values: ISO 4217 code represented as string."
                          },
                          "amount" : {
                            "type" : "number",
                            "description" : "Total amount of line extensions."
                          }
                        },
                        "required" : [ "currencyId", "amount" ]
                      },
                      "payableAmount" : {
                        "type" : "object",
                        "additionalProperties" : false,
                        "description" : "An object holding total payable amount of line extensions.",
                        "properties" : {
                          "currencyId" : {
                            "type" : "string",
                            "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                          },
                          "amount" : {
                            "type" : "number",
                            "description" : "The total amount to be paid."
                          }
                        },
                        "required" : [ "currencyId", "amount" ]
                      }
                    },
                    "required" : [ "payableAmount" ]
                },
                "buyerReference": {
                    "description": "Buyer reference in the business document.",
                    "additionalProperties" : false,
                    "properties" : {
                      "id" : {
                        "type" : "string",
                        "description" : "The id value of the buyer reference"
                      }
                    },
                    "required" : [ "id" ]
                },
                "customFields": {
                    "items" : {
                      "type" : "object",
                      "description" : "Custom fields in the business document",
                      "properties" : {
                        "name" : {
                          "type" : "string",
                          "description" : "Name of the custom field",
                          "default" : "file"
                        },
                        "value" : {
                          "type" : "string",
                          "description" : "Value of the custom field"
                        },
                        "description" : {
                          "type" : "string",
                          "description" : "The purpose of this field"
                        }
                      },
                      "required" : [ "name", "value" ]
                    }
                },
                "creditNoteLines": {
                    "type": "array",
                    "description": "An array holding the credit note lines.",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "description": "A credit note line",
                        "properties": {
                            "id": {
                                "type": "string",
                                "description": "External system identifier for the Credit Note line."
                            },
                            "quantity": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "amount" : {
                                    "type" : "number",
                                    "description" : "The quantity of the target Business Document line items."
                                  },
                                  "unitCode" : {
                                    "type" : "string",
                                    "description" : "The unit code of the quantity of the target Business Document line item. Valid values: UN/ECE CEFACT Trade Facilitation Recommendation No.20 common code value represented as string."
                                  }
                                }
                            },
                            "serviceIndicator": {
                                "type": "boolean",
                                "description": "Flag indicating whether the line represents goods or services (true if services, false if goods)."
                            },
                            "lineExtension": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "currencyId" : {
                                    "type" : "string",
                                    "description" : "The currency of the amount."
                                  },
                                  "amount" : {
                                    "type" : "number",
                                    "description" : "The total amount for the line item, including allowance charges but net of taxes."
                                  }
                                },
                                "required" : [ "currencyId", "amount" ]
                            },
                            "item": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "description" : {
                                    "type" : "array",
                                    "description" : "An array holding the descriptions of the Business Document line items.",
                                    "items" : {
                                      "type" : "string",
                                      "description" : "Description of the Business Document line item."
                                    }
                                  },
                                  "name" : {
                                    "type" : "string",
                                    "description" : "Name of the Business Document line item.  A short name optionally given to an item, such as a name from a catalogue, as distinct from a description."
                                  },
                                  "taxPercent" : {
                                    "type" : "number",
                                    "description" : "Tax amount for the item"
                                  },
                                  "sellersItem" : {
                                    "type" : "object",
                                    "additionalProperties" : false,
                                    "description" : "An object holding a identification of the Business Documents line item as it is in sellers system.",
                                    "properties" : {
                                      "id" : {
                                        "type" : "string",
                                        "description" : "Id of the Business Document line item as it is in sellers system."
                                      },
                                      "schemeId" : {
                                        "type" : "string",
                                        "description" : "External system specific identifier of the sellers item identifier element. If the source business document has any matching element, it should be used."
                                      }
                                    },
                                    "required" : [ "id" ]
                                  }
                                }
                            },
                            "taxTotals": {
                                "items" : {
                                  "type" : "object",
                                  "additionalProperties" : false,
                                  "description" : "An object holding the information about tax.",
                                  "properties" : {
                                    "amount" : {
                                      "type" : "number",
                                      "description" : "Total amount of the taxes. The total tax amount for particular tax scheme e.g. VAT; the sum of each of the tax subtotals for each tax category within the tax scheme."
                                    },
                                    "currencyId" : {
                                      "type" : "string",
                                      "description" : "A code that identifies the currency of the total payable amount. Valid values: ISO 4217 code represented as string."
                                    },
                                    "transactionCurrencyTax" : {
                                      "type" : "object",
                                      "additionalProperties" : false,
                                      "description" : "An object holding transaction tax.",
                                      "properties" : {
                                        "amount" : {
                                          "type" : "number",
                                          "description" : "Amount of tax for the transaction."
                                        }
                                      },
                                      "required" : [ "amount" ]
                                    },
                                    "taxSubtotals" : {
                                      "items" : {
                                        "type" : "object",
                                        "additionalProperties" : false,
                                        "description" : "An object holding the information about tax.",
                                        "properties" : {
                                          "currencyId" : {
                                            "type" : "string",
                                            "description" : "A code that identifies the currency of the tax subtotal. Valid values: ISO 4217 code represented as string."
                                          },
                                          "amount" : {
                                            "type" : "number",
                                            "description" : "Total amount of the taxes."
                                          },
                                          "percent" : {
                                            "type" : "number",
                                            "description" : "The tax rate for the category, expressed as a percentage."
                                          },
                                          "taxableAmount" : {
                                            "type" : "number",
                                            "description" : "Basis of the taxes. The net amount to which the tax percent (rate) is applied to calculate the tax amount."
                                          },
                                          "taxCategory" : {
                                            "type" : "object",
                                            "description" : "External identifier of tax category.",
                                            "properties" : {
                                              "id" : {
                                                "type" : "string",
                                                "description" : "Identifies the tax category identifier."
                                              },
                                              "schemeId" : {
                                                "type" : "string",
                                                "description" : "Identifies the namespace of the tax category identifier."
                                              },
                                              "name" : {
                                                "type" : "string",
                                                "description" : "Tax category description."
                                              }
                                            },
                                            "required" : [ "id" ],
                                            "additionalProperties" : false
                                          }
                                        },
                                        "required" : [ "currencyId", "amount" ]
                                      }
                                    }
                                  },
                                  "required" : [ "amount", "currencyId" ]
                                }
                            },
                            "price": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "amount" : {
                                    "type" : "number",
                                    "description" : "The price of the line item."
                                  },
                                  "currencyId" : {
                                    "type" : "string",
                                    "description" : "A code that identifies the currency of the line item price. Valid values: ISO 4217 code represented as string."
                                  }
                                },
                                "required" : [ "amount", "currencyId" ]
                            },
                            "delivery": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "actualDeliveryDate" : {
                                    "type" : "string",
                                    "description" : "Date when the goods/services are delivered. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty. ",
                                    "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
                                  }
                                }
                            },
                            "orderLineReference": {
                                "additionalProperties" : false,
                                "properties" : {
                                  "lineId" : {
                                    "type" : "string",
                                    "description" : "An identifier for the referenced order line, assigned by the buyer."
                                  },
                                  "orderReference" : {
                                    "type" : "string",
                                    "description" : "A reference to the order containing the referenced order line."
                                  }
                                },
                                "required" : [ "lineId" ]
                            },
                            "allowanceCharges": {
                                "additionalProperties" : false,
                                "items" : {
                                  "type" : "object",
                                  "properties" : {
                                    "changeIndicator" : {
                                      "type" : "boolean",
                                      "description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
                                    },
                                    "allowanceChargeReasonCode" : {
                                      "type" : "string",
                                      "description" : "A mutually agreed code signifying the reason for this allowance or charge. Valid values are defined in UN/ECE CEFACT Trade Facilitation Recommendation 4465 Adjustment reason description code"
                                    },
                                    "allowanceChargeReason" : {
                                      "type" : "string",
                                      "description" : "The reason for this allowance or charge."
                                    },
                                    "multiplierFactorNumeric" : {
                                      "type" : "number",
                                      "description" : "The factor applied to the base amount to calculate the allowance charge."
                                    },
                                    "amount" : {
                                      "type" : "number",
                                      "description" : "The allowance charge amount."
                                    }
                                  },
                                  "required" : [ "changeIndicator", "amount" ]
                                }
                            },
                            "customFields": {
                              "items" : {
                                "type" : "object",
                                "description" : "Custom fields in the business document",
                                "properties" : {
                                  "name" : {
                                    "type" : "string",
                                    "description" : "Name of the custom field",
                                    "default" : "file"
                                  },
                                  "value" : {
                                    "type" : "string",
                                    "description" : "Value of the custom field"
                                  },
                                  "description" : {
                                    "type" : "string",
                                    "description" : "The purpose of this field"
                                  }
                                },
                                "required" : [ "name", "value" ]
                              }
                            }
                        },
                        "required": [
                            "id",
                            "item"
                        ]
                    }
                }
            },
            "required": [
                "externalDocumentIdentifier",
                "documentCurrencyCode",
                "issueDate",
                "accountingSupplierParty",
                "accountingCustomerParty",
                "legalMonetaryTotal",
                "creditNoteLines"
            ]
        }
    },
    "required": [
        "clientToken",
        "data"
    ]
}

Response code 400 - Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.

Response example for the response code above

{
  "error": {
    "id": "c842c9c3-75e5-4c32-ae3f-c1fe250fc186",
    "type": "VALIDATION",
    "message": "Business document identifier bumId does not match the pattern :[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
    "code": "Error.004.0003",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Response code 500 - Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

Response example for the response code above

{
  "error": {
    "id": "a312a9b3-35e5-1a32-be3f-a5fe250fc121",
    "type": "TECHNICAL",
    "message": "BCN encountered an unexpected system error",
    "code": "Error.001.0006",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Upload an Credit Note document to Basware Network.

Request URI

https://api.basware.com/v2/creditNotes/{bumId}

URI Parameters

Param Name Type Required Example Description
bumId string true 8da06e38-6737-48ee-893b-741ff4b22354 Unique UUID for business document

Request Headers

Param Name Required Example Description
Content-Type true application/json Specifies media types which are acceptable for the request. Value application/json is supported.
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Responses

Response code Description
201 The request has been fulfilled successfully and new resource is created on server.
400 Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
409 Conflict. The request could not be completed due to a conflict with the current state of the target resource.
415 Unsupported Media Type. The server is refusing to service the request because the payload is in an unsupported format.
500 Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

API for Files v2

Files

API for Files lets you send and receive files related to a business document through Basware Network.

POST

POST /files HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Request example

{
  "bumId": "5dg91997-70dq-51b8-84g1-41cc473naxd7",
  "fileType": "imageFile"
}

Request schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "Schema for File.",
    "description": "File is an attachment to a business document.",
    "definitions": {
      "dateType": {
        "type": "string",
        "description": "The date which can optionally include time zone. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
        "pattern": "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
      },
      "timeType": {
        "type": "string",
        "description": "Timestamp. Valid values must be in format: hh:mm:ss. If the timezone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If timezone is not known, it must be left empty.",
        "pattern": "([01][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9])(?:.([0-9]{1,7}))?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
      },
      "identifierType": {
          "type": "object",
          "additionalProperties": false,
          "description": "Endpoint identification.",
          "properties": {
              "id": {
                  "type": "string",
                  "description": "An object holding the external system identifier of the endpoint."
              },
              "schemeId": {
                  "type": "string",
                  "description": "Identifies the endpoint scheme. Possible values are for example EMAIL-RFC2822."
              }
          },
          "required": [
              "id",
              "schemeId"
          ]
        }
    },
    "properties": {
      "bumId": {
        "type": "string",
        "description": "Basware Unique Message Identifier (bumid). It is an unique identifier (UUID) that can be used by external systems to identify a business document. The id must have been created before calling this interface. Note that the same bumId must also be used when sending the actual business document to Basware Network."
      },
      "fileType": {
        "type": "string",
        "description": "Allowed file type values: imageFile - image of the document which is human readable, attachmentFile - file related to an invoice which gives extra information, dataFile - invoice in a format which can be programmatically processed."
      },
      "id": {
        "type": "string",
        "description": "External system identifier of the business document."
      },
      "schemeId": {
        "type": "string",
        "description": "External system specific identifier of the system identifier element. If the source business document has any matching element, it should be used."
      },
      "sender": {
         "type": "object",
         "description": "Sender details are normally defined when the files are delivered without creating a separate business document.",
         "properties": {
           "identifier": {
             "description": "Identifies the sender of the business document. This is normally defined when the files are delivered without creating a separate business document.",
             "additionalProperties" : false,
             "properties" : {
               "id" : {
                 "type" : "string",
                 "description" : "An object holding the external system identifier of the endpoint."
               },
               "schemeId" : {
                 "type" : "string",
                 "description" : "Identifies the endpoint scheme. Possible values are for example EMAIL-RFC2822."
               }
             },
             "required" : [ "id", "schemeId" ]
           },
           "dateSent": {
             "type": "string",
             "description": "The date when the file was sent. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
             "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
           },
           "timeSent": {
             "type": "string",
             "description": "The timestamp when the file was sent. Valid values must be in format: hh:mm:ss. If the timezone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If timezone is not known, it must be left empty.",
             "pattern" : "([01][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9])(?:.([0-9]{1,7}))?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
           },
           "senderNote": {
             "type": "string",
             "description": "A free-form description."
           }
         }
       },
       "receiver": {
          "type": "object",
          "description": "Receiver details are normally defined when the files are delivered without creating a separate business document.",
          "properties": {
            "identifier": {
              "description": "Identifies the sender of the business document. This is normally defined when the files are delivered without creating a separate business document..",
              "additionalProperties" : false,
              "properties" : {
                "id" : {
                  "type" : "string",
                  "description" : "An object holding the external system identifier of the endpoint."
                },
                "schemeId" : {
                  "type" : "string",
                  "description" : "Identifies the endpoint scheme. Possible values are for example EMAIL-RFC2822."
                }
              },
              "required" : [ "id", "schemeId" ]
            },
            "dateReceived": {
              "type": "string",
              "description": "The date when the file was received. Valid values must be in format: CCYY-MM-DD. If the time zone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If time zone is not known, it must be left empty.",
              "pattern" : "^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            },
            "timeReceived": {
              "type": "string",
              "description": "The timestamp when the file was received. Valid values must be in format: hh:mm:ss. If the timezone is known, it must be represented with +hh:mm or -hh:mm or Z (which means UTC). If timezone is not known, it must be left empty.",
              "pattern" : "([01][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9])(?:.([0-9]{1,7}))?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$"
            }
        }
      }
    },
    "required": [
        "bumId",
        "fileType"
    ],
    "additionalProperties": false
}

Response code 201 - The request has been fulfilled and resulted in a new resource being created.

Response example for the response code above

{
  "fileId": "539a785684aed4025464647d",
  "links": [
    {
      "rel": "file",
      "href": "https://api.basware.com/v2/files/539a785684aed4025464647d",
      "method": "GET"
    }
  ]
}

Response schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "fileId": {
            "type": "string",
            "description": "Identifier for stored file."
        },
        "links": {
            "type": "array",
            "description": "Links related to the files",
            "items": {
                "type": "object",
                "description": "Links related to the file",
                "properties": {
                    "rel": {
                        "type": "string",
                        "description": "Relation type for the URL in question. Possible values are file (default).",
                        "default": "file"
                    },
                    "href": {
                        "type": "string",
                        "description": "Link between the completed call and a future call. The URI is a fully formed URI, which needs also the method field"
                    },
                    "method": {
                        "type": "string",
                        "enum": ["GET", "POST", "DELETE"],
                        "description": "HTTP methods required to interact with the provided URL",
                        "default": "GET"
                    }
                }
            }
        }
    },
    "required": [
        "fileId"
    ]
}

Response code 400 - Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.

Response example for the response code above

{
  "error": {
    "id": "c842c9c3-75e5-4c32-ae3f-c1fe250fc186",
    "type": "VALIDATION",
    "message": "Business document identifier bumId does not match the pattern :[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
    "code": "Error.004.0003",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Response schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "title": "Error response",
  "description": "Error response for REST API.",
  "properties": {
    "error": {
      "type": "object",
      "title": "Error schema.",
      "description": "An explanation about the purpose of this instance.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Request identifier that was sent as part of request."
        },
        "type": {
          "type": "string",
          "description": "Error type. Possible values are TECHNICAL, BUSINESS, VALIDATION or SECURITY"
        },
        "message": {
          "type": "string",
          "description": "An explanation about the error."
        },
        "code": {
          "type": "string",
          "description": "Error code to identify the error situation."
        },
        "info": {
          "type": "string",
          "description": "An explanation about the purpose of this instance."
        }
      },
      "required": [
        "type",
        "message",
        "code",
        "info"
      ]
    }
  },
  "required": [
    "error"
  ]
}

Response code 500 - Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.

Response example for the response code above

{
  "error": {
    "id": "a312a9b3-35e5-1a32-be3f-a5fe250fc121",
    "type": "TECHNICAL",
    "message": "BCN encountered an unexpected system error",
    "code": "Error.001.0006",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Response schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "title": "Error response",
  "description": "Error response for REST API.",
  "properties": {
    "error": {
      "type": "object",
      "title": "Error schema.",
      "description": "An explanation about the purpose of this instance.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Request identifier that was sent as part of request."
        },
        "type": {
          "type": "string",
          "description": "Error type. Possible values are TECHNICAL, BUSINESS, VALIDATION or SECURITY"
        },
        "message": {
          "type": "string",
          "description": "An explanation about the error."
        },
        "code": {
          "type": "string",
          "description": "Error code to identify the error situation."
        },
        "info": {
          "type": "string",
          "description": "An explanation about the purpose of this instance."
        }
      },
      "required": [
        "type",
        "message",
        "code",
        "info"
      ]
    }
  },
  "required": [
    "error"
  ]
}

If your business document has files attached to it, you can deliver them, too, using the POST files method.

You must upload the attachments one at a time. You must also link each file to a business document. The files are linked to a business document using the business document’s Basware Unique Message Identifier (BUMID).

Basware starts the delivery of the invoice with files after the API client has called the POST /invoices method. Alternatively, if the files already contain the required business document contents, you can specify action=startDelivery in query parameters of /POST files method. The immediate delivery method is supported for PDF attachments only.

The files that you deliver must follow these rules:

  1. The file must be in a supported format which are .csv, .doc, .docx, .jpeg, .jpg, .odt, .pdf, .png, .ppt, .pptx, .rtf, .tif, .tiff, .txt, .xls, .xlsx, .xml and .zip. Note that business documents which are to be printed only support pdf format.
  2. File name must not be longer than 75 characters.
  3. Size of an individual file must not exceed 5 MB.
  4. Total size of all the attachments must not exceed 25 MB.

File upload works in the following manner:

Request header has a Content-Type parameter that can must have the following values for each part:

  1. Content type defined as “multipart/mixed”. This defines the content type for the entire request as multipart.
  2. Content type defined for metadata part as “application/json”. Only JSON is supported at the moment.
  3. Content type defined for file part. This defines the content type for the file part of the request.

File upload supports also base64 encoding:

Request URI

https://api.basware.com/v2/files

Request Headers

Param Name Required Example Description
Content-Disposition true attachment; filename=acme-invoice.pdf File name without path. The parameter must be in the format (where FILENAME represents the actual file name) like attachment; filename=FILENAME
Content-Length true Size of the uploaded file in bytes so that the server can verify that it has received the entire file contents
Content-Type true multipart/mixed The MIME type of the body of the request. It should be set to “multipart/mixed”.
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Query Parameters

Param Name Required Example Description
action false Defines what action will be performed. If startDelivery is specified, the business document will be delivered immediately. If startTransmission is specified, the business document will be delivered immediately without any processing. Possible values are store (default), startDelivery or startTransmission.
documentType false Defines the business document type the file belongs to. This field can be used when action is to start delivery or transmission immediately. Possible values are ApplicationResponse.

Responses

Response code Description
201 The request has been fulfilled and resulted in a new resource being created.
400 Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
409 Conflict. A similar resource already exists.
413 Request Entity Too Large. The server is refusing to process a request because the request entity is larger than the server is willing or able to process.
415 Unsupported Media Type. The server is refusing to service the request because the payload is in a format not supported.
500 Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.
503 Service Unavailable. The server is currently unable to handle the request due to a temporary overload or scheduled maintenance.

GET

GET /files/{fileId} HTTP/1.1 
Accept: application/json
Authorization: Basic dXMlbjp1c2Vy
X-BW-REQUEST-ID: 1204edd0-ff8d-11e4-a322-1697f925ec7b

Response code 400 - Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.

Response example for the response code above

{
  "error": {
    "id": "c842c9c3-75e5-4c32-ae3f-c1fe250fc186",
    "type": "VALIDATION",
    "message": "Business document identifier bumId does not match the pattern :[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",
    "code": "Error.004.0003",
    "info": "Contact Basware Support http://www.basware.com/contact and provide them with the error ID and the error code you encountered. Basware support will investigate the cause of the error."
  }
}

Response schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "title": "Error response",
  "description": "Error response for REST API.",
  "properties": {
    "error": {
      "type": "object",
      "title": "Error schema.",
      "description": "An explanation about the purpose of this instance.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Request identifier that was sent as part of request."
        },
        "type": {
          "type": "string",
          "description": "Error type. Possible values are TECHNICAL, BUSINESS, VALIDATION or SECURITY"
        },
        "message": {
          "type": "string",
          "description": "An explanation about the error."
        },
        "code": {
          "type": "string",
          "description": "Error code to identify the error situation."
        },
        "info": {
          "type": "string",
          "description": "An explanation about the purpose of this instance."
        }
      },
      "required": [
        "type",
        "message",
        "code",
        "info"
      ]
    }
  },
  "required": [
    "error"
  ]
}

You can fetch a file related to a business document.

The response header will include the following fields:

Possible values for X-BW-FILE-TYPE are the same which are used in POST method:

File download supports also base64 encoding:

Request URI

https://api.basware.com/v2/files/{fileId}

URI Parameters

Param Name Type Required Example Description
fileId string false 5878e54d2d95404381a09f48 File id or attachment id. The identifier was returned when the file was stored into Basware Network.

Request Headers

Param Name Required Example Description
Accept false application/json Specifies media types which are acceptable for the response. Value application/json is supported.
X-BW-REQUEST-ID false 7fc7d038-4306-4fc5-89c3-7ac8a12a30d0 Client generated UUID value for identifying request-response flow. Disclaimer. This value is highly recommended to be included. Production support for this request is not possible if this value is missing.

Responses

Response code Description
200 The request has been completed successfully.
304 Not Modified. The requested resource has not been modified. There is no need to retransmit the resource from server.
400 Bad Request. The server cannot or will not process the request. Bad request due to invalid request syntax or invalid request message framing.
401 Unauthorized. The request has not been serviced, the request is unauthorized as it lacks valid authentication credentials (UserName/Password).
403 Forbidden. The server understood the request, but is refusing to fulfill it.
404 Resource could not be found. The server has not found anything matching the request URI.
415 Unsupported Media Type. The server is refusing to service the request because the payload is in a format not supported.
500 Internal Server Error. The server encountered an unexpected condition, which prevented it from fulfilling the request.