{"openapi":"3.1.0","info":{"title":"AbaNinja Documents API - Common","version":"3.0.0","x-domain-id":"documents"},"servers":[{"url":"https://api.abaninja.ch","description":"The AbaNinja API server"}],"tags":[{"name":"document-common","description":"Manage documents","x-displayName":"Common"}],"security":[{"ApiToken":[]}],"paths":{"/accounts/{accountUuid}/documents/v2/queue":{"get":{"tags":["document-common"],"summary":"Get queues","description":"Get the document-mass-import queues","operationId":"documents_list_queue","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","schema":{"type":["integer","null"],"default":1,"minimum":1}},{"name":"perPage","in":"query","schema":{"type":["integer","null"],"minimum":1}},{"name":"type","in":"query","schema":{"type":["string","null"],"enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"title":"Mass Document Import Queue Collection Resource","description":"Describes the status of an document mass import, used in collections","properties":{"uuid":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"total":{"type":"integer"},"successful":{"type":"integer"},"failed":{"type":"integer"},"status":{"type":"string","enum":["pending","failed","finished","aborted"]}},"type":"object"}},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"properties":{"pagination":{"properties":{"currentPage":{"type":"integer","minimum":1},"firstPageUrl":{"type":["string","null"],"format":"uri"},"from":{"type":["integer","null"],"example":1},"lastPage":{"type":"integer"},"lastPageUrl":{"type":"string","format":"uri"},"nextPageUrl":{"type":["string","null"],"format":"uri"},"perPage":{"type":"integer","example":50},"previousPageUrl":{"type":["string","null"],"format":"uri"},"to":{"type":["integer","null"],"example":50},"totalItems":{"type":"integer"}},"type":"object"}},"type":"object"}},"required":["data","message","status"]}}}},"400":{"description":"Bad request or validation error","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/customers","https://api.abaninja.ch/auth/suppliers"]}],"x-legacy-operation-id":"1a624e567dbd96d00cf952077f416109","x-required-scopes":["customers","suppliers"]}},"/accounts/{accountUuid}/documents/v2/statistics":{"get":{"tags":["document-common"],"summary":"Get document statistics","description":"Get statistics of saved documents and their location","operationId":"documents_list_statistics","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"title":"Document statistics resource","properties":{"total":{"type":"number","format":"int64","minimum":0},"deepBox":{"type":"number","format":"int64","minimum":0},"s3":{"type":"number","format":"int64","minimum":0}},"type":"object"},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/profile","https://api.abaninja.ch/auth/settings"]}],"x-legacy-operation-id":"81e8bf43b3f06636d92f5cd48689c497","x-required-scopes":["profile","settings"]}},"/accounts/{accountUuid}/documents/v2/queue/{queueUuid}":{"get":{"tags":["document-common"],"summary":"Get queue status","description":"Get the status of the document-mass-import queue","operationId":"documents_get_queue","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"queueUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"title":"Mass Document Import Queue Resource","description":"Describes the status of an document mass import","properties":{"uuid":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"total":{"type":"integer"},"successful":{"type":"integer"},"failed":{"type":"integer"},"status":{"type":"string","enum":["pending","failed","finished","aborted"]},"details":{"type":["array","null"],"items":{"title":"Mass Document Json Import Detail Resource","properties":{"status":{"type":"string","enum":["pending","failed","finished","aborted"]},"message":{"type":["string","null"]},"invoice":{"properties":{"documentUrl":{"type":["string","null"],"format":"uri"},"documentData":{"properties":{"uuid":{"type":"string","format":"uuid"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"currencyCodeRecognized":{"description":"when importing invoices and detecting the currency, this field contains the detected value","type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"reference":{"type":"string"},"publicNotes":{"type":["string","null"]},"receiver":{"properties":{"addressUuid":{"type":["string","null"],"format":"uuid"},"companyUuid":{"type":"string","format":"uuid"},"networkUuid":{"type":["string","null"],"format":"uuid"},"networkKey":{"type":["string","null"]},"networkName":{"type":["string","null"]},"deliveryAddressUuid":{"type":["string","null"],"format":"uuid"},"contactPersonUuid":{"type":["string","null"],"format":"uuid"},"additionalReceivers":{"type":"array","items":{"properties":{"personUuid":{"type":"string","format":"uuid"}},"type":"object"}},"receiverInformation":{"title":"Receiver Information Resource","description":"Receiver information resource","properties":{"customerNumber":{"type":["string","null"],"readOnly":true},"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"format":"email","readOnly":true},"language":{"type":["string","null"],"readOnly":true,"enum":["de","en","fr","it"]},"deliveryAddress":{"properties":{"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true}},"type":"object","readOnly":true},"additionalReceivers":{"type":"array","items":{"properties":{"fullName":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"readOnly":true}},"type":"object"},"readOnly":true}},"type":"object"},"personUuid":{"type":["string","null"],"format":"uuid"}}},"invoiceNumber":{"description":"Equals to importedInvoiceNumber if set, otherwise systemInvoiceNumber","type":"string","deprecated":true},"importedInvoiceNumber":{"description":"The recognized invoiceNumber of the imported document","type":["string","null"]},"systemInvoiceNumber":{"description":"The invoiceNumber generated by AbaNinja","type":"string"},"invoiceDate":{"type":["string","null"],"format":"date"},"dueDate":{"type":["string","null"],"format":"date"},"deliveryDate":{"type":["string","null"],"format":"date"},"nextDunningDate":{"type":["string","null"],"format":"date"},"customDunningDate":{"type":["string","null"],"format":"date"},"dunningLevel":{"type":"string","enum":["REMINDER","FIRST_DUNNING","FINAL_DUNNING","NO_DUNNING"]},"sentStatus":{"type":"string","enum":["OPEN","SENDING","ERROR","SENT"]},"status":{"type":"string","enum":["draft","open","sending","send-failed","sent","viewed","approved","declined","partial","paid","in-payment","collected","planned","pending","archived","cancelled","converted","due","reminder","first-dunning","second-dunning","final-dunning","inactive","active","inbox","expired","done","assign","awaiting-payment","error"]},"paymentInstructions":{"properties":{"bankAccountUuid":{"type":"string","format":"uuid"},"iban":{"type":"string"},"bic":{"type":["string","null"]},"qrIban":{"type":"string"},"reference":{"type":["string","null"]}}},"documentTotal":{"type":"number","format":"float"},"taxPositions":{"type":"array","items":{"title":"Tax Position Resource","properties":{"uuid":{"type":"string","format":"uuid"},"id":{"type":"number","format":"int64","deprecated":true},"accountNumber":{"type":["number","null"],"format":"int64","deprecated":true},"bookingAccountUuid":{"type":["string","null"],"format":"uuid"},"isTaxIncluded":{"type":"boolean"},"amount":{"type":"number","format":"float"},"taxRate":{"type":"number","format":"float","deprecated":true},"vatUuid":{"type":["string","null"],"format":"uuid","deprecated":true},"taxRateUuid":{"type":["string","null"],"format":"uuid"},"vat":{"properties":{"percentage":{"type":"number","format":"float"},"amount":{"type":["number","null"],"format":"float"}},"type":"object"}},"type":"object"}},"isTemplate":{"type":"boolean"},"openAmount":{"type":"number","format":"float"},"type":{"type":"string","enum":["invoice"]},"subtype":{"type":["string","null"],"enum":["partial","final","on_account","instalment","dunning"]},"abanetSendAt":{"type":["string","null"],"format":"date-time"},"abanetConfirmedAt":{"type":["string","null"],"format":"date-time"},"wasRecognitionLimitReached":{"type":"boolean"},"hasCustomPaymentSlip":{"description":"if the invoice has a custom payment slip (true) or if it will be generated by AbaNinja (false)","type":"boolean"}},"type":"object"},"uuid":{"type":"string","format":"uuid"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"currencyCodeRecognized":{"description":"when importing invoices and detecting the currency, this field contains the detected value","type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"title":{"type":["string","null"]},"reference":{"type":"string"},"sentStatus":{"type":"string","enum":["OPEN","SENDING","ERROR","SENT"]},"status":{"type":"string","enum":["draft","open","sending","send-failed","sent","viewed","approved","declined","partial","paid","in-payment","collected","planned","pending","archived","cancelled","converted","due","reminder","first-dunning","second-dunning","final-dunning","inactive","active","inbox","expired","done","assign","awaiting-payment","error"]},"customField1":{"type":["string","null"]},"customField2":{"type":["string","null"]},"customField3":{"type":["string","null"]},"customField4":{"type":["string","null"]},"terms":{"type":"string"},"publicNotes":{"type":["string","null"]},"footerText":{"type":["string","null"]},"receiver":{"properties":{"addressUuid":{"type":["string","null"],"format":"uuid"},"companyUuid":{"type":"string","format":"uuid"},"networkUuid":{"type":["string","null"],"format":"uuid"},"networkKey":{"type":["string","null"]},"networkName":{"type":["string","null"]},"deliveryAddressUuid":{"type":["string","null"],"format":"uuid"},"contactPersonUuid":{"type":["string","null"],"format":"uuid"},"additionalReceivers":{"type":"array","items":{"properties":{"personUuid":{"type":"string","format":"uuid"}},"type":"object"}},"receiverInformation":{"title":"Receiver Information Resource","description":"Receiver information resource","properties":{"customerNumber":{"type":["string","null"],"readOnly":true},"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"format":"email","readOnly":true},"language":{"type":["string","null"],"readOnly":true,"enum":["de","en","fr","it"]},"deliveryAddress":{"properties":{"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true}},"type":"object","readOnly":true},"additionalReceivers":{"type":"array","items":{"properties":{"fullName":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"readOnly":true}},"type":"object"},"readOnly":true}},"type":"object"},"personUuid":{"type":["string","null"],"format":"uuid"}}},"invoiceDate":{"type":["string","null"],"format":"date"},"dueDate":{"type":["string","null"],"format":"date"},"deliveryDate":{"type":["string","null"],"format":"date"},"nextDunningDate":{"type":["string","null"],"format":"date"},"customDunningDate":{"type":["string","null"],"format":"date"},"dunningLevel":{"type":"string","enum":["REMINDER","FIRST_DUNNING","FINAL_DUNNING","NO_DUNNING"]},"paymentInstructions":{"properties":{"bankAccountUuid":{"type":"string","format":"uuid"},"iban":{"type":"string"},"bic":{"type":["string","null"]},"qrIban":{"type":"string"}}},"pricesIncludeVat":{"type":"boolean"},"isVariantInvoice":{"type":"boolean"},"documentTotal":{"type":"number","format":"float"},"positions":{"type":"array","items":{"properties":{"uuid":{"type":"string","format":"uuid"},"positionNumber":{"type":"number","format":"int64"},"kind":{"type":"string","enum":["text"]},"productNumber":{"type":"string"},"productDescription":{"type":"string"},"productUuid":{"type":["string","null"],"format":"uuid"},"productGroupUuid":{"type":["string","null"],"format":"uuid"},"singlePrice":{"type":"number","format":"float"},"positionTotal":{"type":"number","format":"float"},"discount":{"properties":{"amount":{"type":"number","format":"float"},"percentage":{"type":"number","format":"float"}}},"vatUuid":{"type":["string","null"],"format":"uuid"},"vat":{"properties":{"percentage":{"type":"number","format":"float"},"amount":{"type":["number","null"],"format":"float"}},"type":"object"},"quantity":{"type":["number","null"],"format":"float"},"unitUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityEmployeeUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityStartDate":{"type":["string","null"],"format":"date-time"},"relatedInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"originalInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"title":{"type":"string"},"showCollapsed":{"type":"boolean"},"items":{"type":"array","items":{"properties":{"uuid":{"type":"string","format":"uuid"},"positionNumber":{"type":"number","format":"int64"},"kind":{"type":"string","enum":["product"]},"productNumber":{"type":"string"},"productDescription":{"type":"string"},"productUuid":{"type":["string","null"],"format":"uuid"},"productGroupUuid":{"type":["string","null"],"format":"uuid"},"singlePrice":{"type":"number","format":"float"},"positionTotal":{"type":"number","format":"float"},"discount":{"properties":{"amount":{"type":"number","format":"float"},"percentage":{"type":"number","format":"float"}}},"vatUuid":{"type":["string","null"],"format":"uuid"},"vat":{"properties":{"percentage":{"type":"number","format":"float"},"amount":{"type":["number","null"],"format":"float"}},"type":"object"},"quantity":{"type":["number","null"],"format":"float"},"unitUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityEmployeeUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityStartDate":{"type":["string","null"],"format":"date-time"},"relatedInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"originalInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"unitCode":{"type":"string"}}}},"unitCode":{"type":"string"},"text":{"type":"string"}}}},"isTemplate":{"type":"boolean"},"isCollectiveBill":{"type":"boolean"},"invoiceNumber":{"description":"Equals to importedInvoiceNumber if set, otherwise systemInvoiceNumber","type":"string","deprecated":true},"importedInvoiceNumber":{"description":"The recognized invoiceNumber of the imported document","type":["string","null"]},"systemInvoiceNumber":{"description":"The invoiceNumber generated by AbaNinja","type":"string"},"openAmount":{"type":"number","format":"float"},"type":{"type":"string","enum":["supplier_credit_note"]},"subtype":{"type":["string","null"],"enum":["partial","final","on_account","instalment","dunning"]},"abanetSendAt":{"type":["string","null"],"format":"date-time"},"abanetConfirmedAt":{"type":["string","null"],"format":"date-time"},"bookedAt":{"type":["string","null"],"format":"date-time"},"syncedAt":{"type":["string","null"],"format":"date-time"},"syncMessage":{"type":["string","null"]},"syncStatus":{"type":["string","null"],"enum":["OK","FAILED","INCORRECT_STATE","GENERAL_ERROR","CONNECTION_ERROR","BLOCKED_PREVIOUS_NOT_SYNCED"]},"cashDiscounts":{"type":"array","items":{"properties":{"days":{"type":"number","format":"int64"},"percentage":{"type":"number","format":"float"}},"type":"object"},"maxItems":3,"minItems":0},"documentDiscount":{"properties":{"amount":{"type":"number","format":"float"},"percentage":{"type":"number","format":"float"}}},"startDate":{"type":["string","null"],"format":"date"},"endDate":{"type":["string","null"],"format":"date"},"nextSendDate":{"type":["string","null"],"format":"date"},"frequency":{"type":["string","null"],"enum":["weekly","two_weeks","four_weeks","monthly","three_months","six_months","annually"]},"isRecurringActive":{"type":"boolean"},"isLastOfMonth":{"type":"boolean"},"paymentTerms":{"type":["integer","null"],"deprecated":true},"recurringInvoiceNumber":{"type":"string"},"creditNoteDate":{"type":["string","null"],"format":"date"},"creditNoteNumber":{"type":"string"},"quoteDate":{"type":["string","null"],"format":"date"},"validUntilDate":{"type":["string","null"],"format":"date"},"quoteNumber":{"type":"string"},"signaturePage":{"type":"boolean"},"deepSignSignatureMode":{"type":["string","null"],"enum":["timestamp","advanced","qualified"]},"signees":{"type":["array","null"],"items":{"title":"Signee Resource","properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["receiver","sender"]},"addressUuid":{"type":["string","null"],"format":"uuid"},"personUuid":{"type":["string","null"],"format":"uuid"},"userUuid":{"type":["string","null"],"format":"uuid"},"signOrder":{"type":"number","format":"int64"},"companyName":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"completedAt":{"type":["string","null"],"format":"date-time"},"signStatus":{"type":"string","enum":["pending","signed","rejected"]},"comment":{"type":["string","null"]}},"type":"object"}},"deliveryNoteDate":{"type":["string","null"],"format":"date"},"deliveryNoteNumber":{"type":"string"},"contractNoteDate":{"type":["string","null"],"format":"date"},"contractNoteNumber":{"type":"string"},"supplierCreditNoteNumber":{"type":"string"},"supplierCreditNoteDate":{"type":["string","null"],"format":"date"},"taxPositions":{"type":"array","items":{"title":"Receipt Tax Position Resource","properties":{"id":{"type":"integer","format":"int64"},"accountNumber":{"type":"integer","format":"int64"},"isTaxIncluded":{"type":"boolean"},"amount":{"type":"number","format":"float"},"taxRate":{"type":"number","format":"float"},"taxRateUuid":{"type":["string","null"],"format":"uuid"}},"type":"object"}},"wasTaxIncluded":{"type":"boolean"},"wasRecognitionLimitReached":{"type":"boolean"}}}},"type":"object"}}},"type":"object"},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/customers","https://api.abaninja.ch/auth/suppliers"]}],"x-legacy-operation-id":"87b422a0b55aea120a99abab47af38ef","x-required-scopes":["customers","suppliers"]},"delete":{"tags":["document-common"],"summary":"Delete queue","description":"Delete the document-mass-import queue. Can only be done as long as the queue is aborted, finished or failed.","operationId":"documents_delete_queue","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"queueUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Successful response"},"400":{"description":"Bad Request, for instance when queue is still pending","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/customers","https://api.abaninja.ch/auth/suppliers"]}],"x-legacy-operation-id":"a4d754a6c2d7f83f9014ccef4dec070a","x-required-scopes":["customers","suppliers"]}},"/accounts/{accountUuid}/documents/v2/documents/{documentUuid}/document-flow":{"get":{"tags":["document-common"],"summary":"Get document flow","description":"Get the document flow of a document","operationId":"documents_list_document_flow","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful return of a document flow","content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"title":"Document Flow Item Resource","properties":{"uuid":{"type":"string","format":"uuid"},"documentFlowUuid":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"from":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"subtype":{"type":["string","null"],"enum":["partial","final","on_account","instalment","dunning"]},"isDeleted":{"type":"boolean"},"isTemplate":{"type":"boolean"},"date":{"type":["string","null"],"format":"date"},"number":{"type":"string"},"amount":{"type":"number"},"currency":{"type":["string","null"],"format":"iso-4217"}},"type":"object"},"to":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"subtype":{"type":["string","null"],"enum":["partial","final","on_account","instalment","dunning"]},"isDeleted":{"type":"boolean"},"isTemplate":{"type":"boolean"},"date":{"type":["string","null"],"format":"date"},"number":{"type":"string"},"amount":{"type":"number"},"currency":{"type":["string","null"],"format":"iso-4217"}},"type":"object"}},"type":"object"}},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"204":{"description":"No document flow items"},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/customers"]}],"x-legacy-operation-id":"21c085a1a741e30dfe2571ab5a41a0e9","x-required-scopes":["customers"]}},"/accounts/{accountUuid}/documents/v2/queue/{queueUuid}/abort":{"post":{"tags":["document-common"],"summary":"Abort queue","description":"Abort the document-mass-import queue. No other items will be processed. Can only be done as long as the queue is not aborted, finished or failed.","operationId":"documents_create_abort","parameters":[{"name":"accountUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"queueUuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"properties":{"data":{"title":"Mass Document Import Queue Resource","description":"Describes the status of an document mass import","properties":{"uuid":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"total":{"type":"integer"},"successful":{"type":"integer"},"failed":{"type":"integer"},"status":{"type":"string","enum":["pending","failed","finished","aborted"]},"details":{"type":["array","null"],"items":{"title":"Mass Document Json Import Detail Resource","properties":{"status":{"type":"string","enum":["pending","failed","finished","aborted"]},"message":{"type":["string","null"]},"invoice":{"properties":{"documentUrl":{"type":["string","null"],"format":"uri"},"documentData":{"properties":{"uuid":{"type":"string","format":"uuid"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"currencyCodeRecognized":{"description":"when importing invoices and detecting the currency, this field contains the detected value","type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"reference":{"type":"string"},"publicNotes":{"type":["string","null"]},"receiver":{"properties":{"addressUuid":{"type":["string","null"],"format":"uuid"},"companyUuid":{"type":"string","format":"uuid"},"networkUuid":{"type":["string","null"],"format":"uuid"},"networkKey":{"type":["string","null"]},"networkName":{"type":["string","null"]},"deliveryAddressUuid":{"type":["string","null"],"format":"uuid"},"contactPersonUuid":{"type":["string","null"],"format":"uuid"},"additionalReceivers":{"type":"array","items":{"properties":{"personUuid":{"type":"string","format":"uuid"}},"type":"object"}},"receiverInformation":{"title":"Receiver Information Resource","description":"Receiver information resource","properties":{"customerNumber":{"type":["string","null"],"readOnly":true},"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"format":"email","readOnly":true},"language":{"type":["string","null"],"readOnly":true,"enum":["de","en","fr","it"]},"deliveryAddress":{"properties":{"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true}},"type":"object","readOnly":true},"additionalReceivers":{"type":"array","items":{"properties":{"fullName":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"readOnly":true}},"type":"object"},"readOnly":true}},"type":"object"},"personUuid":{"type":["string","null"],"format":"uuid"}}},"invoiceNumber":{"description":"Equals to importedInvoiceNumber if set, otherwise systemInvoiceNumber","type":"string","deprecated":true},"importedInvoiceNumber":{"description":"The recognized invoiceNumber of the imported document","type":["string","null"]},"systemInvoiceNumber":{"description":"The invoiceNumber generated by AbaNinja","type":"string"},"invoiceDate":{"type":["string","null"],"format":"date"},"dueDate":{"type":["string","null"],"format":"date"},"deliveryDate":{"type":["string","null"],"format":"date"},"nextDunningDate":{"type":["string","null"],"format":"date"},"customDunningDate":{"type":["string","null"],"format":"date"},"dunningLevel":{"type":"string","enum":["REMINDER","FIRST_DUNNING","FINAL_DUNNING","NO_DUNNING"]},"sentStatus":{"type":"string","enum":["OPEN","SENDING","ERROR","SENT"]},"status":{"type":"string","enum":["draft","open","sending","send-failed","sent","viewed","approved","declined","partial","paid","in-payment","collected","planned","pending","archived","cancelled","converted","due","reminder","first-dunning","second-dunning","final-dunning","inactive","active","inbox","expired","done","assign","awaiting-payment","error"]},"paymentInstructions":{"properties":{"bankAccountUuid":{"type":"string","format":"uuid"},"iban":{"type":"string"},"bic":{"type":["string","null"]},"qrIban":{"type":"string"},"reference":{"type":["string","null"]}}},"documentTotal":{"type":"number","format":"float"},"taxPositions":{"type":"array","items":{"title":"Tax Position Resource","properties":{"uuid":{"type":"string","format":"uuid"},"id":{"type":"number","format":"int64","deprecated":true},"accountNumber":{"type":["number","null"],"format":"int64","deprecated":true},"bookingAccountUuid":{"type":["string","null"],"format":"uuid"},"isTaxIncluded":{"type":"boolean"},"amount":{"type":"number","format":"float"},"taxRate":{"type":"number","format":"float","deprecated":true},"vatUuid":{"type":["string","null"],"format":"uuid","deprecated":true},"taxRateUuid":{"type":["string","null"],"format":"uuid"},"vat":{"properties":{"percentage":{"type":"number","format":"float"},"amount":{"type":["number","null"],"format":"float"}},"type":"object"}},"type":"object"}},"isTemplate":{"type":"boolean"},"openAmount":{"type":"number","format":"float"},"type":{"type":"string","enum":["invoice"]},"subtype":{"type":["string","null"],"enum":["partial","final","on_account","instalment","dunning"]},"abanetSendAt":{"type":["string","null"],"format":"date-time"},"abanetConfirmedAt":{"type":["string","null"],"format":"date-time"},"wasRecognitionLimitReached":{"type":"boolean"},"hasCustomPaymentSlip":{"description":"if the invoice has a custom payment slip (true) or if it will be generated by AbaNinja (false)","type":"boolean"}},"type":"object"},"uuid":{"type":"string","format":"uuid"},"currencyCode":{"type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"currencyCodeRecognized":{"description":"when importing invoices and detecting the currency, this field contains the detected value","type":["string","null"],"format":"iso-4217","maxLength":3,"minLength":3},"title":{"type":["string","null"]},"reference":{"type":"string"},"sentStatus":{"type":"string","enum":["OPEN","SENDING","ERROR","SENT"]},"status":{"type":"string","enum":["draft","open","sending","send-failed","sent","viewed","approved","declined","partial","paid","in-payment","collected","planned","pending","archived","cancelled","converted","due","reminder","first-dunning","second-dunning","final-dunning","inactive","active","inbox","expired","done","assign","awaiting-payment","error"]},"customField1":{"type":["string","null"]},"customField2":{"type":["string","null"]},"customField3":{"type":["string","null"]},"customField4":{"type":["string","null"]},"terms":{"type":"string"},"publicNotes":{"type":["string","null"]},"footerText":{"type":["string","null"]},"receiver":{"properties":{"addressUuid":{"type":["string","null"],"format":"uuid"},"companyUuid":{"type":"string","format":"uuid"},"networkUuid":{"type":["string","null"],"format":"uuid"},"networkKey":{"type":["string","null"]},"networkName":{"type":["string","null"]},"deliveryAddressUuid":{"type":["string","null"],"format":"uuid"},"contactPersonUuid":{"type":["string","null"],"format":"uuid"},"additionalReceivers":{"type":"array","items":{"properties":{"personUuid":{"type":"string","format":"uuid"}},"type":"object"}},"receiverInformation":{"title":"Receiver Information Resource","description":"Receiver information resource","properties":{"customerNumber":{"type":["string","null"],"readOnly":true},"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"format":"email","readOnly":true},"language":{"type":["string","null"],"readOnly":true,"enum":["de","en","fr","it"]},"deliveryAddress":{"properties":{"companyName":{"type":["string","null"],"readOnly":true},"name":{"type":["string","null"],"readOnly":true},"nameWithSalutation":{"type":["string","null"],"readOnly":true},"careOfAddress":{"type":["string","null"],"readOnly":true},"address":{"type":["string","null"],"readOnly":true},"extension":{"type":["string","null"],"readOnly":true},"houseNumber":{"type":["string","null"],"readOnly":true},"zipCode":{"type":["string","null"],"readOnly":true},"city":{"type":["string","null"],"readOnly":true},"countryCode":{"type":["string","null"],"readOnly":true}},"type":"object","readOnly":true},"additionalReceivers":{"type":"array","items":{"properties":{"fullName":{"type":["string","null"],"readOnly":true},"email":{"type":["string","null"],"readOnly":true}},"type":"object"},"readOnly":true}},"type":"object"},"personUuid":{"type":["string","null"],"format":"uuid"}}},"invoiceDate":{"type":["string","null"],"format":"date"},"dueDate":{"type":["string","null"],"format":"date"},"deliveryDate":{"type":["string","null"],"format":"date"},"nextDunningDate":{"type":["string","null"],"format":"date"},"customDunningDate":{"type":["string","null"],"format":"date"},"dunningLevel":{"type":"string","enum":["REMINDER","FIRST_DUNNING","FINAL_DUNNING","NO_DUNNING"]},"paymentInstructions":{"properties":{"bankAccountUuid":{"type":"string","format":"uuid"},"iban":{"type":"string"},"bic":{"type":["string","null"]},"qrIban":{"type":"string"}}},"pricesIncludeVat":{"type":"boolean"},"isVariantInvoice":{"type":"boolean"},"documentTotal":{"type":"number","format":"float"},"positions":{"type":"array","items":{"properties":{"uuid":{"type":"string","format":"uuid"},"positionNumber":{"type":"number","format":"int64"},"kind":{"type":"string","enum":["text"]},"productNumber":{"type":"string"},"productDescription":{"type":"string"},"productUuid":{"type":["string","null"],"format":"uuid"},"productGroupUuid":{"type":["string","null"],"format":"uuid"},"singlePrice":{"type":"number","format":"float"},"positionTotal":{"type":"number","format":"float"},"discount":{"properties":{"amount":{"type":"number","format":"float"},"percentage":{"type":"number","format":"float"}}},"vatUuid":{"type":["string","null"],"format":"uuid"},"vat":{"properties":{"percentage":{"type":"number","format":"float"},"amount":{"type":["number","null"],"format":"float"}},"type":"object"},"quantity":{"type":["number","null"],"format":"float"},"unitUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityEmployeeUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityStartDate":{"type":["string","null"],"format":"date-time"},"relatedInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"originalInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"title":{"type":"string"},"showCollapsed":{"type":"boolean"},"items":{"type":"array","items":{"properties":{"uuid":{"type":"string","format":"uuid"},"positionNumber":{"type":"number","format":"int64"},"kind":{"type":"string","enum":["product"]},"productNumber":{"type":"string"},"productDescription":{"type":"string"},"productUuid":{"type":["string","null"],"format":"uuid"},"productGroupUuid":{"type":["string","null"],"format":"uuid"},"singlePrice":{"type":"number","format":"float"},"positionTotal":{"type":"number","format":"float"},"discount":{"properties":{"amount":{"type":"number","format":"float"},"percentage":{"type":"number","format":"float"}}},"vatUuid":{"type":["string","null"],"format":"uuid"},"vat":{"properties":{"percentage":{"type":"number","format":"float"},"amount":{"type":["number","null"],"format":"float"}},"type":"object"},"quantity":{"type":["number","null"],"format":"float"},"unitUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityEmployeeUuid":{"type":["string","null"],"format":"uuid"},"employeeActivityStartDate":{"type":["string","null"],"format":"date-time"},"relatedInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"originalInvoice":{"properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["invoice","receipt","credit_note","recurring_invoice","quote","contract_note","delivery_note","supplier_credit_note"]},"number":{"type":"string"}},"type":["object","null"]},"unitCode":{"type":"string"}}}},"unitCode":{"type":"string"},"text":{"type":"string"}}}},"isTemplate":{"type":"boolean"},"isCollectiveBill":{"type":"boolean"},"invoiceNumber":{"description":"Equals to importedInvoiceNumber if set, otherwise systemInvoiceNumber","type":"string","deprecated":true},"importedInvoiceNumber":{"description":"The recognized invoiceNumber of the imported document","type":["string","null"]},"systemInvoiceNumber":{"description":"The invoiceNumber generated by AbaNinja","type":"string"},"openAmount":{"type":"number","format":"float"},"type":{"type":"string","enum":["supplier_credit_note"]},"subtype":{"type":["string","null"],"enum":["partial","final","on_account","instalment","dunning"]},"abanetSendAt":{"type":["string","null"],"format":"date-time"},"abanetConfirmedAt":{"type":["string","null"],"format":"date-time"},"bookedAt":{"type":["string","null"],"format":"date-time"},"syncedAt":{"type":["string","null"],"format":"date-time"},"syncMessage":{"type":["string","null"]},"syncStatus":{"type":["string","null"],"enum":["OK","FAILED","INCORRECT_STATE","GENERAL_ERROR","CONNECTION_ERROR","BLOCKED_PREVIOUS_NOT_SYNCED"]},"cashDiscounts":{"type":"array","items":{"properties":{"days":{"type":"number","format":"int64"},"percentage":{"type":"number","format":"float"}},"type":"object"},"maxItems":3,"minItems":0},"documentDiscount":{"properties":{"amount":{"type":"number","format":"float"},"percentage":{"type":"number","format":"float"}}},"startDate":{"type":["string","null"],"format":"date"},"endDate":{"type":["string","null"],"format":"date"},"nextSendDate":{"type":["string","null"],"format":"date"},"frequency":{"type":["string","null"],"enum":["weekly","two_weeks","four_weeks","monthly","three_months","six_months","annually"]},"isRecurringActive":{"type":"boolean"},"isLastOfMonth":{"type":"boolean"},"paymentTerms":{"type":["integer","null"],"deprecated":true},"recurringInvoiceNumber":{"type":"string"},"creditNoteDate":{"type":["string","null"],"format":"date"},"creditNoteNumber":{"type":"string"},"quoteDate":{"type":["string","null"],"format":"date"},"validUntilDate":{"type":["string","null"],"format":"date"},"quoteNumber":{"type":"string"},"signaturePage":{"type":"boolean"},"deepSignSignatureMode":{"type":["string","null"],"enum":["timestamp","advanced","qualified"]},"signees":{"type":["array","null"],"items":{"title":"Signee Resource","properties":{"uuid":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["receiver","sender"]},"addressUuid":{"type":["string","null"],"format":"uuid"},"personUuid":{"type":["string","null"],"format":"uuid"},"userUuid":{"type":["string","null"],"format":"uuid"},"signOrder":{"type":"number","format":"int64"},"companyName":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"completedAt":{"type":["string","null"],"format":"date-time"},"signStatus":{"type":"string","enum":["pending","signed","rejected"]},"comment":{"type":["string","null"]}},"type":"object"}},"deliveryNoteDate":{"type":["string","null"],"format":"date"},"deliveryNoteNumber":{"type":"string"},"contractNoteDate":{"type":["string","null"],"format":"date"},"contractNoteNumber":{"type":"string"},"supplierCreditNoteNumber":{"type":"string"},"supplierCreditNoteDate":{"type":["string","null"],"format":"date"},"taxPositions":{"type":"array","items":{"title":"Receipt Tax Position Resource","properties":{"id":{"type":"integer","format":"int64"},"accountNumber":{"type":"integer","format":"int64"},"isTaxIncluded":{"type":"boolean"},"amount":{"type":"number","format":"float"},"taxRate":{"type":"number","format":"float"},"taxRateUuid":{"type":["string","null"],"format":"uuid"}},"type":"object"}},"wasTaxIncluded":{"type":"boolean"},"wasRecognitionLimitReached":{"type":"boolean"}}}},"type":"object"}}},"type":"object"},"message":{"title":"message","type":"string"},"status":{"example":200},"meta":{"title":"meta","type":["object","null"]}},"required":["data","message","status"]}}}},"400":{"description":"Bad Request, for instance when queue is already done","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"properties":{"detail":{"title":"details"},"type":{"title":"type","type":"string"},"requestUuid":{"title":"requestUuid","type":"string","format":"uuid"},"path":{"title":"path","type":"string"},"message":{"title":"message","type":["string","null"]},"status":{"title":"status","description":"HTTP status code","type":"integer"}},"required":["detail","type","message","status"]}}}}},"security":[{"ApiToken":["https://api.abaninja.ch/auth/customers","https://api.abaninja.ch/auth/suppliers"]}],"x-legacy-operation-id":"40da8d8e8ec62c60a0121acaeed189b2","x-required-scopes":["customers","suppliers"]}}},"components":{"securitySchemes":{"ApiToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication. Create tokens in Settings > API Token."}}}}