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:
- Deliver and receive business documents
- Follow the life cycle of business documents by sending and receiving notifications
- Send and receive files related to business documents
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.
Receiving invoices
The following diagram shows how to receive invoices. Note that the similar flow also applies to credit notes.
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:
- TechnicalAccept with actionCode
DeliveryConfirmed
or - TechnicalReject with actioncode
Undelivered
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:
- BusinessAccept with actionCode
DocumentAccepted
or - BusinessReject with actionCode
DocumentRejected
The following diagram shows how to confirm 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:
- You want to use Basware’s value added services and
- You have not sent or received invoices through Basware Network.
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:
id
– an identifier of the recipient, typically a string or a number derived from a registry number. For example, a VAT number or an email addressschemeId
– identifies the type of theid
. For example,VAT
orIBAN
The following rules apply when determining the endpoint:
- You should always use the endpoint given by the recipient with
id
andschemeId
. - If
schemeId
is not known,id
should be a globally unique value such“ISO6523-ACTORID-UPIS”
.
The endpoint’s scheme identifiers are group to the following categories:
- Recommended, globally unique identifiers - Recommended, as they can be used without scheme identifiers and still be guaranteed to be globally unique.
- ISO6523
- EU-VAT
- Commercial and common scheme identifiers - Supported, but must be used with scheme identifier
- IBAN
- DUNS
- GLN
- Local tax identifiers and national trade registry identifiers - Supported, but must be used with scheme identifier
- NL:KVK
- FI:ORGNR
- …
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
- Requests are validated in a stricter manner according to JSON schemas.
- API v2 has structural changes to improve readability
- Fields having array content have been renamed to reflect this (for example the array field name
invoiceLine
has been changed toinvoiceLines
) - Mandatory checks have been added to improve invoice quality (for example the field
documentCurrencyCode
is now mandatory)
- Fields having array content have been renamed to reflect this (for example the array field name
- New optional fields have been added to Invoice API and Credit Note API
- Support for
base64
has been added to File API. - UTF-8 encoding is enforced. If your API client does not support UTF-8 by default, include the following UTF-8 charset in the header of POST methods:
Content-Type: application/json; charset=utf-8
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
- Changed the field
documentCurrencyCode
from optional to mandatory in POST /invoices and POST /creditNotes
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:
data.accountingCustomerParty.partyIdentifications
data.accountingSupplierParty.partyIdentifications
data.deliveryParty.partyIdentifications
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:
data.invoiceLine
->data.invoiceLines
(Invoice API only)data.invoiceLine.taxTotal
todata.invoiceLines.taxTotals
(Invoice API only)data.creditNoteLine
todata.creditNoteLines
(CreditNote API only)data.creditNoteLine.taxTotal
todata.creditNoteLines.taxTotals
(CreditNote API only)
Similar renaming has been done for tax total elements:
taxTotal.taxSubTotal
totaxTotals.taxSubtotals
(note also corrected spelling for subtotals)invoiceLine.taxTotal.taxSubTotal
toinvoiceLines.taxTotals.taxSubtotals
(note also corrected spelling for subtotals)creditNoteLine.taxTotal.taxSubTotal
tocreditNoteLines.taxTotals.taxSubtotals
(note also corrected spelling for subtotals)
Similar renaming has been done for financial account elements:
paymentMeans.financialAccount
topaymentMeans.financialAccounts
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:
data.contractDocumentReference
todata.contractDocumentReferences
(array field)
Field name changes for externalDocumentIdentifier
in Invoice and Credit Note
Invoice identifier field provided by invoice issuer has been renamed:
data.id
->data.externalDocumentIdentifier.id
data.idSchemeId
–>data.externalDocumentIdentifier.schemeid
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:
data.allowanceCharge
->data.allowanceCharges
(change to array, field changes)data.invoiceLines.allowanceCharge
->data.invoiceLines.allowanceCharges
(change to array, field changes) (Invoice API)data.creditNoteLines.allowanceCharge
->data.creditNoteLines.allowanceCharges
(change to array, field changes) (CreditNote API)
New ‘processingPreference’ element in Invoice and Credit Note
Added endpoint outside “data” to new “processingPreference” element (applied to POST methods only)
- sentTo (endpoint) MANDATORY
- receiveFrom (endpoint) MANDATORY
- replyTo (endpoint) OPTIONAL
- operator (endpoint) OPTIONAL
- printingPreference OPTIONAL
- recipientNotificationPreference OPTIONAL
- isConsumerRecipient OPTIONAL
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
deliveryChannelPreference
->processingPreference.printingPreference
The values for printingPreference
are the following:
PrintingAllowed
PrintingAlways
NoPrinting
Field serviceProviderId
changed to operator
Changed the intermediate service provider field serviceProviderId
to operator
serviceProviderId
->processingPreference.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:
data.buyerCustomerParty
data.sellerSupplierParty
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:
data.taxTotals.taxSubtotals.taxCategory
invoiceLines.taxTotals.taxSubtotals.taxCategory
creditNoteLines.taxTotals.taxSubtotals.taxCategory
New optional addressLine3
field to Invoice and Credit Note
Added optional field addressLine3
to postalAddress
element in the party:
data.accountingSupplierParty.postalAddress.addressLine3
data.accountingCustomerParty.postalAddress.addressLine3
data.buyerCustomerParty.postalAddress.addressLine3
data.sellerSupplierParty.postalAddress.addressLine3
data.deliveryParty.postalAddress.addressLine3
New optional isIssuedAgainstOrder
field to Invoice and Credit Note
Added optional, boolean field to indicate whether the invoice has been issued
data.isIssuedAgainstOrder
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.
- Added an array field 'customFields’ to data element
data.customFields
- Added an array field 'customFields’ to line item:
data.invoiceLines.customFields
(Invoice API)data.creditNoteLines.customFields
(CreditNote API)
New optional paymentReferenceMessage
field added to Invoice and Credit Note
- Added field
paymentReferenceMessage
topaymentMeans
to data elementdata.paymentMeans.paymentReferenceMessage
- This field is a free text describing the payment
Remove 'internalId’ and 'amountUninvoiced’ fields from Invoice and Credit Note
- Removed fields 'internalId’ and 'amountUninvoiced’ from business document lines:
- 'data.invoiceLines.internalId’
- 'data.creditNoteLines.internalId’
- 'data.invoiceLines.quantity.amountUninvoiced’
- 'data.creditNoteLines.quantity.amountUninvoiced’
Remove billingReference
from Invoice
- Removed the field
billingReference
from Invoice API
Remove version
from Invoice and Credit Note
- Removed the field
version
from GET /invoices and GET /creditNotes
GET /invoices and /creditNotes returns origin
in the response
- Added optional
origin
field to GET methods to return details about the document origin such as source channel (electronic mail, postal mail etc.)
GET /invoices and /creditNotes returns bumId
in the response
- Added field
bumId
to business documents in GET methods as a mandatory fields. The field is included in the root of the document.
Upload invoices feature for Invoice
- POST /invoices/{bumId} method has an optional 'action’ parameter to upload invoices to Basware Network without invoice delivery. Possible values for 'action’ are 'startDelivery’ (default) and 'store’.
- You only need to upload invoices in the following scenario:
- You want to use Basware’s value added services and
- You have not sent or received invoices through Basware Network.
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
- If the
Content-Transfer-Encoding
header in the file content part of the mixed-multipart message is set to base64 then the content of the file is expected to be base64 encoded.
base64 in GET method
- If the GET request header
X-BW-Accept-Encoding
containsbase64
then the response will be return with the body base64 encoded.
File API returns response header fields
- Added two fields to response header in File API:
- X-BW-BUM-ID - Business document identifier
- X-BW-FILE-TYPE - File type can have imageFile, attachmentFile or dataFile
2016-09-21 New fields added to Invoices and Credit Notes v1
New fields to postalAddress in Invoice and Credit Note
- Added
locality
attribute to postalAddress in party element. This field is required in UK if a similar road name exists within a post town area. - Added
addressLine2
attribute to postalAddress in party element. This field is the second address line.
New fields to paymentMeans in Invoice and Credit Note
- Added the following fields to denote virtual bank bar code. Virtual bar code can be added to the business document that should be printed.
paymentMeans.financialAccount.accounting.virtualBankBarcode.id
. This is the actual bank bar code value.paymentMeans.financialAccount.accounting.virtualBankBarcode.schemeId
. This is typically country code according to ISO3166-1 alpha-2. Possible values:FI
.
New fields to paymentIdentifier in Invoice and Credit Note
- Added
paymentMeans.paymentIdentifier.schemeId
to paymentMeans. This is a scheme which identifies the type of payment identifier. Possible values areSPY
,ISO
.
2016-09-21 API for Notifications v1.1 released
GET /notifications
- Added
links
attribute which contains HATEOAS type URI addresses. - Added
documentType
.
POST /notifications
- Added optional
documentType
.
API versioning
Basware Network API has two types of versions
- Major version: Requires normally changes by the API client.
- Minor version: No mandatory changes are normally required by the API client. See detailed minor version rules below.
Your application using Basware Network API should be flexible enough to handle backwards compatible changes:
- Fields in the JSON response are not guaranteed to be returned in a specific order (JSON is by definition an object of unordered key/value mappings).
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:
- Adding new mandatory request fields
- Removing an existing field
- Modifying an existing attribute, for example changing an attribute to be an array of attributes
- Changes in the request validation, for example adding enumeration validation
- Other changes in the supporting functionality
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:
- Adding optional fields to the request of an existing endpoint
- Adding new optional or mandatory fields to the response of an existing endpoint
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:
- 20x - Successful response
- 40x - The error was caused by faulty information sent to Basware Network
- 50x - The error was caused by a processing issue in Basware Network
In addition, the response may include additional details about the error situation. The following fields will appear in the error response:
- Id: Unique identifier for the error message
- Type: The error response type. This can be one of the following values: BUSINESS, VALIDATION, TECHNICAL, SECURITY
- Code: The error code
- Message: Human readable error message that explains the cause for the error situation.
- Info: Action to take in order to recover from the error situation
Error response type indicates the type of the error situation:
- BUSINESS: The API request has failed due to business related issue.
- VALIDATION: The API request has failed due to invalid values in the request.
- TECHNICAL: The API request failed because of a technical error in Basware Network.
- SECURITY: The API request failed because of a security violation.
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:
- BusinessAccept: The recipient has accepted the business document.
- BusinessReject: The recipient has rejected the business document.
- BusinessInformation: A business process action has been taken for the business document, for example “the invoice has been paid”.
- TechnicalAccept: The business document has been accepted for processing in the Basware Network.
- TechnicalReject: The business document has been rejected because Basware Network was unable to deliver the business document.
- TechnicalInformation: Basware Network encountered a temporary delivery failure. The service will automatically retry to deliver the document. No action is required from your side.
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 v1
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
{
"version": "1.0",
"bumId": "fedd8dec-af24-430e-8944-a056474816c2",
"fileRefs": [
{
"refId": "539a78446842ed4025464947d",
"fileType": "imageFile"
},
{
"refId": "539a785684edd4025415947d",
"fileType": "attachmentFile"
}
],
"links": [
{
"rel": "file",
"href": "https://api.basware.com/v1/files/539a78446842ed4025464947d",
"method": "GET"
},
{
"rel": "file",
"href": "https://api.basware.com/v1/files/539a785684edd4025415947d",
"method": "GET"
}
],
"data": {
"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"
},
"contractDocumentReference": {
"id": "147217"
},
"documentCurrencyCode": "EUR",
"id": "56328230",
"invoiceLine": [
{
"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"
},
"taxTotal": [
{
"amount": 17.28,
"currencyId": "EUR",
"taxSubTotal": [
{
"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"
},
"taxTotal": [
{
"amount": 5.54,
"currencyId": "EUR",
"taxSubTotal": [
{
"amount": 5.54,
"currencyId": "EUR",
"percent": 24
}
],
"transactionCurrencyTax": {
"amount": 0.9
}
}
]
}
],
"issueDate": "2015-05-01",
"legalMonetaryTotal": {
"payableAmount": {
"amount": 462.8,
"currencyId": "EUR"
}
},
"paymentMeans": {
"financialAccount": [
{
"financialInstitutionName": "BARCGB22",
"ids": [
{
"id": "GB54BARC20992012345678",
"schemeId": "IBAN"
}
],
"accounting": {
"virtualBankBarcode": {
"id": "240555610000072001175500000000001005010507104022700003",
"schemeId": "FI"
}
}
}
],
"paymentDueDate": "2015-06-01",
"paymentIdentifier": {
"id": "63156783578924",
"schemeId": "SPY"
},
"paymentMeansCode": "31"
},
"taxTotal": {
"amount": 89.56,
"currencyId": "EUR",
"taxSubTotal": [
{
"amount": 89.56,
"currencyId": "EUR",
"percent": 24,
"taxableAmount": 373.24
}
]
}
},
"version" : "1.0"
}
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": {
"version": {
"type": "string",
"description": "Message version number."
},
"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"
}
}
}
},
"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": {
"id": {
"type": "string",
"description": "External system identifier of the business document."
},
"idSchemeId": {
"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."
},
"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."
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"freight" : {
"type" : "number",
"description" : "Freight charge."
},
"handling" : {
"type" : "number",
"description" : "Handling charge."
}
}
},
"orderReference": {
"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": {
"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" ]
},
"contractDocumentReference": {
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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])?$"
},
"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" ]
},
"financialAccount" : {
"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": {
"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."
},
"taxSubTotal" : {
"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."
}
},
"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": {
"additionalProperties" : false,
"properties" : {
"id" : {
"type" : "string",
"description" : "The id value of the buyer reference"
}
},
"required" : [ "id" ]
},
"invoiceLine": {
"type": "array",
"description": "An array holding the Invoice lines.",
"items": {
"type": "object",
"additionalProperties": false,
"description": "An object holding a Invoice line.",
"properties": {
"id": {
"type": "string",
"description": "External system identifier for the Invoice line."
},
"internalId": {
"type": "string",
"description": "Internal identifier for the Invoice line."
},
"quantity": {
"additionalProperties" : false,
"properties" : {
"amount" : {
"type" : "number",
"description" : "The quantity of the target Business Document line items."
},
"amountUninvoiced" : {
"type" : "number",
"description" : "The available quantity of the target Business Document line item which has not been invoiced."
},
"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" ]
}
}
},
"taxTotal": {
"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" ]
},
"taxSubTotal" : {
"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."
}
},
"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" ]
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"chargeIndicator" : {
"type" : "boolean",
"description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
},
"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" : [ "chargeIndicator", "amount" ]
}
},
"required": [
"id",
"lineExtension",
"item"
]
}
}
},
"required": [
"id",
"issueDate",
"accountingSupplierParty",
"accountingCustomerParty",
"legalMonetaryTotal",
"invoiceLine"
]
}
},
"required": [
"version",
"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/v1/invoices/{bumId}
URI Parameters
Param Name | Type | Required | Example | Description |
---|---|---|---|---|
bumId | string | true | a07089b1-a230-4b80-9011-6fc810b9830a | 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"
}
],
"deliveryChannelPreference" : "printing-allowed",
"data": {
"id": "56328230",
"issueDate": "2016-05-01",
"documentCurrencyCode": "EUR",
"contractDocumentReference": {
"id": "147217"
},
"accountingSupplierParty": {
"endpoint": {
"id": "114823943023440",
"schemeId": "ISO6523-ACTORID-UPIS"
},
"partyName": "Acme Supplier Inc.",
"postalAddress": {
"addressLine": "1800 Main Street",
"cityName": "Dallas",
"postalZone": "75201",
"countrySubentity": "TX",
"countryId": "US"
}
},
"accountingCustomerParty": {
"endpoint": {
"id": "114612065012",
"schemeId": "BE:ORGNR"
},
"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": {
"financialAccount": [
{
"financialInstitutionName": "BARCGB22",
"ids": [
{
"id": "GB54BARC20992012345678",
"schemeId": "IBAN"
}
],
"accounting": {
"virtualBankBarcode": {
"id": "240555610000072001175500000000001005010507104022700003",
"schemeId": "FI"
}
}
}
],
"paymentDueDate": "2016-06-30",
"paymentIdentifier": {
"id": "63156783578924",
"schemeId": "SPY"
},
"paymentMeansCode": "31"
},
"buyerReference" : {
"id" : "PO-1563224"
},
"taxTotal": {
"amount": 89.56,
"currencyId": "EUR",
"taxSubTotal": [
{
"taxableAmount": 373.24,
"amount": 89.56,
"currencyId": "EUR",
"percent": 24
}
]
},
"legalMonetaryTotal": {
"payableAmount": {
"amount": 462.8,
"currencyId": "EUR"
}
},
"invoiceLine": [
{
"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"
}
},
"taxTotal": [
{
"currencyId": "EUR",
"amount": 17.28,
"transactionCurrencyTax" : {
"amount" : 0.9
},
"taxSubTotal": [
{
"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
},
"taxTotal": [
{
"currencyId": "EUR",
"amount": 5.54,
"transactionCurrencyTax" : {
"amount" : 0.9
},
"taxSubTotal": [
{
"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"
]
}
},
"deliveryChannelPreference": {
"type": "string",
"enum": ["printing-always", "only-eInvoicing", "printing-allowed", ""],
"description": "The way document to be routed, printing-always goes for printing as sender specific processing, only-eInvoicing goes for normal processing as receiver specific processing, printing-allowed goes first for only-eInvoicing if fails then for printing-always, empty value goes by-default for only-eInvoicing case"
},
"serviceProviderId": {
"type": "string",
"description": "Identifier for the intermediate service provider."
},
"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": {
"id": {
"type": "string",
"description": "External system identifier of the business document."
},
"idSchemeId": {
"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."
},
"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."
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"freight" : {
"type" : "number",
"description" : "Freight charge."
},
"handling" : {
"type" : "number",
"description" : "Handling charge."
}
}
},
"orderReference": {
"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": {
"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" ]
},
"contractDocumentReference": {
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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])?$"
},
"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" ]
},
"financialAccount" : {
"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": {
"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."
},
"taxSubTotal" : {
"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."
}
},
"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": {
"additionalProperties" : false,
"properties" : {
"id" : {
"type" : "string",
"description" : "The id value of the buyer reference"
}
},
"required" : [ "id" ]
},
"invoiceLine": {
"type": "array",
"description": "An array holding the Invoice lines.",
"items": {
"type": "object",
"additionalProperties": false,
"description": "An object holding a Invoice line.",
"properties": {
"id": {
"type": "string",
"description": "External system identifier for the Invoice line."
},
"internalId": {
"type": "string",
"description": "Internal identifier for the Invoice line."
},
"quantity": {
"additionalProperties" : false,
"properties" : {
"amount" : {
"type" : "number",
"description" : "The quantity of the target Business Document line items."
},
"amountUninvoiced" : {
"type" : "number",
"description" : "The available quantity of the target Business Document line item which has not been invoiced."
},
"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" ]
}
}
},
"taxTotal": {
"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" ]
},
"taxSubTotal" : {
"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."
}
},
"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" ]
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"chargeIndicator" : {
"type" : "boolean",
"description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
},
"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" : [ "chargeIndicator", "amount" ]
}
},
"required": [
"id",
"lineExtension",
"item"
]
}
}
},
"required": [
"id",
"issueDate",
"accountingSupplierParty",
"accountingCustomerParty",
"legalMonetaryTotal",
"invoiceLine"
]
}
},
"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/v1/invoices/{bumId}
URI Parameters
Param Name | Type | Required | Example | Description |
---|---|---|---|---|
bumId | string | true | a07089b1-a230-4b80-9011-6fc810b9830a | 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 |
---|---|
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 v1
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
{
"version": "1.0",
"bumId": "c6d7067f-eb67-4289-89ec-819446078a3a",
"fileRefs": [
{
"refId": "539a583684aed4025464947d",
"fileType": "imageFile"
},
{
"refId": "516a255684aed4025464947d",
"fileType": "attachmentFile"
}
],
"links": [
{
"rel": "file",
"href": "https://api.basware.com/v1/files/539a78446842ed4025464947d",
"method": "GET"
},
{
"rel": "file",
"href": "https://api.basware.com/v1/files/516a255684aed4025464947d",
"method": "GET"
}
],
"data": {
"id": "56328230",
"issueDate": "2015-05-01",
"documentCurrencyCode": "EUR",
"contractDocumentReference": {
"id": "147217"
},
"accountingSupplierParty": {
"endpoint": {
"id": "114823943023440",
"schemeId": "ISO6523-ACTORID-UPIS"
},
"partyName": "Tele-yhtiö Oy",
"postalAddress": {
"addressLine": "PL 3600",
"cityName": "Tele-yhtiö",
"postalZone": "00053"
}
},
"accountingCustomerParty": {
"endpoint": {
"id": "114612065012",
"schemeId": "ISO6523-ACTORID-UPIS"
},
"partyName": "KAUPPA OY",
"postalAddress": {
"addressLine": "PL 801",
"cityName": "KAUPPA",
"postalZone": "00089"
}
},
"deliveryParty": {
"partyName": "Parcels United",
"postalAddress": {
"addressLine": "1 Back Lane",
"locality": "Clayton West",
"cityName": "HUDDERSFIELD",
"postalZone": "HD8 9PP",
"countryId": "UK"
}
},
"paymentMeans": {
"financialAccount": [
{
"financialInstitutionName": "OKOYFIHH",
"ids": [
{
"id": "FI8650000110001238",
"schemeId": "IBAN"
}
],
"accounting": {
"virtualBankBarcode": {
"id": "240555610000072001175500000000001005010507104022700003",
"schemeId": "FI"
}
}
}
],
"paymentDueDate": "2015-06-30",
"paymentIdentifier": {
"id": "63156783578924"
},
"paymentMeansCode": "31"
},
"taxTotal": {
"amount": 89.56,
"currencyId": "EUR",
"taxSubTotal": [
{
"taxableAmount": 373.24,
"amount": 89.56,
"currencyId": "EUR",
"percent": 24
}
]
},
"buyerReference": {
"id": "PO-15512324"
},
"legalMonetaryTotal": {
"payableAmount": {
"amount": 462.8,
"currencyId": "EUR"
}
},
"creditNoteLine": [
{
"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"
}
},
"taxTotal": [
{
"currencyId": "EUR",
"amount": 17.28,
"transactionCurrencyTax": {
"amount": 0.9
},
"taxSubTotal": [
{
"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
},
"taxTotal": [
{
"currencyId": "EUR",
"amount": 5.54,
"transactionCurrencyTax": {
"amount": 0.9
},
"taxSubTotal": [
{
"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": {
"version": {
"type": "string",
"description": "Message version number."
},
"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"
}
}
}
},
"bumid": {
"type": "string",
"description": "Bumid. Format is UUID"
},
"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": {
"id": {
"type": "string",
"description": "External system identifier of the business document."
},
"idSchemeId": {
"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."
},
"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."
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"freight" : {
"type" : "number",
"description" : "Freight charge."
},
"handling" : {
"type" : "number",
"description" : "Handling charge."
}
}
},
"orderReference": {
"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": {
"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" ]
},
"contractDocumentReference": {
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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])?$"
},
"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" ]
},
"financialAccount" : {
"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": {
"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."
},
"taxSubTotal" : {
"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."
}
},
"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": {
"additionalProperties" : false,
"properties" : {
"id" : {
"type" : "string",
"description" : "The id value of the buyer reference"
}
},
"required" : [ "id" ]
},
"creditNoteLine": {
"type": "array",
"description": "An array holding the Credit Note lines.",
"items": {
"type": "object",
"additionalProperties": false,
"description": "An object holding a Credit Note line.",
"properties": {
"id": {
"type": "string",
"description": "External system identifier for the Credit Note line."
},
"internalId": {
"type": "string",
"description": "Internal identifier for the Credit Note line."
},
"quantity": {
"additionalProperties" : false,
"properties" : {
"amount" : {
"type" : "number",
"description" : "The quantity of the target Business Document line items."
},
"amountUninvoiced" : {
"type" : "number",
"description" : "The available quantity of the target Business Document line item which has not been invoiced."
},
"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" ]
}
}
},
"taxTotal": {
"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" ]
},
"taxSubTotal" : {
"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."
}
},
"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" ]
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"chargeIndicator" : {
"type" : "boolean",
"description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
},
"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" : [ "chargeIndicator", "amount" ]
}
},
"required": [
"id",
"item"
]
}
}
},
"required": [
"id",
"issueDate",
"accountingSupplierParty",
"accountingCustomerParty",
"legalMonetaryTotal",
"creditNoteLine"
]
}
},
"required": [
"version",
"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/v1/creditNotes/{bumId}
URI Parameters
Param Name | Type | Required | Example | Description |
---|---|---|---|---|
bumId | string | true | a2cbb40b-8031-449d-af14-5b7974681b2b | 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"
}
],
"data": {
"id": "56328230",
"issueDate": "2016-05-09",
"documentCurrencyCode": "EUR",
"contractDocumentReference": {
"id": "267212"
},
"accountingSupplierParty": {
"endpoint": {
"id": "114823943023440",
"schemeId": "ISO6523-ACTORID-UPIS"
},
"partyName": "Acme Supplier Inc.",
"postalAddress": {
"addressLine": "1800 Main Street",
"cityName": "Dallas",
"postalZone": "75201",
"countrySubentity": "TX",
"countryId": "US"
}
},
"accountingCustomerParty": {
"endpoint": {
"id": "0612065012",
"schemeId": "BE:ORGNR"
},
"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": "2016-06-30",
"paymentIdentifier": {
"id": "63156783578924"
},
"paymentMeansCode": "31",
"financialAccount": [
{
"financialInstitutionName": "BARCGB22",
"ids": [
{
"id": "GB54BARC20992012345678",
"schemeId": "IBAN"
}
],
"accounting": {
"virtualBankBarcode": {
"id": "240555610000072001175500000000001005010507104022700003",
"schemeId": "FI"
}
}
}
]
},
"buyerReference": {
"id": "PO-156345"
},
"taxTotal": {
"amount": 89.56,
"currencyId": "EUR",
"taxSubTotal": [
{
"taxableAmount": 373.24,
"amount": 89.56,
"currencyId": "EUR",
"percent": 24
}
]
},
"legalMonetaryTotal": {
"payableAmount": {
"amount": 462.8,
"currencyId": "EUR"
}
},
"creditNoteLine": [
{
"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"
}
},
"taxTotal": [
{
"currencyId": "EUR",
"amount": 17.28,
"transactionCurrencyTax": {
"amount": 0.9
},
"taxSubTotal": [
{
"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
},
"taxTotal": [
{
"currencyId": "EUR",
"amount": 5.54,
"transactionCurrencyTax": {
"amount": 0.9
},
"taxSubTotal": [
{
"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"
]
}
},
"deliveryChannelPreference": {
"type": "string",
"enum": ["printing-always", "only-eInvoicing", "printing-allowed", ""],
"description": "The way document to be routed, printing-always goes for printing as sender specific processing, only-eInvoicing goes for normal processing as receiver specific processing, printing-allowed goes first for only-eInvoicing if fails then for printing-always, empty value goes by-default for only-eInvoicing case"
},
"serviceProviderId": {
"type": "string",
"description": "Identifier for the intermediate service provider."
},
"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": {
"id": {
"type": "string",
"description": "External system identifier of the business document."
},
"idSchemeId": {
"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."
},
"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."
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"freight" : {
"type" : "number",
"description" : "Freight charge."
},
"handling" : {
"type" : "number",
"description" : "Handling charge."
}
}
},
"orderReference": {
"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": {
"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" ]
},
"contractDocumentReference": {
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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": {
"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" : "An object holding the external system identifier of the party."
},
"schemeId" : {
"type" : "string",
"description" : "External global identifier of the id identifier element."
}
},
"required" : [ "id" ]
},
"partyIdentification" : {
"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."
},
"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])?$"
},
"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" ]
},
"financialAccount" : {
"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": {
"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."
},
"taxSubTotal" : {
"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."
}
},
"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": {
"additionalProperties" : false,
"properties" : {
"id" : {
"type" : "string",
"description" : "The id value of the buyer reference"
}
},
"required" : [ "id" ]
},
"creditNoteLine": {
"type": "array",
"description": "An array holding the Credit Note lines.",
"items": {
"type": "object",
"additionalProperties": false,
"description": "An object holding a Credit Note line.",
"properties": {
"id": {
"type": "string",
"description": "External system identifier for the Credit Note line."
},
"internalId": {
"type": "string",
"description": "Internal identifier for the Credit Note line."
},
"quantity": {
"additionalProperties" : false,
"properties" : {
"amount" : {
"type" : "number",
"description" : "The quantity of the target Business Document line items."
},
"amountUninvoiced" : {
"type" : "number",
"description" : "The available quantity of the target Business Document line item which has not been invoiced."
},
"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" ]
}
}
},
"taxTotal": {
"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" ]
},
"taxSubTotal" : {
"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."
}
},
"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" ]
},
"allowanceCharge": {
"additionalProperties" : false,
"properties" : {
"chargeIndicator" : {
"type" : "boolean",
"description" : "Indicates whether the allowance charge is a charge (true) or a discount (false)."
},
"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" : [ "chargeIndicator", "amount" ]
}
},
"required": [
"id",
"item"
]
}
}
},
"required": [
"id",
"issueDate",
"accountingSupplierParty",
"accountingCustomerParty",
"legalMonetaryTotal",
"creditNoteLine"
]
}
},
"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/v1/creditNotes/{bumId}
URI Parameters
Param Name | Type | Required | Example | Description |
---|---|---|---|---|
bumId | string | true | a2cbb40b-8031-449d-af14-5b7974681b2b | 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 |
---|---|
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 v1
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
{
"version": "1.0",
"fileId": "539a785684aed4025464647d",
"links": [
{
"rel": "file",
"href": "https://api.basware.com/v1/files/539a785684aed4025464647d",
"method": "GET"
}
]
}
Response schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "Message version number."
},
"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": ["version"]
}
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:
- 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.
- File name must not be longer than 75 characters.
- Size of an individual file must not exceed 5 MB.
- Total size of all the attachments must not exceed 25 MB.
File upload works in the following manner:
- Only one file and its metadata can be uploaded at a time.
- Each part of the multipart request needs an additional Content-Type header.
- Metadata part must come first and Content-Type must match one of the accepted metadata formats.
- File part must come second and Content-Type must match one the method’s accepted media MIME types.
Request header has a Content-Type parameter that can must have the following values for each part:
- Content type defined as “multipart/mixed”. This defines the content type for the entire request as multipart.
- Content type defined for metadata part as “application/json”. Only JSON is supported at the moment.
- Content type defined for file part. This defines the content type for the file part of the request.
File upload supports also base64 encoding:
- If the Content-Transfer-Encoding header in the file content part of the mixed-multipart message (the last part) is set to base64 then the content of the file is expected to be base64 encoded.
Request URI
https://api.basware.com/v1/files
Request Headers
Param Name | Required | Example | Description |
---|---|---|---|
Content-Type | true | multipart/mixed | The MIME type of the body of the request. It should be set to “multipart/mixed”. |
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 | |
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.
File download supports also base64 encoding:
- If the GET request header X-BW-Accept-Encoding contains `base64` then the response will be return with the body base64 encoded.
Request URI
https://api.basware.com/v1/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. |