Docpier IDP API
  1. agent
Docpier IDP API
  • IDP API
  • Webhook
  • Endpoints
    • agent
      • Upload a document
        POST
      • Retrieve structured data
        GET
      • Stream Document Content
        GET
      • Provide feedback
        PATCH
      • Get Document Feedback
        GET
  1. agent

Retrieve structured data

GET
/v1/workspaces/{workspaceId}/documents/{documentId}
Retrieves the structured data extracted from the document identified by the documentId.
Supports both JSON and XML formats via content negotiation (Accept header).
Polling behavior:
This endpoint should be polled periodically until the status in the 202 Accepted response
indicates 'COMPLETED'.
Multiple documents:
A single uploaded file might contain multiple logical documents (e.g., multiple QR bills on
one page) or a single one. Therefore, the response contains an array of detected and structured
documents.
Response formats:
application/json: Returns JSON response
application/xml: Returns XML response
Default: JSON if no Accept header specified

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Path Params

Responses

🟢200
application/json
Processing complete. Returns an array of identified documents.
Body

🟢202
🟠401
🟠403
🟠404
🔴500
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://test.your-api-server.com/v1/workspaces//documents/' \
--header 'Authorization: Bearer <token>'
Response Response Example
200 - Example 1
{
    "apiVersion": "string",
    "workspaceId": "string",
    "documentId": "string",
    "extRef": "string",
    "status": "PENDING",
    "createdAt": "string",
    "file": {
        "filename": "string",
        "mimeType": "string",
        "fileSize": 0,
        "fileHash": "string",
        "numberOfPages": 0,
        "source": "UPLOAD",
        "pdfVersion": "string",
        "pdfEncrypted": true,
        "pdfSigned": true,
        "pdfAnnotations": true,
        "pdfPermissions": [
            "string"
        ],
        "pdfPasswordProtected": true,
        "pdfLinearized": true,
        "pdfDefaultLanguage": "st",
        "textLayer": {
            "present": true,
            "source": "EMBEDDED",
            "qualityScore": 0
        },
        "contentEncoding": "string",
        "content": "string"
    },
    "process": {
        "pipeline": "string",
        "startedAt": "string",
        "completedAt": "string",
        "duration": 0,
        "warnings": [
            {
                "code": "string",
                "message": "string",
                "level": "INFO",
                "affectedPages": [
                    0
                ],
                "affectedFields": [
                    "string"
                ],
                "hint": "string"
            }
        ],
        "errors": [
            {
                "code": "string",
                "message": "string",
                "level": "INFO",
                "affectedPages": [
                    0
                ],
                "affectedFields": [
                    "string"
                ],
                "hint": "string"
            }
        ]
    },
    "data": [
        {
            "invoiceType": "FINAL",
            "dueDate": "string",
            "stateOfInvoice": "PAID",
            "grossAmount": {
                "currency": "CHF",
                "value": 42.5
            },
            "netAmount": {
                "currency": "CHF",
                "value": 42.5
            },
            "payableAmount": {
                "currency": "CHF",
                "value": 42.5
            },
            "paymentDetails": {
                "paymentType": "QR",
                "iban": "string",
                "referenceNumber": "string",
                "accountNumber": "string",
                "bicSwift": "string",
                "message": "string",
                "inFavorOf": {
                    "name": "string",
                    "address": {
                        "city": "Zürich",
                        "country": "CHE",
                        "street": "Musterstrasse",
                        "streetNumber": "12A",
                        "zipCode": "8001"
                    },
                    "phoneNumbers": [
                        "string"
                    ],
                    "emails": [
                        "string"
                    ],
                    "taxIds": [
                        {
                            "type": "UID",
                            "value": "CHE-999.999.999"
                        }
                    ],
                    "legalForm": "SOLE_PROPRIETORSHIP"
                },
                "paidBy": {
                    "name": "string",
                    "address": {
                        "city": "Zürich",
                        "country": "CHE",
                        "street": "Musterstrasse",
                        "streetNumber": "12A",
                        "zipCode": "8001"
                    },
                    "phoneNumbers": [
                        "string"
                    ],
                    "emails": [
                        "string"
                    ],
                    "taxIds": [
                        {
                            "type": "UID",
                            "value": "CHE-999.999.999"
                        }
                    ],
                    "legalForm": "SOLE_PROPRIETORSHIP"
                }
            },
            "paymentMethods": [
                {
                    "type": "CREDIT_CARD",
                    "vendor": "string",
                    "number": "stri",
                    "settlementDate": "string"
                }
            ],
            "allowances": [
                {
                    "type": "EARLY_PAYMENT",
                    "rate": 0,
                    "amount": {
                        "currency": "CHF",
                        "value": 42.5
                    },
                    "adjustedAmount": {
                        "currency": "CHF",
                        "value": 42.5
                    },
                    "respiteDate": "string"
                }
            ],
            "items": [
                {
                    "date": "string",
                    "category": "string",
                    "groupId": "string",
                    "position": "string",
                    "itemId": "string",
                    "description": "string",
                    "quantity": 0,
                    "unit": "string",
                    "unitPrice": {
                        "currency": "CHF",
                        "value": 42.5
                    },
                    "lineTotal": {
                        "currency": "CHF",
                        "value": 42.5
                    },
                    "vatRate": 0,
                    "discount": {
                        "reason": "string",
                        "rate": 0,
                        "amount": {
                            "currency": "CHF",
                            "value": 42.5
                        },
                        "reducedAmount": {
                            "currency": "CHF",
                            "value": 42.5
                        }
                    },
                    "periodFrom": "string",
                    "periodTo": "string"
                }
            ],
            "discounts": [
                {
                    "reason": "string",
                    "rate": 0,
                    "amount": {
                        "currency": "CHF",
                        "value": 42.5
                    },
                    "reducedAmount": {
                        "currency": "CHF",
                        "value": 42.5
                    }
                }
            ],
            "vatDetails": {
                "conformity": true,
                "serviceDateFrom": "string",
                "serviceDateTo": "string",
                "breakdown": [
                    null
                ]
            },
            "energyDetails": {
                "premises": [
                    {
                        "utilityType": "ELECTRICITY",
                        "measurementId": "string",
                        "location": {
                            "name": "string",
                            "address": {
                                "city": "Zürich",
                                "country": "CHE",
                                "street": "Musterstrasse",
                                "streetNumber": "12A",
                                "zipCode": "8001"
                            },
                            "phoneNumbers": [
                                "string"
                            ],
                            "emails": [
                                "string"
                            ],
                            "taxIds": [
                                {
                                    "type": "UID",
                                    "value": "CHE-999.999.999"
                                }
                            ],
                            "legalForm": "SOLE_PROPRIETORSHIP"
                        },
                        "metadata": [
                            {
                                "type": "CONTRACT_NUMBER",
                                "value": "string"
                            }
                        ],
                        "consumptions": [
                            {
                                "type": "INDIVIDUAL",
                                "description": "string",
                                "unit": "string",
                                "quantity": 0,
                                "readings": [
                                    {
                                        "meterNumber": "string",
                                        "start": 0,
                                        "end": 0,
                                        "periodFrom": "string",
                                        "periodTo": "string"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "creditCardDetails": {
                "companyName": "string",
                "accountNumber": "string",
                "cardHolder": "string",
                "cardNumber": "string",
                "cardType": "string",
                "cardLimit": {
                    "currency": "CHF",
                    "value": 42.5
                },
                "transactions": [
                    null
                ]
            },
            "insuranceDetails": {
                "policy": {
                    "insuranceType": "VEHICLE_INSURANCE",
                    "policyHolder": {
                        "name": "string",
                        "address": {
                            "city": "Zürich",
                            "country": "CHE",
                            "street": "Musterstrasse",
                            "streetNumber": "12A",
                            "zipCode": "8001"
                        },
                        "phoneNumbers": [
                            "string"
                        ],
                        "emails": [
                            "string"
                        ],
                        "taxIds": [
                            {
                                "type": "UID",
                                "value": "CHE-999.999.999"
                            }
                        ],
                        "legalForm": "SOLE_PROPRIETORSHIP"
                    },
                    "broker": {
                        "name": "string",
                        "address": {
                            "city": "Zürich",
                            "country": "CHE",
                            "street": "Musterstrasse",
                            "streetNumber": "12A",
                            "zipCode": "8001"
                        },
                        "phoneNumbers": [
                            "string"
                        ],
                        "emails": [
                            "string"
                        ],
                        "taxIds": [
                            {
                                "type": "UID",
                                "value": "CHE-999.999.999"
                            }
                        ],
                        "legalForm": "SOLE_PROPRIETORSHIP"
                    },
                    "policyItems": [
                        {
                            "insuranceType": "VEHICLE_INSURANCE",
                            "coverageLimit": {
                                "currency": "CHF",
                                "value": 42.5
                            },
                            "objectReference": "string",
                            "netPremium": {
                                "currency": "CHF",
                                "value": 42.5
                            },
                            "periodFrom": "string",
                            "periodTo": "string"
                        }
                    ],
                    "totalNetPremium": {
                        "currency": "CHF",
                        "value": 42.5
                    },
                    "totalGrossPremium": {
                        "currency": "CHF",
                        "value": 42.5
                    }
                },
                "premiumType": "REGULAR_RENEWAL"
            },
            "language": "DE",
            "officialEntity": {
                "name": "string",
                "address": {
                    "city": "Zürich",
                    "country": "CHE",
                    "street": "Musterstrasse",
                    "streetNumber": "12A",
                    "zipCode": "8001"
                },
                "phoneNumbers": [
                    "string"
                ],
                "emails": [
                    "string"
                ],
                "taxIds": [
                    {
                        "type": "UID",
                        "value": "CHE-999.999.999"
                    }
                ],
                "legalForm": "SOLE_PROPRIETORSHIP"
            },
            "title": "string",
            "documentType": "INVOICE",
            "documentId": "string",
            "sender": {
                "name": "string",
                "address": {
                    "city": "Zürich",
                    "country": "CHE",
                    "street": "Musterstrasse",
                    "streetNumber": "12A",
                    "zipCode": "8001"
                },
                "phoneNumbers": [
                    "string"
                ],
                "emails": [
                    "string"
                ],
                "taxIds": [
                    {
                        "type": "UID",
                        "value": "CHE-999.999.999"
                    }
                ],
                "legalForm": "SOLE_PROPRIETORSHIP"
            },
            "recipient": {
                "name": "string",
                "address": {
                    "city": "Zürich",
                    "country": "CHE",
                    "street": "Musterstrasse",
                    "streetNumber": "12A",
                    "zipCode": "8001"
                },
                "phoneNumbers": [
                    "string"
                ],
                "emails": [
                    "string"
                ],
                "taxIds": [
                    {
                        "type": "UID",
                        "value": "CHE-999.999.999"
                    }
                ],
                "legalForm": "SOLE_PROPRIETORSHIP"
            },
            "identifications": [
                null
            ],
            "notes": "string",
            "documentDate": "stringstri"
        }
    ]
}
Modified at 2026-01-06 20:52:46
Previous
Upload a document
Next
Stream Document Content
Built with