Create/update invoice
curl --request POST \
--url https://api.altera.co/sales/invoice \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"modelType": "INVOICE",
"override": false,
"basicInformation": {
"invoiceId": 2069,
"invoiceType": "SALES",
"invoiceFormat": "%N/%M/%Y",
"saleDate": "2022-10-11T00:00:00.000Z",
"issueDate": "2022-10-11T00:00:00.000Z",
"isReceipt": false,
"relatedInvoicesIds": [],
"priceTypeId": "NET"
},
"contractor": {
"contractorRegion": "POLAND",
"country": "PL",
"contractorType": "COMPANY",
"contractorName": "Test działania",
"street": "Testowa",
"houseNumber": "10",
"flatNumber": "10",
"city": "Bydgoszcz",
"postCode": "62-156",
"defaultCurrency": "PLN",
"taxIdentificationNumber": "1589651654",
"email": "testing@attention.please",
"areaNumber": "+58",
"phoneNumber": "518 961 516"
},
"invoicePosition": [
{
"productPosition": 0,
"productName": "A",
"positionType": "PRODUCT",
"productCategory": "Health",
"quantity": 10,
"unit": "szt.",
"priceType": null,
"unitNetPrice": 150,
"unitGrossPrice": 184.5,
"vat": "23%",
"pkwiu": "",
"discount": "0",
"deductions": false,
"netPrice": "1500",
"grossPrice": "1845",
"invoiceProductId": 179
}
],
"additionalDetails": "",
"correctionReason": "",
"payments": {
"isPaid": false,
"paymentMethod": "TRANSFER",
"dueDate": "2022-10-25T00:00:00.000Z",
"bankAccountNumber": "10 1010 1062 5565 1561 5615 1516",
"isSplitPayment": false
},
"projects": []
}
'import requests
url = "https://api.altera.co/sales/invoice"
payload = {
"modelType": "INVOICE",
"override": False,
"basicInformation": {
"invoiceId": 2069,
"invoiceType": "SALES",
"invoiceFormat": "%N/%M/%Y",
"saleDate": "2022-10-11T00:00:00.000Z",
"issueDate": "2022-10-11T00:00:00.000Z",
"isReceipt": False,
"relatedInvoicesIds": [],
"priceTypeId": "NET"
},
"contractor": {
"contractorRegion": "POLAND",
"country": "PL",
"contractorType": "COMPANY",
"contractorName": "Test działania",
"street": "Testowa",
"houseNumber": "10",
"flatNumber": "10",
"city": "Bydgoszcz",
"postCode": "62-156",
"defaultCurrency": "PLN",
"taxIdentificationNumber": "1589651654",
"email": "testing@attention.please",
"areaNumber": "+58",
"phoneNumber": "518 961 516"
},
"invoicePosition": [
{
"productPosition": 0,
"productName": "A",
"positionType": "PRODUCT",
"productCategory": "Health",
"quantity": 10,
"unit": "szt.",
"priceType": None,
"unitNetPrice": 150,
"unitGrossPrice": 184.5,
"vat": "23%",
"pkwiu": "",
"discount": "0",
"deductions": False,
"netPrice": "1500",
"grossPrice": "1845",
"invoiceProductId": 179
}
],
"additionalDetails": "",
"correctionReason": "",
"payments": {
"isPaid": False,
"paymentMethod": "TRANSFER",
"dueDate": "2022-10-25T00:00:00.000Z",
"bankAccountNumber": "10 1010 1062 5565 1561 5615 1516",
"isSplitPayment": False
},
"projects": []
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
modelType: 'INVOICE',
override: false,
basicInformation: {
invoiceId: 2069,
invoiceType: 'SALES',
invoiceFormat: '%N/%M/%Y',
saleDate: '2022-10-11T00:00:00.000Z',
issueDate: '2022-10-11T00:00:00.000Z',
isReceipt: false,
relatedInvoicesIds: [],
priceTypeId: 'NET'
},
contractor: {
contractorRegion: 'POLAND',
country: 'PL',
contractorType: 'COMPANY',
contractorName: 'Test działania',
street: 'Testowa',
houseNumber: '10',
flatNumber: '10',
city: 'Bydgoszcz',
postCode: '62-156',
defaultCurrency: 'PLN',
taxIdentificationNumber: '1589651654',
email: 'testing@attention.please',
areaNumber: '+58',
phoneNumber: '518 961 516'
},
invoicePosition: [
{
productPosition: 0,
productName: 'A',
positionType: 'PRODUCT',
productCategory: 'Health',
quantity: 10,
unit: 'szt.',
priceType: null,
unitNetPrice: 150,
unitGrossPrice: 184.5,
vat: '23%',
pkwiu: '',
discount: '0',
deductions: false,
netPrice: '1500',
grossPrice: '1845',
invoiceProductId: 179
}
],
additionalDetails: '',
correctionReason: '',
payments: {
isPaid: false,
paymentMethod: 'TRANSFER',
dueDate: '2022-10-25T00:00:00.000Z',
bankAccountNumber: '10 1010 1062 5565 1561 5615 1516',
isSplitPayment: false
},
projects: []
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'modelType' => 'INVOICE',
'override' => false,
'basicInformation' => [
'invoiceId' => 2069,
'invoiceType' => 'SALES',
'invoiceFormat' => '%N/%M/%Y',
'saleDate' => '2022-10-11T00:00:00.000Z',
'issueDate' => '2022-10-11T00:00:00.000Z',
'isReceipt' => false,
'relatedInvoicesIds' => [
],
'priceTypeId' => 'NET'
],
'contractor' => [
'contractorRegion' => 'POLAND',
'country' => 'PL',
'contractorType' => 'COMPANY',
'contractorName' => 'Test działania',
'street' => 'Testowa',
'houseNumber' => '10',
'flatNumber' => '10',
'city' => 'Bydgoszcz',
'postCode' => '62-156',
'defaultCurrency' => 'PLN',
'taxIdentificationNumber' => '1589651654',
'email' => 'testing@attention.please',
'areaNumber' => '+58',
'phoneNumber' => '518 961 516'
],
'invoicePosition' => [
[
'productPosition' => 0,
'productName' => 'A',
'positionType' => 'PRODUCT',
'productCategory' => 'Health',
'quantity' => 10,
'unit' => 'szt.',
'priceType' => null,
'unitNetPrice' => 150,
'unitGrossPrice' => 184.5,
'vat' => '23%',
'pkwiu' => '',
'discount' => '0',
'deductions' => false,
'netPrice' => '1500',
'grossPrice' => '1845',
'invoiceProductId' => 179
]
],
'additionalDetails' => '',
'correctionReason' => '',
'payments' => [
'isPaid' => false,
'paymentMethod' => 'TRANSFER',
'dueDate' => '2022-10-25T00:00:00.000Z',
'bankAccountNumber' => '10 1010 1062 5565 1561 5615 1516',
'isSplitPayment' => false
],
'projects' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.altera.co/sales/invoice"
payload := strings.NewReader("{\n \"modelType\": \"INVOICE\",\n \"override\": false,\n \"basicInformation\": {\n \"invoiceId\": 2069,\n \"invoiceType\": \"SALES\",\n \"invoiceFormat\": \"%N/%M/%Y\",\n \"saleDate\": \"2022-10-11T00:00:00.000Z\",\n \"issueDate\": \"2022-10-11T00:00:00.000Z\",\n \"isReceipt\": false,\n \"relatedInvoicesIds\": [],\n \"priceTypeId\": \"NET\"\n },\n \"contractor\": {\n \"contractorRegion\": \"POLAND\",\n \"country\": \"PL\",\n \"contractorType\": \"COMPANY\",\n \"contractorName\": \"Test działania\",\n \"street\": \"Testowa\",\n \"houseNumber\": \"10\",\n \"flatNumber\": \"10\",\n \"city\": \"Bydgoszcz\",\n \"postCode\": \"62-156\",\n \"defaultCurrency\": \"PLN\",\n \"taxIdentificationNumber\": \"1589651654\",\n \"email\": \"testing@attention.please\",\n \"areaNumber\": \"+58\",\n \"phoneNumber\": \"518 961 516\"\n },\n \"invoicePosition\": [\n {\n \"productPosition\": 0,\n \"productName\": \"A\",\n \"positionType\": \"PRODUCT\",\n \"productCategory\": \"Health\",\n \"quantity\": 10,\n \"unit\": \"szt.\",\n \"priceType\": null,\n \"unitNetPrice\": 150,\n \"unitGrossPrice\": 184.5,\n \"vat\": \"23%\",\n \"pkwiu\": \"\",\n \"discount\": \"0\",\n \"deductions\": false,\n \"netPrice\": \"1500\",\n \"grossPrice\": \"1845\",\n \"invoiceProductId\": 179\n }\n ],\n \"additionalDetails\": \"\",\n \"correctionReason\": \"\",\n \"payments\": {\n \"isPaid\": false,\n \"paymentMethod\": \"TRANSFER\",\n \"dueDate\": \"2022-10-25T00:00:00.000Z\",\n \"bankAccountNumber\": \"10 1010 1062 5565 1561 5615 1516\",\n \"isSplitPayment\": false\n },\n \"projects\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.altera.co/sales/invoice")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"modelType\": \"INVOICE\",\n \"override\": false,\n \"basicInformation\": {\n \"invoiceId\": 2069,\n \"invoiceType\": \"SALES\",\n \"invoiceFormat\": \"%N/%M/%Y\",\n \"saleDate\": \"2022-10-11T00:00:00.000Z\",\n \"issueDate\": \"2022-10-11T00:00:00.000Z\",\n \"isReceipt\": false,\n \"relatedInvoicesIds\": [],\n \"priceTypeId\": \"NET\"\n },\n \"contractor\": {\n \"contractorRegion\": \"POLAND\",\n \"country\": \"PL\",\n \"contractorType\": \"COMPANY\",\n \"contractorName\": \"Test działania\",\n \"street\": \"Testowa\",\n \"houseNumber\": \"10\",\n \"flatNumber\": \"10\",\n \"city\": \"Bydgoszcz\",\n \"postCode\": \"62-156\",\n \"defaultCurrency\": \"PLN\",\n \"taxIdentificationNumber\": \"1589651654\",\n \"email\": \"testing@attention.please\",\n \"areaNumber\": \"+58\",\n \"phoneNumber\": \"518 961 516\"\n },\n \"invoicePosition\": [\n {\n \"productPosition\": 0,\n \"productName\": \"A\",\n \"positionType\": \"PRODUCT\",\n \"productCategory\": \"Health\",\n \"quantity\": 10,\n \"unit\": \"szt.\",\n \"priceType\": null,\n \"unitNetPrice\": 150,\n \"unitGrossPrice\": 184.5,\n \"vat\": \"23%\",\n \"pkwiu\": \"\",\n \"discount\": \"0\",\n \"deductions\": false,\n \"netPrice\": \"1500\",\n \"grossPrice\": \"1845\",\n \"invoiceProductId\": 179\n }\n ],\n \"additionalDetails\": \"\",\n \"correctionReason\": \"\",\n \"payments\": {\n \"isPaid\": false,\n \"paymentMethod\": \"TRANSFER\",\n \"dueDate\": \"2022-10-25T00:00:00.000Z\",\n \"bankAccountNumber\": \"10 1010 1062 5565 1561 5615 1516\",\n \"isSplitPayment\": false\n },\n \"projects\": []\n}")
.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::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"modelType\": \"INVOICE\",\n \"override\": false,\n \"basicInformation\": {\n \"invoiceId\": 2069,\n \"invoiceType\": \"SALES\",\n \"invoiceFormat\": \"%N/%M/%Y\",\n \"saleDate\": \"2022-10-11T00:00:00.000Z\",\n \"issueDate\": \"2022-10-11T00:00:00.000Z\",\n \"isReceipt\": false,\n \"relatedInvoicesIds\": [],\n \"priceTypeId\": \"NET\"\n },\n \"contractor\": {\n \"contractorRegion\": \"POLAND\",\n \"country\": \"PL\",\n \"contractorType\": \"COMPANY\",\n \"contractorName\": \"Test działania\",\n \"street\": \"Testowa\",\n \"houseNumber\": \"10\",\n \"flatNumber\": \"10\",\n \"city\": \"Bydgoszcz\",\n \"postCode\": \"62-156\",\n \"defaultCurrency\": \"PLN\",\n \"taxIdentificationNumber\": \"1589651654\",\n \"email\": \"testing@attention.please\",\n \"areaNumber\": \"+58\",\n \"phoneNumber\": \"518 961 516\"\n },\n \"invoicePosition\": [\n {\n \"productPosition\": 0,\n \"productName\": \"A\",\n \"positionType\": \"PRODUCT\",\n \"productCategory\": \"Health\",\n \"quantity\": 10,\n \"unit\": \"szt.\",\n \"priceType\": null,\n \"unitNetPrice\": 150,\n \"unitGrossPrice\": 184.5,\n \"vat\": \"23%\",\n \"pkwiu\": \"\",\n \"discount\": \"0\",\n \"deductions\": false,\n \"netPrice\": \"1500\",\n \"grossPrice\": \"1845\",\n \"invoiceProductId\": 179\n }\n ],\n \"additionalDetails\": \"\",\n \"correctionReason\": \"\",\n \"payments\": {\n \"isPaid\": false,\n \"paymentMethod\": \"TRANSFER\",\n \"dueDate\": \"2022-10-25T00:00:00.000Z\",\n \"bankAccountNumber\": \"10 1010 1062 5565 1561 5615 1516\",\n \"isSplitPayment\": false\n },\n \"projects\": []\n}"
response = http.request(request)
puts response.read_body{
"result": "OK",
"data": {
"invoiceId": 12413
}
}{
"result": "Error",
"errorMessage": "<string>",
"errorMessagePL": "<string>"
}Sales
Create/update invoice
POST
/
sales
/
invoice
Create/update invoice
curl --request POST \
--url https://api.altera.co/sales/invoice \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"modelType": "INVOICE",
"override": false,
"basicInformation": {
"invoiceId": 2069,
"invoiceType": "SALES",
"invoiceFormat": "%N/%M/%Y",
"saleDate": "2022-10-11T00:00:00.000Z",
"issueDate": "2022-10-11T00:00:00.000Z",
"isReceipt": false,
"relatedInvoicesIds": [],
"priceTypeId": "NET"
},
"contractor": {
"contractorRegion": "POLAND",
"country": "PL",
"contractorType": "COMPANY",
"contractorName": "Test działania",
"street": "Testowa",
"houseNumber": "10",
"flatNumber": "10",
"city": "Bydgoszcz",
"postCode": "62-156",
"defaultCurrency": "PLN",
"taxIdentificationNumber": "1589651654",
"email": "testing@attention.please",
"areaNumber": "+58",
"phoneNumber": "518 961 516"
},
"invoicePosition": [
{
"productPosition": 0,
"productName": "A",
"positionType": "PRODUCT",
"productCategory": "Health",
"quantity": 10,
"unit": "szt.",
"priceType": null,
"unitNetPrice": 150,
"unitGrossPrice": 184.5,
"vat": "23%",
"pkwiu": "",
"discount": "0",
"deductions": false,
"netPrice": "1500",
"grossPrice": "1845",
"invoiceProductId": 179
}
],
"additionalDetails": "",
"correctionReason": "",
"payments": {
"isPaid": false,
"paymentMethod": "TRANSFER",
"dueDate": "2022-10-25T00:00:00.000Z",
"bankAccountNumber": "10 1010 1062 5565 1561 5615 1516",
"isSplitPayment": false
},
"projects": []
}
'import requests
url = "https://api.altera.co/sales/invoice"
payload = {
"modelType": "INVOICE",
"override": False,
"basicInformation": {
"invoiceId": 2069,
"invoiceType": "SALES",
"invoiceFormat": "%N/%M/%Y",
"saleDate": "2022-10-11T00:00:00.000Z",
"issueDate": "2022-10-11T00:00:00.000Z",
"isReceipt": False,
"relatedInvoicesIds": [],
"priceTypeId": "NET"
},
"contractor": {
"contractorRegion": "POLAND",
"country": "PL",
"contractorType": "COMPANY",
"contractorName": "Test działania",
"street": "Testowa",
"houseNumber": "10",
"flatNumber": "10",
"city": "Bydgoszcz",
"postCode": "62-156",
"defaultCurrency": "PLN",
"taxIdentificationNumber": "1589651654",
"email": "testing@attention.please",
"areaNumber": "+58",
"phoneNumber": "518 961 516"
},
"invoicePosition": [
{
"productPosition": 0,
"productName": "A",
"positionType": "PRODUCT",
"productCategory": "Health",
"quantity": 10,
"unit": "szt.",
"priceType": None,
"unitNetPrice": 150,
"unitGrossPrice": 184.5,
"vat": "23%",
"pkwiu": "",
"discount": "0",
"deductions": False,
"netPrice": "1500",
"grossPrice": "1845",
"invoiceProductId": 179
}
],
"additionalDetails": "",
"correctionReason": "",
"payments": {
"isPaid": False,
"paymentMethod": "TRANSFER",
"dueDate": "2022-10-25T00:00:00.000Z",
"bankAccountNumber": "10 1010 1062 5565 1561 5615 1516",
"isSplitPayment": False
},
"projects": []
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
modelType: 'INVOICE',
override: false,
basicInformation: {
invoiceId: 2069,
invoiceType: 'SALES',
invoiceFormat: '%N/%M/%Y',
saleDate: '2022-10-11T00:00:00.000Z',
issueDate: '2022-10-11T00:00:00.000Z',
isReceipt: false,
relatedInvoicesIds: [],
priceTypeId: 'NET'
},
contractor: {
contractorRegion: 'POLAND',
country: 'PL',
contractorType: 'COMPANY',
contractorName: 'Test działania',
street: 'Testowa',
houseNumber: '10',
flatNumber: '10',
city: 'Bydgoszcz',
postCode: '62-156',
defaultCurrency: 'PLN',
taxIdentificationNumber: '1589651654',
email: 'testing@attention.please',
areaNumber: '+58',
phoneNumber: '518 961 516'
},
invoicePosition: [
{
productPosition: 0,
productName: 'A',
positionType: 'PRODUCT',
productCategory: 'Health',
quantity: 10,
unit: 'szt.',
priceType: null,
unitNetPrice: 150,
unitGrossPrice: 184.5,
vat: '23%',
pkwiu: '',
discount: '0',
deductions: false,
netPrice: '1500',
grossPrice: '1845',
invoiceProductId: 179
}
],
additionalDetails: '',
correctionReason: '',
payments: {
isPaid: false,
paymentMethod: 'TRANSFER',
dueDate: '2022-10-25T00:00:00.000Z',
bankAccountNumber: '10 1010 1062 5565 1561 5615 1516',
isSplitPayment: false
},
projects: []
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'modelType' => 'INVOICE',
'override' => false,
'basicInformation' => [
'invoiceId' => 2069,
'invoiceType' => 'SALES',
'invoiceFormat' => '%N/%M/%Y',
'saleDate' => '2022-10-11T00:00:00.000Z',
'issueDate' => '2022-10-11T00:00:00.000Z',
'isReceipt' => false,
'relatedInvoicesIds' => [
],
'priceTypeId' => 'NET'
],
'contractor' => [
'contractorRegion' => 'POLAND',
'country' => 'PL',
'contractorType' => 'COMPANY',
'contractorName' => 'Test działania',
'street' => 'Testowa',
'houseNumber' => '10',
'flatNumber' => '10',
'city' => 'Bydgoszcz',
'postCode' => '62-156',
'defaultCurrency' => 'PLN',
'taxIdentificationNumber' => '1589651654',
'email' => 'testing@attention.please',
'areaNumber' => '+58',
'phoneNumber' => '518 961 516'
],
'invoicePosition' => [
[
'productPosition' => 0,
'productName' => 'A',
'positionType' => 'PRODUCT',
'productCategory' => 'Health',
'quantity' => 10,
'unit' => 'szt.',
'priceType' => null,
'unitNetPrice' => 150,
'unitGrossPrice' => 184.5,
'vat' => '23%',
'pkwiu' => '',
'discount' => '0',
'deductions' => false,
'netPrice' => '1500',
'grossPrice' => '1845',
'invoiceProductId' => 179
]
],
'additionalDetails' => '',
'correctionReason' => '',
'payments' => [
'isPaid' => false,
'paymentMethod' => 'TRANSFER',
'dueDate' => '2022-10-25T00:00:00.000Z',
'bankAccountNumber' => '10 1010 1062 5565 1561 5615 1516',
'isSplitPayment' => false
],
'projects' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.altera.co/sales/invoice"
payload := strings.NewReader("{\n \"modelType\": \"INVOICE\",\n \"override\": false,\n \"basicInformation\": {\n \"invoiceId\": 2069,\n \"invoiceType\": \"SALES\",\n \"invoiceFormat\": \"%N/%M/%Y\",\n \"saleDate\": \"2022-10-11T00:00:00.000Z\",\n \"issueDate\": \"2022-10-11T00:00:00.000Z\",\n \"isReceipt\": false,\n \"relatedInvoicesIds\": [],\n \"priceTypeId\": \"NET\"\n },\n \"contractor\": {\n \"contractorRegion\": \"POLAND\",\n \"country\": \"PL\",\n \"contractorType\": \"COMPANY\",\n \"contractorName\": \"Test działania\",\n \"street\": \"Testowa\",\n \"houseNumber\": \"10\",\n \"flatNumber\": \"10\",\n \"city\": \"Bydgoszcz\",\n \"postCode\": \"62-156\",\n \"defaultCurrency\": \"PLN\",\n \"taxIdentificationNumber\": \"1589651654\",\n \"email\": \"testing@attention.please\",\n \"areaNumber\": \"+58\",\n \"phoneNumber\": \"518 961 516\"\n },\n \"invoicePosition\": [\n {\n \"productPosition\": 0,\n \"productName\": \"A\",\n \"positionType\": \"PRODUCT\",\n \"productCategory\": \"Health\",\n \"quantity\": 10,\n \"unit\": \"szt.\",\n \"priceType\": null,\n \"unitNetPrice\": 150,\n \"unitGrossPrice\": 184.5,\n \"vat\": \"23%\",\n \"pkwiu\": \"\",\n \"discount\": \"0\",\n \"deductions\": false,\n \"netPrice\": \"1500\",\n \"grossPrice\": \"1845\",\n \"invoiceProductId\": 179\n }\n ],\n \"additionalDetails\": \"\",\n \"correctionReason\": \"\",\n \"payments\": {\n \"isPaid\": false,\n \"paymentMethod\": \"TRANSFER\",\n \"dueDate\": \"2022-10-25T00:00:00.000Z\",\n \"bankAccountNumber\": \"10 1010 1062 5565 1561 5615 1516\",\n \"isSplitPayment\": false\n },\n \"projects\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.altera.co/sales/invoice")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"modelType\": \"INVOICE\",\n \"override\": false,\n \"basicInformation\": {\n \"invoiceId\": 2069,\n \"invoiceType\": \"SALES\",\n \"invoiceFormat\": \"%N/%M/%Y\",\n \"saleDate\": \"2022-10-11T00:00:00.000Z\",\n \"issueDate\": \"2022-10-11T00:00:00.000Z\",\n \"isReceipt\": false,\n \"relatedInvoicesIds\": [],\n \"priceTypeId\": \"NET\"\n },\n \"contractor\": {\n \"contractorRegion\": \"POLAND\",\n \"country\": \"PL\",\n \"contractorType\": \"COMPANY\",\n \"contractorName\": \"Test działania\",\n \"street\": \"Testowa\",\n \"houseNumber\": \"10\",\n \"flatNumber\": \"10\",\n \"city\": \"Bydgoszcz\",\n \"postCode\": \"62-156\",\n \"defaultCurrency\": \"PLN\",\n \"taxIdentificationNumber\": \"1589651654\",\n \"email\": \"testing@attention.please\",\n \"areaNumber\": \"+58\",\n \"phoneNumber\": \"518 961 516\"\n },\n \"invoicePosition\": [\n {\n \"productPosition\": 0,\n \"productName\": \"A\",\n \"positionType\": \"PRODUCT\",\n \"productCategory\": \"Health\",\n \"quantity\": 10,\n \"unit\": \"szt.\",\n \"priceType\": null,\n \"unitNetPrice\": 150,\n \"unitGrossPrice\": 184.5,\n \"vat\": \"23%\",\n \"pkwiu\": \"\",\n \"discount\": \"0\",\n \"deductions\": false,\n \"netPrice\": \"1500\",\n \"grossPrice\": \"1845\",\n \"invoiceProductId\": 179\n }\n ],\n \"additionalDetails\": \"\",\n \"correctionReason\": \"\",\n \"payments\": {\n \"isPaid\": false,\n \"paymentMethod\": \"TRANSFER\",\n \"dueDate\": \"2022-10-25T00:00:00.000Z\",\n \"bankAccountNumber\": \"10 1010 1062 5565 1561 5615 1516\",\n \"isSplitPayment\": false\n },\n \"projects\": []\n}")
.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::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"modelType\": \"INVOICE\",\n \"override\": false,\n \"basicInformation\": {\n \"invoiceId\": 2069,\n \"invoiceType\": \"SALES\",\n \"invoiceFormat\": \"%N/%M/%Y\",\n \"saleDate\": \"2022-10-11T00:00:00.000Z\",\n \"issueDate\": \"2022-10-11T00:00:00.000Z\",\n \"isReceipt\": false,\n \"relatedInvoicesIds\": [],\n \"priceTypeId\": \"NET\"\n },\n \"contractor\": {\n \"contractorRegion\": \"POLAND\",\n \"country\": \"PL\",\n \"contractorType\": \"COMPANY\",\n \"contractorName\": \"Test działania\",\n \"street\": \"Testowa\",\n \"houseNumber\": \"10\",\n \"flatNumber\": \"10\",\n \"city\": \"Bydgoszcz\",\n \"postCode\": \"62-156\",\n \"defaultCurrency\": \"PLN\",\n \"taxIdentificationNumber\": \"1589651654\",\n \"email\": \"testing@attention.please\",\n \"areaNumber\": \"+58\",\n \"phoneNumber\": \"518 961 516\"\n },\n \"invoicePosition\": [\n {\n \"productPosition\": 0,\n \"productName\": \"A\",\n \"positionType\": \"PRODUCT\",\n \"productCategory\": \"Health\",\n \"quantity\": 10,\n \"unit\": \"szt.\",\n \"priceType\": null,\n \"unitNetPrice\": 150,\n \"unitGrossPrice\": 184.5,\n \"vat\": \"23%\",\n \"pkwiu\": \"\",\n \"discount\": \"0\",\n \"deductions\": false,\n \"netPrice\": \"1500\",\n \"grossPrice\": \"1845\",\n \"invoiceProductId\": 179\n }\n ],\n \"additionalDetails\": \"\",\n \"correctionReason\": \"\",\n \"payments\": {\n \"isPaid\": false,\n \"paymentMethod\": \"TRANSFER\",\n \"dueDate\": \"2022-10-25T00:00:00.000Z\",\n \"bankAccountNumber\": \"10 1010 1062 5565 1561 5615 1516\",\n \"isSplitPayment\": false\n },\n \"projects\": []\n}"
response = http.request(request)
puts response.read_body{
"result": "OK",
"data": {
"invoiceId": 12413
}
}{
"result": "Error",
"errorMessage": "<string>",
"errorMessagePL": "<string>"
}Authorizations
OpenApi Key created within Altera.app for a certain company
Body
application/json
Defines whether we wish to override split payments warning, in Machine-machine integrations should be set to true
Submit the invoice to KSeF during save.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Describes extra information that we wish to present on the invoice
Additional information regarding the reason behing correcting your invoice
Show child attributes
Show child attributes
Was this page helpful?
⌘I

