curl --request GET \
--url https://api.altera.co/sales/invoice \
--header 'Authorization: <api-key>'import requests
url = "https://api.altera.co/sales/invoice"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.altera.co/sales/invoice', 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.altera.co/sales/invoice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.altera.co/sales/invoice"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.altera.co/sales/invoice")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altera.co/sales/invoice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice": {
"modelType": "INVOICE",
"readOnly": false,
"basicInformation": {
"invoiceId": 118584,
"invoiceType": "PRO_FORMA",
"invoiceFormat": "PRO %N/%M/%Y",
"invoiceNumber": "PRO 2/12/2022",
"year": 2022,
"month": 12,
"invoiceNumberInPeriod": 2,
"statusId": "SENT",
"isReceipt": false,
"isRelated": false,
"netPrice": 5760,
"grossPrice": 7084.8,
"currency": "PLN",
"exchangeRate": 1,
"vatPLN": 1324.8,
"issueDate": "2022-12-27T00:00:00.000Z",
"saleDate": "2022-12-27T00:00:00.000Z",
"uploadDate": "2022-12-27T08:52:22.000Z",
"relatedInvoicesIds": [],
"priceTypeId": "NET"
},
"contractor": {
"contractorName": "American Water Works Company, Inc.",
"contractorId": 106,
"taxIdentificationNumber": "3748414103",
"country": "PL",
"contractorType": "COMPANY",
"contractorRegion": "POLAND",
"defaultCurrency": "PLN",
"city": "Norton Canes",
"street": "Dezsez View",
"houseNumber": "396",
"flatNumber": "154",
"postCode": "97-135",
"email": "went@able.com,fv@altera.co",
"phoneNumber": "420577850",
"areaNumber": ""
},
"buyer": {
"contractorName": "American Water Works Company, Inc.",
"contractorId": 106,
"taxIdentificationNumber": "3748414103",
"country": "PL",
"contractorType": "COMPANY",
"contractorRegion": "POLAND",
"defaultCurrency": "PLN",
"city": "Norton Canes",
"street": "Dezsez View",
"houseNumber": "396",
"flatNumber": "154",
"postCode": "97-135",
"email": "went@able.com,fv@altera.co",
"phoneNumber": "420577850",
"areaNumber": ""
},
"seller": {
"taxIdentificationNumber": "1397887352",
"contractorName": "Express Scripts Inc."
},
"payments": {
"paymentMethod": "TRANSFER",
"dueDate": "2023-01-26T00:00:00.000Z",
"isSplitPayment": false,
"isPaid": false,
"paidAmount": 0,
"bankAccountNumber": "29 1111 1111 1111 1111 1111 1111"
},
"invoicePosition": [
{
"invoiceProductId": 57822,
"positionType": "SERVICE",
"productPosition": 0,
"productCategory": "Facebook",
"productCategoryId": 808,
"productName": "Facebook Ads",
"unit": "szt.",
"unitNetPrice": 480,
"unitGrossPrice": 590.4,
"quantity": 12,
"discount": 0,
"vat": "23%",
"priceNet": 5760,
"netPrice": "5760",
"vatAmt": 1324.8,
"priceGross": 7084.8,
"grossPrice": "7084.8",
"gtu": "-",
"deductions": true
}
],
"attachments": [
{
"id": 41660,
"fileName": "1_3_2022_1.pdf",
"fileSize": 26968
}
],
"costCenterPerItem": false,
"accounting": {
"vatProcedures": [],
"isSubjectToVat": true,
"activeVat": true
}
},
"defaults": {
"suggestedProducts": [
{
"productId": 780,
"productName": "Facebook Ads"
},
{
"productId": 781,
"productName": "Google Ads"
},
{
"productId": 779,
"productName": "Prowadzenie FP"
}
],
"suggestedContractor": [
{
"contractorId": 106,
"tinCountry": "PL",
"tin": "3748414103",
"name": "American Water Works Company, Inc.",
"contractorType": "COMPANY"
},
{
"contractorId": 104,
"tinCountry": "PL",
"tin": "4387990234",
"name": "Whirlpool Corporation",
"contractorType": "COMPANY"
},
{
"contractorId": 87,
"tinCountry": "PL",
"tin": "2231185845",
"name": "World Fuel Services Corporation",
"contractorType": "COMPANY"
}
],
"suggestedCategories": [
{
"categoryName": "Google"
},
{
"categoryName": "Facebook"
},
{
"categoryName": ""
}
],
"suggestedReasons": [
"Brak adnotacji \"mechanizm podzielonej płatności\"",
"Pomyłka w cenie",
"Pomyłka w dacie",
"Pomyłka w danych nabywcy",
"Pomyłka w ilości",
"Pomyłka w kwocie",
"Pomyłka w opisie",
"Pomyłka w stawce VAT",
"Rabat",
"Reklamacja",
"Zwrot towaru / płatności"
],
"units": [
"szt.",
"godz",
"dni",
"kg",
"mb"
],
"pkwiu": [],
"vatPcs": [
{
"name": "23%",
"value": 0.23
},
{
"name": "8%",
"value": 0.08
},
{
"name": "5%",
"value": 0.05
},
{
"name": "zw",
"nameEN": "exempt.",
"value": 0
},
{
"name": "np",
"nameEN": "reverse charge",
"value": 0
},
{
"name": "0%",
"value": 0
}
]
},
"relatedInvoices": []
}{
"result": "Error",
"errorMessage": "This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.",
"errorMessagePL": "Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."
}{
"result": "Error",
"errorCode": "KEY_EXPIRED",
"errorMessage": "API key has expired"
}{
"result": "Error",
"errorMessage": "This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.",
"errorMessagePL": "Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."
}{
"result": "Error",
"errorMessage": "This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.",
"errorMessagePL": "Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."
}Get invoice data
Retrieve data for a particular invoice available in the system
This endpoint may be used as a base for new invoice data that we wish to create based on a set of related invoices
If you wish to generate such object base you will need to provide both:
relatedparameter, listing the related invoicesinvoiceTypeof the new invoice we wish to create
The return object will be a temporary invoice object you may further extend before saving it.
Missing, permanently deleted and other-company invoices return 404 NOT_FOUND with a generic message. Own soft-deleted invoices return 404 NOT_FOUND with “Invoice has been deleted” and no invoice data. This applies to ref and related lookups. For CORRECTION, rows come from the referenced document, without applying later corrections automatically. Reference the previous correction to use its stored after-correction state.
curl --request GET \
--url https://api.altera.co/sales/invoice \
--header 'Authorization: <api-key>'import requests
url = "https://api.altera.co/sales/invoice"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.altera.co/sales/invoice', 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.altera.co/sales/invoice",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.altera.co/sales/invoice"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.altera.co/sales/invoice")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altera.co/sales/invoice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice": {
"modelType": "INVOICE",
"readOnly": false,
"basicInformation": {
"invoiceId": 118584,
"invoiceType": "PRO_FORMA",
"invoiceFormat": "PRO %N/%M/%Y",
"invoiceNumber": "PRO 2/12/2022",
"year": 2022,
"month": 12,
"invoiceNumberInPeriod": 2,
"statusId": "SENT",
"isReceipt": false,
"isRelated": false,
"netPrice": 5760,
"grossPrice": 7084.8,
"currency": "PLN",
"exchangeRate": 1,
"vatPLN": 1324.8,
"issueDate": "2022-12-27T00:00:00.000Z",
"saleDate": "2022-12-27T00:00:00.000Z",
"uploadDate": "2022-12-27T08:52:22.000Z",
"relatedInvoicesIds": [],
"priceTypeId": "NET"
},
"contractor": {
"contractorName": "American Water Works Company, Inc.",
"contractorId": 106,
"taxIdentificationNumber": "3748414103",
"country": "PL",
"contractorType": "COMPANY",
"contractorRegion": "POLAND",
"defaultCurrency": "PLN",
"city": "Norton Canes",
"street": "Dezsez View",
"houseNumber": "396",
"flatNumber": "154",
"postCode": "97-135",
"email": "went@able.com,fv@altera.co",
"phoneNumber": "420577850",
"areaNumber": ""
},
"buyer": {
"contractorName": "American Water Works Company, Inc.",
"contractorId": 106,
"taxIdentificationNumber": "3748414103",
"country": "PL",
"contractorType": "COMPANY",
"contractorRegion": "POLAND",
"defaultCurrency": "PLN",
"city": "Norton Canes",
"street": "Dezsez View",
"houseNumber": "396",
"flatNumber": "154",
"postCode": "97-135",
"email": "went@able.com,fv@altera.co",
"phoneNumber": "420577850",
"areaNumber": ""
},
"seller": {
"taxIdentificationNumber": "1397887352",
"contractorName": "Express Scripts Inc."
},
"payments": {
"paymentMethod": "TRANSFER",
"dueDate": "2023-01-26T00:00:00.000Z",
"isSplitPayment": false,
"isPaid": false,
"paidAmount": 0,
"bankAccountNumber": "29 1111 1111 1111 1111 1111 1111"
},
"invoicePosition": [
{
"invoiceProductId": 57822,
"positionType": "SERVICE",
"productPosition": 0,
"productCategory": "Facebook",
"productCategoryId": 808,
"productName": "Facebook Ads",
"unit": "szt.",
"unitNetPrice": 480,
"unitGrossPrice": 590.4,
"quantity": 12,
"discount": 0,
"vat": "23%",
"priceNet": 5760,
"netPrice": "5760",
"vatAmt": 1324.8,
"priceGross": 7084.8,
"grossPrice": "7084.8",
"gtu": "-",
"deductions": true
}
],
"attachments": [
{
"id": 41660,
"fileName": "1_3_2022_1.pdf",
"fileSize": 26968
}
],
"costCenterPerItem": false,
"accounting": {
"vatProcedures": [],
"isSubjectToVat": true,
"activeVat": true
}
},
"defaults": {
"suggestedProducts": [
{
"productId": 780,
"productName": "Facebook Ads"
},
{
"productId": 781,
"productName": "Google Ads"
},
{
"productId": 779,
"productName": "Prowadzenie FP"
}
],
"suggestedContractor": [
{
"contractorId": 106,
"tinCountry": "PL",
"tin": "3748414103",
"name": "American Water Works Company, Inc.",
"contractorType": "COMPANY"
},
{
"contractorId": 104,
"tinCountry": "PL",
"tin": "4387990234",
"name": "Whirlpool Corporation",
"contractorType": "COMPANY"
},
{
"contractorId": 87,
"tinCountry": "PL",
"tin": "2231185845",
"name": "World Fuel Services Corporation",
"contractorType": "COMPANY"
}
],
"suggestedCategories": [
{
"categoryName": "Google"
},
{
"categoryName": "Facebook"
},
{
"categoryName": ""
}
],
"suggestedReasons": [
"Brak adnotacji \"mechanizm podzielonej płatności\"",
"Pomyłka w cenie",
"Pomyłka w dacie",
"Pomyłka w danych nabywcy",
"Pomyłka w ilości",
"Pomyłka w kwocie",
"Pomyłka w opisie",
"Pomyłka w stawce VAT",
"Rabat",
"Reklamacja",
"Zwrot towaru / płatności"
],
"units": [
"szt.",
"godz",
"dni",
"kg",
"mb"
],
"pkwiu": [],
"vatPcs": [
{
"name": "23%",
"value": 0.23
},
{
"name": "8%",
"value": 0.08
},
{
"name": "5%",
"value": 0.05
},
{
"name": "zw",
"nameEN": "exempt.",
"value": 0
},
{
"name": "np",
"nameEN": "reverse charge",
"value": 0
},
{
"name": "0%",
"value": 0
}
]
},
"relatedInvoices": []
}{
"result": "Error",
"errorMessage": "This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.",
"errorMessagePL": "Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."
}{
"result": "Error",
"errorCode": "KEY_EXPIRED",
"errorMessage": "API key has expired"
}{
"result": "Error",
"errorMessage": "This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.",
"errorMessagePL": "Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."
}{
"result": "Error",
"errorMessage": "This tag cannot be deleted, it has been used in at least one invoice. You can disable it so it won't appear on the suggestion lists.",
"errorMessagePL": "Ta kategoria nie może zostać usunięta ponieważ została użyta w przynajmniej jednej fakturze. Możesz ją zablokować aby nie pojawiała się na liście sugerowanych."
}Missing and deleted invoices
Retrieve a saved invoice withref={invoiceId}. Unknown, permanently deleted and other-company invoices return HTTP 404 with errorCode: "NOT_FOUND" and the same generic message. This does not disclose whether another company has the document.
A soft-deleted invoice owned by the API key’s company also returns HTTP 404, with errorMessage: "Invoice has been deleted". Its data is not returned. This message can distinguish your company’s soft-deleted document from an unknown identifier. A permanently deleted draft no longer has a record, so its response remains generic.
These checks also apply to documents referenced through related when preparing another invoice.
Correction prefill
related={originalId}&invoiceType=CORRECTION prepares a correction from the referenced invoice. The returned rows are copied from that invoice, without applying earlier corrections to calculate an effective balance. To correct a previous correction, reference that correction: its stored rows represent its after-correction state, while its totals represent the financial difference. See correction input and full returns.Authorizations
OpenApi Key created within Altera.app for a certain company
Query Parameters
InvoiceId identificator of the exact invoice we wish to retrieve
36891
Comma delimited list of related invoices we wish to create a reference from. For CORRECTION this copies the referenced invoice, not the cumulative state after previous corrections. For a correction of a correction, pass the previous correction identifier.
"124,551"
Invoice type for the new invoice we wish to create based on related invoices
SALES, CORRECTION, INTERIM_FINAL "CORRECTION"
Was this page helpful?

