This section gives a step-by-step example for fetching debt invoice data, related invoices, spaces, contracts, and optional files, then writing payments or events.
Option A — by attested date (e.g. last 1 day).
Option B — by known IDs.
Endpoint: GET /accounting/debt/debtinvoice/list/
Option A:
GET .../accounting/debt/debtinvoice/list/?_page=1&_page_size=500&attested_date__gte=2025-01-15Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- attested_date__gte — Only debt invoices attested on or after this date (e.g. 2025-01-15)
Option B:
GET .../accounting/debt/debtinvoice/list/?_page=1&_page_size=500&id__in=<debt-invoice-id-1>,<debt-invoice-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- id__in — Comma-separated debt invoice IDs
Endpoint: GET list for accounting.invoice
GET .../accounting/invoice/list/?_page=1&_page_size=500&id__in=<invoice-id-1>,<invoice-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- id__in — Comma-separated invoice IDs from debt invoices (step 1)
Endpoint: GET list for accounting.invoicerecipient
GET .../accounting/invoicerecipient/list/?_page=1&_page_size=500&invoice__in=<invoice-id-1>,<invoice-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- invoice__in — Comma-separated invoice IDs from step 1
Endpoint: GET list for accounting.debtinvoiceevent
GET .../accounting/debtinvoiceevent/list/?_page=1&_page_size=500&debt_invoice__in=<debt-invoice-id-1>,<debt-invoice-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- debt_invoice__in — Comma-separated debt invoice IDs from step 1
Collect tenant IDs from the recipients, then fetch accounts.tenant. If needed, do the same for sub-tenants.
Endpoint: GET list for accounts.tenant
GET .../accounts/tenant/list/?_page=1&_page_size=500&id__in=<tenant-id-1>,<tenant-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- id__in — Comma-separated tenant IDs from recipients (step 3)
Endpoint: List endpoint for accounting.invoicerelatedpdffile (see API Reference).
GET .../accounting/invoicerelatedpdffile/list/?_page=1&_page_size=500&invoice__in=<invoice-id-1>,<invoice-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- invoice__in — Comma-separated invoice IDs from step 1
From each accounting.invoice, use originates_from_content_type and originates_from_object_id to build a map of contract IDs per content type. From the contracts, collect space IDs and fetch spaces.
Endpoint: List endpoint for the contract type (e.g. contracts.apartmentcontract).
GET .../contracts/apartmentcontract/list/?_page=1&_page_size=500&id__in=<contract-id-1>,<contract-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- id__in — Comma-separated contract IDs from invoices (originates_from_object_id)
Endpoint: List endpoint for the space type (e.g. objects.apartment).
GET .../objects/apartment/list/?_page=1&_page_size=500&id__in=<space-id-1>,<space-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- id__in — Comma-separated space IDs from contracts
SignedContractDocument (imported, not signed in Pigello).
SignableDocument (signed in Pigello). For SignableDocument file data, GET /documents/signing/signabledocument/<id>/document_data/. The response may contain a URL to a file (often a ZIP with the main PDF, attachment PDFs, and metadata). Unzip to get the main PDF or other content.
Endpoint: List endpoint for contracts.signedcontractdocument.
GET .../contracts/signedcontractdocument/list/<content-type>/?_page=1&_page_size=500&object_id__in=<contract-id-1>,<contract-id-2>Query parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- object_id__in — Comma-separated contract IDs from step 7
Example content-type: contracts.apartmentcontract.
Endpoint: List endpoint for documents.signabledocument.
GET .../documents/signing/signabledocument/list/<content-type>/?_page=1&_page_size=500&object_id__in=<contract-id-1>,<contract-id-2>&signed_time__isnull=falseQuery parameters:
- _page — Page number (e.g. 1)
- _page_size — Page size (e.g. 500)
- object_id__in — Comma-separated contract IDs from step 7
- signed_time__isnull —
falseto only include signed documents
- Payments: bulk upsert via POST to the invoice payments list endpoint.
- Debt invoices: bulk upsert via POST to the debt invoices list endpoint (e.g. to annul).
- Debt invoice events: bulk upsert via POST to the debt invoice events list endpoint to communicate progress to the customer.