Skip to main content
POST
/
accounting
/
files
cURL
curl --request POST \
  --url https://api.maesn.dev/accounting/files \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-ACCOUNT-KEY: <x-account-key>' \
  --header 'X-API-KEY: <x-api-key>' \
  --form contactId=287a382-s35e624e5-fb9e-483 \
  --form documentDate=2021-01-01T00:00:00Z \
  --form documentId=b5e624e5-fb9e-4836-a443-87a3820f5b48 \
  --form documentType=Ausgangsrechnung \
  --form 'integrationSource=Third party app' \
  --form 'note=Invoice 02-03-2023' \
  --form file=@example-file
{
  "meta": {
    "warnings": [
      "Field not used by target system"
    ],
    "pagination": {
      "total": 123,
      "perPage": 123,
      "currentPage": 123,
      "totalPages": 123
    }
  },
  "data": {
    "id": "document id",
    "base64Encoded": true,
    "content": "content",
    "contentType": "application/pdf",
    "fileName": "invoice.pdf"
  }
}

Field support per integration

If you’re not using the Interactive Authentication Flow, make sure the query parameter companyId is accurately populated with the appropriate company ID. You can obtain this value by using the GET Companies endpoint available under the Authentication section.
Supported Request Parameters:
file
File
required
The name of the uploaded file must include the file extension, for example invoice.pdf.
documentId
string
The documentId field can be used to uniquely identify a document. If provided, it must be a valid GUID.
documentType
string
required
The documentType field must match one of the document types returned by the GET Document Types endpoint.
note
string
If you’re not using the Interactive Authentication Flow, make sure the query parameter companyId is accurately populated with the appropriate company ID. You can obtain this value by using the GET Companies endpoint available under the Authentication section.
Supported Request Parameters:
file
File
required
The name of the uploaded file must include the file extension, for example invoice.pdf.
documentDate
string
required
documentId
string
The documentId field can be used to uniquely identify a document. If provided, it must be a valid GUID.
documentType
string
required
The documentType field must match one of the document types returned by the GET Document Types endpoint.
integrationSource
string
required
The integrationSource field should be set to the name of your application integrating with DATEV.
note
string
If you’re not using the Interactive Authentication Flow, make sure the query parameter companyId is correctly populated. You can obtain this value by using the GET Companies endpoint available under the Authentication section.
Supported Request Parameters:
file
File
required
contactId
string
The contactId field is required for the INVOICE document type.
documentType
string
required
Available options: BILL, INVOICE

Headers

X-API-KEY
string
required

API key

X-ACCOUNT-KEY
string
required

Account key

Query Parameters

companyId
string

Body

multipart/form-data
file
file
required
documentType
string
required
Example:

"Ausgangsrechnung"

contactId
string
Example:

"287a382-s35e624e5-fb9e-483"

documentDate
string
Example:

"2021-01-01T00:00:00Z"

documentId
string
Example:

"b5e624e5-fb9e-4836-a443-87a3820f5b48"

integrationSource
string
Example:

"Third party app"

note
string
Example:

"Invoice 02-03-2023"

Response

200 - application/json
meta
object
data
object
I