# Basware

> Take approved invoices into your ERP and report back, track invoice status and purchase orders, and keep vendors, GL accounts and cost centers up to date in Basware.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/basware

## Actions

### Acknowledge invoice

Mark an invoice as taken by your ERP, so it isn't offered again. Do it right after reading the invoice, before sending its transfer response.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice, by its Basware invoice ID.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Acknowledge purchase order

Mark a purchase order as picked up, so it isn't offered again until it changes.

**Inputs**

- Purchase order (`order_id`, text, required): The purchase order, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Acknowledge purchase requisition

Mark a purchase requisition as picked up, so it isn't offered again.

**Inputs**

- Purchase requisition (`requisition_id`, text, required): The purchase requisition, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Create or update cost center

Add a cost center for invoice coding, or replace one sent before with the same external code.

**Inputs**

- External code (`external_code`, text, required): Your own unique key for the cost center, up to 36 characters. Send the same one again to update it.
- Cost center code (`cost_center_code`, text, required): The cost center's code, as used in invoice coding.
- Name (`name`, text, required): The cost center's name.
- Companies (`company_codes`, list, required): The companies (organization units) the cost center belongs to, by company code.
- Include lower units (`include_child_units`, true/false): Also use it in the companies' lower organization units. On unless you turn it off.
- Active (`active`, true/false): Whether people can use it in Basware. On unless you turn it off.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "records": [
      {}
    ],
    "requestId": "example"
  }
}
```

### Create or update GL account

Add a general ledger account for invoice coding, or replace one sent before with the same external code.

**Inputs**

- External code (`external_code`, text, required): Your own unique key for the account, up to 36 characters. Send the same one again to update it.
- Account code (`account_code`, text, required): The account's code, as used in invoice coding.
- Name (`name`, text, required): The account's name.
- Companies (`company_codes`, list, required): The companies (organization units) the account belongs to, by company code.
- Tax code (`tax_code`, text): The account's default tax code.
- Include lower units (`include_child_units`, true/false): Also use it in the companies' lower organization units. On unless you turn it off.
- Active (`active`, true/false): Whether people can use it in Basware. On unless you turn it off.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "records": [
      {}
    ],
    "requestId": "example"
  }
}
```

### Create or update vendor

Add a vendor (supplier) to Basware, or replace one sent before with the same external code.

**Inputs**

- External code (`external_code`, text, required): Your own unique key for the vendor, up to 36 characters. Send the same one again to update it.
- Vendor code (`vendor_code`, text, required): The vendor's code, normally its number in your ERP.
- Name (`name`, text, required): The vendor's name.
- Companies (`company_codes`, list, required): The companies (organization units) the vendor belongs to, by company code.
- Include lower units (`include_child_units`, true/false): Also use it in the companies' lower organization units. On unless you turn it off.
- Payment term code (`payment_term_code`, text): The vendor's payment term, by its code in Basware.
- Email (`email`, text): The vendor's email address.
- Street (`street`, text): The vendor's street address.
- City (`city`, text): The vendor's city.
- Postal code (`postal_code`, text): The vendor's postal code.
- Country code (`country`, text): The vendor's country, as a two-letter code such as `US` or `DE`.
- Ordering format (`ordering_format`, text): How Basware Procurement sends this vendor orders. One of: `BaswareNetwork` (Basware Network), `email`, `EHFXML21` (EHF XML 2.1), `other`, `none` (Not ordered through Basware).
- Order email (`order_email`, text): Where orders are emailed, when the ordering format is Email.
- Description (`description`, text): A note about the vendor.
- Active (`active`, true/false): Whether the vendor can be used. On unless you turn it off.
- Payment blocked (`payment_blocked`, true/false): Block payments to this vendor.
- Source system (`source_system`, text): The system the vendor comes from, such as your ERP's name.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "records": [
      {}
    ],
    "requestId": "example"
  }
}
```

### Delete cost center

Delete a cost center you imported through Basware API, by its external code. It is removed from Basware API only: remove it in AP Automation too if it was used there.

**Inputs**

- Cost center (`external_code`, text, required): The cost center, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "statusApiLink": "example",
    "taskName": "example",
    "taskStatus": "example"
  }
}
```

