New to the Export API (v3)?
Export Workflow Guide
End-to-end walkthrough of the Export API (v3) integration model.
Attachment Handling
Rules for downloading, associating and storing attachments during an export.
API Scopes
Required scopes:
export-jobs:write, export-jobs:read, export-items:read.OAuth Guide
End-to-end OAuth 2.0 workflow guide for Pleo integrations.
Standalone API Key Guide
End-to-end guide for authenticating with standalone API keys.
Migrate from the Expenses API
The full export steps for integrations that used the Expenses API.
What Changes in Your Integration
The Export API (v3) is not a standalone receipt lookup. Pleo now provides each receipt as an attachment on an Export Item. You fetch the Export Items of an Export Job, so the attachments arrive in that response. You no longer call a separate receipt endpoint for each expense.Fetching Attachments
- Detect a
pendingExport Job and start it withPOST /v3/export-job-eventsand"event": "started". The Export Job is nowin_progress. - Fetch the Export Items with
GET /v3/export-items?job_id={jobId}. This endpoint is paginated. Uselimitto set the page size. To read the next page, send theendCursorfrom the response asafter, untilhasNextPageisfalse. - Read the
files[]list on each Export Item. Each entry has aurl, atypeand asize. - Download each attachment from its
url. Then upload it to the entry that you create in the Accounting System.
export-jobs:write scope to start the Export Job and the export-items:read scope to fetch the Export Items.
An Export Item has zero, one or several attachments. Pleo includes an attachment only if the file is available at export time and the Export Item passes validation. The maximum size is 30 MB per attachment. Your integration decides whether a missing attachment is an error. For the rules on downloading, merging and retrying, see How to Transfer Attachments.
Field Mapping
The table below maps fields from the legacyReceipt model to their equivalents in the files[] entries of an Export Item.
—: field is not available in the Export API (v3)*: data is the same but represented differently
FAQs
Which API replaces the legacy Receipt API?
It depends on whether you run an export.
- If you book expenses in an Accounting System, use the Export API (v3). It provides receipts as attachments on Export Items.
- To get receipts outside an Export Job, use the Accounting Entries API.
How do I get receipts with the Export API (v3)?
Follow these steps:
- Start the Export Job.
- Fetch its Export Items with
GET /v3/export-items?job_id={jobId}. - Read the
files[]list on each item and download each file from itsurl. - Complete the job after the downloads.
- You can only fetch Export Items while the job is
pendingorin_progress, so download the files before you complete the job. - The
urlexpires 24 hours after you fetch the items. - An item has zero, one or several attachments. Each attachment can be up to 30 MB.