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.

↓ Download skill (.md)
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 `bookkeepingStatus=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
}
```


## 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

/
  1. 1
    Download the file s19-payables-exportes-depuis-date.md using the button above.
  2. 2
    Place 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
  3. 3
    Use 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
95/100·🔍 Ad hoc·Expert

Audit what the MCP covers

Probes all available MCP tools, re-evaluates coverage of 50 persona use cases, detects new fields or tools, and regenerates the gap analysis report.

CFOControllerAP Manager
90/100·📅 Weekly·Beginner

Card requests via get_requests

Explains how to use get_requests for card requests and why expense reimbursements don't appear there. Avoids a frequent source of confusion between two distinct workflows.

ControllerFinance Analyst
90/100·🔍 Ad hoc·Intermediate

Active vs archived cost centers

Distinguishes active cost centers from archived ones with correct use of get_cost_centers. Avoids the counter-intuitive isArchived vs isActive naming convention pitfall.

ControllerFinance Analyst

Interested in AI Agent services or Custom Integrations?