### Delete GL account

Delete a GL account you imported through Basware API, by its external code. It is removed from Basware API only: remove it in AP Automation too if it was used there.

**Inputs**

- GL account (`external_code`, text, required): The GL account, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "statusApiLink": "example",
    "taskName": "example",
    "taskStatus": "example"
  }
}
```

### Delete vendor

Delete a vendor you imported through Basware API, by its external code. It is removed from Basware API only: remove it in AP Automation too if it was used there.

**Inputs**

- Vendor (`external_code`, text, required): The vendor, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "statusApiLink": "example",
    "taskName": "example",
    "taskStatus": "example"
  }
}
```

### Get cost center

Get a cost center you imported through Basware API, by its external code.

**Inputs**

- Cost center (`external_code`, text, required): The cost center, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "companies": [
      {
        "active": true,
        "companyCode": "example",
        "inherit": true,
        "inheritToChildUnits": true
      }
    ],
    "costCenterCode": "example",
    "costCenterNames": [
      {
        "language": "example",
        "translation": "example"
      }
    ],
    "externalCode": "example",
    "lastUpdated": "example"
  }
}
```

### Get GL account

Get a general ledger account you imported through Basware API, by its external code.

**Inputs**

- Account (`external_code`, text, required): The account, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "accountCode": "example",
    "accountNames": [
      {
        "language": "example",
        "translation": "example"
      }
    ],
    "companies": [
      {
        "active": true,
        "companyCode": "example",
        "inherit": true,
        "inheritToChildUnits": true
      }
    ],
    "externalCode": "example",
    "lastUpdated": "example",
    "taxCode": "example"
  }
}
```

### Get import status

Check whether one import reached Basware and each system it was sent to, using the request ID a create or update step returned.

**Inputs**

- Request ID (`request_id`, text, required): The request ID a create or update step returned.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "requestStatus": [
      {
        "changedBy": "example",
        "entityType": "example",
        "lastUpdated": "example",
        "operationType": "example",
        "requestId": "example",
        "requestStatus": "example",
        "systems": [
          {
            "items": [
              {}
            ],
            "module": "example",
            "system": "example",
            "systemStatus": "example"
          }
        ]
      }
    ]
  }
}
```

### Get invoice

Get an invoice's full details: its supplier, sums, dates, coding rows, lines and attachments.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice, by its Basware invoice ID.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "attachments": [
      {
        "attachmentExternalCode": "example",
        "fileName": "example"
      }
    ],
    "codingRows": [
      {
        "accountCode": "example",
        "costCenterCode": "example",
        "netSum": 1,
        "taxCode": "example"
      }
    ],
    "companyCode": "example",
    "companyName": "example",
    "currencyCode": "example",
    "description": "example",
    "dueDate": "example",
    "grossSum": 1,
    "invoiceDate": "example",
    "invoiceId": "example",
    "invoiceImageURL": "example",
    "invoiceNumber": "example",
    "lastUpdated": "example",
    "netSum": 1,
    "orderNumbers": [
      "example"
    ],
    "p2pProcessingMode": "example",
    "paymentBlock": true,
    "paymentTermCode": "example",
    "processingStatus": "example",
    "referenceNumber": "example",
    "supplierCode": "example",
    "supplierName": "example",
    "voucherNumber1": "example"
  }
}
```

### Get invoice status

Look up where a supplier's invoice is: in approval, ready for payment, paid or rejected. Basware turns this on for your account on request.

**Inputs**

