Batch update purchase invoices

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://restapi.wyzio.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Wyzio MCP server": {
    "url": "https://restapi.wyzio.com/mcp"
  }
}

Close
POST /api-v1/purchase-invoice/batch

Updates multiple purchase invoices. Returns 200 on success, or 400 if any entry fails validation.

Headers

  • WEAL-TOKEN Required

    API token (can be retrieved from account settings)

  • TARGET-ORGANIZATION-ID

    ID of organization, for which the operation must be performed

Query parameters

  • suppressDuplicateWarning boolean

    Whether to suppress duplicate invoice warnings

application/json

Body Required

  • id integer

    Entity ID. If negative value, a new entity will be created

  • journalEntryId integer

    Journal entry ID

  • date string Required

    Invoice date (format dd/MM/yyyy)

  • supplierId integer Required

    Supplier contact ID

  • currencyId integer Required

    Currency ID

  • reference string Required

    Supplier invoice reference

  • description string

    Invoice description

  • comment string

    Internal comment

  • validated boolean

    Whether the invoice is validated. Only applied if the current user has validation permission

  • vatType string

    VAT type

    Values are NO_VAT, NATIVE, or IMPORT_OF_SERVICE.

  • vatTypeCodeId integer

    VAT type code ID

  • paymentAccountId integer

    Payment chart of accounts ID. Auto-filled from organization defaults when creating and left empty

  • isDraft boolean

    Whether to save the invoice as a draft, bypassing strict validation. Forced to true by the server if validation fails for a not-yet-existing or draft invoice

  • amounts array[object] Required

    Invoice amount lines (VAT breakdown). Required, must not be empty

    Hide amounts attributes Show amounts attributes object
    • id integer

      Entity ID. If negative value, a new entity will be created

    • vatRateId integer

      VAT rate ID

    • amountType string

      Purchase amount type

      Values are NO_VAT, VAT_RATE, or MANUAL.

    • net string

      Net amount as string

    • vat string

      VAT amount as string

    • vatType string

      VAT type. Auto-filled from the invoice's vatType when not provided and this is a new line

      Values are NO_VAT, NATIVE, or IMPORT_OF_SERVICE.

    • vatTypeCodeId integer

      VAT type code ID. Auto-filled from the invoice's vatTypeCodeId when not provided and this is a new line

  • attributions array[object] Required

    Cost attributions, must not be empty

    Hide attributions attributes Show attributions attributes object
    • id integer

      Entity ID. If negative value, a new entity will be created

    • chartOfAccountsId integer

      Chart of accounts (expense category) ID

    • dateFrom string

      Accrual start date (format dd/MM/yyyy)

    • dateTo string

      Accrual end date (format dd/MM/yyyy)

    • net string

      Net amount as string

    • percent string

      Percentage of the total invoice amount as string

    • departmentId integer

      Department ID

    • orderId integer

      Order ID this attribution is charged to

    • reBill boolean

      Whether this attribution should be rebilled to the client

    • articleId integer

      Article ID

    • quantity string

      Quantity as string

    • shipments array[object]

      Shipment records for this attribution

      Hide shipments attributes Show shipments attributes object
      • id integer

        Entity ID. If negative value, a new entity will be created

      • shipmentDate string

        Shipment date (format dd/MM/yyyy)

      • articleId integer

        Article ID

      • quantity string

        Quantity as string

      • totalCost number

        Total cost

      • generatedStockMovementId integer

        ID of the stock movement generated for this shipment

      • officeId integer

        Office ID

    • fixedAssetId integer

      Fixed asset ID this attribution creates or is linked to

    • officeId integer

      Office ID

  • payments array[object] Required

    Payment records. Required, must not be empty

    Hide payments attributes Show payments attributes object
    • id integer

      Entity ID. If negative value, a new entity will be created

    • requestedDate string

      Requested payment date (format dd/MM/yyyy)

    • plannedDate string

      Planned payment date (format dd/MM/yyyy)

    • sentDate string

      Date the payment was sent (format dd/MM/yyyy)

    • valueDate string

      Value date of the payment (format dd/MM/yyyy)

    • requestedAmount string

      Requested amount as string

    • paidAmount string

      Paid amount as string

    • bankCharges string

      Bank charges as string

    • payableByAccountId integer

      Chart of accounts ID used as the payable-by account

    • paymentType string

      Payment type

      Values are BANK_TRANSFER, BVR, or QR_BILL.

    • payableToBankId integer

      Bank ID to pay to

    • lineCode string

      Payment line code

    • accountNumber string

      Account number

    • referenceNumber string

      Payment reference number

    • qrBillData string

      QR-bill data

    • paymentPurposeCodeId integer

      Payment purpose code ID

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
    • items array[object]
      Hide items attributes Show items attributes object
      • errorCode object
        Hide errorCode attributes Show errorCode attributes object
        • errorCode string

          Values are NO_ERROR, NOT_IMPLEMENTED_YET, CONTACT_NOT_FOUND, FIELD_REQUIRED, VALIDATION_ERROR, DUPLICATION_ERROR, UNIQUE_CONSTRAINT_VIOLATION, WRONG_PASSWORD_FORMAT, WRONG_PASSWORD, ACTION_DENIED, NOT_FOUND, EXPECTED_ONE_FILE, UNIQUE_VIOLATION, CONTENT_EMPTY, INVALID_TYPE, CONVERSION_ERROR, FILE_PARSE_EXCEPTION, or IN_USE.

        • errorDetailValues array[object]
          Hide errorDetailValues attributes Show errorDetailValues attributes object
          • errorCode string
          • fieldName string
          • data string
          • isSevere boolean
      • freshData

        Refreshed domain data

      • freshRow

        Refreshed table row data

      • possibleWorkflows array[object]
        Hide possibleWorkflows attributes Show possibleWorkflows attributes object
        • id integer(int64)
        • name string
      • error boolean
      • severeError boolean
  • 400

    400 Bad Request

  • 401

    401 Unauthorized

  • 403

    403 Access Denied

  • 404

    404 Not Found

  • 500

    500 Internal Server Error

