Ga naar inhoud

Prudai Developer API: twaka

Twaka (u-logi) data of the own organisation in MAIA, read only from the nightly replica (invoices, payment matching, relations, orders, revenue, batch tracing). Personal tokens only; never issuable to a service key.

Basis-URL https://api.prudai.com/v1. Inloggen staat in Inloggen, scopes in Scopes en rechten, fouten in Fouten. Overzicht.

MethodePadWat het doetStand
GET/v1/twaka/article-pricesPrice and margin per article over a period, with cost price coverageBinnenkort
GET/v1/twaka/batches/{batch}/traceTrace a batch to the orders, customers and invoices did it go (recall, HACCP)Binnenkort
GET/v1/twaka/invoice-matchesWhich invoices belong to this payment (candidates with a score)Binnenkort
GET/v1/twaka/invoicesList Twaka invoices per debtor and period (open, paid, credit)Binnenkort
GET/v1/twaka/invoices/{invoice_number}One Twaka invoice with lines and VAT per rateBinnenkort
GET/v1/twaka/ordersList Twaka orders by customer reference, delivered but not invoiced, or stuck in a statusBinnenkort
GET/v1/twaka/orders/{order_id}/historyStatus history of one Twaka orderBinnenkort
GET/v1/twaka/relationsFind Twaka relations (customers, suppliers) by debtor number or nameBinnenkort
GET/v1/twaka/relations/{relation_id}One Twaka relation with its contact persons (invoice contact first)Binnenkort
GET/v1/twaka/revenueRevenue per customer, article or main group over a period (vs. previous year)Binnenkort
GET/v1/twaka/sync-statusHow fresh is the Twaka data (last change per table)Binnenkort

Price and margin per article over a period, with cost price coverage

GET /v1/twaka/article-prices

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Per article (sales invoices, by invoice date, credits included, max. 400 days): revenue, kg, quantity in the price unit, average/min/max price, number of invoices and customers. Optional filter on main group or debtor number. Margin only where Twaka has a cost price (Article.PurchasePrice > 0); cost_coverage reports how many articles and which share of revenue have one. No estimated margins.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • from query · string (date) verplicht
    From (YYYY-MM-DD).
  • to query · string (date) verplicht
    To (YYYY-MM-DD).
  • main_group_id query · integer
    Only articles of this main group (id from getTwakaRevenue group_by=main_group). min. 0
  • debtor_number query · string
    Only sales to this debtor. max. lengte 40
  • limit query · integer
    Number of articles. standaard: 50 · min. 1 · max. 500

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/article-prices?from=%3Cfrom%3E&to=%3Cto%3E" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka article-prices

Trace a batch to the orders, customers and invoices did it go (recall, HACCP)

GET /v1/twaka/batches/{batch}/trace

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. By batch id or external batch code: registrations of the batch grouped per order, customer, article and invoice (kg and count), plus what is not on an order yet.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • batch path · string verplicht
    Batch id or external batch code.

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/batches/<batch>/trace" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka-batches trace

Which invoices belong to this payment (candidates with a score)

GET /v1/twaka/invoice-matches

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Give a payment amount, the payment reference (description/specification text; invoice numbers in it are recognised), optionally debtor_number and date. Returns up to 25 candidate invoices with a score (0-100) and the reasons. Combinations of several invoices and booking are done by the settlement proposal in MAIA (Exact).

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • amount query · number
    Payment amount in euro (e.g. 1234.56).
  • reference query · string
    Payment description or specification text. max. lengte 500
  • debtor_number query · string
    Debtor number, if known.
  • date query · string (date)
    Payment date (YYYY-MM-DD); without a debtor, amount matches are searched in the 400 days before it.

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/invoice-matches" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka invoice-matches

List Twaka invoices per debtor and period (open, paid, credit)

GET /v1/twaka/invoices

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Filters: debtor_number or relation_id, invoice date from/to, status open (open amount ≠ 0), paid, credit or all. Per invoice: number, dates, amounts incl./excl. VAT, open amount, credit link, raw status_code/type_code and the relation.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • debtor_number query · string
    Debtor number of the relation.
  • relation_id query · integer
    Twaka relation id.
  • from query · string (date)
    Invoice date from (YYYY-MM-DD).
  • to query · string (date)
    Invoice date to (YYYY-MM-DD).
  • status query · string
    open, paid, credit or all (default). Een van: open, paid, credit, all
  • limit query · integer
    Page size. standaard: 50 · min. 1 · max. 200
  • offset query · integer
    Offset. standaard: 0 · min. 0

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/invoices" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka-invoices list

One Twaka invoice with lines and VAT per rate

