API Dokumentation
Einfache, vorhersagbare Endpunkte zum Parsen von Belegen in sauberes, typisiertes JSON. Beginnen Sie in Minuten.
Schnellstart
Beginnen Sie mit Parsetto in Sekunden. Wählen Sie Ihre bevorzugte Methode:
JavaScript/Node.js
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('https://api.parsetto.com/v1/parse', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk-your-api-key'
},
body: formData
});
const result = await response.json();
console.log(result.data.vendor); // "Starbucks"
console.log(result.data.total); // 12.45
cURL
curl -X POST https://api.parsetto.com/v1/parse \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]"
Authentifizierung
Fügen Sie Ihren API-Schlüssel in den Authorization-Header ein:
curl -X POST https://api.parsetto.com/v1/parse \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]"
Beleg Parsen
/v1/parse
Laden Sie ein Bild oder PDF-Beleg hoch, um strukturierte Daten zu extrahieren.
cURL Beispiel
curl -X POST https://api.parsetto.com/v1/parse \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "format=json"
Anfrage-Parameter
{
"file": "<binary data>",
"format": "json"
}
Erfolgreiche Antwort
{
"id": "parse_1234567890",
"status": "completed",
"data": {
"vendor": "Starbucks",
"total": 12.45,
"subtotal": 11.50,
"tax": 0.95,
"date": "2025-08-02",
"time": "14:30:00",
"items": [
{
"name": "Grande Latte",
"quantity": 1,
"price": 5.75
},
{
"name": "Blueberry Muffin",
"quantity": 1,
"price": 5.75
}
],
"payment_method": "credit_card",
"currency": "USD"
},
"confidence": 0.95,
"processing_time_ms": 1250
}
Fehlerbehandlung
Alle API-Fehler geben ein konsistentes JSON-Format mit hilfreichen Fehlermeldungen und Codes zurück.
Ungültige Anfrage
Ungültiges Dateiformat, fehlende Pflichtfelder oder fehlerhafte Anfragedaten.
{
"error": {
"code": "invalid_file_format",
"message": "File must be JPEG, PNG, or PDF",
"details": {
"received_format": "text/plain",
"supported_formats": ["image/jpeg", "image/png", "application/pdf"]
}
}
}
Nicht autorisiert
Ungültiger, abgelaufener oder fehlender API-Schlüssel im Authorization-Header.
{
"error": {
"code": "invalid_api_key",
"message": "API key is invalid or has been revoked",
"details": {
"hint": "Check your API key at https://app.parsetto.com/settings"
}
}
}
Datei zu groß
Hochgeladene Datei überschreitet die maximal zulässige Größe.
{
"error": {
"code": "file_too_large",
"message": "File size exceeds 10MB limit",
"details": {
"max_size_mb": 10,
"received_size_mb": 15.2
}
}
}
Rate Limit überschritten
Zu viele Anfragen in einem bestimmten Zeitraum. Überprüfen Sie die Rate-Limit-Header.
{
"error": {
"code": "rate_limit_exceeded",
"message": "Monthly request limit reached",
"details": {
"limit": 100,
"reset_date": "2025-09-01T00:00:00Z",
"upgrade_url": "https://app.parsetto.com/billing"
}
}
}
Interner Server-Fehler
Etwas ist auf unserer Seite schiefgelaufen. Diese sind selten und werden automatisch gemeldet.
{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred while processing your request",
"details": {
"request_id": "req_1234567890",
"support_email": "[email protected]"
}
}
}
Rate Limits
Rate Limits werden pro API-Schlüssel auf monatlicher Basis durchgesetzt:
Antwort-Schema
Alle erfolgreichen Antworten folgen einem konsistenten Schema mit typisierten Feldern für zuverlässiges Parsen:
{
"id": "string", // Unique parsing job ID
"status": "completed", // Job status: "completed" | "failed" | "processing"
"confidence": 0.95, // AI confidence score (0-1)
"processing_time_ms": 1250, // Time taken to process
"data": {
// Merchant Information
"vendor": "string", // Business name
"vendor_address": "string", // Optional business address
"vendor_phone": "string", // Optional phone number
// Financial Details
"total": 12.45, // Final amount (number)
"subtotal": 11.50, // Pre-tax amount (number)
"tax": 0.95, // Tax amount (number)
"tip": 0.00, // Tip amount (number)
"currency": "USD", // Currency code (ISO 4217)
// Date & Time
"date": "2025-08-02", // Transaction date (YYYY-MM-DD)
"time": "14:30:00", // Transaction time (HH:MM:SS)
// Line Items
"items": [
{
"name": "string", // Item description
"quantity": 1, // Quantity (number)
"price": 5.75, // Unit price (number)
"total": 5.75 // Line total (number)
}
],
// Payment Details
"payment_method": "credit_card", // "cash" | "credit_card" | "debit_card" | "other"
"card_last_four": "4242", // Optional last 4 digits
// Receipt Metadata
"receipt_number": "string", // Optional receipt/transaction ID
"cashier": "string" // Optional cashier name
}
}