Invoice
A-Cube accepts two formats of the Invoice: XML and JSON.
Received information about the invoice is validated against XSD schema provided by KSeF. This schema handles all types of invoices in Poland. A-Cube Platform provides easy to use API to handle it.
Here are examples of fundamental invoices in FA(2) KSeF formats for your reference.
XML Format FA(2)
<?xml version="1.0" encoding="UTF-8"?>
<Faktura xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://crd.gov.pl/wzor/2023/06/29/12648/">
<Naglowek>
<KodFormularza kodSystemowy="FA (2)" wersjaSchemy="1-0E">FA</KodFormularza>
<WariantFormularza>2</WariantFormularza>
<DataWytworzeniaFa>2023-09-12T13:54:35.3250835+02:00</DataWytworzeniaFa>
<SystemInfo>Aplikacja Podatnika KSeF</SystemInfo>
</Naglowek>
<Podmiot1>
<DaneIdentyfikacyjne>
<NIP>ENTER-NIP-HERE</NIP>
<Nazwa>test</Nazwa>
</DaneIdentyfikacyjne>
<Adres>
<KodKraju>PL</KodKraju>
<AdresL1>test sender</AdresL1>
</Adres>
</Podmiot1>
<Podmiot2>
<DaneIdentyfikacyjne>
<NIP>ENTER-NIP-HERE</NIP>
</DaneIdentyfikacyjne>
<Adres>
<KodKraju>PL</KodKraju>
<AdresL1>test recipient</AdresL1>
</Adres>
</Podmiot2>
<Fa>
<KodWaluty>PLN</KodWaluty>
<P_1>2023-09-12</P_1>
<P_2>TEST</P_2>
<P_6>2023-09-12</P_6>
<P_13_1>1000</P_13_1>
<P_14_1>230</P_14_1>
<P_15>1230</P_15>
<Adnotacje>
<P_16>2</P_16>
<P_17>2</P_17>
<P_18>2</P_18>
<P_18A>2</P_18A>
<Zwolnienie>
<P_19N>1</P_19N>
</Zwolnienie>
<NoweSrodkiTransportu>
<P_22N>1</P_22N>
</NoweSrodkiTransportu>
<P_23>2</P_23>
<PMarzy>
<P_PMarzyN>1</P_PMarzyN>
</PMarzy>
</Adnotacje>
<RodzajFaktury>VAT</RodzajFaktury>
<FaWiersz>
<NrWierszaFa>1</NrWierszaFa>
<P_7>test</P_7>
<P_8A>działa</P_8A>
<P_8B>1</P_8B>
<P_9A>1000</P_9A>
<P_11>1000</P_11>
<P_12>23</P_12>
</FaWiersz>
</Fa>
</Faktura>
JSON Format FA (2)
{
"Naglowek": {
"KodFormularza": {
"__value": "FA",
"kodSystemowy": "FA (2)",
"wersjaSchemy": "1-0E"
},
"WariantFormularza": "2",
"DataWytworzeniaFa": "2023-02-14T12:46:25+00:00"
},
"Podmiot1": {
"DaneIdentyfikacyjne": {
"NIP": "ENTER-NIP-HERE",
"Nazwa": "Sender"
},
"Adres": {
"KodKraju": "PL",
"AdresL1": "Testowa"
},
"Telefon": []
},
"Podmiot2": {
"DaneIdentyfikacyjne": {
"BrakID": "1"
},
"Adres": {
"KodKraju": "PL",
"AdresL1": "Testowa"
},
"Telefon": []
},
"Podmiot3": [],
"Fa": {
"KodWaluty": "PLN",
"P_1": "2022-01-01",
"P_2": "FV\/2023\/02\/14\/12\/46\/23",
"WZ": [],
"P_13_1": 7700.0,
"P_14_1": 2300.0,
"P_15": 10000.0,
"Adnotacje": {
"P_16": "2",
"P_17": "1",
"P_18": "2",
"P_18A": "2",
"Zwolnienie": {
"P_19N": "1"
},
"NoweSrodkiTransportu": {
"NowySrodekTransportu": [],
"P_22N": "1"
},
"P_23": "1",
"PMarzy": {
"P_PMarzyN": "1"
}
},
"RodzajFaktury": "VAT",
"DaneFaKorygowanej": [],
"DaneFaKorygowanejPozaKSEF": [],
"Podmiot2K": [],
"P_6Z": [],
"P_15Z": [],
"KursWalutyZW": [],
"DodatkowyOpis": [],
"NrFaZaliczkowej": [],
"FaWiersz": []
}
}
Dashboard
In user's panel, A-Cube Platform lists all outgoing and incoming invoices. There is also basic details screen showing most important information. Additionally, filter panel has been provided to browse invoices by dates, NIP numbers, status and type.
Invoice Details
All details about the invoice can be fetched individually by API.
A-Cube can return invoice in following type: HTML, PDF or JSON. This can be achieved by specifying proper Accept
header during the query.
(application/json
, text/html
, application/pdf
, application/xml
)
curl --header 'Accept: application/json' --header 'Authorization: Bearer TOKEN' https://pl-sandbox.api.acubeapi.com/invoices/{invoiceUUID}
curl --header 'Accept: application/pdf' --header 'Authorization: Bearer TOKEN' https://pl-sandbox.api.acubeapi.com/invoices/{invoiceUUID}
curl --header 'Accept: text/html' --header 'Authorization: Bearer TOKEN' https://pl-sandbox.api.acubeapi.com/invoices/{invoiceUUID}
To fetch original structured XML invoice, use following endpoint:
curl --header 'Accept: application/xml' --header 'Authorization: Bearer TOKEN' https://pl-sandbox.api.acubeapi.com/invoices/{invoiceUUID}
It is also possible to view rendered invoice as HTML in the browser using URL from Dashboard:
Sandbox - https://dashboard-sandbox.acubeapi.com/pl/invoices/:InvoiceUuid
Production - Production: https://dashboard.acubeapi.com/pl/invoices/:InvoiceUuid
Endpoints
Invoice API section.