Payables exported to ERP since a date (firstExportedAt)
Retrieves payables exported to the ERP since a given date via the firstExportedAt filter. Enables reconciliation of flows between Spendesk and the accounting system.
86/100·⚡ Daily·BeginnerController
ERP exportget_payables
🎯 Skill purpose
Retrieves payables exported to the ERP since a given date via the firstExportedAt filter. Enables reconciliation of flows between Spendesk and the accounting system.
📊 What it produces
List of exported payables with export date, amount, and ERP reference.
⚡ Benefit
Before
Manual reconciliation between Spendesk exports and the accounting ledger in the ERP.
After
Precise list of exported payables for the period, ready for automatic reconciliation.
# Payables exported to the ERP since a date (firstExportedAt)
## Incremental ERP synchronization pattern
`firstExportedAt` records the date of the **first export to the ERP** of each payable. It is the basis of a reliable incremental synchronization strategy.
```json
{
"companyId": "<companyId>",
"filters": {
"field": "firstExportedAt",
"operator": "after",
"value": "<timestamp-last-export>"
},
"pageSize": 100
}
```
→ Returns only the payables that were not yet exported during the last batch.
→ `hasNextPage: true` if there are more results — paginate until exhausted so nothing is missed.
→ Only payables with `state=exported` have a `firstExportedAt` — `toPrepare`/`toExport` are automatically excluded.
## Practical values for synchronization
```json
// Since yesterday evening
{ "field": "firstExportedAt", "operator": "after", "value": "yesterday" }
// Since the 1st of the current month
{ "field": "firstExportedAt", "operator": "after", "value": "thisMonth" }
// Precise window (timestamp of the last run)
{ "field": "firstExportedAt", "operator": "after", "value": "2026-06-01T00:00:00.000Z" }
// Last month
{ "field": "firstExportedAt", "operator": "between", "value": { "from": "lastMonth", "to": "thisMonth" } }
```
(See skill S17 for the full list of date operators.)
## ⚠️ payableDate ≠ firstExportedAt — backdated invoices are frequent
`firstExportedAt` can be much later than `payableDate` — a 2023 invoice can be exported in 2026:
| Description | payableDate | firstCreatedAt | firstExportedAt |
|-------------|-------------|----------------|-----------------|
| "MALT" (consulting invoice) | 2023-09-13 | 2026-06-02 | 2026-06-02 |
| "Regnology CONSO" | 2025-12-08 | 2026-06-12 | 2026-06-25 |
| "ABM platform tool" | 2025-10-27 | 2026-06-16 | 2026-06-25 |
→ A filter on `payableDate >= 2026-06-01` would **miss** all these invoices.
→ A filter on `firstExportedAt >= 2026-06-01` **captures all of them** — that's what matters for the ERP.
## firstCreatedAt ≠ firstExportedAt
Several days can pass between entry into Spendesk and export to the ERP:
| Payable | firstCreatedAt | firstExportedAt | Delay |
|---------|----------------|-----------------|-------|
| "Partner support" | 2026-06-11 | 2026-06-25 | 14 days |
| "REGNOLOGY CONSO 2026" | 2026-06-15 | 2026-06-25 | 10 days |
| "MALT" | 2026-06-02 | 2026-06-02 | 0 days (immediate export) |
→ For accurate ERP tracking, always use `firstExportedAt`, not `firstCreatedAt`.
## Deduplication — avoid double-posting
If your ERP is already up to date through `<timestamp>`, use:
```json
{ "field": "firstExportedAt", "operator": "after", "value": "<timestamp>" }
```
This guarantees that a payable already exported is never returned again in the next batch (`firstExportedAt` never changes after the first export).
## Combining with other filters
To export only certain types:
```json
{
"companyId": "<companyId>",
"filters": {
"operator": "and",
"subfilters": [
{ "field": "firstExportedAt", "operator": "after", "value": "2026-06-01T00:00:00.000Z" },
{ "field": "payableType", "operator": "=", "value": ["invoicePurchase", "creditNote"] }
]
},
"pageSize": 100
}
```
Note: check AND filter combinations — some can fail (see skill S11 for the known bug).
## Example prompts
- "Which invoices have been exported to accounting since yesterday?"
- "Give me all payables exported this month for my ERP reconciliation"
- "Are there any new invoices to import since our last batch on June 1st?"
How to install this skill
/
- 1Download the file
s19-payables-exportes-depuis-date.mdusing the button above. - 2Place the file in the
.claude/directory of your project (or~/.claude/for a global install).cp s19-payables-exportes-depuis-date.md .claude/s19-payables-exportes-depuis-date.md - 3Use in Claude Code — the skill is automatically discovered. Describe your need in natural language and Claude will apply the skill instructions.
💡 Make sure the Spendesk MCP is configured in your
.claude/settings.json with the tools get_payables.Similar skills
★ Top