GET /v1/twaka/invoices/{invoice_number}

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. The invoice by its number, with up to 500 lines (article, quantities, kg, price, total, VAT %, order and customer reference) and the VAT summary per rate. No PDF (Twaka keeps none).

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • invoice_number path · integer verplicht
    Twaka invoice number.

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/invoices/1" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka-invoices get

List Twaka orders by customer reference, delivered but not invoiced, or stuck in a status

GET /v1/twaka/orders

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Filters: customer_reference, debtor_number, uninvoiced=true (sales order delivered, no invoice, not cancelled), status_code with older_than_days (orders that hang), delivery date from/to.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • customer_reference query · string
    Customer reference on the order.
  • debtor_number query · string
    Debtor number.
  • uninvoiced query · boolean
    Only delivered sales orders without an invoice.
  • status_code query · integer
    Twaka order status code.
  • older_than_days query · integer
    Status unchanged for more than this many days. min. 1
  • from query · string (date)
    Delivery date from (YYYY-MM-DD).
  • to query · string (date)
    Delivery date to (YYYY-MM-DD).
  • limit query · integer
    Page size. standaard: 50 · min. 1 · max. 200
  • offset query · integer
    Offset. standaard: 0 · min. 0

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/orders" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka-orders list

Status history of one Twaka order

GET /v1/twaka/orders/{order_id}/history

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Every status change of the order with its date (up to 200).

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • order_id path · integer verplicht
    Twaka order id.

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/orders/<order_id>/history" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka-orders history

Find Twaka relations (customers, suppliers) by debtor number or name

GET /v1/twaka/relations

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Search by debtor_number or q (name, code or debtor number). Per relation: code, name, debtor/creditor number, customer/supplier flags, blocked, billing city.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • debtor_number query · string
    Exact debtor number.
  • q query · string
    Name, code or debtor number (min. 2 characters).
  • limit query · integer
    Page size. standaard: 50 · min. 1 · max. 200
  • offset query · integer
    Offset. standaard: 0 · min. 0

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/relations" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka-relations list

One Twaka relation with its contact persons (invoice contact first)

GET /v1/twaka/relations/{relation_id}

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. The relation and its active contact persons: name, e-mail, phone and roles (invoice, purchase, quality, general). Nothing else about contacts is copied.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • relation_id path · integer verplicht
    Twaka relation id.

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/relations/<relation_id>" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka-relations get

Revenue per customer, article or main group over a period (vs. previous year)

GET /v1/twaka/revenue

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Sum of invoice line totals (sales invoices, by invoice date, credits included) per group_by over from-to (max. 400 days), with kg and number of invoices, sorted by revenue. compare=previous_year adds the same period a year earlier. Margin is not included (no reliable cost price in Twaka).

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Parameters

  • group_by query · string verplicht
    customer, article or main_group. Een van: customer, article, main_group
  • from query · string (date) verplicht
    From (YYYY-MM-DD).
  • to query · string (date) verplicht
    To (YYYY-MM-DD).
  • compare query · string
    previous_year. Een van: previous_year
  • limit query · integer
    Number of groups. standaard: 50 · min. 1 · max. 500

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/revenue?group_by=customer&from=%3Cfrom%3E&to=%3Cto%3E" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka revenue

How fresh is the Twaka data (last change per table)

GET /v1/twaka/sync-status

Personal tokens only (prudai login or a personal token); read only. MAIA organisations with a Twaka (u-logi) connection, each reading only its own replica; without a connection 403 twaka_not_connected. Data from the nightly replica (04:30), never live from the customer server. Latest Modified/Created per core table (invoices, orders, relations, batches, registrations) and the sync schedule.

  • Stand: binnenkort, nog niet op productie.
  • Scope: prudai:twaka:read
  • Goedkeuring: none, geen extra stap.

Antwoorden

StatusBetekenis
200The result.
401Missing, malformed, unknown, expired or revoked key, or a key used against the wrong environment.
403Authenticated, but not allowed (missing scope, product not on the key or organisation, organisation suspended, Developer API switched off for the organisation, IP not on the allowlist, depth not permitted, licence does not permit redistribution).
404Unknown model, source or document.
422Well-formed request with invalid values (for example an unknown reasoning_effort, empty messages, or an Idempotency-Key reused with a different body).
429Rate limit, concurrency limit, Ultra daily quota or fair-use limit of the free sources operations exceeded.
503Temporarily unavailable (maintenance, overload, or the credit check could not be performed). Nothing ran, nothing is charged.
curl
curl -s "https://api.prudai.com/v1/twaka/sync-status" \
-H "Authorization: Bearer $PRUDAI_TOKEN"
CLI (binnenkort)
prudai leo twaka sync-status