cURL
curl --request POST \
--url https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments \
--header 'Content-Type: multipart/form-data' \
--header 'X-ACCOUNT-KEY: <x-account-key>' \
--header 'X-API-KEY: <x-api-key>' \
--form file='@example-file'import requests
url = "https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"X-API-KEY": "<x-api-key>",
"X-ACCOUNT-KEY": "<x-account-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-API-KEY': '<x-api-key>', 'X-ACCOUNT-KEY': '<x-account-key>'}
};
options.body = form;
fetch('https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-ACCOUNT-KEY: <x-account-key>",
"X-API-KEY: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("X-ACCOUNT-KEY", "<x-account-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments")
.header("X-API-KEY", "<x-api-key>")
.header("X-ACCOUNT-KEY", "<x-account-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["X-ACCOUNT-KEY"] = '<x-account-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"meta": {
"warnings": [
"Field not used by target system"
],
"pagination": {
"total": 125,
"perPage": 50,
"currentPage": 1,
"totalPages": 3
}
},
"data": [
{
"id": "document id",
"base64Encoded": true,
"content": "content",
"contentType": "application/pdf",
"fileName": "invoice.pdf"
}
]
}Journal Entries
Create journal entry attachment
POST
/
accounting
/
journalEntries
/
{journalEntryId}
/
Attachments
cURL
curl --request POST \
--url https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments \
--header 'Content-Type: multipart/form-data' \
--header 'X-ACCOUNT-KEY: <x-account-key>' \
--header 'X-API-KEY: <x-api-key>' \
--form file='@example-file'import requests
url = "https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"X-API-KEY": "<x-api-key>",
"X-ACCOUNT-KEY": "<x-account-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-API-KEY': '<x-api-key>', 'X-ACCOUNT-KEY': '<x-account-key>'}
};
options.body = form;
fetch('https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-ACCOUNT-KEY: <x-account-key>",
"X-API-KEY: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("X-ACCOUNT-KEY", "<x-account-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments")
.header("X-API-KEY", "<x-api-key>")
.header("X-ACCOUNT-KEY", "<x-account-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maesn.dev/accounting/journalEntries/{journalEntryId}/Attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["X-ACCOUNT-KEY"] = '<x-account-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"meta": {
"warnings": [
"Field not used by target system"
],
"pagination": {
"total": 125,
"perPage": 50,
"currentPage": 1,
"totalPages": 3
}
},
"data": [
{
"id": "document id",
"base64Encoded": true,
"content": "content",
"contentType": "application/pdf",
"fileName": "invoice.pdf"
}
]
}Field support per integration

Business Central
Business Central
If you’re not using the Interactive Authentication Flow, make sure the query parameters
environmentName and companyId are correctly populated.
You can obtain these values by using the GET Environments and GET Companies endpoints available under the Authentication section.
Sage Active
Sage Active
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. Please use the id field as the companyId.
Xero
Xero
Supported request parameters:
Headers
API key
Example:
"example value"
Account key
Example:
"example value"
Path Parameters
Body
multipart/form-data
Last modified on July 9, 2026
Was this page helpful?
⌘I