Batch update sales 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/sales-invoice/batch

Updates multiple sales 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

application/json

Body Required

  • id integer

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

  • journalEntryId integer

    Journal entry ID

  • number string

    Invoice number

  • date string Required

    Invoice date (format dd/MM/yyyy)

  • clientId integer

    Client contact ID

  • clientAddressId integer

    Client address ID

  • address object

    Invoice client address. If clientAddressId is not provided, a new invoice client address can be specified.

    Hide address attributes Show address attributes object
    • id integer

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

    • name string

      Address label / name

    • line1 string

      Address line 1

    • line2 string

      Address line 2

    • city string

      City

    • region object

      Region

      Hide region attribute Show region attribute object
      • id integer

        Region ID

    • countryCode2 string

      ISO 3166-1 alpha-2 country code

    • countryId integer

      Country ID

    • postCode string

      Postal code

    • houseNumber string

      House number

    • toTheAttentionOf string

      To the attention of

    • position integer(int32)

      Position order

    • service string

      Service label

  • ourContactId integer

    Our contact ID

  • yourContactId integer

    Client's internal contact ID

  • clientName string

    Client name for display

  • reference string

    Internal reference

  • yourReference string

    Client's reference

  • currencyId integer

    Currency ID

  • description string

    Invoice description

  • comments string

    Internal comments

  • receivableAccountId integer

    Receivable chart of accounts ID

  • vatTypeCodeId integer

    VAT type code ID

  • excludedFromVat boolean

    Whether this invoice is excluded from VAT reporting

  • accrualFrom string

    Accrual period start date (format dd/MM/yyyy)

  • accrualTo string

    Accrual period end date (format dd/MM/yyyy)

  • validated boolean

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

  • invoiceLines array[object] Required

    Line item of a sales invoice

    Hide invoiceLines attributes Show invoiceLines attributes object

    Line item of a sales invoice

    • id integer

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

    • tempId integer

      Temporary negative ID used to reference this line from invoiceLinesLayout before it is saved

    • lineType string

      Line type

      Values are ARTICLE, NO_ARTICLE, TIMESHEET, EXPENSES, DISBURSEMENT, HEADER, or FIXED_ASSET.

    • quantity number

      Quantity

    • articleId integer

      Article ID

    • description string

      Line description

    • longDescription string

      Long description

    • netUnitPrice number

      Net unit price

    • discount number

      Discount percentage. Defaults to 0

    • totalNet number

      Net total

    • vatRateId integer

      VAT rate ID. Send null or -1 for no VAT

    • vat number

      VAT amount

    • totalPrice number

      Total price including VAT

    • saleAccountId integer

      Sale chart of accounts ID

    • departmentId integer

      Department ID

    • allocationKey string

      Allocation key

    • appliedAllocationRules array[string]

      Applied allocation rules

    • vatTypeCodeId integer

      VAT type code ID

    • officeId integer

      Office ID

  • invoiceLinesLayout array[object]

    Layout tree node grouping and ordering sales invoice lines. Processed into a materialized path structure on the server; the recursive children field is required to define the tree since the server does not use a flat parentId reference for this endpoint.

    Hide invoiceLinesLayout attributes Show invoiceLinesLayout attributes object

    Layout tree node grouping and ordering sales invoice lines. Processed into a materialized path structure on the server; the recursive children field is required to define the tree since the server does not use a flat parentId reference for this endpoint.

    • id integer

      Layout node ID. Negative value = new node, will be created and not linked to an existing entity

    • name string

      Display name for HEADER type nodes

    • position integer(int32)

      Position among siblings

    • lineType string

      Layout node type

      Values are ARTICLE, NO_ARTICLE, TIMESHEET, EXPENSES, DISBURSEMENT, HEADER, or FIXED_ASSET.

    • salesInvoiceLineId integer

      ID of the sales invoice line this node refers to. Applicable when lineType is not HEADER. May be a negative temporary ID matching a new line's tempId

    • sourceOrderId integer

      Source order ID this layout node originates from

    • children array

      Child layout nodes (recursive)

  • payments array[object] Required

    Payment record for a sales invoice

    Hide payments attributes Show payments attributes object

    Payment record for a sales invoice

    • id integer

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

    • receivableByAccountId integer

      Receivable chart of accounts ID

    • requestedDate string

      Requested payment date (format dd/MM/yyyy)

    • overdueDate string

      Overdue date (format dd/MM/yyyy)

    • valueDate string

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

    • sentDate string

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

    • requestedAmount string

      Requested amount as string

    • paidAmount string

      Paid amount as string

    • bankCharges string

      Bank charges as string

    • lossOnDebtors string

      Loss on debtors as string. Defaults to 0

    • qrBillData string

      QR-bill data

    • qrReferenceNumber string

      QR reference number, write-only

  • timesheetInfoItems array[object]

    Timesheet entry billed through a sales invoice

    Hide timesheetInfoItems attributes Show timesheetInfoItems attributes object

    Timesheet entry billed through a sales invoice

    • id integer

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

    • date string

      Date (format dd/MM/yyyy)

    • description string

      Description

    • time string

      Time spent as string, in hours

    • billableAmount string

      Billable amount as string

    • billableRate string

      Billable rate as string

    • employeeContactId integer

      Employee contact ID

    • originalTimesheetId integer

      Original timesheet entry ID this billing line originates from

    • employeeTaskId integer

      Employee task 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/sales-invoice/batch
