Receive an invoice

A-Cube is a great tool to fetch all incoming invoices from various sources. Because KSeF is by it's nature created to accept structured invoices only, we can use it as a hub collecting invoices from suppliers.

A-Cube provides solution to fetch invoices by NIP number of the authorized recipient and notify customer's systems.

All incoming invoices will be listed on the account of the LegalEntity in the Dashboard --> Incoming Invoices section.

Webhook Notification

If there is a webhook defined for invoice-receiver you will get notification about incoming invoice.

Copy
Copied
{
  "legalEntityUuid": "e8f8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8",
  "invoiceUuid": "fa87d11a-22c6-11ed-861d-0242ac120002",
  "subjectType": "Subject2",
  "status": "valid",
  "processingCode": 200,
  "ksefReferenceNumber": "5555555555-20250828-010080615740-E4",
  "acquisitionTimestamp": "2025-10-10T00:00:00+00:00",
  "hash": "ayrw+3m5trnfxlTYhq3QFn74LkEO69MFNlsMAkCDSPA=",
  "invoicingMode": "Online",
  "webhookType": "invoice-receiver"
}

Having this in place, using A-Cube REST API, it is easy to fetch details about invoice to own system.

Knowing invoiceUuid we can request details of the invoice like:

Copy
Copied
curl -i -X GET \
  'http://pl-sandbox.api.acubeapi.com/invoices/{uuid}' \
  -H 'Authorization: YOUR_API_KEY_HERE'

It is also possible to fetch the source of structured invoice as an XML file.

Copy
Copied
curl --header 'Accept: application/xml' --header 'Authorization: Bearer TOKEN' http://pl-sandbox.api.acubeapi.com/invoices/UUID