Skip to content

Implementation example

This section gives a step-by-step example for fetching bookkeeping data and optionally marking verifications as synced. It assumes activation level organization.company (API calls are then scoped to that company).

Step 1: Confirmed verification groups

Fetch confirmed verification groups after a given date (e.g. 30 days before the run).

  • Unconfirmed groups have no confirmation_date and are excluded.
  • For minimal payload, add _slim=true to return only id.

Endpoint: GET /accounting/bookkeeping/verificationgroup/list/

GET .../accounting/bookkeeping/verificationgroup/list/?_page=1&_page_size=500&confirmation_date__gte=2024-01-15

Query parameters:

  • _page — Page number (e.g. 1)
  • _page_size — Page size (e.g. 500)
  • confirmation_date__gte — Only groups confirmed on or after this date (e.g. 2024-01-15)

Step 2: Verifications in those groups

Fetch accounting.verification items in the groups from step 1, with a registration date filter (e.g. same 30-day window) to avoid re-syncing old data.

  • Filtering on registration_date is recommended to avoid duplicate syncs.

Endpoint: GET /accounting/bookkeeping/verification/list/

GET .../accounting/bookkeeping/verification/list/?_page=1&_page_size=500&registration_date__gte=2024-01-15&verification_group__in=<group-id-1>,<group-id-2>

Query parameters:

  • _page — Page number (e.g. 1)
  • _page_size — Page size (e.g. 500)
  • registration_date__gte — Only verifications registered on or after this date (e.g. 2024-01-15)
  • verification_group__in — Comma-separated IDs from step 1

Step 3: Transactions for those verifications

Fetch accounting.transaction items for the verifications from step 2.

Endpoint: GET /accounting/bookkeeping/transaction/list/ (or equivalent transaction list in the API)

GET .../accounting/bookkeeping/transaction/list/?_page=1&_page_size=500&verification__in=<verification-id-1>,<verification-id-2>

Query parameters:

  • _page — Page number (e.g. 1)
  • _page_size — Page size (e.g. 500)
  • verification__in — Comma-separated verification IDs from step 2

Step 4 (optional): Invoice PDF files

  1. Collect the set of invoice IDs from the invoice field on the verifications from step 2.
  2. Fetch accounting.invoicerelatedpdffile items.

Endpoint: List endpoint for invoice-related PDF files (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 verifications (step 2)

Step 5 (optional): Mark verifications as synced

You can record that a verification has been synced/processed. This reduces duplicate syncs and allows Pigello UI to show sync status.

  • POST to the list endpoint for integrations.integrationserviceidconnection with a list of items.
  • Set content_type to {"id":"accounting.verification"} and object_id to the verification ID.
  • Set external_id to the ID in your external system.

Endpoint: List endpoint for integrations.integrationserviceidconnection.

To list connections for verifications:

GET .../integrations/integrationserviceidconnection/list/accounting.verification/?_page=1&_page_size=500

Query parameters:

  • _page — Page number (e.g. 1)
  • _page_size — Page size (e.g. 500)

Notes:

  • All activations of your integration can read each other's integration-service-id connections (e.g. Company A can see connections for Company B).