- Company (`company_code`, text, required): The company the invoice was sent to.
- Invoice number (`invoice_number`, text, required): The supplier's invoice number.
- Invoice date (`invoice_date`, date, required): The invoice's date.
- Total with tax (`gross_sum`, number): The invoice's total with tax, to tell apart invoices with the same number.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "statuses": [
      {
        "invoiceId": "example",
        "lastUpdated": "example",
        "processingStatus": "example",
        "status": "example"
      }
    ]
  }
}
```

### Get purchase order

Get a purchase order sent from Basware Procurement, with its lines and goods receipts.

**Inputs**

- Purchase order (`order_id`, text, required): The purchase order, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "companyCode": "example",
    "companyName": "example",
    "documentLink": "example",
    "extOrderNumber": "example",
    "externalCode": "example",
    "grossSum": 1,
    "lastUpdated": "example",
    "netSum": 1,
    "orderCreationTime": "example",
    "orderLines": [
      {}
    ],
    "orderNumber": "example",
    "orderStatus": "example",
    "orderType": "example",
    "processingStatus": "example",
    "purchaseCurrency": "example",
    "requisitionNumber": "example",
    "supplierCode": "example",
    "supplierName": "example"
  }
}
```

### Get purchase requisition

Get a purchase requisition from Basware Procurement, with its lines.

**Inputs**

- Purchase requisition (`requisition_id`, text, required): The purchase requisition, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "companyCode": "example",
    "companyName": "example",
    "documentLink": "example",
    "extRequisitionNumber": "example",
    "externalCode": "example",
    "grossSum": 1,
    "lastUpdated": "example",
    "lines": [
      {}
    ],
    "processingStatus": "example",
    "purchaseCurrency": "example",
    "purpose": "example",
    "requisitionCreationTime": "example",
    "requisitionNumber": "example",
    "requisitionStatus": "example"
  }
}
```

### Get vendor

Get a vendor you imported through Basware API, by its external code.

**Inputs**

- Vendor (`external_code`, text, required): The vendor, by the external code it was imported with.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "buvid": "example",
    "companies": [
      {
        "active": true,
        "companyCode": "example",
        "inherit": true,
        "inheritToChildUnits": true
      }
    ],
    "description": "example",
    "externalCode": "example",
    "lastUpdated": "example",
    "name": "example",
    "paymentTerms": {
      "paymentTermCode": "example"
    },
    "processingStatus": {
      "active": true,
      "paymentDenied": true
    },
    "sourceSystem": "example",
    "vendorCode": "example"
  }
}
```

### List companies

List the companies (organization units) imported into Basware.

**Inputs**

- Changed since (`updated_since`, date and time): Only records changed after this time.
- Results per page (`page_size`, number): How many results to return, up to 500. Leave empty for 500. From 1 to 500.
- Continuation token (`continuation_token`, text): The next page's token, from the previous page's Continuation token. Leave empty for the first page.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "companies": [
      {
        "active": true,
        "companyCode": "example",
        "description": "example",
        "homeCurrency": "example",
        "lastUpdated": "example",
        "name": "example"
      }
    ],
    "continuationToken": "example"
  }
}
```

### List import statuses

Find out whether vendors, accounts and other records you sent reached Basware, or why they failed. Leave the status empty for failures.

**Inputs**

- Status (`status`, text): Only imports with this outcome. One of: `InProgress` (In progress), `Success` (Succeeded), `Error` (Failed), `AcknowledgedSuccess` (Succeeded, acknowledged), `AcknowledgedError` (Failed, acknowledged).
- Record type (`record_type`, text): Only imports of this kind of record. One of: `Account` (GL account), `Contract`, `CostCenter` (Cost center), `TaxCode` (Tax code), `ExchangeRate` (Exchange rate), `PaymentTerm` (Payment term), `User`, `Project`, `MatchingOrder` (Matching order), `MatchingOrderLine` (Matching order line), and 7 more.
- Changed since (`updated_since`, date and time): Only records changed after this time.
- Results per page (`page_size`, number): How many results to return, up to 500. Leave empty for 500. From 1 to 500.
- Continuation token (`continuation_token`, text): The next page's token, from the previous page's Continuation token. Leave empty for the first page.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "continuationToken": "example",
    "requestStatus": [
      {
        "changedBy": "example",
        "entityType": "example",
        "lastUpdated": "example",
        "operationType": "example",
        "requestId": "example",
        "requestStatus": "example",
        "systems": [
          {
            "items": [
              {}
            ],
            "module": "example",
            "system": "example",
            "systemStatus": "example"
          }
        ]
      }
    ]
  }
}
```

