Create a new invoice
curl --request POST \
--url https://api.wellapp.ai/v1/invoices \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "invoices",
"attributes": {
"reference_number": "INV-2025-0456",
"issue_date": "2025-06-19",
"due_date": "2025-07-19",
"document_type_code": "380",
"local_currency": "EUR",
"local_totals": {
"items_total": 2500,
"tax_total": 500,
"grand_total": 3000
},
"terms": "Net 30",
"status": "sent",
"payment_status": {
"paid": true,
"local_amount_paid": 3000,
"local_amount_remaining": 0
},
"billing_context": "subscription",
"description": "Monthly cloud hosting subscription"
},
"relationships": {
"issuer": {
"data": {
"type": "company",
"id": "company_id"
}
},
"receiver": {
"data": {
"type": "company",
"id": "company_id_2"
}
},
"payment_type": {
"data": [
{
"type": "payment_means",
"id": "id1"
},
{
"type": "payment_means",
"id": "id2"
}
]
},
"invoice_items": {
"data": [
{
"type": "invoice_item",
"id": "id1"
},
{
"type": "invoice_item",
"id": "id2"
}
]
},
"documents": {
"data": {
"type": "document",
"id": "doc_original_invoice"
}
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/invoices"
payload = {
"type": "invoices",
"attributes": {
"reference_number": "INV-2025-0456",
"issue_date": "2025-06-19",
"due_date": "2025-07-19",
"document_type_code": "380",
"local_currency": "EUR",
"local_totals": {
"items_total": 2500,
"tax_total": 500,
"grand_total": 3000
},
"terms": "Net 30",
"status": "sent",
"payment_status": {
"paid": True,
"local_amount_paid": 3000,
"local_amount_remaining": 0
},
"billing_context": "subscription",
"description": "Monthly cloud hosting subscription"
},
"relationships": {
"issuer": { "data": {
"type": "company",
"id": "company_id"
} },
"receiver": { "data": {
"type": "company",
"id": "company_id_2"
} },
"payment_type": { "data": [
{
"type": "payment_means",
"id": "id1"
},
{
"type": "payment_means",
"id": "id2"
}
] },
"invoice_items": { "data": [
{
"type": "invoice_item",
"id": "id1"
},
{
"type": "invoice_item",
"id": "id2"
}
] },
"documents": { "data": {
"type": "document",
"id": "doc_original_invoice"
} }
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'invoices',
attributes: {
reference_number: 'INV-2025-0456',
issue_date: '2025-06-19',
due_date: '2025-07-19',
document_type_code: '380',
local_currency: 'EUR',
local_totals: {items_total: 2500, tax_total: 500, grand_total: 3000},
terms: 'Net 30',
status: 'sent',
payment_status: {paid: true, local_amount_paid: 3000, local_amount_remaining: 0},
billing_context: 'subscription',
description: 'Monthly cloud hosting subscription'
},
relationships: {
issuer: {data: {type: 'company', id: 'company_id'}},
receiver: {data: {type: 'company', id: 'company_id_2'}},
payment_type: {data: [{type: 'payment_means', id: 'id1'}, {type: 'payment_means', id: 'id2'}]},
invoice_items: {data: [{type: 'invoice_item', id: 'id1'}, {type: 'invoice_item', id: 'id2'}]},
documents: {data: {type: 'document', id: 'doc_original_invoice'}}
}
})
};
fetch('https://api.wellapp.ai/v1/invoices', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'invoices',
'attributes' => [
'reference_number' => 'INV-2025-0456',
'issue_date' => '2025-06-19',
'due_date' => '2025-07-19',
'document_type_code' => '380',
'local_currency' => 'EUR',
'local_totals' => [
'items_total' => 2500,
'tax_total' => 500,
'grand_total' => 3000
],
'terms' => 'Net 30',
'status' => 'sent',
'payment_status' => [
'paid' => true,
'local_amount_paid' => 3000,
'local_amount_remaining' => 0
],
'billing_context' => 'subscription',
'description' => 'Monthly cloud hosting subscription'
],
'relationships' => [
'issuer' => [
'data' => [
'type' => 'company',
'id' => 'company_id'
]
],
'receiver' => [
'data' => [
'type' => 'company',
'id' => 'company_id_2'
]
],
'payment_type' => [
'data' => [
[
'type' => 'payment_means',
'id' => 'id1'
],
[
'type' => 'payment_means',
'id' => 'id2'
]
]
],
'invoice_items' => [
'data' => [
[
'type' => 'invoice_item',
'id' => 'id1'
],
[
'type' => 'invoice_item',
'id' => 'id2'
]
]
],
'documents' => [
'data' => [
'type' => 'document',
'id' => 'doc_original_invoice'
]
]
]
]),
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"
payload := strings.NewReader("{\n \"type\": \"invoices\",\n \"attributes\": {\n \"reference_number\": \"INV-2025-0456\",\n \"issue_date\": \"2025-06-19\",\n \"due_date\": \"2025-07-19\",\n \"document_type_code\": \"380\",\n \"local_currency\": \"EUR\",\n \"local_totals\": {\n \"items_total\": 2500,\n \"tax_total\": 500,\n \"grand_total\": 3000\n },\n \"terms\": \"Net 30\",\n \"status\": \"sent\",\n \"payment_status\": {\n \"paid\": true,\n \"local_amount_paid\": 3000,\n \"local_amount_remaining\": 0\n },\n \"billing_context\": \"subscription\",\n \"description\": \"Monthly cloud hosting subscription\"\n },\n \"relationships\": {\n \"issuer\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id\"\n }\n },\n \"receiver\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id_2\"\n }\n },\n \"payment_type\": {\n \"data\": [\n {\n \"type\": \"payment_means\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"payment_means\",\n \"id\": \"id2\"\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"invoice_item\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"invoice_item\",\n \"id\": \"id2\"\n }\n ]\n },\n \"documents\": {\n \"data\": {\n \"type\": \"document\",\n \"id\": \"doc_original_invoice\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.wellapp.ai/v1/invoices")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"invoices\",\n \"attributes\": {\n \"reference_number\": \"INV-2025-0456\",\n \"issue_date\": \"2025-06-19\",\n \"due_date\": \"2025-07-19\",\n \"document_type_code\": \"380\",\n \"local_currency\": \"EUR\",\n \"local_totals\": {\n \"items_total\": 2500,\n \"tax_total\": 500,\n \"grand_total\": 3000\n },\n \"terms\": \"Net 30\",\n \"status\": \"sent\",\n \"payment_status\": {\n \"paid\": true,\n \"local_amount_paid\": 3000,\n \"local_amount_remaining\": 0\n },\n \"billing_context\": \"subscription\",\n \"description\": \"Monthly cloud hosting subscription\"\n },\n \"relationships\": {\n \"issuer\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id\"\n }\n },\n \"receiver\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id_2\"\n }\n },\n \"payment_type\": {\n \"data\": [\n {\n \"type\": \"payment_means\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"payment_means\",\n \"id\": \"id2\"\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"invoice_item\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"invoice_item\",\n \"id\": \"id2\"\n }\n ]\n },\n \"documents\": {\n \"data\": {\n \"type\": \"document\",\n \"id\": \"doc_original_invoice\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"invoices\",\n \"attributes\": {\n \"reference_number\": \"INV-2025-0456\",\n \"issue_date\": \"2025-06-19\",\n \"due_date\": \"2025-07-19\",\n \"document_type_code\": \"380\",\n \"local_currency\": \"EUR\",\n \"local_totals\": {\n \"items_total\": 2500,\n \"tax_total\": 500,\n \"grand_total\": 3000\n },\n \"terms\": \"Net 30\",\n \"status\": \"sent\",\n \"payment_status\": {\n \"paid\": true,\n \"local_amount_paid\": 3000,\n \"local_amount_remaining\": 0\n },\n \"billing_context\": \"subscription\",\n \"description\": \"Monthly cloud hosting subscription\"\n },\n \"relationships\": {\n \"issuer\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id\"\n }\n },\n \"receiver\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id_2\"\n }\n },\n \"payment_type\": {\n \"data\": [\n {\n \"type\": \"payment_means\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"payment_means\",\n \"id\": \"id2\"\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"invoice_item\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"invoice_item\",\n \"id\": \"id2\"\n }\n ]\n },\n \"documents\": {\n \"data\": {\n \"type\": \"document\",\n \"id\": \"doc_original_invoice\"\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"
}
]
},
"documents": {
"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"
}
}
]
}Invoices
Create Invoices
Create a new invoice with comprehensive details including issuer/receiver relationships, payment terms, line items, and document attachments. Supports both basic invoice creation and complex scenarios with detailed billing contexts.
POST
/
v1
/
invoices
Create a new invoice
curl --request POST \
--url https://api.wellapp.ai/v1/invoices \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "invoices",
"attributes": {
"reference_number": "INV-2025-0456",
"issue_date": "2025-06-19",
"due_date": "2025-07-19",
"document_type_code": "380",
"local_currency": "EUR",
"local_totals": {
"items_total": 2500,
"tax_total": 500,
"grand_total": 3000
},
"terms": "Net 30",
"status": "sent",
"payment_status": {
"paid": true,
"local_amount_paid": 3000,
"local_amount_remaining": 0
},
"billing_context": "subscription",
"description": "Monthly cloud hosting subscription"
},
"relationships": {
"issuer": {
"data": {
"type": "company",
"id": "company_id"
}
},
"receiver": {
"data": {
"type": "company",
"id": "company_id_2"
}
},
"payment_type": {
"data": [
{
"type": "payment_means",
"id": "id1"
},
{
"type": "payment_means",
"id": "id2"
}
]
},
"invoice_items": {
"data": [
{
"type": "invoice_item",
"id": "id1"
},
{
"type": "invoice_item",
"id": "id2"
}
]
},
"documents": {
"data": {
"type": "document",
"id": "doc_original_invoice"
}
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/invoices"
payload = {
"type": "invoices",
"attributes": {
"reference_number": "INV-2025-0456",
"issue_date": "2025-06-19",
"due_date": "2025-07-19",
"document_type_code": "380",
"local_currency": "EUR",
"local_totals": {
"items_total": 2500,
"tax_total": 500,
"grand_total": 3000
},
"terms": "Net 30",
"status": "sent",
"payment_status": {
"paid": True,
"local_amount_paid": 3000,
"local_amount_remaining": 0
},
"billing_context": "subscription",
"description": "Monthly cloud hosting subscription"
},
"relationships": {
"issuer": { "data": {
"type": "company",
"id": "company_id"
} },
"receiver": { "data": {
"type": "company",
"id": "company_id_2"
} },
"payment_type": { "data": [
{
"type": "payment_means",
"id": "id1"
},
{
"type": "payment_means",
"id": "id2"
}
] },
"invoice_items": { "data": [
{
"type": "invoice_item",
"id": "id1"
},
{
"type": "invoice_item",
"id": "id2"
}
] },
"documents": { "data": {
"type": "document",
"id": "doc_original_invoice"
} }
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'invoices',
attributes: {
reference_number: 'INV-2025-0456',
issue_date: '2025-06-19',
due_date: '2025-07-19',
document_type_code: '380',
local_currency: 'EUR',
local_totals: {items_total: 2500, tax_total: 500, grand_total: 3000},
terms: 'Net 30',
status: 'sent',
payment_status: {paid: true, local_amount_paid: 3000, local_amount_remaining: 0},
billing_context: 'subscription',
description: 'Monthly cloud hosting subscription'
},
relationships: {
issuer: {data: {type: 'company', id: 'company_id'}},
receiver: {data: {type: 'company', id: 'company_id_2'}},
payment_type: {data: [{type: 'payment_means', id: 'id1'}, {type: 'payment_means', id: 'id2'}]},
invoice_items: {data: [{type: 'invoice_item', id: 'id1'}, {type: 'invoice_item', id: 'id2'}]},
documents: {data: {type: 'document', id: 'doc_original_invoice'}}
}
})
};
fetch('https://api.wellapp.ai/v1/invoices', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'invoices',
'attributes' => [
'reference_number' => 'INV-2025-0456',
'issue_date' => '2025-06-19',
'due_date' => '2025-07-19',
'document_type_code' => '380',
'local_currency' => 'EUR',
'local_totals' => [
'items_total' => 2500,
'tax_total' => 500,
'grand_total' => 3000
],
'terms' => 'Net 30',
'status' => 'sent',
'payment_status' => [
'paid' => true,
'local_amount_paid' => 3000,
'local_amount_remaining' => 0
],
'billing_context' => 'subscription',
'description' => 'Monthly cloud hosting subscription'
],
'relationships' => [
'issuer' => [
'data' => [
'type' => 'company',
'id' => 'company_id'
]
],
'receiver' => [
'data' => [
'type' => 'company',
'id' => 'company_id_2'
]
],
'payment_type' => [
'data' => [
[
'type' => 'payment_means',
'id' => 'id1'
],
[
'type' => 'payment_means',
'id' => 'id2'
]
]
],
'invoice_items' => [
'data' => [
[
'type' => 'invoice_item',
'id' => 'id1'
],
[
'type' => 'invoice_item',
'id' => 'id2'
]
]
],
'documents' => [
'data' => [
'type' => 'document',
'id' => 'doc_original_invoice'
]
]
]
]),
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"
payload := strings.NewReader("{\n \"type\": \"invoices\",\n \"attributes\": {\n \"reference_number\": \"INV-2025-0456\",\n \"issue_date\": \"2025-06-19\",\n \"due_date\": \"2025-07-19\",\n \"document_type_code\": \"380\",\n \"local_currency\": \"EUR\",\n \"local_totals\": {\n \"items_total\": 2500,\n \"tax_total\": 500,\n \"grand_total\": 3000\n },\n \"terms\": \"Net 30\",\n \"status\": \"sent\",\n \"payment_status\": {\n \"paid\": true,\n \"local_amount_paid\": 3000,\n \"local_amount_remaining\": 0\n },\n \"billing_context\": \"subscription\",\n \"description\": \"Monthly cloud hosting subscription\"\n },\n \"relationships\": {\n \"issuer\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id\"\n }\n },\n \"receiver\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id_2\"\n }\n },\n \"payment_type\": {\n \"data\": [\n {\n \"type\": \"payment_means\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"payment_means\",\n \"id\": \"id2\"\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"invoice_item\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"invoice_item\",\n \"id\": \"id2\"\n }\n ]\n },\n \"documents\": {\n \"data\": {\n \"type\": \"document\",\n \"id\": \"doc_original_invoice\"\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.wellapp.ai/v1/invoices")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"invoices\",\n \"attributes\": {\n \"reference_number\": \"INV-2025-0456\",\n \"issue_date\": \"2025-06-19\",\n \"due_date\": \"2025-07-19\",\n \"document_type_code\": \"380\",\n \"local_currency\": \"EUR\",\n \"local_totals\": {\n \"items_total\": 2500,\n \"tax_total\": 500,\n \"grand_total\": 3000\n },\n \"terms\": \"Net 30\",\n \"status\": \"sent\",\n \"payment_status\": {\n \"paid\": true,\n \"local_amount_paid\": 3000,\n \"local_amount_remaining\": 0\n },\n \"billing_context\": \"subscription\",\n \"description\": \"Monthly cloud hosting subscription\"\n },\n \"relationships\": {\n \"issuer\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id\"\n }\n },\n \"receiver\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id_2\"\n }\n },\n \"payment_type\": {\n \"data\": [\n {\n \"type\": \"payment_means\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"payment_means\",\n \"id\": \"id2\"\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"invoice_item\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"invoice_item\",\n \"id\": \"id2\"\n }\n ]\n },\n \"documents\": {\n \"data\": {\n \"type\": \"document\",\n \"id\": \"doc_original_invoice\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"invoices\",\n \"attributes\": {\n \"reference_number\": \"INV-2025-0456\",\n \"issue_date\": \"2025-06-19\",\n \"due_date\": \"2025-07-19\",\n \"document_type_code\": \"380\",\n \"local_currency\": \"EUR\",\n \"local_totals\": {\n \"items_total\": 2500,\n \"tax_total\": 500,\n \"grand_total\": 3000\n },\n \"terms\": \"Net 30\",\n \"status\": \"sent\",\n \"payment_status\": {\n \"paid\": true,\n \"local_amount_paid\": 3000,\n \"local_amount_remaining\": 0\n },\n \"billing_context\": \"subscription\",\n \"description\": \"Monthly cloud hosting subscription\"\n },\n \"relationships\": {\n \"issuer\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id\"\n }\n },\n \"receiver\": {\n \"data\": {\n \"type\": \"company\",\n \"id\": \"company_id_2\"\n }\n },\n \"payment_type\": {\n \"data\": [\n {\n \"type\": \"payment_means\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"payment_means\",\n \"id\": \"id2\"\n }\n ]\n },\n \"invoice_items\": {\n \"data\": [\n {\n \"type\": \"invoice_item\",\n \"id\": \"id1\"\n },\n {\n \"type\": \"invoice_item\",\n \"id\": \"id2\"\n }\n ]\n },\n \"documents\": {\n \"data\": {\n \"type\": \"document\",\n \"id\": \"doc_original_invoice\"\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"
}
]
},
"documents": {
"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"
}
}
]
}⌘I