POST /api-v1/purchase-invoice/batch
curl \
 --request POST 'https://wyzio.app/api-v1/purchase-invoice/batch' \
 --header "Content-Type: application/json" \
 --data '[{"id":12345678,"journalEntryId":12345678,"date":"01/06/2026","supplierId":12345678,"currencyId":12345678,"reference":"INV-2026-001","description":"Office supplies Q2","comment":"Approved by manager","validated":false,"vatType":"NO_VAT","vatTypeCodeId":12345678,"paymentAccountId":12345678,"isDraft":false,"amounts":[{"id":12345678,"vatRateId":12345678,"amountType":"NO_VAT","net":100.0,"vat":7.7,"vatType":"NO_VAT","vatTypeCodeId":12345678}],"attributions":[{"id":12345678,"chartOfAccountsId":12345678,"dateFrom":"01/01/2026","dateTo":"31/03/2026","net":100.0,"percent":100.0,"departmentId":12345678,"orderId":12345678,"reBill":false,"articleId":12345678,"quantity":1.0,"shipments":[{"id":12345678,"shipmentDate":"01/06/2026","articleId":12345678,"quantity":10.0,"totalCost":250.0,"generatedStockMovementId":12345678,"officeId":12345678}],"fixedAssetId":12345678,"officeId":12345678}],"payments":[{"id":12345678,"requestedDate":"01/06/2026","plannedDate":"05/06/2026","sentDate":"05/06/2026","valueDate":"05/06/2026","requestedAmount":1200.0,"paidAmount":1200.0,"bankCharges":5.0,"payableByAccountId":12345678,"paymentType":"BANK_TRANSFER","payableToBankId":12345678,"lineCode":"L001","accountNumber":"CH56 0483 5012 3456 7800 9","referenceNumber":210000000003139471430009017,"qrBillData":"SPC...","paymentPurposeCodeId":12345678}]}]'
Request examples
# Headers

# Payload
[
  {
    "id": 12345678,
    "journalEntryId": 12345678,
    "date": "01/06/2026",
    "supplierId": 12345678,
    "currencyId": 12345678,
    "reference": "INV-2026-001",
    "description": "Office supplies Q2",
    "comment": "Approved by manager",
    "validated": false,
    "vatType": "NO_VAT",
    "vatTypeCodeId": 12345678,
    "paymentAccountId": 12345678,
    "isDraft": false,
    "amounts": [
      {
        "id": 12345678,
        "vatRateId": 12345678,
        "amountType": "NO_VAT",
        "net": 100.0,
        "vat": 7.7,
        "vatType": "NO_VAT",
        "vatTypeCodeId": 12345678
      }
    ],
    "attributions": [
      {
        "id": 12345678,
        "chartOfAccountsId": 12345678,
        "dateFrom": "01/01/2026",
        "dateTo": "31/03/2026",
        "net": 100.0,
        "percent": 100.0,
        "departmentId": 12345678,
        "orderId": 12345678,
        "reBill": false,
        "articleId": 12345678,
        "quantity": 1.0,
        "shipments": [
          {
            "id": 12345678,
            "shipmentDate": "01/06/2026",
            "articleId": 12345678,
            "quantity": 10.0,
            "totalCost": 250.0,
            "generatedStockMovementId": 12345678,
            "officeId": 12345678
          }
        ],
        "fixedAssetId": 12345678,
        "officeId": 12345678
      }
    ],
    "payments": [
      {
        "id": 12345678,
        "requestedDate": "01/06/2026",
        "plannedDate": "05/06/2026",
        "sentDate": "05/06/2026",
        "valueDate": "05/06/2026",
        "requestedAmount": 1200.0,
        "paidAmount": 1200.0,
        "bankCharges": 5.0,
        "payableByAccountId": 12345678,
        "paymentType": "BANK_TRANSFER",
        "payableToBankId": 12345678,
        "lineCode": "L001",
        "accountNumber": "CH56 0483 5012 3456 7800 9",
        "referenceNumber": 210000000003139471430009017,
        "qrBillData": "SPC...",
        "paymentPurposeCodeId": 12345678
      }
    ]
  }
]
Response examples (200)
{
  "items": [
    {
      "errorCode": {
        "errorCode": "NO_ERROR",
        "errorDetailValues": [
          {
            "errorCode": "string",
            "fieldName": "string",
            "data": "string",
            "isSevere": true
          }
        ]
      },
      "possibleWorkflows": [
        {
          "id": 42,
          "name": "string"
        }
      ],
      "error": true,
      "severeError": true
    }
  ]
}