### List invoices

Find invoices ready for, or already sent to, your accounting system, by status, company and when they changed.

**Inputs**

- Status (`status`, text): Only invoices with this processing status. Choose Ready for transfer for approved invoices your ERP hasn't taken yet. One of: `WaitingForPrebook` (Waiting for prebook), `PrebookInProgress` (Prebook in progress), `Prebooked`, `PrebookFailed` (Prebook failed), `WaitingForTransfer` (Ready for transfer), `TransferInProgress` (Transfer in progress), `Transferred`, `TransferFailed` (Transfer failed), `WaitingForPrebookCancelation` (Waiting for prebook cancellation), `PrebookCancelationInProgress` (Prebook cancellation in progress), and 20 more.
- Company (`company_code`, text): Only records for this company.
- Changed since (`updated_since`, date and time): Only records changed after this time.
- Processing mode (`processing_mode`, text): Approved invoices (standard), or invoices only enriched in Basware and approved in your ERP. Leave empty for approved ones. One of: `Standard` (Approved for payment (standard)), `InvoiceEnrichment` (Enriched only (approved elsewhere)).
- Results per page (`page_size`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Continuation token (`continuation_token`, text): The next page's token, from the previous page's Continuation token. Leave empty for the first page.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "accountingDocuments": [
      {
        "attachments": [
          {
            "attachmentExternalCode": "example",
            "fileName": "example"
          }
        ],
        "codingRows": [
          {
            "accountCode": "example",
            "costCenterCode": "example",
            "netSum": 1,
            "taxCode": "example"
          }
        ],
        "companyCode": "example",
        "companyName": "example",
        "currencyCode": "example",
        "description": "example",
        "dueDate": "example",
        "grossSum": 1,
        "invoiceDate": "example",
        "invoiceId": "example",
        "invoiceImageURL": "example",
        "invoiceNumber": "example",
        "lastUpdated": "example",
        "netSum": 1,
        "orderNumbers": [
          "example"
        ],
        "p2pProcessingMode": "example",
        "paymentBlock": true,
        "paymentTermCode": "example",
        "processingStatus": "example",
        "referenceNumber": "example",
        "supplierCode": "example",
        "supplierName": "example",
        "voucherNumber1": "example"
      }
    ],
    "continuationToken": "example"
  }
}
```

### List purchase orders

Find purchase orders sent from Basware Procurement, such as new or changed ones your ERP hasn't picked up.

**Inputs**

- Pick-up status (`status`, text): Only orders your system has, or hasn't, picked up yet. One of: `WaitingForExport` (Not yet picked up), `Exported` (Picked up).
- Company (`company_code`, text): Only records for this company.
- Changed since (`updated_since`, date and time): Only records changed after this time.
- Results per page (`page_size`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Continuation token (`continuation_token`, text): The next page's token, from the previous page's Continuation token. Leave empty for the first page.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "continuationToken": "example",
    "exportedPurchaseOrders": [
      {
        "companyCode": "example",
        "companyName": "example",
        "documentLink": "example",
        "extOrderNumber": "example",
        "externalCode": "example",
        "grossSum": 1,
        "lastUpdated": "example",
        "netSum": 1,
        "orderCreationTime": "example",
        "orderLines": [
          {}
        ],
        "orderNumber": "example",
        "orderStatus": "example",
        "orderType": "example",
        "processingStatus": "example",
        "purchaseCurrency": "example",
        "requisitionNumber": "example",
        "supplierCode": "example",
        "supplierName": "example"
      }
    ]
  }
}
```

### List purchase requisitions

Find purchase requisitions that were approved, rejected or canceled in Basware Procurement.

**Inputs**

