cURL
curl --request PATCH \
--url https://api.maesn.dev/accounting/invoices/{invoiceId} \
--header 'Content-Type: application/json' \
--header 'X-ACCOUNT-KEY: <x-account-key>' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"addresses": [
{
"addressLine1": "Main street 45",
"addressLine2": "2nd floor",
"city": "Berlin",
"countryCode": "DE",
"postalCode": "10243",
"type": "BILLING"
}
],
"contactId": "eaa28f49-6028-4b6e-bb12-d8f6278073fc",
"currency": "EUR",
"discountPercentage": 10,
"dueDate": "2021-01-01T00:00:00Z",
"fileId": "93c6b8e0-80a4-4c22-a46c-18beebab82d6",
"invoiceDate": "2021-01-01T00:00:00Z",
"invoiceType": "STANDARD",
"journalCode": "50",
"lineAmountTypes": "EXCLUSIVE",
"lineItems": [
{
"accountCode": "1890",
"accountId": "6733a433-9662-4a40-8e36-e38ebda94fe1",
"description": "SEOUL Guest Chair, red",
"dimensions": [
{
"id": "c1d2e3f4-5678-9abc-def0-1234567890ab",
"categoryName": "CostCenter",
"name": "C1"
}
],
"discountItemPercentage": 10,
"grossAmount": 109,
"itemId": "9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"name": "RED CHAIR",
"quantity": 1,
"taxCode": "03",
"taxRatePercentage": 19,
"taxType": "Tax 19 percent",
"type": "SERVICE",
"unitAmount": 100,
"unitName": "PIECE"
}
],
"name": "Invoice name",
"oneLineAddress": "Main street 45, Berlin",
"paidDate": "2021-01-01T00:00:00Z",
"paymentTermDuration": 30,
"paymentTermId": "1",
"reference": "RCXF197253F",
"shippingDate": "2021-01-01T00:00:00Z",
"shippingEndDate": "2021-01-10T00:00:00Z",
"shippingType": "SERVICE",
"status": "DRAFT",
"taxRule": "NET",
"taxText": "Tax 19 percent"
}
'import requests
url = "https://api.maesn.dev/accounting/invoices/{invoiceId}"
payload = {
"addresses": [
{
"addressLine1": "Main street 45",
"addressLine2": "2nd floor",
"city": "Berlin",
"countryCode": "DE",
"postalCode": "10243",
"type": "BILLING"
}
],
"contactId": "eaa28f49-6028-4b6e-bb12-d8f6278073fc",
"currency": "EUR",
"discountPercentage": 10,
"dueDate": "2021-01-01T00:00:00Z",
"fileId": "93c6b8e0-80a4-4c22-a46c-18beebab82d6",
"invoiceDate": "2021-01-01T00:00:00Z",
"invoiceType": "STANDARD",
"journalCode": "50",
"lineAmountTypes": "EXCLUSIVE",
"lineItems": [
{
"accountCode": "1890",
"accountId": "6733a433-9662-4a40-8e36-e38ebda94fe1",
"description": "SEOUL Guest Chair, red",
"dimensions": [
{
"id": "c1d2e3f4-5678-9abc-def0-1234567890ab",
"categoryName": "CostCenter",
"name": "C1"
}
],
"discountItemPercentage": 10,
"grossAmount": 109,
"itemId": "9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"name": "RED CHAIR",
"quantity": 1,
"taxCode": "03",
"taxRatePercentage": 19,
"taxType": "Tax 19 percent",
"type": "SERVICE",
"unitAmount": 100,
"unitName": "PIECE"
}
],
"name": "Invoice name",
"oneLineAddress": "Main street 45, Berlin",
"paidDate": "2021-01-01T00:00:00Z",
"paymentTermDuration": 30,
"paymentTermId": "1",
"reference": "RCXF197253F",
"shippingDate": "2021-01-01T00:00:00Z",
"shippingEndDate": "2021-01-10T00:00:00Z",
"shippingType": "SERVICE",
"status": "DRAFT",
"taxRule": "NET",
"taxText": "Tax 19 percent"
}
headers = {
"X-API-KEY": "<x-api-key>",
"X-ACCOUNT-KEY": "<x-account-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-KEY': '<x-api-key>',
'X-ACCOUNT-KEY': '<x-account-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
addresses: [
{
addressLine1: 'Main street 45',
addressLine2: '2nd floor',
city: 'Berlin',
countryCode: 'DE',
postalCode: '10243',
type: 'BILLING'
}
],
contactId: 'eaa28f49-6028-4b6e-bb12-d8f6278073fc',
currency: 'EUR',
discountPercentage: 10,
dueDate: '2021-01-01T00:00:00Z',
fileId: '93c6b8e0-80a4-4c22-a46c-18beebab82d6',
invoiceDate: '2021-01-01T00:00:00Z',
invoiceType: 'STANDARD',
journalCode: '50',
lineAmountTypes: 'EXCLUSIVE',
lineItems: [
{
accountCode: '1890',
accountId: '6733a433-9662-4a40-8e36-e38ebda94fe1',
description: 'SEOUL Guest Chair, red',
dimensions: [
{
id: 'c1d2e3f4-5678-9abc-def0-1234567890ab',
categoryName: 'CostCenter',
name: 'C1'
}
],
discountItemPercentage: 10,
grossAmount: 109,
itemId: '9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b',
name: 'RED CHAIR',
quantity: 1,
taxCode: '03',
taxRatePercentage: 19,
taxType: 'Tax 19 percent',
type: 'SERVICE',
unitAmount: 100,
unitName: 'PIECE'
}
],
name: 'Invoice name',
oneLineAddress: 'Main street 45, Berlin',
paidDate: '2021-01-01T00:00:00Z',
paymentTermDuration: 30,
paymentTermId: '1',
reference: 'RCXF197253F',
shippingDate: '2021-01-01T00:00:00Z',
shippingEndDate: '2021-01-10T00:00:00Z',
shippingType: 'SERVICE',
status: 'DRAFT',
taxRule: 'NET',
taxText: 'Tax 19 percent'
})
};
fetch('https://api.maesn.dev/accounting/invoices/{invoiceId}', 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/invoices/{invoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'addresses' => [
[
'addressLine1' => 'Main street 45',
'addressLine2' => '2nd floor',
'city' => 'Berlin',
'countryCode' => 'DE',
'postalCode' => '10243',
'type' => 'BILLING'
]
],
'contactId' => 'eaa28f49-6028-4b6e-bb12-d8f6278073fc',
'currency' => 'EUR',
'discountPercentage' => 10,
'dueDate' => '2021-01-01T00:00:00Z',
'fileId' => '93c6b8e0-80a4-4c22-a46c-18beebab82d6',
'invoiceDate' => '2021-01-01T00:00:00Z',
'invoiceType' => 'STANDARD',
'journalCode' => '50',
'lineAmountTypes' => 'EXCLUSIVE',
'lineItems' => [
[
'accountCode' => '1890',
'accountId' => '6733a433-9662-4a40-8e36-e38ebda94fe1',
'description' => 'SEOUL Guest Chair, red',
'dimensions' => [
[
'id' => 'c1d2e3f4-5678-9abc-def0-1234567890ab',
'categoryName' => 'CostCenter',
'name' => 'C1'
]
],
'discountItemPercentage' => 10,
'grossAmount' => 109,
'itemId' => '9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b',
'name' => 'RED CHAIR',
'quantity' => 1,
'taxCode' => '03',
'taxRatePercentage' => 19,
'taxType' => 'Tax 19 percent',
'type' => 'SERVICE',
'unitAmount' => 100,
'unitName' => 'PIECE'
]
],
'name' => 'Invoice name',
'oneLineAddress' => 'Main street 45, Berlin',
'paidDate' => '2021-01-01T00:00:00Z',
'paymentTermDuration' => 30,
'paymentTermId' => '1',
'reference' => 'RCXF197253F',
'shippingDate' => '2021-01-01T00:00:00Z',
'shippingEndDate' => '2021-01-10T00:00:00Z',
'shippingType' => 'SERVICE',
'status' => 'DRAFT',
'taxRule' => 'NET',
'taxText' => 'Tax 19 percent'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/invoices/{invoiceId}"
payload := strings.NewReader("{\n \"addresses\": [\n {\n \"addressLine1\": \"Main street 45\",\n \"addressLine2\": \"2nd floor\",\n \"city\": \"Berlin\",\n \"countryCode\": \"DE\",\n \"postalCode\": \"10243\",\n \"type\": \"BILLING\"\n }\n ],\n \"contactId\": \"eaa28f49-6028-4b6e-bb12-d8f6278073fc\",\n \"currency\": \"EUR\",\n \"discountPercentage\": 10,\n \"dueDate\": \"2021-01-01T00:00:00Z\",\n \"fileId\": \"93c6b8e0-80a4-4c22-a46c-18beebab82d6\",\n \"invoiceDate\": \"2021-01-01T00:00:00Z\",\n \"invoiceType\": \"STANDARD\",\n \"journalCode\": \"50\",\n \"lineAmountTypes\": \"EXCLUSIVE\",\n \"lineItems\": [\n {\n \"accountCode\": \"1890\",\n \"accountId\": \"6733a433-9662-4a40-8e36-e38ebda94fe1\",\n \"description\": \"SEOUL Guest Chair, red\",\n \"dimensions\": [\n {\n \"id\": \"c1d2e3f4-5678-9abc-def0-1234567890ab\",\n \"categoryName\": \"CostCenter\",\n \"name\": \"C1\"\n }\n ],\n \"discountItemPercentage\": 10,\n \"grossAmount\": 109,\n \"itemId\": \"9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b\",\n \"name\": \"RED CHAIR\",\n \"quantity\": 1,\n \"taxCode\": \"03\",\n \"taxRatePercentage\": 19,\n \"taxType\": \"Tax 19 percent\",\n \"type\": \"SERVICE\",\n \"unitAmount\": 100,\n \"unitName\": \"PIECE\"\n }\n ],\n \"name\": \"Invoice name\",\n \"oneLineAddress\": \"Main street 45, Berlin\",\n \"paidDate\": \"2021-01-01T00:00:00Z\",\n \"paymentTermDuration\": 30,\n \"paymentTermId\": \"1\",\n \"reference\": \"RCXF197253F\",\n \"shippingDate\": \"2021-01-01T00:00:00Z\",\n \"shippingEndDate\": \"2021-01-10T00:00:00Z\",\n \"shippingType\": \"SERVICE\",\n \"status\": \"DRAFT\",\n \"taxRule\": \"NET\",\n \"taxText\": \"Tax 19 percent\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("X-ACCOUNT-KEY", "<x-account-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.maesn.dev/accounting/invoices/{invoiceId}")
.header("X-API-KEY", "<x-api-key>")
.header("X-ACCOUNT-KEY", "<x-account-key>")
.header("Content-Type", "application/json")
.body("{\n \"addresses\": [\n {\n \"addressLine1\": \"Main street 45\",\n \"addressLine2\": \"2nd floor\",\n \"city\": \"Berlin\",\n \"countryCode\": \"DE\",\n \"postalCode\": \"10243\",\n \"type\": \"BILLING\"\n }\n ],\n \"contactId\": \"eaa28f49-6028-4b6e-bb12-d8f6278073fc\",\n \"currency\": \"EUR\",\n \"discountPercentage\": 10,\n \"dueDate\": \"2021-01-01T00:00:00Z\",\n \"fileId\": \"93c6b8e0-80a4-4c22-a46c-18beebab82d6\",\n \"invoiceDate\": \"2021-01-01T00:00:00Z\",\n \"invoiceType\": \"STANDARD\",\n \"journalCode\": \"50\",\n \"lineAmountTypes\": \"EXCLUSIVE\",\n \"lineItems\": [\n {\n \"accountCode\": \"1890\",\n \"accountId\": \"6733a433-9662-4a40-8e36-e38ebda94fe1\",\n \"description\": \"SEOUL Guest Chair, red\",\n \"dimensions\": [\n {\n \"id\": \"c1d2e3f4-5678-9abc-def0-1234567890ab\",\n \"categoryName\": \"CostCenter\",\n \"name\": \"C1\"\n }\n ],\n \"discountItemPercentage\": 10,\n \"grossAmount\": 109,\n \"itemId\": \"9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b\",\n \"name\": \"RED CHAIR\",\n \"quantity\": 1,\n \"taxCode\": \"03\",\n \"taxRatePercentage\": 19,\n \"taxType\": \"Tax 19 percent\",\n \"type\": \"SERVICE\",\n \"unitAmount\": 100,\n \"unitName\": \"PIECE\"\n }\n ],\n \"name\": \"Invoice name\",\n \"oneLineAddress\": \"Main street 45, Berlin\",\n \"paidDate\": \"2021-01-01T00:00:00Z\",\n \"paymentTermDuration\": 30,\n \"paymentTermId\": \"1\",\n \"reference\": \"RCXF197253F\",\n \"shippingDate\": \"2021-01-01T00:00:00Z\",\n \"shippingEndDate\": \"2021-01-10T00:00:00Z\",\n \"shippingType\": \"SERVICE\",\n \"status\": \"DRAFT\",\n \"taxRule\": \"NET\",\n \"taxText\": \"Tax 19 percent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maesn.dev/accounting/invoices/{invoiceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["X-ACCOUNT-KEY"] = '<x-account-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addresses\": [\n {\n \"addressLine1\": \"Main street 45\",\n \"addressLine2\": \"2nd floor\",\n \"city\": \"Berlin\",\n \"countryCode\": \"DE\",\n \"postalCode\": \"10243\",\n \"type\": \"BILLING\"\n }\n ],\n \"contactId\": \"eaa28f49-6028-4b6e-bb12-d8f6278073fc\",\n \"currency\": \"EUR\",\n \"discountPercentage\": 10,\n \"dueDate\": \"2021-01-01T00:00:00Z\",\n \"fileId\": \"93c6b8e0-80a4-4c22-a46c-18beebab82d6\",\n \"invoiceDate\": \"2021-01-01T00:00:00Z\",\n \"invoiceType\": \"STANDARD\",\n \"journalCode\": \"50\",\n \"lineAmountTypes\": \"EXCLUSIVE\",\n \"lineItems\": [\n {\n \"accountCode\": \"1890\",\n \"accountId\": \"6733a433-9662-4a40-8e36-e38ebda94fe1\",\n \"description\": \"SEOUL Guest Chair, red\",\n \"dimensions\": [\n {\n \"id\": \"c1d2e3f4-5678-9abc-def0-1234567890ab\",\n \"categoryName\": \"CostCenter\",\n \"name\": \"C1\"\n }\n ],\n \"discountItemPercentage\": 10,\n \"grossAmount\": 109,\n \"itemId\": \"9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b\",\n \"name\": \"RED CHAIR\",\n \"quantity\": 1,\n \"taxCode\": \"03\",\n \"taxRatePercentage\": 19,\n \"taxType\": \"Tax 19 percent\",\n \"type\": \"SERVICE\",\n \"unitAmount\": 100,\n \"unitName\": \"PIECE\"\n }\n ],\n \"name\": \"Invoice name\",\n \"oneLineAddress\": \"Main street 45, Berlin\",\n \"paidDate\": \"2021-01-01T00:00:00Z\",\n \"paymentTermDuration\": 30,\n \"paymentTermId\": \"1\",\n \"reference\": \"RCXF197253F\",\n \"shippingDate\": \"2021-01-01T00:00:00Z\",\n \"shippingEndDate\": \"2021-01-10T00:00:00Z\",\n \"shippingType\": \"SERVICE\",\n \"status\": \"DRAFT\",\n \"taxRule\": \"NET\",\n \"taxText\": \"Tax 19 percent\"\n}"
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
},
"partialErrors": [
{
"code": "FILE_UPLOAD_FAILED",
"message": "Attachment invoice.pdf could not be uploaded to the target system."
}
]
},
"data": {
"id": "9714f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"invoiceId": "9714f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"addresses": [
{
"addressLine1": "Main street 45",
"addressLine2": "2nd floor",
"city": "Berlin",
"countryCode": "DE",
"postalCode": "10243",
"type": "BILLING"
}
],
"contactId": "eaa28f49-6028-4b6e-bb12-d8f6278073fc",
"createdDate": "2021-01-01T00:00:00Z",
"currency": "EUR",
"discountAmount": 10,
"dueDate": "2021-02-01T00:00:00Z",
"fileId": "93c6b8e0-80a4-4c22-a46c-18beebab82d6",
"invoiceDate": "2021-01-01T00:00:00Z",
"invoiceNumber": "1020",
"invoiceType": "STANDARD",
"journalCode": "50",
"lineAmountType": "EXCLUSIVE",
"lineItems": [
{
"lineItemId": "987a2b3c-4d5e-6f7g-8h9i-0j1k2l3m4n5o",
"accountId": "6733a433-9662-4a40-8e36-e38ebda94fe1",
"createdDate": "2021-01-01T00:00:00Z",
"description": "SEOUL Guest Chair, red",
"dimensions": [
{
"id": "c1d2e3f4-5678-9abc-def0-1234567890ab",
"categoryName": "CostCenter",
"name": "C1"
}
],
"discountItemAmount": 10,
"discountItemPercentage": 10,
"grossAmount": 109,
"itemsAmount": 100,
"itemId": "9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"name": "RED CHAIR",
"quantity": 1,
"taxCode": "03",
"taxRatePercentage": 19,
"unitAmount": 100,
"updatedDate": "2021-01-01T00:00:00Z"
}
],
"name": "Office Supplies",
"oneLineAddress": "Main street 45, Berlin",
"paidDate": "2021-01-25T00:00:00Z",
"paymentStatus": "PENDING",
"paymentTermDuration": 30,
"paymentTermId": "1",
"reference": "RCXF197253F",
"salesOrderId": "30911",
"shippingDate": "2021-01-01T00:00:00Z",
"status": "DRAFT",
"sumNetAmount": 100,
"taxRule": "NET",
"totalAmount": 109,
"totalTaxAmount": 19,
"updatedDate": "2021-01-01T00:00:00Z"
}
}Invoices
Patch invoice
PATCH
/
accounting
/
invoices
/
{invoiceId}
cURL
curl --request PATCH \
--url https://api.maesn.dev/accounting/invoices/{invoiceId} \
--header 'Content-Type: application/json' \
--header 'X-ACCOUNT-KEY: <x-account-key>' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"addresses": [
{
"addressLine1": "Main street 45",
"addressLine2": "2nd floor",
"city": "Berlin",
"countryCode": "DE",
"postalCode": "10243",
"type": "BILLING"
}
],
"contactId": "eaa28f49-6028-4b6e-bb12-d8f6278073fc",
"currency": "EUR",
"discountPercentage": 10,
"dueDate": "2021-01-01T00:00:00Z",
"fileId": "93c6b8e0-80a4-4c22-a46c-18beebab82d6",
"invoiceDate": "2021-01-01T00:00:00Z",
"invoiceType": "STANDARD",
"journalCode": "50",
"lineAmountTypes": "EXCLUSIVE",
"lineItems": [
{
"accountCode": "1890",
"accountId": "6733a433-9662-4a40-8e36-e38ebda94fe1",
"description": "SEOUL Guest Chair, red",
"dimensions": [
{
"id": "c1d2e3f4-5678-9abc-def0-1234567890ab",
"categoryName": "CostCenter",
"name": "C1"
}
],
"discountItemPercentage": 10,
"grossAmount": 109,
"itemId": "9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"name": "RED CHAIR",
"quantity": 1,
"taxCode": "03",
"taxRatePercentage": 19,
"taxType": "Tax 19 percent",
"type": "SERVICE",
"unitAmount": 100,
"unitName": "PIECE"
}
],
"name": "Invoice name",
"oneLineAddress": "Main street 45, Berlin",
"paidDate": "2021-01-01T00:00:00Z",
"paymentTermDuration": 30,
"paymentTermId": "1",
"reference": "RCXF197253F",
"shippingDate": "2021-01-01T00:00:00Z",
"shippingEndDate": "2021-01-10T00:00:00Z",
"shippingType": "SERVICE",
"status": "DRAFT",
"taxRule": "NET",
"taxText": "Tax 19 percent"
}
'import requests
url = "https://api.maesn.dev/accounting/invoices/{invoiceId}"
payload = {
"addresses": [
{
"addressLine1": "Main street 45",
"addressLine2": "2nd floor",
"city": "Berlin",
"countryCode": "DE",
"postalCode": "10243",
"type": "BILLING"
}
],
"contactId": "eaa28f49-6028-4b6e-bb12-d8f6278073fc",
"currency": "EUR",
"discountPercentage": 10,
"dueDate": "2021-01-01T00:00:00Z",
"fileId": "93c6b8e0-80a4-4c22-a46c-18beebab82d6",
"invoiceDate": "2021-01-01T00:00:00Z",
"invoiceType": "STANDARD",
"journalCode": "50",
"lineAmountTypes": "EXCLUSIVE",
"lineItems": [
{
"accountCode": "1890",
"accountId": "6733a433-9662-4a40-8e36-e38ebda94fe1",
"description": "SEOUL Guest Chair, red",
"dimensions": [
{
"id": "c1d2e3f4-5678-9abc-def0-1234567890ab",
"categoryName": "CostCenter",
"name": "C1"
}
],
"discountItemPercentage": 10,
"grossAmount": 109,
"itemId": "9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"name": "RED CHAIR",
"quantity": 1,
"taxCode": "03",
"taxRatePercentage": 19,
"taxType": "Tax 19 percent",
"type": "SERVICE",
"unitAmount": 100,
"unitName": "PIECE"
}
],
"name": "Invoice name",
"oneLineAddress": "Main street 45, Berlin",
"paidDate": "2021-01-01T00:00:00Z",
"paymentTermDuration": 30,
"paymentTermId": "1",
"reference": "RCXF197253F",
"shippingDate": "2021-01-01T00:00:00Z",
"shippingEndDate": "2021-01-10T00:00:00Z",
"shippingType": "SERVICE",
"status": "DRAFT",
"taxRule": "NET",
"taxText": "Tax 19 percent"
}
headers = {
"X-API-KEY": "<x-api-key>",
"X-ACCOUNT-KEY": "<x-account-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-KEY': '<x-api-key>',
'X-ACCOUNT-KEY': '<x-account-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
addresses: [
{
addressLine1: 'Main street 45',
addressLine2: '2nd floor',
city: 'Berlin',
countryCode: 'DE',
postalCode: '10243',
type: 'BILLING'
}
],
contactId: 'eaa28f49-6028-4b6e-bb12-d8f6278073fc',
currency: 'EUR',
discountPercentage: 10,
dueDate: '2021-01-01T00:00:00Z',
fileId: '93c6b8e0-80a4-4c22-a46c-18beebab82d6',
invoiceDate: '2021-01-01T00:00:00Z',
invoiceType: 'STANDARD',
journalCode: '50',
lineAmountTypes: 'EXCLUSIVE',
lineItems: [
{
accountCode: '1890',
accountId: '6733a433-9662-4a40-8e36-e38ebda94fe1',
description: 'SEOUL Guest Chair, red',
dimensions: [
{
id: 'c1d2e3f4-5678-9abc-def0-1234567890ab',
categoryName: 'CostCenter',
name: 'C1'
}
],
discountItemPercentage: 10,
grossAmount: 109,
itemId: '9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b',
name: 'RED CHAIR',
quantity: 1,
taxCode: '03',
taxRatePercentage: 19,
taxType: 'Tax 19 percent',
type: 'SERVICE',
unitAmount: 100,
unitName: 'PIECE'
}
],
name: 'Invoice name',
oneLineAddress: 'Main street 45, Berlin',
paidDate: '2021-01-01T00:00:00Z',
paymentTermDuration: 30,
paymentTermId: '1',
reference: 'RCXF197253F',
shippingDate: '2021-01-01T00:00:00Z',
shippingEndDate: '2021-01-10T00:00:00Z',
shippingType: 'SERVICE',
status: 'DRAFT',
taxRule: 'NET',
taxText: 'Tax 19 percent'
})
};
fetch('https://api.maesn.dev/accounting/invoices/{invoiceId}', 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/invoices/{invoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'addresses' => [
[
'addressLine1' => 'Main street 45',
'addressLine2' => '2nd floor',
'city' => 'Berlin',
'countryCode' => 'DE',
'postalCode' => '10243',
'type' => 'BILLING'
]
],
'contactId' => 'eaa28f49-6028-4b6e-bb12-d8f6278073fc',
'currency' => 'EUR',
'discountPercentage' => 10,
'dueDate' => '2021-01-01T00:00:00Z',
'fileId' => '93c6b8e0-80a4-4c22-a46c-18beebab82d6',
'invoiceDate' => '2021-01-01T00:00:00Z',
'invoiceType' => 'STANDARD',
'journalCode' => '50',
'lineAmountTypes' => 'EXCLUSIVE',
'lineItems' => [
[
'accountCode' => '1890',
'accountId' => '6733a433-9662-4a40-8e36-e38ebda94fe1',
'description' => 'SEOUL Guest Chair, red',
'dimensions' => [
[
'id' => 'c1d2e3f4-5678-9abc-def0-1234567890ab',
'categoryName' => 'CostCenter',
'name' => 'C1'
]
],
'discountItemPercentage' => 10,
'grossAmount' => 109,
'itemId' => '9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b',
'name' => 'RED CHAIR',
'quantity' => 1,
'taxCode' => '03',
'taxRatePercentage' => 19,
'taxType' => 'Tax 19 percent',
'type' => 'SERVICE',
'unitAmount' => 100,
'unitName' => 'PIECE'
]
],
'name' => 'Invoice name',
'oneLineAddress' => 'Main street 45, Berlin',
'paidDate' => '2021-01-01T00:00:00Z',
'paymentTermDuration' => 30,
'paymentTermId' => '1',
'reference' => 'RCXF197253F',
'shippingDate' => '2021-01-01T00:00:00Z',
'shippingEndDate' => '2021-01-10T00:00:00Z',
'shippingType' => 'SERVICE',
'status' => 'DRAFT',
'taxRule' => 'NET',
'taxText' => 'Tax 19 percent'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/invoices/{invoiceId}"
payload := strings.NewReader("{\n \"addresses\": [\n {\n \"addressLine1\": \"Main street 45\",\n \"addressLine2\": \"2nd floor\",\n \"city\": \"Berlin\",\n \"countryCode\": \"DE\",\n \"postalCode\": \"10243\",\n \"type\": \"BILLING\"\n }\n ],\n \"contactId\": \"eaa28f49-6028-4b6e-bb12-d8f6278073fc\",\n \"currency\": \"EUR\",\n \"discountPercentage\": 10,\n \"dueDate\": \"2021-01-01T00:00:00Z\",\n \"fileId\": \"93c6b8e0-80a4-4c22-a46c-18beebab82d6\",\n \"invoiceDate\": \"2021-01-01T00:00:00Z\",\n \"invoiceType\": \"STANDARD\",\n \"journalCode\": \"50\",\n \"lineAmountTypes\": \"EXCLUSIVE\",\n \"lineItems\": [\n {\n \"accountCode\": \"1890\",\n \"accountId\": \"6733a433-9662-4a40-8e36-e38ebda94fe1\",\n \"description\": \"SEOUL Guest Chair, red\",\n \"dimensions\": [\n {\n \"id\": \"c1d2e3f4-5678-9abc-def0-1234567890ab\",\n \"categoryName\": \"CostCenter\",\n \"name\": \"C1\"\n }\n ],\n \"discountItemPercentage\": 10,\n \"grossAmount\": 109,\n \"itemId\": \"9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b\",\n \"name\": \"RED CHAIR\",\n \"quantity\": 1,\n \"taxCode\": \"03\",\n \"taxRatePercentage\": 19,\n \"taxType\": \"Tax 19 percent\",\n \"type\": \"SERVICE\",\n \"unitAmount\": 100,\n \"unitName\": \"PIECE\"\n }\n ],\n \"name\": \"Invoice name\",\n \"oneLineAddress\": \"Main street 45, Berlin\",\n \"paidDate\": \"2021-01-01T00:00:00Z\",\n \"paymentTermDuration\": 30,\n \"paymentTermId\": \"1\",\n \"reference\": \"RCXF197253F\",\n \"shippingDate\": \"2021-01-01T00:00:00Z\",\n \"shippingEndDate\": \"2021-01-10T00:00:00Z\",\n \"shippingType\": \"SERVICE\",\n \"status\": \"DRAFT\",\n \"taxRule\": \"NET\",\n \"taxText\": \"Tax 19 percent\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("X-ACCOUNT-KEY", "<x-account-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.maesn.dev/accounting/invoices/{invoiceId}")
.header("X-API-KEY", "<x-api-key>")
.header("X-ACCOUNT-KEY", "<x-account-key>")
.header("Content-Type", "application/json")
.body("{\n \"addresses\": [\n {\n \"addressLine1\": \"Main street 45\",\n \"addressLine2\": \"2nd floor\",\n \"city\": \"Berlin\",\n \"countryCode\": \"DE\",\n \"postalCode\": \"10243\",\n \"type\": \"BILLING\"\n }\n ],\n \"contactId\": \"eaa28f49-6028-4b6e-bb12-d8f6278073fc\",\n \"currency\": \"EUR\",\n \"discountPercentage\": 10,\n \"dueDate\": \"2021-01-01T00:00:00Z\",\n \"fileId\": \"93c6b8e0-80a4-4c22-a46c-18beebab82d6\",\n \"invoiceDate\": \"2021-01-01T00:00:00Z\",\n \"invoiceType\": \"STANDARD\",\n \"journalCode\": \"50\",\n \"lineAmountTypes\": \"EXCLUSIVE\",\n \"lineItems\": [\n {\n \"accountCode\": \"1890\",\n \"accountId\": \"6733a433-9662-4a40-8e36-e38ebda94fe1\",\n \"description\": \"SEOUL Guest Chair, red\",\n \"dimensions\": [\n {\n \"id\": \"c1d2e3f4-5678-9abc-def0-1234567890ab\",\n \"categoryName\": \"CostCenter\",\n \"name\": \"C1\"\n }\n ],\n \"discountItemPercentage\": 10,\n \"grossAmount\": 109,\n \"itemId\": \"9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b\",\n \"name\": \"RED CHAIR\",\n \"quantity\": 1,\n \"taxCode\": \"03\",\n \"taxRatePercentage\": 19,\n \"taxType\": \"Tax 19 percent\",\n \"type\": \"SERVICE\",\n \"unitAmount\": 100,\n \"unitName\": \"PIECE\"\n }\n ],\n \"name\": \"Invoice name\",\n \"oneLineAddress\": \"Main street 45, Berlin\",\n \"paidDate\": \"2021-01-01T00:00:00Z\",\n \"paymentTermDuration\": 30,\n \"paymentTermId\": \"1\",\n \"reference\": \"RCXF197253F\",\n \"shippingDate\": \"2021-01-01T00:00:00Z\",\n \"shippingEndDate\": \"2021-01-10T00:00:00Z\",\n \"shippingType\": \"SERVICE\",\n \"status\": \"DRAFT\",\n \"taxRule\": \"NET\",\n \"taxText\": \"Tax 19 percent\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maesn.dev/accounting/invoices/{invoiceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["X-ACCOUNT-KEY"] = '<x-account-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addresses\": [\n {\n \"addressLine1\": \"Main street 45\",\n \"addressLine2\": \"2nd floor\",\n \"city\": \"Berlin\",\n \"countryCode\": \"DE\",\n \"postalCode\": \"10243\",\n \"type\": \"BILLING\"\n }\n ],\n \"contactId\": \"eaa28f49-6028-4b6e-bb12-d8f6278073fc\",\n \"currency\": \"EUR\",\n \"discountPercentage\": 10,\n \"dueDate\": \"2021-01-01T00:00:00Z\",\n \"fileId\": \"93c6b8e0-80a4-4c22-a46c-18beebab82d6\",\n \"invoiceDate\": \"2021-01-01T00:00:00Z\",\n \"invoiceType\": \"STANDARD\",\n \"journalCode\": \"50\",\n \"lineAmountTypes\": \"EXCLUSIVE\",\n \"lineItems\": [\n {\n \"accountCode\": \"1890\",\n \"accountId\": \"6733a433-9662-4a40-8e36-e38ebda94fe1\",\n \"description\": \"SEOUL Guest Chair, red\",\n \"dimensions\": [\n {\n \"id\": \"c1d2e3f4-5678-9abc-def0-1234567890ab\",\n \"categoryName\": \"CostCenter\",\n \"name\": \"C1\"\n }\n ],\n \"discountItemPercentage\": 10,\n \"grossAmount\": 109,\n \"itemId\": \"9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b\",\n \"name\": \"RED CHAIR\",\n \"quantity\": 1,\n \"taxCode\": \"03\",\n \"taxRatePercentage\": 19,\n \"taxType\": \"Tax 19 percent\",\n \"type\": \"SERVICE\",\n \"unitAmount\": 100,\n \"unitName\": \"PIECE\"\n }\n ],\n \"name\": \"Invoice name\",\n \"oneLineAddress\": \"Main street 45, Berlin\",\n \"paidDate\": \"2021-01-01T00:00:00Z\",\n \"paymentTermDuration\": 30,\n \"paymentTermId\": \"1\",\n \"reference\": \"RCXF197253F\",\n \"shippingDate\": \"2021-01-01T00:00:00Z\",\n \"shippingEndDate\": \"2021-01-10T00:00:00Z\",\n \"shippingType\": \"SERVICE\",\n \"status\": \"DRAFT\",\n \"taxRule\": \"NET\",\n \"taxText\": \"Tax 19 percent\"\n}"
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
},
"partialErrors": [
{
"code": "FILE_UPLOAD_FAILED",
"message": "Attachment invoice.pdf could not be uploaded to the target system."
}
]
},
"data": {
"id": "9714f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"invoiceId": "9714f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"addresses": [
{
"addressLine1": "Main street 45",
"addressLine2": "2nd floor",
"city": "Berlin",
"countryCode": "DE",
"postalCode": "10243",
"type": "BILLING"
}
],
"contactId": "eaa28f49-6028-4b6e-bb12-d8f6278073fc",
"createdDate": "2021-01-01T00:00:00Z",
"currency": "EUR",
"discountAmount": 10,
"dueDate": "2021-02-01T00:00:00Z",
"fileId": "93c6b8e0-80a4-4c22-a46c-18beebab82d6",
"invoiceDate": "2021-01-01T00:00:00Z",
"invoiceNumber": "1020",
"invoiceType": "STANDARD",
"journalCode": "50",
"lineAmountType": "EXCLUSIVE",
"lineItems": [
{
"lineItemId": "987a2b3c-4d5e-6f7g-8h9i-0j1k2l3m4n5o",
"accountId": "6733a433-9662-4a40-8e36-e38ebda94fe1",
"createdDate": "2021-01-01T00:00:00Z",
"description": "SEOUL Guest Chair, red",
"dimensions": [
{
"id": "c1d2e3f4-5678-9abc-def0-1234567890ab",
"categoryName": "CostCenter",
"name": "C1"
}
],
"discountItemAmount": 10,
"discountItemPercentage": 10,
"grossAmount": 109,
"itemsAmount": 100,
"itemId": "9fc4f3a2-5b8e-4d1b-8a0c-9f6e7d2f3e4b",
"name": "RED CHAIR",
"quantity": 1,
"taxCode": "03",
"taxRatePercentage": 19,
"unitAmount": 100,
"updatedDate": "2021-01-01T00:00:00Z"
}
],
"name": "Office Supplies",
"oneLineAddress": "Main street 45, Berlin",
"paidDate": "2021-01-25T00:00:00Z",
"paymentStatus": "PENDING",
"paymentTermDuration": 30,
"paymentTermId": "1",
"reference": "RCXF197253F",
"salesOrderId": "30911",
"shippingDate": "2021-01-01T00:00:00Z",
"status": "DRAFT",
"sumNetAmount": 100,
"taxRule": "NET",
"totalAmount": 109,
"totalTaxAmount": 19,
"updatedDate": "2021-01-01T00:00:00Z"
}
}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.string
enum
Available options:
STANDARDenum
The
currency field supports ISO 4217 (3-letter codes).
For details visit the Standardized Data section.string
For date format details visit the Standardized Data section
string
For date format details visit the Standardized Data section
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Example:
"eaa28f49-6028-4b6e-bb12-d8f6278073fc"
Available options:
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYR, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CVE, CZK, DJF, DKK, DOP, DZD, EEK, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GQE, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MYR, MZM, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SYP, SZL, THB, TJS, TMT, TND, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEB, VND, VUV, WST, XAF, XCD, XDR, XOF, XPF, YER, ZAR, ZMK, ZWR Example:
"EUR"
Example:
10
Example:
"2021-01-01T00:00:00Z"
Example:
"93c6b8e0-80a4-4c22-a46c-18beebab82d6"
Example:
"2021-01-01T00:00:00Z"
Available options:
STANDARD Example:
"STANDARD"
Example:
"50"
Available options:
EXCLUSIVE, INCLUSIVE, NOTAX Example:
"EXCLUSIVE"
Show child attributes
Show child attributes
Example:
"Invoice name"
Example:
"Main street 45, Berlin"
Example:
"2021-01-01T00:00:00Z"
Example:
30
Example:
"1"
Example:
"RCXF197253F"
Example:
"2021-01-01T00:00:00Z"
Example:
"2021-01-10T00:00:00Z"
Available options:
SERVICE, SERVICEPERIOD, DELIVERY, DELIVERYPERIOD, NONE Example:
"SERVICE"
Available options:
DRAFT, SUBMITTED, AUTHORISED, PAID, CANCELED Example:
"DRAFT"
Available options:
NET, TAXFREE, INTRACOMMUNITY_GOODS, INTRACOMMUNITY_SERVICE, EXPORT_SERVICE, EXPORT_GOODS, REVERSE_CHARGE, GROSS, CONSTRUCTION_SERVICE, PHOTOVOLTAIC_EQUIPMENT, SMALL_BUSINESS_VAT_EXEMPTION, NON_DOMESTIC_SERVICE, OSS_GOODS, OSS_ELECTRONIC_SERVICES, OSS_SERVICES Example:
"NET"
Example:
"Tax 19 percent"
Last modified on November 5, 2026
Was this page helpful?