Update an invoice
curl --request PATCH \
--url https://api.wellapp.ai/v1/invoices/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "invoice",
"included": {
"issuer": {
"data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": [
"VAT",
"TVA",
"IVA",
"..."
]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
]
},
"receiver": {
"data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": [
"VAT",
"TVA",
"IVA",
"..."
]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
]
},
"payment_means": {
"data": [
{
"type": "<string>",
"id": "pm-1",
"attributes": {
"account_details": {
"iban": "<string>",
"bic": "<string>",
"sort_code": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"currency": "<string>"
},
"bank_details": {
"bank_name": "<string>",
"bank_code": "<string>",
"branch_name": "<string>",
"branch_code": "<string>"
},
"card_details": {
"masked_pan": "<string>",
"expiry_month": 6,
"expiry_year": 2025,
"cardholder_name": "<string>"
},
"digital_wallet": {
"wallet_id": "<string>"
},
"compliance": {},
"nickname": "<string>",
"description": "<string>",
"tags": [
"<string>"
]
}
}
]
},
"invoice_items": {
"data": [
{
"type": "<string>",
"id": "item-1",
"attributes": {
"line_id": "1",
"name": "Wireless Mouse",
"unit_price": 25,
"currency": "EUR",
"sku": "WM-1001",
"description": "Ergonomic wireless mouse with USB receiver",
"unit": "EA",
"min_quantity": 1,
"max_quantity": 500,
"tax": {
"rate": 20,
"category": "standard",
"scheme": "VAT"
},
"period": {
"start": "2025-06-26",
"end": "2025-06-27"
}
}
}
]
},
"documents": {
"data": [
{
"type": "<string>",
"id": "doc-1",
"attributes": {
"file_name": "<string>",
"status": "<string>",
"file_type": "<string>",
"size_bytes": 123
}
}
]
},
"people": {
"data": [
{
"type": "<string>",
"id": "person-1",
"attributes": {
"first_name": "John",
"last_name": "Doe"
}
}
]
}
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/invoices/{id}"
payload = { "data": {
"type": "invoice",
"included": {
"issuer": { "data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": ["VAT", "TVA", "IVA", "..."]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
] },
"receiver": { "data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": ["VAT", "TVA", "IVA", "..."]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
] },
"payment_means": { "data": [
{
"type": "<string>",
"id": "pm-1",
"attributes": {
"account_details": {
"iban": "<string>",
"bic": "<string>",
"sort_code": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"currency": "<string>"
},
"bank_details": {
"bank_name": "<string>",
"bank_code": "<string>",
"branch_name": "<string>",
"branch_code": "<string>"
},
"card_details": {
"masked_pan": "<string>",
"expiry_month": 6,
"expiry_year": 2025,
"cardholder_name": "<string>"
},
"digital_wallet": { "wallet_id": "<string>" },
"compliance": {},
"nickname": "<string>",
"description": "<string>",
"tags": ["<string>"]
}
}
] },
"invoice_items": { "data": [
{
"type": "<string>",
"id": "item-1",
"attributes": {
"line_id": "1",
"name": "Wireless Mouse",
"unit_price": 25,
"currency": "EUR",
"sku": "WM-1001",
"description": "Ergonomic wireless mouse with USB receiver",
"unit": "EA",
"min_quantity": 1,
"max_quantity": 500,
"tax": {
"rate": 20,
"category": "standard",
"scheme": "VAT"
},
"period": {
"start": "2025-06-26",
"end": "2025-06-27"
}
}
}
] },
"documents": { "data": [
{
"type": "<string>",
"id": "doc-1",
"attributes": {
"file_name": "<string>",
"status": "<string>",
"file_type": "<string>",
"size_bytes": 123
}
}
] },
"people": { "data": [
{
"type": "<string>",
"id": "person-1",
"attributes": {
"first_name": "John",
"last_name": "Doe"
}
}
] }
}
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'invoice',
included: {
issuer: {
data: [
{
type: '<string>',
id: 'company-2',
attributes: {
registration: {registered_name: 'TechCorp AI Solutions LLC', trade_name: 'TechSol'},
locale: 'en-US',
domain_name_primary_link_url: 'https://www.techcorp.com',
tax_id: {value: 'DE123456789', type: ['VAT', 'TVA', 'IVA', '...']},
registration_number: {
business_type: 'GmbH',
value: 'HRB 123456',
registry_name: 'Handelsregister Berlin',
registry_country: 'DE, FR, US, etc.'
},
description: 'An innovative technology company focused on AI solutions'
}
}
]
},
receiver: {
data: [
{
type: '<string>',
id: 'company-2',
attributes: {
registration: {registered_name: 'TechCorp AI Solutions LLC', trade_name: 'TechSol'},
locale: 'en-US',
domain_name_primary_link_url: 'https://www.techcorp.com',
tax_id: {value: 'DE123456789', type: ['VAT', 'TVA', 'IVA', '...']},
registration_number: {
business_type: 'GmbH',
value: 'HRB 123456',
registry_name: 'Handelsregister Berlin',
registry_country: 'DE, FR, US, etc.'
},
description: 'An innovative technology company focused on AI solutions'
}
}
]
},
payment_means: {
data: [
{
type: '<string>',
id: 'pm-1',
attributes: {
account_details: {
iban: '<string>',
bic: '<string>',
sort_code: '<string>',
account_number: '<string>',
routing_number: '<string>',
currency: '<string>'
},
bank_details: {
bank_name: '<string>',
bank_code: '<string>',
branch_name: '<string>',
branch_code: '<string>'
},
card_details: {
masked_pan: '<string>',
expiry_month: 6,
expiry_year: 2025,
cardholder_name: '<string>'
},
digital_wallet: {wallet_id: '<string>'},
compliance: {},
nickname: '<string>',
description: '<string>',
tags: ['<string>']
}
}
]
},
invoice_items: {
data: [
{
type: '<string>',
id: 'item-1',
attributes: {
line_id: '1',
name: 'Wireless Mouse',
unit_price: 25,
currency: 'EUR',
sku: 'WM-1001',
description: 'Ergonomic wireless mouse with USB receiver',
unit: 'EA',
min_quantity: 1,
max_quantity: 500,
tax: {rate: 20, category: 'standard', scheme: 'VAT'},
period: {start: '2025-06-26', end: '2025-06-27'}
}
}
]
},
documents: {
data: [
{
type: '<string>',
id: 'doc-1',
attributes: {
file_name: '<string>',
status: '<string>',
file_type: '<string>',
size_bytes: 123
}
}
]
},
people: {
data: [
{
type: '<string>',
id: 'person-1',
attributes: {first_name: 'John', last_name: 'Doe'}
}
]
}
}
}
})
};
fetch('https://api.wellapp.ai/v1/invoices/{id}', 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.wellapp.ai/v1/invoices/{id}",
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([
'data' => [
'type' => 'invoice',
'included' => [
'issuer' => [
'data' => [
[
'type' => '<string>',
'id' => 'company-2',
'attributes' => [
'registration' => [
'registered_name' => 'TechCorp AI Solutions LLC',
'trade_name' => 'TechSol'
],
'locale' => 'en-US',
'domain_name_primary_link_url' => 'https://www.techcorp.com',
'tax_id' => [
'value' => 'DE123456789',
'type' => [
'VAT',
'TVA',
'IVA',
'...'
]
],
'registration_number' => [
'business_type' => 'GmbH',
'value' => 'HRB 123456',
'registry_name' => 'Handelsregister Berlin',
'registry_country' => 'DE, FR, US, etc.'
],
'description' => 'An innovative technology company focused on AI solutions'
]
]
]
],
'receiver' => [
'data' => [
[
'type' => '<string>',
'id' => 'company-2',
'attributes' => [
'registration' => [
'registered_name' => 'TechCorp AI Solutions LLC',
'trade_name' => 'TechSol'
],
'locale' => 'en-US',
'domain_name_primary_link_url' => 'https://www.techcorp.com',
'tax_id' => [
'value' => 'DE123456789',
'type' => [
'VAT',
'TVA',
'IVA',
'...'
]
],
'registration_number' => [
'business_type' => 'GmbH',
'value' => 'HRB 123456',
'registry_name' => 'Handelsregister Berlin',
'registry_country' => 'DE, FR, US, etc.'
],
'description' => 'An innovative technology company focused on AI solutions'
]
]
]
],
'payment_means' => [
'data' => [
[
'type' => '<string>',
'id' => 'pm-1',
'attributes' => [
'account_details' => [
'iban' => '<string>',
'bic' => '<string>',
'sort_code' => '<string>',
'account_number' => '<string>',
'routing_number' => '<string>',
'currency' => '<string>'
],
'bank_details' => [
'bank_name' => '<string>',
'bank_code' => '<string>',
'branch_name' => '<string>',
'branch_code' => '<string>'
],
'card_details' => [
'masked_pan' => '<string>',
'expiry_month' => 6,
'expiry_year' => 2025,
'cardholder_name' => '<string>'
],
'digital_wallet' => [
'wallet_id' => '<string>'
],
'compliance' => [
],
'nickname' => '<string>',
'description' => '<string>',
'tags' => [
'<string>'
]
]
]
]
],
'invoice_items' => [
'data' => [
[
'type' => '<string>',
'id' => 'item-1',
'attributes' => [
'line_id' => '1',
'name' => 'Wireless Mouse',
'unit_price' => 25,
'currency' => 'EUR',
'sku' => 'WM-1001',
'description' => 'Ergonomic wireless mouse with USB receiver',
'unit' => 'EA',
'min_quantity' => 1,
'max_quantity' => 500,
'tax' => [
'rate' => 20,
'category' => 'standard',
'scheme' => 'VAT'
],
'period' => [
'start' => '2025-06-26',
'end' => '2025-06-27'
]
]
]
]
],
'documents' => [
'data' => [
[
'type' => '<string>',
'id' => 'doc-1',
'attributes' => [
'file_name' => '<string>',
'status' => '<string>',
'file_type' => '<string>',
'size_bytes' => 123
]
]
]
],
'people' => [
'data' => [
[
'type' => '<string>',
'id' => 'person-1',
'attributes' => [
'first_name' => 'John',
'last_name' => 'Doe'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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.wellapp.ai/v1/invoices/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"invoice\",\n \"included\": {\n \"issuer\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"receiver\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"payment_means\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"pm-1\",\n \"attributes\": {\n \"account_details\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"currency\": \"<string>\"\n },\n \"bank_details\": {\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"branch_code\": \"<string>\"\n },\n \"card_details\": {\n \"masked_pan\": \"<string>\",\n \"expiry_month\": 6,\n \"expiry_year\": 2025,\n \"cardholder_name\": \"<string>\"\n },\n \"digital_wallet\": {\n \"wallet_id\": \"<string>\"\n },\n \"compliance\": {},\n \"nickname\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"item-1\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"name\": \"Wireless Mouse\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\n \"sku\": \"WM-1001\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit\": \"EA\",\n \"min_quantity\": 1,\n \"max_quantity\": 500,\n \"tax\": {\n \"rate\": 20,\n \"category\": \"standard\",\n \"scheme\": \"VAT\"\n },\n \"period\": {\n \"start\": \"2025-06-26\",\n \"end\": \"2025-06-27\"\n }\n }\n }\n ]\n },\n \"documents\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"doc-1\",\n \"attributes\": {\n \"file_name\": \"<string>\",\n \"status\": \"<string>\",\n \"file_type\": \"<string>\",\n \"size_bytes\": 123\n }\n }\n ]\n },\n \"people\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"person-1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.wellapp.ai/v1/invoices/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"invoice\",\n \"included\": {\n \"issuer\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"receiver\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"payment_means\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"pm-1\",\n \"attributes\": {\n \"account_details\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"currency\": \"<string>\"\n },\n \"bank_details\": {\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"branch_code\": \"<string>\"\n },\n \"card_details\": {\n \"masked_pan\": \"<string>\",\n \"expiry_month\": 6,\n \"expiry_year\": 2025,\n \"cardholder_name\": \"<string>\"\n },\n \"digital_wallet\": {\n \"wallet_id\": \"<string>\"\n },\n \"compliance\": {},\n \"nickname\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"item-1\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"name\": \"Wireless Mouse\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\n \"sku\": \"WM-1001\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit\": \"EA\",\n \"min_quantity\": 1,\n \"max_quantity\": 500,\n \"tax\": {\n \"rate\": 20,\n \"category\": \"standard\",\n \"scheme\": \"VAT\"\n },\n \"period\": {\n \"start\": \"2025-06-26\",\n \"end\": \"2025-06-27\"\n }\n }\n }\n ]\n },\n \"documents\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"doc-1\",\n \"attributes\": {\n \"file_name\": \"<string>\",\n \"status\": \"<string>\",\n \"file_type\": \"<string>\",\n \"size_bytes\": 123\n }\n }\n ]\n },\n \"people\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"person-1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"invoice\",\n \"included\": {\n \"issuer\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"receiver\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"payment_means\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"pm-1\",\n \"attributes\": {\n \"account_details\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"currency\": \"<string>\"\n },\n \"bank_details\": {\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"branch_code\": \"<string>\"\n },\n \"card_details\": {\n \"masked_pan\": \"<string>\",\n \"expiry_month\": 6,\n \"expiry_year\": 2025,\n \"cardholder_name\": \"<string>\"\n },\n \"digital_wallet\": {\n \"wallet_id\": \"<string>\"\n },\n \"compliance\": {},\n \"nickname\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"item-1\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"name\": \"Wireless Mouse\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\n \"sku\": \"WM-1001\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit\": \"EA\",\n \"min_quantity\": 1,\n \"max_quantity\": 500,\n \"tax\": {\n \"rate\": 20,\n \"category\": \"standard\",\n \"scheme\": \"VAT\"\n },\n \"period\": {\n \"start\": \"2025-06-26\",\n \"end\": \"2025-06-27\"\n }\n }\n }\n ]\n },\n \"documents\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"doc-1\",\n \"attributes\": {\n \"file_name\": \"<string>\",\n \"status\": \"<string>\",\n \"file_type\": \"<string>\",\n \"size_bytes\": 123\n }\n }\n ]\n },\n \"people\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"person-1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "invoice",
"id": "invoice_550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"reference_number": "INV-2025-001",
"document_type": "commercial_invoice",
"document_type_code": "380",
"issue_date": "2025-01-15",
"due_date": "2025-02-15",
"local_currency": "EUR",
"local_totals": {
"subtotal": "1000.00",
"tax_total": "200.00",
"total_amount": "1200.00"
},
"terms": "Payment due within 30 days",
"billing_context": "subscription",
"payment_status": {
"paid": true,
"amount_paid": 123,
"amount_remaining": 123
},
"status": "draft",
"description": "Professional services invoice for January 2025",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
},
"relationships": {
"issuer": {
"data": {
"type": "company",
"id": "company-issuer-uuid"
}
},
"receiver": {
"data": {
"type": "company",
"id": "company-receiver-uuid"
}
},
"payment_means": {
"data": [
{
"type": "payment_means",
"id": "pm_1"
}
]
},
"invoice_items": {
"data": [
{
"type": "invoice_item",
"id": "item_1"
}
]
},
"document": {
"data": {
"type": "document",
"id": "doc_original_invoice"
}
},
"people": {
"data": [
{
"type": "people",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
}
},
"included": [
{
"type": "people",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"first_name": "John",
"last_name": "Smith",
"full_name": "John Smith",
"email": "jsmith@example.com",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "document",
"id": "doc_original_invoice",
"attributes": {
"file_name": "invoice_2025_001.pdf",
"status": "processed",
"uploaded_at": "2023-11-07T05:31:56Z",
"processed_at": "2023-11-07T05:31:56Z",
"file_type": "application/pdf",
"size_bytes": 245678,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "invoice_item",
"id": "item_1",
"attributes": {
"line_id": "1",
"sku": "WM-1001",
"name": "Wireless Mouse",
"description": "Ergonomic wireless mouse with USB receiver",
"unit_price": 25,
"currency": "EUR",
"unit": "EA",
"min_quantity": 1,
"max_quantity": 500,
"tax": {
"rate": 20,
"category": "standard",
"scheme": "VAT"
},
"period": {
"start": "2025-06-26",
"end": "2025-06-27"
},
"created_at": "2025-05-11T13:42:12Z",
"updated_at": "2025-05-11T13:45:20Z"
}
},
{
"type": "payment_means",
"id": "pm_1",
"attributes": {
"type": "card_details",
"scheme": "SEPA",
"status": "active",
"account_details": {
"iban": "DE89370400440532013000",
"bic": "COBADEFFXXX",
"account_number": "532013000",
"routing_number": "37040044",
"currency": "EUR"
},
"bank_details": {
"bank_name": "Commerzbank AG",
"bank_code": "37040044",
"branch_name": "Main Branch",
"branch_code": "440"
},
"card_details": {
"masked_pan": "****1234",
"brand": "visa",
"card_type": "credit",
"expiry_month": 12,
"expiry_year": 2027,
"cardholder_name": "John Smith"
},
"digital_wallet": {
"provider": "paypal",
"wallet_id": "john.smith@example.com",
"wallet_type": "personal"
},
"compliance": {
"kyc_status": "verified",
"aml_status": "cleared",
"sanctions_check": "passed",
"last_compliance_check": "2023-11-07T05:31:56Z"
},
"metadata": {
"source": "api",
"external_id": "ext_pm_12345"
},
"nickname": "Primary Payment Method",
"description": "Main company payment account",
"tags": [
"primary",
"sepa"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "company",
"id": "company-receiver-uuid",
"attributes": {
"name": "ACME Corporation",
"description": "Technology solutions provider",
"domain_name_primary_link_url": "acme.com",
"locale": "en",
"tax_id": {
"value": "DE123456789",
"type": "VAT"
},
"registration": {
"trade_name": "TechSol",
"registered_name": "ACME Corporation GmbH"
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE"
},
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "company",
"id": "company-issuer-uuid",
"attributes": {
"name": "Service Provider Inc",
"description": "Professional services company",
"domain_name_primary_link_url": "serviceprovider.com",
"locale": "en",
"tax_id": {
"value": "FR987654321",
"type": "VAT"
},
"registration": {
"trade_name": "Service Provider",
"registered_name": "Service Provider Inc."
},
"registration_number": {
"business_type": "Inc",
"value": "RCS 987654",
"registry_name": "Paris Commercial Registry",
"registry_country": "FR"
},
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
]
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}{
"error": {
"code": "invoice_not_found",
"message": "Invoice not found"
}
}Invoices
Patch Invoice
Modify an existing invoice by its unique ID.
PATCH
/
v1
/
invoices
/
{id}
Update an invoice
curl --request PATCH \
--url https://api.wellapp.ai/v1/invoices/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "invoice",
"included": {
"issuer": {
"data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": [
"VAT",
"TVA",
"IVA",
"..."
]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
]
},
"receiver": {
"data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": [
"VAT",
"TVA",
"IVA",
"..."
]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
]
},
"payment_means": {
"data": [
{
"type": "<string>",
"id": "pm-1",
"attributes": {
"account_details": {
"iban": "<string>",
"bic": "<string>",
"sort_code": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"currency": "<string>"
},
"bank_details": {
"bank_name": "<string>",
"bank_code": "<string>",
"branch_name": "<string>",
"branch_code": "<string>"
},
"card_details": {
"masked_pan": "<string>",
"expiry_month": 6,
"expiry_year": 2025,
"cardholder_name": "<string>"
},
"digital_wallet": {
"wallet_id": "<string>"
},
"compliance": {},
"nickname": "<string>",
"description": "<string>",
"tags": [
"<string>"
]
}
}
]
},
"invoice_items": {
"data": [
{
"type": "<string>",
"id": "item-1",
"attributes": {
"line_id": "1",
"name": "Wireless Mouse",
"unit_price": 25,
"currency": "EUR",
"sku": "WM-1001",
"description": "Ergonomic wireless mouse with USB receiver",
"unit": "EA",
"min_quantity": 1,
"max_quantity": 500,
"tax": {
"rate": 20,
"category": "standard",
"scheme": "VAT"
},
"period": {
"start": "2025-06-26",
"end": "2025-06-27"
}
}
}
]
},
"documents": {
"data": [
{
"type": "<string>",
"id": "doc-1",
"attributes": {
"file_name": "<string>",
"status": "<string>",
"file_type": "<string>",
"size_bytes": 123
}
}
]
},
"people": {
"data": [
{
"type": "<string>",
"id": "person-1",
"attributes": {
"first_name": "John",
"last_name": "Doe"
}
}
]
}
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/invoices/{id}"
payload = { "data": {
"type": "invoice",
"included": {
"issuer": { "data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": ["VAT", "TVA", "IVA", "..."]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
] },
"receiver": { "data": [
{
"type": "<string>",
"id": "company-2",
"attributes": {
"registration": {
"registered_name": "TechCorp AI Solutions LLC",
"trade_name": "TechSol"
},
"locale": "en-US",
"domain_name_primary_link_url": "https://www.techcorp.com",
"tax_id": {
"value": "DE123456789",
"type": ["VAT", "TVA", "IVA", "..."]
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE, FR, US, etc."
},
"description": "An innovative technology company focused on AI solutions"
}
}
] },
"payment_means": { "data": [
{
"type": "<string>",
"id": "pm-1",
"attributes": {
"account_details": {
"iban": "<string>",
"bic": "<string>",
"sort_code": "<string>",
"account_number": "<string>",
"routing_number": "<string>",
"currency": "<string>"
},
"bank_details": {
"bank_name": "<string>",
"bank_code": "<string>",
"branch_name": "<string>",
"branch_code": "<string>"
},
"card_details": {
"masked_pan": "<string>",
"expiry_month": 6,
"expiry_year": 2025,
"cardholder_name": "<string>"
},
"digital_wallet": { "wallet_id": "<string>" },
"compliance": {},
"nickname": "<string>",
"description": "<string>",
"tags": ["<string>"]
}
}
] },
"invoice_items": { "data": [
{
"type": "<string>",
"id": "item-1",
"attributes": {
"line_id": "1",
"name": "Wireless Mouse",
"unit_price": 25,
"currency": "EUR",
"sku": "WM-1001",
"description": "Ergonomic wireless mouse with USB receiver",
"unit": "EA",
"min_quantity": 1,
"max_quantity": 500,
"tax": {
"rate": 20,
"category": "standard",
"scheme": "VAT"
},
"period": {
"start": "2025-06-26",
"end": "2025-06-27"
}
}
}
] },
"documents": { "data": [
{
"type": "<string>",
"id": "doc-1",
"attributes": {
"file_name": "<string>",
"status": "<string>",
"file_type": "<string>",
"size_bytes": 123
}
}
] },
"people": { "data": [
{
"type": "<string>",
"id": "person-1",
"attributes": {
"first_name": "John",
"last_name": "Doe"
}
}
] }
}
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'invoice',
included: {
issuer: {
data: [
{
type: '<string>',
id: 'company-2',
attributes: {
registration: {registered_name: 'TechCorp AI Solutions LLC', trade_name: 'TechSol'},
locale: 'en-US',
domain_name_primary_link_url: 'https://www.techcorp.com',
tax_id: {value: 'DE123456789', type: ['VAT', 'TVA', 'IVA', '...']},
registration_number: {
business_type: 'GmbH',
value: 'HRB 123456',
registry_name: 'Handelsregister Berlin',
registry_country: 'DE, FR, US, etc.'
},
description: 'An innovative technology company focused on AI solutions'
}
}
]
},
receiver: {
data: [
{
type: '<string>',
id: 'company-2',
attributes: {
registration: {registered_name: 'TechCorp AI Solutions LLC', trade_name: 'TechSol'},
locale: 'en-US',
domain_name_primary_link_url: 'https://www.techcorp.com',
tax_id: {value: 'DE123456789', type: ['VAT', 'TVA', 'IVA', '...']},
registration_number: {
business_type: 'GmbH',
value: 'HRB 123456',
registry_name: 'Handelsregister Berlin',
registry_country: 'DE, FR, US, etc.'
},
description: 'An innovative technology company focused on AI solutions'
}
}
]
},
payment_means: {
data: [
{
type: '<string>',
id: 'pm-1',
attributes: {
account_details: {
iban: '<string>',
bic: '<string>',
sort_code: '<string>',
account_number: '<string>',
routing_number: '<string>',
currency: '<string>'
},
bank_details: {
bank_name: '<string>',
bank_code: '<string>',
branch_name: '<string>',
branch_code: '<string>'
},
card_details: {
masked_pan: '<string>',
expiry_month: 6,
expiry_year: 2025,
cardholder_name: '<string>'
},
digital_wallet: {wallet_id: '<string>'},
compliance: {},
nickname: '<string>',
description: '<string>',
tags: ['<string>']
}
}
]
},
invoice_items: {
data: [
{
type: '<string>',
id: 'item-1',
attributes: {
line_id: '1',
name: 'Wireless Mouse',
unit_price: 25,
currency: 'EUR',
sku: 'WM-1001',
description: 'Ergonomic wireless mouse with USB receiver',
unit: 'EA',
min_quantity: 1,
max_quantity: 500,
tax: {rate: 20, category: 'standard', scheme: 'VAT'},
period: {start: '2025-06-26', end: '2025-06-27'}
}
}
]
},
documents: {
data: [
{
type: '<string>',
id: 'doc-1',
attributes: {
file_name: '<string>',
status: '<string>',
file_type: '<string>',
size_bytes: 123
}
}
]
},
people: {
data: [
{
type: '<string>',
id: 'person-1',
attributes: {first_name: 'John', last_name: 'Doe'}
}
]
}
}
}
})
};
fetch('https://api.wellapp.ai/v1/invoices/{id}', 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.wellapp.ai/v1/invoices/{id}",
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([
'data' => [
'type' => 'invoice',
'included' => [
'issuer' => [
'data' => [
[
'type' => '<string>',
'id' => 'company-2',
'attributes' => [
'registration' => [
'registered_name' => 'TechCorp AI Solutions LLC',
'trade_name' => 'TechSol'
],
'locale' => 'en-US',
'domain_name_primary_link_url' => 'https://www.techcorp.com',
'tax_id' => [
'value' => 'DE123456789',
'type' => [
'VAT',
'TVA',
'IVA',
'...'
]
],
'registration_number' => [
'business_type' => 'GmbH',
'value' => 'HRB 123456',
'registry_name' => 'Handelsregister Berlin',
'registry_country' => 'DE, FR, US, etc.'
],
'description' => 'An innovative technology company focused on AI solutions'
]
]
]
],
'receiver' => [
'data' => [
[
'type' => '<string>',
'id' => 'company-2',
'attributes' => [
'registration' => [
'registered_name' => 'TechCorp AI Solutions LLC',
'trade_name' => 'TechSol'
],
'locale' => 'en-US',
'domain_name_primary_link_url' => 'https://www.techcorp.com',
'tax_id' => [
'value' => 'DE123456789',
'type' => [
'VAT',
'TVA',
'IVA',
'...'
]
],
'registration_number' => [
'business_type' => 'GmbH',
'value' => 'HRB 123456',
'registry_name' => 'Handelsregister Berlin',
'registry_country' => 'DE, FR, US, etc.'
],
'description' => 'An innovative technology company focused on AI solutions'
]
]
]
],
'payment_means' => [
'data' => [
[
'type' => '<string>',
'id' => 'pm-1',
'attributes' => [
'account_details' => [
'iban' => '<string>',
'bic' => '<string>',
'sort_code' => '<string>',
'account_number' => '<string>',
'routing_number' => '<string>',
'currency' => '<string>'
],
'bank_details' => [
'bank_name' => '<string>',
'bank_code' => '<string>',
'branch_name' => '<string>',
'branch_code' => '<string>'
],
'card_details' => [
'masked_pan' => '<string>',
'expiry_month' => 6,
'expiry_year' => 2025,
'cardholder_name' => '<string>'
],
'digital_wallet' => [
'wallet_id' => '<string>'
],
'compliance' => [
],
'nickname' => '<string>',
'description' => '<string>',
'tags' => [
'<string>'
]
]
]
]
],
'invoice_items' => [
'data' => [
[
'type' => '<string>',
'id' => 'item-1',
'attributes' => [
'line_id' => '1',
'name' => 'Wireless Mouse',
'unit_price' => 25,
'currency' => 'EUR',
'sku' => 'WM-1001',
'description' => 'Ergonomic wireless mouse with USB receiver',
'unit' => 'EA',
'min_quantity' => 1,
'max_quantity' => 500,
'tax' => [
'rate' => 20,
'category' => 'standard',
'scheme' => 'VAT'
],
'period' => [
'start' => '2025-06-26',
'end' => '2025-06-27'
]
]
]
]
],
'documents' => [
'data' => [
[
'type' => '<string>',
'id' => 'doc-1',
'attributes' => [
'file_name' => '<string>',
'status' => '<string>',
'file_type' => '<string>',
'size_bytes' => 123
]
]
]
],
'people' => [
'data' => [
[
'type' => '<string>',
'id' => 'person-1',
'attributes' => [
'first_name' => 'John',
'last_name' => 'Doe'
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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.wellapp.ai/v1/invoices/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"invoice\",\n \"included\": {\n \"issuer\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"receiver\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"payment_means\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"pm-1\",\n \"attributes\": {\n \"account_details\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"currency\": \"<string>\"\n },\n \"bank_details\": {\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"branch_code\": \"<string>\"\n },\n \"card_details\": {\n \"masked_pan\": \"<string>\",\n \"expiry_month\": 6,\n \"expiry_year\": 2025,\n \"cardholder_name\": \"<string>\"\n },\n \"digital_wallet\": {\n \"wallet_id\": \"<string>\"\n },\n \"compliance\": {},\n \"nickname\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"item-1\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"name\": \"Wireless Mouse\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\n \"sku\": \"WM-1001\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit\": \"EA\",\n \"min_quantity\": 1,\n \"max_quantity\": 500,\n \"tax\": {\n \"rate\": 20,\n \"category\": \"standard\",\n \"scheme\": \"VAT\"\n },\n \"period\": {\n \"start\": \"2025-06-26\",\n \"end\": \"2025-06-27\"\n }\n }\n }\n ]\n },\n \"documents\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"doc-1\",\n \"attributes\": {\n \"file_name\": \"<string>\",\n \"status\": \"<string>\",\n \"file_type\": \"<string>\",\n \"size_bytes\": 123\n }\n }\n ]\n },\n \"people\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"person-1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n }\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.wellapp.ai/v1/invoices/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"invoice\",\n \"included\": {\n \"issuer\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"receiver\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"payment_means\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"pm-1\",\n \"attributes\": {\n \"account_details\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"currency\": \"<string>\"\n },\n \"bank_details\": {\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"branch_code\": \"<string>\"\n },\n \"card_details\": {\n \"masked_pan\": \"<string>\",\n \"expiry_month\": 6,\n \"expiry_year\": 2025,\n \"cardholder_name\": \"<string>\"\n },\n \"digital_wallet\": {\n \"wallet_id\": \"<string>\"\n },\n \"compliance\": {},\n \"nickname\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"item-1\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"name\": \"Wireless Mouse\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\n \"sku\": \"WM-1001\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit\": \"EA\",\n \"min_quantity\": 1,\n \"max_quantity\": 500,\n \"tax\": {\n \"rate\": 20,\n \"category\": \"standard\",\n \"scheme\": \"VAT\"\n },\n \"period\": {\n \"start\": \"2025-06-26\",\n \"end\": \"2025-06-27\"\n }\n }\n }\n ]\n },\n \"documents\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"doc-1\",\n \"attributes\": {\n \"file_name\": \"<string>\",\n \"status\": \"<string>\",\n \"file_type\": \"<string>\",\n \"size_bytes\": 123\n }\n }\n ]\n },\n \"people\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"person-1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n }\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"invoice\",\n \"included\": {\n \"issuer\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"receiver\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"company-2\",\n \"attributes\": {\n \"registration\": {\n \"registered_name\": \"TechCorp AI Solutions LLC\",\n \"trade_name\": \"TechSol\"\n },\n \"locale\": \"en-US\",\n \"domain_name_primary_link_url\": \"https://www.techcorp.com\",\n \"tax_id\": {\n \"value\": \"DE123456789\",\n \"type\": [\n \"VAT\",\n \"TVA\",\n \"IVA\",\n \"...\"\n ]\n },\n \"registration_number\": {\n \"business_type\": \"GmbH\",\n \"value\": \"HRB 123456\",\n \"registry_name\": \"Handelsregister Berlin\",\n \"registry_country\": \"DE, FR, US, etc.\"\n },\n \"description\": \"An innovative technology company focused on AI solutions\"\n }\n }\n ]\n },\n \"payment_means\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"pm-1\",\n \"attributes\": {\n \"account_details\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"account_number\": \"<string>\",\n \"routing_number\": \"<string>\",\n \"currency\": \"<string>\"\n },\n \"bank_details\": {\n \"bank_name\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"branch_code\": \"<string>\"\n },\n \"card_details\": {\n \"masked_pan\": \"<string>\",\n \"expiry_month\": 6,\n \"expiry_year\": 2025,\n \"cardholder_name\": \"<string>\"\n },\n \"digital_wallet\": {\n \"wallet_id\": \"<string>\"\n },\n \"compliance\": {},\n \"nickname\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"item-1\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"name\": \"Wireless Mouse\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\n \"sku\": \"WM-1001\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit\": \"EA\",\n \"min_quantity\": 1,\n \"max_quantity\": 500,\n \"tax\": {\n \"rate\": 20,\n \"category\": \"standard\",\n \"scheme\": \"VAT\"\n },\n \"period\": {\n \"start\": \"2025-06-26\",\n \"end\": \"2025-06-27\"\n }\n }\n }\n ]\n },\n \"documents\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"doc-1\",\n \"attributes\": {\n \"file_name\": \"<string>\",\n \"status\": \"<string>\",\n \"file_type\": \"<string>\",\n \"size_bytes\": 123\n }\n }\n ]\n },\n \"people\": {\n \"data\": [\n {\n \"type\": \"<string>\",\n \"id\": \"person-1\",\n \"attributes\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n }\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "invoice",
"id": "invoice_550e8400-e29b-41d4-a716-446655440000",
"attributes": {
"reference_number": "INV-2025-001",
"document_type": "commercial_invoice",
"document_type_code": "380",
"issue_date": "2025-01-15",
"due_date": "2025-02-15",
"local_currency": "EUR",
"local_totals": {
"subtotal": "1000.00",
"tax_total": "200.00",
"total_amount": "1200.00"
},
"terms": "Payment due within 30 days",
"billing_context": "subscription",
"payment_status": {
"paid": true,
"amount_paid": 123,
"amount_remaining": 123
},
"status": "draft",
"description": "Professional services invoice for January 2025",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
},
"relationships": {
"issuer": {
"data": {
"type": "company",
"id": "company-issuer-uuid"
}
},
"receiver": {
"data": {
"type": "company",
"id": "company-receiver-uuid"
}
},
"payment_means": {
"data": [
{
"type": "payment_means",
"id": "pm_1"
}
]
},
"invoice_items": {
"data": [
{
"type": "invoice_item",
"id": "item_1"
}
]
},
"document": {
"data": {
"type": "document",
"id": "doc_original_invoice"
}
},
"people": {
"data": [
{
"type": "people",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}
}
},
"included": [
{
"type": "people",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"first_name": "John",
"last_name": "Smith",
"full_name": "John Smith",
"email": "jsmith@example.com",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "document",
"id": "doc_original_invoice",
"attributes": {
"file_name": "invoice_2025_001.pdf",
"status": "processed",
"uploaded_at": "2023-11-07T05:31:56Z",
"processed_at": "2023-11-07T05:31:56Z",
"file_type": "application/pdf",
"size_bytes": 245678,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "invoice_item",
"id": "item_1",
"attributes": {
"line_id": "1",
"sku": "WM-1001",
"name": "Wireless Mouse",
"description": "Ergonomic wireless mouse with USB receiver",
"unit_price": 25,
"currency": "EUR",
"unit": "EA",
"min_quantity": 1,
"max_quantity": 500,
"tax": {
"rate": 20,
"category": "standard",
"scheme": "VAT"
},
"period": {
"start": "2025-06-26",
"end": "2025-06-27"
},
"created_at": "2025-05-11T13:42:12Z",
"updated_at": "2025-05-11T13:45:20Z"
}
},
{
"type": "payment_means",
"id": "pm_1",
"attributes": {
"type": "card_details",
"scheme": "SEPA",
"status": "active",
"account_details": {
"iban": "DE89370400440532013000",
"bic": "COBADEFFXXX",
"account_number": "532013000",
"routing_number": "37040044",
"currency": "EUR"
},
"bank_details": {
"bank_name": "Commerzbank AG",
"bank_code": "37040044",
"branch_name": "Main Branch",
"branch_code": "440"
},
"card_details": {
"masked_pan": "****1234",
"brand": "visa",
"card_type": "credit",
"expiry_month": 12,
"expiry_year": 2027,
"cardholder_name": "John Smith"
},
"digital_wallet": {
"provider": "paypal",
"wallet_id": "john.smith@example.com",
"wallet_type": "personal"
},
"compliance": {
"kyc_status": "verified",
"aml_status": "cleared",
"sanctions_check": "passed",
"last_compliance_check": "2023-11-07T05:31:56Z"
},
"metadata": {
"source": "api",
"external_id": "ext_pm_12345"
},
"nickname": "Primary Payment Method",
"description": "Main company payment account",
"tags": [
"primary",
"sepa"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "company",
"id": "company-receiver-uuid",
"attributes": {
"name": "ACME Corporation",
"description": "Technology solutions provider",
"domain_name_primary_link_url": "acme.com",
"locale": "en",
"tax_id": {
"value": "DE123456789",
"type": "VAT"
},
"registration": {
"trade_name": "TechSol",
"registered_name": "ACME Corporation GmbH"
},
"registration_number": {
"business_type": "GmbH",
"value": "HRB 123456",
"registry_name": "Handelsregister Berlin",
"registry_country": "DE"
},
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
},
{
"type": "company",
"id": "company-issuer-uuid",
"attributes": {
"name": "Service Provider Inc",
"description": "Professional services company",
"domain_name_primary_link_url": "serviceprovider.com",
"locale": "en",
"tax_id": {
"value": "FR987654321",
"type": "VAT"
},
"registration": {
"trade_name": "Service Provider",
"registered_name": "Service Provider Inc."
},
"registration_number": {
"business_type": "Inc",
"value": "RCS 987654",
"registry_name": "Paris Commercial Registry",
"registry_country": "FR"
},
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
]
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}{
"error": {
"code": "invoice_not_found",
"message": "Invoice not found"
}
}Headers
Bearer token for authentication
Path Parameters
Unique identifier of the invoice to be updated.
Body
application/json
Schema for creating a new invoice
Show child attributes
Show child attributes
Response
Invoice updated successfully
Response schema for successfully created invoice
Show child attributes
Show child attributes
⌘I