You are using the wrong endpoint to upload the document for the voucher/batch. mutation createBatchAndVoucherWithAttachment($batchId: Int = 0) {
useCompany(no: 5051201) {
batch_create(
values: [{voucherSeriesNo: null, valueDate: 20240905, description: "Z-rapport-1-1003"}]
) {
affectedRows
items {
batchNo @export(as: "batchId")
}
}
voucher_create(
values: [{creditAccountNo: 3005, creditTaxCode: null, amountDomestic: 2660, batchNo: $batchId, voucherType: 1, voucherNo: null, voucherDate: null, text: "Z-rapport 1003 Salg Varer 25.00% MVA (05.09.2024)"}, {debitAccountNo: 1920, debitTaxCode: null, amountDomestic: 1930, batchNo: $batchId, voucherType: 1, voucherNo: null, voucherDate: null, text: "Z-rapport 1003 BankAxept (05.09.2024)"}, {debitAccountNo: 1901, debitTaxCode: null, amountDomestic: 730, batchNo: $batchId, voucherType: 1, voucherNo: null, voucherDate: null, text: "Z-rapport 1003 Til nattsafe (05.09.2024)"}]
) {
affectedRows
items {
batchNo
voucherNo
voucherDate
}
}
voucher_processings {
addNewDocument(
filter: {batchNo: {_eq: $batchId}}
args: {fileName: "z-report-1003-4.pdf", description: "z-report-1003-4", fileBytes: "JVBERi0xLjMKMSAwIG9iago8PC..."}
) {
succeeded
}
}
}
}
... View more