curl \
 --request POST 'https://wyzio.app/api-v1/sales-invoice/batch' \
 --header "Content-Type: application/json" \
 --data '[{"id":12345678,"journalEntryId":12345678,"number":"2026-0001","date":"01/06/2026","clientId":12345678,"clientAddressId":12345678,"address":{"id":12345678,"name":"Main Office","line1":123,"line2":"Suite 4B","city":"Geneva","region":{"id":206},"countryCode2":"CH","countryId":12345678,"postCode":1200,"houseNumber":42,"toTheAttentionOf":"John Doe","position":1,"service":"HR"},"ourContactId":12345678,"yourContactId":12345678,"clientName":"Acme Corp","reference":"REF-2026-001","yourReference":"PO-2026-100","currencyId":12345678,"description":"Consulting services Q2 2026","comments":"Approved by finance","receivableAccountId":12345678,"vatTypeCodeId":12345678,"excludedFromVat":false,"accrualFrom":"01/01/2026","accrualTo":"31/03/2026","validated":false,"invoiceLines":[{"id":12345678,"tempId":-1,"lineType":"ARTICLE","quantity":5.0,"articleId":12345678,"description":"Consulting hours","longDescription":"string","netUnitPrice":150.0,"discount":0.0,"totalNet":750.0,"vatRateId":12345678,"vat":58.5,"totalPrice":808.5,"saleAccountId":12345678,"departmentId":12345678,"allocationKey":"50/50","appliedAllocationRules":["string"],"vatTypeCodeId":12345678,"officeId":12345678}],"invoiceLinesLayout":[{"id":-1,"name":"Consulting Services","position":1,"lineType":"HEADER","salesInvoiceLineId":12345678,"sourceOrderId":12345678,"children":[]}],"payments":[{"id":12345678,"receivableByAccountId":12345678,"requestedDate":"01/06/2026","overdueDate":"15/07/2026","valueDate":"05/06/2026","sentDate":"05/06/2026","requestedAmount":1200.0,"paidAmount":1200.0,"bankCharges":5.0,"lossOnDebtors":0.0,"qrBillData":"SPC...","qrReferenceNumber":210000000003139471430009017}],"timesheetInfoItems":[{"id":12345678,"date":"01/06/2026","description":"Development work","time":8.0,"billableAmount":800.0,"billableRate":100.0,"employeeContactId":12345678,"originalTimesheetId":12345678,"employeeTaskId":12345678}]}]'
Request examples
# Headers

# Payload
[
  {
    "id": 12345678,
    "journalEntryId": 12345678,
    "number": "2026-0001",
    "date": "01/06/2026",
    "clientId": 12345678,
    "clientAddressId": 12345678,
    "address": {
      "id": 12345678,
      "name": "Main Office",
      "line1": 123,
      "line2": "Suite 4B",
      "city": "Geneva",
      "region": {
        "id": 206
      },
      "countryCode2": "CH",
      "countryId": 12345678,
      "postCode": 1200,
      "houseNumber": 42,
      "toTheAttentionOf": "John Doe",
      "position": 1,
      "service": "HR"
    },
    "ourContactId": 12345678,
    "yourContactId": 12345678,
    "clientName": "Acme Corp",
    "reference": "REF-2026-001",
    "yourReference": "PO-2026-100",
    "currencyId": 12345678,
    "description": "Consulting services Q2 2026",
    "comments": "Approved by finance",
    "receivableAccountId": 12345678,
    "vatTypeCodeId": 12345678,
    "excludedFromVat": false,
    "accrualFrom": "01/01/2026",
    "accrualTo": "31/03/2026",
    "validated": false,
    "invoiceLines": [
      {
        "id": 12345678,
        "tempId": -1,
        "lineType": "ARTICLE",
        "quantity": 5.0,
        "articleId": 12345678,
        "description": "Consulting hours",
        "longDescription": "string",
        "netUnitPrice": 150.0,
        "discount": 0.0,
        "totalNet": 750.0,
        "vatRateId": 12345678,
        "vat": 58.5,
        "totalPrice": 808.5,
        "saleAccountId": 12345678,
        "departmentId": 12345678,
        "allocationKey": "50/50",
        "appliedAllocationRules": [
          "string"
        ],
        "vatTypeCodeId": 12345678,
        "officeId": 12345678
      }
    ],
    "invoiceLinesLayout": [
      {
        "id": -1,
        "name": "Consulting Services",
        "position": 1,
        "lineType": "HEADER",
        "salesInvoiceLineId": 12345678,
        "sourceOrderId": 12345678,
        "children": []
      }
    ],
    "payments": [
      {
        "id": 12345678,
        "receivableByAccountId": 12345678,
        "requestedDate": "01/06/2026",
        "overdueDate": "15/07/2026",
        "valueDate": "05/06/2026",
        "sentDate": "05/06/2026",
        "requestedAmount": 1200.0,
        "paidAmount": 1200.0,
        "bankCharges": 5.0,
        "lossOnDebtors": 0.0,
        "qrBillData": "SPC...",
        "qrReferenceNumber": 210000000003139471430009017
      }
    ],
    "timesheetInfoItems": [
      {
        "id": 12345678,
        "date": "01/06/2026",
        "description": "Development work",
        "time": 8.0,
        "billableAmount": 800.0,
        "billableRate": 100.0,
        "employeeContactId": 12345678,
        "originalTimesheetId": 12345678,
        "employeeTaskId": 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
    }
  ]
}