Discussions

Ask a Question
Back to all

[Feature Request] API v2: Enable sorting/filtering by updated_at for Incremental Sync

Hello Pennylane API Team,

I am currently building an integration with your API v2 to synchronize Customer and Supplier invoices daily (/api/external/v2/customer_invoices and /supplier_invoices).

The Issue: We aim to implement an incremental synchronization (Delta Sync) strategy to fetch only records that have been created or modified since our last run. To achieve this, we attempted to sort the results by the update timestamp: GET /api/external/v2/customer_invoices?limit=100&sort=-updated_at

However, we received a 400 Bad Request error: "Invalid sort field: 'updated_at'. Allowed fields: id, date"

The Impact: Since the API currently restricts sorting to date (issue date) or id, it is impossible to efficiently detect older invoices (e.g., issued in 2023) that were modified today (e.g., status changed to "paid"). This forces us to rely on a "sliding window" strategy (fetching the entire history for the past rolling year) and filtering client-side. This approach is inefficient and generates significant unnecessary load on your servers due to the high volume of redundant requests.

The Request: Could you please add updated_at to the list of allowed fields for the sort parameter? Alternatively, supporting a server-side filter such as filter[updated_at]=gte:2025-01-19 would be equally effective.

This would allow us to stop pagination as soon as we reach records that haven't been modified recently, drastically reducing API calls.

Thank you for your help and for the quality of your documentation.

Best regards,