Create an invoice item
curl --request PATCH \
--url https://api.wellapp.ai/v1/invoice-items/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "invoice_item",
"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"
}
},
"relationships": {
"invoices": {
"data": [
{
"type": "invoice",
"id": "invoice1"
}
]
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/invoice-items/{id}"
payload = {
"type": "invoice_item",
"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"
}
},
"relationships": { "invoices": { "data": [
{
"type": "invoice",
"id": "invoice1"
}
] } }
}
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({
type: 'invoice_item',
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'}
},
relationships: {invoices: {data: [{type: 'invoice', id: 'invoice1'}]}}
})
};
fetch('https://api.wellapp.ai/v1/invoice-items/{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/invoice-items/{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([
'type' => 'invoice_item',
'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'
]
],
'relationships' => [
'invoices' => [
'data' => [
[
'type' => 'invoice',
'id' => 'invoice1'
]
]
]
]
]),
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/invoice-items/{id}"
payload := strings.NewReader("{\n \"type\": \"invoice_item\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"sku\": \"WM-1001\",\n \"name\": \"Wireless Mouse\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\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 \"relationships\": {\n \"invoices\": {\n \"data\": [\n {\n \"type\": \"invoice\",\n \"id\": \"invoice1\"\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/invoice-items/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"invoice_item\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"sku\": \"WM-1001\",\n \"name\": \"Wireless Mouse\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\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 \"relationships\": {\n \"invoices\": {\n \"data\": [\n {\n \"type\": \"invoice\",\n \"id\": \"invoice1\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/invoice-items/{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 \"type\": \"invoice_item\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"sku\": \"WM-1001\",\n \"name\": \"Wireless Mouse\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\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 \"relationships\": {\n \"invoices\": {\n \"data\": [\n {\n \"type\": \"invoice\",\n \"id\": \"invoice1\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "invoice_item",
"id": "item_001",
"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"
},
"relationships": {
"invoices": {
"data": [
{
"type": "invoice",
"id": "invoice1"
}
]
},
"medias": {
"data": [
{
"type": "media",
"id": "media-1"
}
]
}
}
},
"included": [
{
"type": "invoice",
"id": "invoice1",
"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": false,
"amount_paid": 0,
"amount_remaining": 1200
},
"status": "draft",
"description": "Professional services invoice for January 2025",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
},
{
"type": "media",
"id": "media-1",
"attributes": {
"media_type": "logo",
"is_primary": true,
"url": "https://cdn.example.com/product-images/wireless-mouse.jpg",
"created_at": "2025-05-11T13:00:00Z",
"updated_at": "2025-05-11T13:00:00Z"
}
}
]
}{
"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"
}
}Invoice items
Patch Invoice items
Create a new invoice item with detailed product information, pricing, taxes, and period specifications.
PATCH
/
v1
/
invoice-items
/
{id}
Create an invoice item
curl --request PATCH \
--url https://api.wellapp.ai/v1/invoice-items/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "invoice_item",
"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"
}
},
"relationships": {
"invoices": {
"data": [
{
"type": "invoice",
"id": "invoice1"
}
]
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/invoice-items/{id}"
payload = {
"type": "invoice_item",
"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"
}
},
"relationships": { "invoices": { "data": [
{
"type": "invoice",
"id": "invoice1"
}
] } }
}
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({
type: 'invoice_item',
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'}
},
relationships: {invoices: {data: [{type: 'invoice', id: 'invoice1'}]}}
})
};
fetch('https://api.wellapp.ai/v1/invoice-items/{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/invoice-items/{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([
'type' => 'invoice_item',
'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'
]
],
'relationships' => [
'invoices' => [
'data' => [
[
'type' => 'invoice',
'id' => 'invoice1'
]
]
]
]
]),
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/invoice-items/{id}"
payload := strings.NewReader("{\n \"type\": \"invoice_item\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"sku\": \"WM-1001\",\n \"name\": \"Wireless Mouse\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\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 \"relationships\": {\n \"invoices\": {\n \"data\": [\n {\n \"type\": \"invoice\",\n \"id\": \"invoice1\"\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/invoice-items/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"invoice_item\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"sku\": \"WM-1001\",\n \"name\": \"Wireless Mouse\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\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 \"relationships\": {\n \"invoices\": {\n \"data\": [\n {\n \"type\": \"invoice\",\n \"id\": \"invoice1\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/invoice-items/{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 \"type\": \"invoice_item\",\n \"attributes\": {\n \"line_id\": \"1\",\n \"sku\": \"WM-1001\",\n \"name\": \"Wireless Mouse\",\n \"description\": \"Ergonomic wireless mouse with USB receiver\",\n \"unit_price\": 25,\n \"currency\": \"EUR\",\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 \"relationships\": {\n \"invoices\": {\n \"data\": [\n {\n \"type\": \"invoice\",\n \"id\": \"invoice1\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "invoice_item",
"id": "item_001",
"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"
},
"relationships": {
"invoices": {
"data": [
{
"type": "invoice",
"id": "invoice1"
}
]
},
"medias": {
"data": [
{
"type": "media",
"id": "media-1"
}
]
}
}
},
"included": [
{
"type": "invoice",
"id": "invoice1",
"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": false,
"amount_paid": 0,
"amount_remaining": 1200
},
"status": "draft",
"description": "Professional services invoice for January 2025",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
},
{
"type": "media",
"id": "media-1",
"attributes": {
"media_type": "logo",
"is_primary": true,
"url": "https://cdn.example.com/product-images/wireless-mouse.jpg",
"created_at": "2025-05-11T13:00:00Z",
"updated_at": "2025-05-11T13:00:00Z"
}
}
]
}{
"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"
}
}Headers
Bearer token for authentication
Body
application/json
Request schema for creating invoice items
Show child attributes
Show child attributes
⌘I