- Pick-up status (`status`, text): Only requisitions your system has, or hasn't, picked up yet. One of: `WaitingForExport` (Not yet picked up), `Exported` (Picked up).
- Company (`company_code`, text): Only records for this company.
- Changed since (`updated_since`, date and time): Only records changed after this time.
- Results per page (`page_size`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Continuation token (`continuation_token`, text): The next page's token, from the previous page's Continuation token. Leave empty for the first page.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "continuationToken": "example",
    "exportedPurchaseRequisitions": [
      {
        "companyCode": "example",
        "companyName": "example",
        "documentLink": "example",
        "extRequisitionNumber": "example",
        "externalCode": "example",
        "grossSum": 1,
        "lastUpdated": "example",
        "lines": [
          {}
        ],
        "processingStatus": "example",
        "purchaseCurrency": "example",
        "purpose": "example",
        "requisitionCreationTime": "example",
        "requisitionNumber": "example",
        "requisitionStatus": "example"
      }
    ]
  }
}
```

### Send payment response

Tell Basware an invoice has been paid, or partly paid. Payment fields you leave empty are cleared on the invoice.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice, by its Basware invoice ID.
- Response ID (`response_id`, text, required): Your own unique ID for this response, up to 36 characters, such as your ERP's document number. Each response to an invoice needs a new one.
- Payment date (`payment_date`, date): When the invoice was paid. Leave empty for today.
- Total paid (`paid_total`, number): The total paid so far. For partial payments, this grows with each payment. At least 0.
- Payment method (`payment_method`, text): How it was paid, as your ERP names it.
- Payment number (`payment_number`, text): The payment's number in your ERP.
- Check number (`check_number`, text): The check number, if paid by check.
- Cash discount (`cash_discount`, number): The cash discount taken. At least 0.
- Message (`message`, text): A note for the invoice's log in Basware.
- Payment blocked (`payment_block`, true/false): Whether your ERP has blocked payment of the invoice.
- Source system (`source_system`, text): The name of the system answering, such as your ERP's name.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "externalCode": "example",
    "paidTotal": 1,
    "paymentDate": "example",
    "success": true
  }
}
```

### Send prebook response

Tell Basware whether your ERP prebooked an invoice, with its voucher number.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice, by its Basware invoice ID.
- Response ID (`response_id`, text, required): Your own unique ID for this response, up to 36 characters, such as your ERP's document number. Each response to an invoice needs a new one.
- Prebooked (`success`, true/false, required): Whether your ERP prebooked the invoice.
- Message (`message`, text, required): A note shown in Basware, such as why prebooking failed.
- Voucher number (`voucher_number`, text): The voucher (posting) number your ERP gave the invoice.
- Second voucher number (`voucher_number_2`, text): A second voucher number, if your ERP gives one.
- Prebook date (`prebook_date`, date and time): When your ERP prebooked the invoice.
- Payment blocked (`payment_block`, true/false): Whether your ERP has blocked payment of the invoice.
- Source system (`source_system`, text): The name of the system answering, such as your ERP's name.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "externalCode": "example",
    "responseMessage": "example",
    "success": true
  }
}
```

### Send transfer response

Tell Basware whether your ERP took an approved invoice, with its voucher number. Basware then marks it transferred, or shows why it failed.

**Inputs**

- Invoice (`invoice_id`, text, required): The invoice, by its Basware invoice ID.
- Response ID (`response_id`, text, required): Your own unique ID for this response, up to 36 characters, such as your ERP's document number. Each response to an invoice needs a new one.
- Transferred (`success`, true/false, required): Whether your ERP took the invoice.
- Message (`message`, text, required): A note shown in Basware, such as why the transfer failed.
- Voucher number (`voucher_number`, text): The voucher (posting) number your ERP gave the invoice.
- Second voucher number (`voucher_number_2`, text): A second voucher number, if your ERP gives one.
- Transfer date (`transfer_date`, date and time): When your ERP took the invoice.
- Payment blocked (`payment_block`, true/false): Whether your ERP has blocked payment of the invoice.
- Source system (`source_system`, text): The name of the system answering, such as your ERP's name.

**Outputs**

- `data` (object): The response from Basware.

**Example output**

```json
{
  "data": {
    "externalCode": "example",
    "responseMessage": "example",
    "success": true
  }
}
```
