Public API
  1. Endpoints
Public API
  • General
  • Endpoints
    • Upload a document for processing
      POST
    • Retrieve structured data results for a processed document
      GET
    • Provide feedback on document extraction results
      PATCH
  1. Endpoints

Retrieve structured data results for a processed document

GET
/workspaces/{workspaceId}/documents/{documentId}
Last modified:2025-07-08 20:19:41
Retrieves the structured JSON data extracted from the document identified by the documentId.
This endpoint should be polled periodically until the status in the 202 Accepted response indicates 'COMPLETED'.
A single uploaded file might contain multiple logical documents (e.g., multiple QR bills on one page) or a single one.
Therefore, the response is an array of detected and structured documents.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET '/workspaces//documents/'
Response Response Example
200 - Example 1
[
    {
        "accountName": "Business Checking Account",
        "iban": "CH9300762011623852957",
        "accountNumber": "01-162385-29",
        "accountOwner": "string",
        "periodFrom": "2025-05-01",
        "periodTo": "2025-05-31",
        "transactions": [
            {
                "date": "2024-11-01",
                "description": "Ordre e-banking Etat de Vaud - Office des poursuites",
                "valueDate": "2024-11-01",
                "debit": {
                    "currency": "CHF",
                    "value": 42.5
                },
                "credit": {
                    "currency": "CHF",
                    "value": 42.5
                },
                "balance": {
                    "currency": "CHF",
                    "value": 42.5
                },
                "isReconsiled": true,
                "subDetails": [
                    {
                        "party": "Etat de Vaud - Office des poursuites",
                        "account": "string",
                        "amount": {
                            "currency": "CHF",
                            "value": 42.5
                        },
                        "fee": {
                            "currency": "CHF",
                            "value": 42.5
                        },
                        "message": "00 00000 00001 82024 42018 00001 202442018"
                    }
                ]
            }
        ],
        "openingBalance": {
            "currency": "CHF",
            "value": 42.5
        },
        "totalCredits": {
            "currency": "CHF",
            "value": 42.5
        },
        "totalDebits": {
            "currency": "CHF",
            "value": 42.5
        },
        "closingBalance": {
            "currency": "CHF",
            "value": 42.5
        },
        "documentId": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
        "documentType": "INVOICE",
        "documentDate": "2025-06-15",
        "sender": {
            "name": "Invoice Beneficiary SA",
            "address": {
                "addressSupplement": "Attn: Accounting Dept.",
                "street": "Musterstrasse",
                "streetNumber": "12A",
                "poBox": "PO Box 123",
                "zipCode": "8001",
                "city": "Zürich",
                "country": "CHE"
            },
            "phoneNumbers": [
                "string"
            ],
            "emails": [
                "string"
            ]
        },
        "recipient": {
            "name": "Invoice Beneficiary SA",
            "address": {
                "addressSupplement": "Attn: Accounting Dept.",
                "street": "Musterstrasse",
                "streetNumber": "12A",
                "poBox": "PO Box 123",
                "zipCode": "8001",
                "city": "Zürich",
                "country": "CHE"
            },
            "phoneNumbers": [
                "string"
            ],
            "emails": [
                "string"
            ]
        },
        "language": "DE",
        "notes": "This document contains a special promotion.",
        "title": "Docpier AG",
        "identifications": [
            {
                "type": "INVOICE_NUMBER",
                "value": "string"
            }
        ],
        "officialEntity": {
            "name": "Invoice Beneficiary SA",
            "address": {
                "addressSupplement": "Attn: Accounting Dept.",
                "street": "Musterstrasse",
                "streetNumber": "12A",
                "poBox": "PO Box 123",
                "zipCode": "8001",
                "city": "Zürich",
                "country": "CHE"
            },
            "phoneNumbers": [
                "string"
            ],
            "emails": [
                "string"
            ]
        },
        "amountGross": {
            "currency": "CHF",
            "value": 42.5
        },
        "amountNet": {
            "currency": "CHF",
            "value": 42.5
        }
    }
]

Request

Authorization
OAuth 2.0
Authorization Code
Client Credentials
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://auth.docpier.com/oauth/authorize
Token URL: https://auth.docpier.com/oauth/token
or
Path Params
workspaceId
string 
required
Unique identifier for the workspace
documentId
string 
required
The uniwue id for uploaded document

Responses

🟢200OK
application/json
Processing complete. Returns an array of identified documents.
Body
array [oneOf] 
optional
An array where each item represents a detected and structured document within the uploaded file.
object (Account Statement) 
optional
Defines the structure for a bank account statement extracted by Docpier (inspired by ISO 20022 camt.053). Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy.
accountName
string 
required
Descriptive name associated with the account (e.g., 'Current Account', 'Savings Account'). Maximum 35 characters.
<= 35 characters
Example:
Business Checking Account
iban
string 
required
International Bank Account Number (IBAN). Conforms to ISO 13616-1:2020. Minimum 15, maximum 34 alphanumeric characters.
>= 15 characters<= 34 characters
Example:
CH9300762011623852957
Match pattern:
^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$
accountNumber
string 
optional
Local bank account number (often legacy, superseded by IBAN). Maximum 35 characters.
<= 35 characters
Example:
01-162385-29
accountOwner
string 
optional
The legal owner of the bank account. Minimum 1 character, maximum 70.
<= 70 characters
periodFrom
string <date>
required
Start date of the statement period (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-05-01
periodTo
string <date>
required
End date of the statement period (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-05-31
transactions
array[object (AccountTransaction) {8}] 
required
openingBalance
object 
Amount
optional
totalCredits
object 
Amount
optional
totalDebits
object 
Amount
optional
closingBalance
object 
Amount
optional
documentId
string 
required
Unique ID assigned by Docpier for the uploaded document and its processing operation (UUID format).
Example:
a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
Match pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
documentType
enum<string> 
required
The specific type of the document identified by Docpier.
Allowed values:
INVOICEACCOUNT_STATEMENTREMINDERRECEIPTCREDIT_NOTEUNKNOWN
Example:
INVOICE
documentDate
string <date>
optional
The date when the document was originally issued (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-06-15
sender
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
recipient
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
language
enum<string> 
optional
The primary language detected in the document content (ISO 639-1 alpha-2, e.g., 'DE', 'FR', 'IT', 'EN').
Allowed values:
DEFRITEN
Example:
DE
notes
string 
optional
General notes or comments extracted from the document.
<= 500 characters
Example:
This document contains a special promotion.
title
string 
required
The title of the document (doctype + sender name)
>= 1 characters<= 50 characters
Example:
Docpier AG
identifications
array[object (Identification) {2}] 
required
officialEntity
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
amountGross
object 
Amount
optional
amountNet
object 
Amount
optional
object (Reminder) 
optional
Defines the structure for a reminder document, typically sent for overdue invoices, extracted by Docpier. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy).
stateOfInvoice
enum<string> 
required
The status of the related invoice.
Allowed values:
PAIDOUTSTANDING
settlementDate
string <date>
optional
Date when the payment was actually credited to the receiver’s account.
>= 10 characters<= 10 characters
Example:
2025-07-30
newDueDate
string <date>
required
The new due date for payment specified in this reminder (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-07-25
originalInvoiceDate
string <date>
optional
The issue date of the original invoice (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-06-01
reminderLevel
integer 
optional
The level or stage of the reminder (e.g., 1 for first reminder, 2 for second). Minimum value 1.
>= 1
Example:
1
paymentDetails
object 
PaymentDetailsInfo
optional
Payment information for the invoice. May include IBAN, BIC/SWIFT, and Swiss QR-Bill reference.
outstandingAmount
object 
Amount
optional
interestAmount
object 
Amount
optional
feeAmount
object 
Amount
optional
documentId
string 
required
Unique ID assigned by Docpier for the uploaded document and its processing operation (UUID format).
Example:
a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
Match pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
documentType
enum<string> 
required
The specific type of the document identified by Docpier.
Allowed values:
INVOICEACCOUNT_STATEMENTREMINDERRECEIPTCREDIT_NOTEUNKNOWN
Example:
INVOICE
documentDate
string <date>
optional
The date when the document was originally issued (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-06-15
sender
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
recipient
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
language
enum<string> 
optional
The primary language detected in the document content (ISO 639-1 alpha-2, e.g., 'DE', 'FR', 'IT', 'EN').
Allowed values:
DEFRITEN
Example:
DE
notes
string 
optional
General notes or comments extracted from the document.
<= 500 characters
Example:
This document contains a special promotion.
title
string 
required
The title of the document (doctype + sender name)
>= 1 characters<= 50 characters
Example:
Docpier AG
identifications
array[object (Identification) {2}] 
required
officialEntity
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
amountGross
object 
Amount
optional
amountNet
object 
Amount
optional
object (Receipt) 
optional
Defines the structure for a payment receipt document extracted by Docpier. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy).
stateOfInvoice
enum<string> 
optional
The status of the related invoice.
Allowed values:
PAIDOUTSTANDING
Example:
PAID
paymentMethod
object 
PaymentMethod
optional
vatDetails
object 
VAT Details Schema
optional
Standardized schema for Value Added Tax (VAT) related information. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy, only present when extracted.
documentId
string 
required
Unique ID assigned by Docpier for the uploaded document and its processing operation (UUID format).
Example:
a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
Match pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
documentType
enum<string> 
required
The specific type of the document identified by Docpier.
Allowed values:
INVOICEACCOUNT_STATEMENTREMINDERRECEIPTCREDIT_NOTEUNKNOWN
Example:
INVOICE
documentDate
string <date>
optional
The date when the document was originally issued (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-06-15
sender
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
recipient
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
language
enum<string> 
optional
The primary language detected in the document content (ISO 639-1 alpha-2, e.g., 'DE', 'FR', 'IT', 'EN').
Allowed values:
DEFRITEN
Example:
DE
notes
string 
optional
General notes or comments extracted from the document.
<= 500 characters
Example:
This document contains a special promotion.
title
string 
required
The title of the document (doctype + sender name)
>= 1 characters<= 50 characters
Example:
Docpier AG
identifications
array[object (Identification) {2}] 
required
officialEntity
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
amountGross
object 
Amount
optional
amountNet
object 
Amount
optional
object (Invoice) 
optional
Defines the structure for an invoice document, including common fields and Swiss-specific payment details, extracted by Docpier. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy.
dueDate
string <date>
required
The payment due date for the invoice (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-07-15
stateOfInvoice
enum<string> 
required
The status of the related invoice.
Allowed values:
PAIDOUTSTANDING
paymentDetails
object 
PaymentDetailsInfo
required
Payment information for the invoice. May include IBAN, BIC/SWIFT, and Swiss QR-Bill reference.
paymentMethod
object 
PaymentMethod
optional
discounts
array[object (DiscountInfo) {5}] 
optional
Array of discounts applied to the invoice. Each discount can have a type, rate, and amount.
items
array[object (InvoiceItemInfo) {10}] 
optional
Line items detailing products or services on the invoice.
vatDetails
object 
VAT Details Schema
optional
Standardized schema for Value Added Tax (VAT) related information. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy, only present when extracted.
documentId
string 
required
Unique ID assigned by Docpier for the uploaded document and its processing operation (UUID format).
Example:
a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
Match pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
documentType
enum<string> 
required
The specific type of the document identified by Docpier.
Allowed values:
INVOICEACCOUNT_STATEMENTREMINDERRECEIPTCREDIT_NOTEUNKNOWN
Example:
INVOICE
documentDate
string <date>
optional
The date when the document was originally issued (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-06-15
sender
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
recipient
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
language
enum<string> 
optional
The primary language detected in the document content (ISO 639-1 alpha-2, e.g., 'DE', 'FR', 'IT', 'EN').
Allowed values:
DEFRITEN
Example:
DE
notes
string 
optional
General notes or comments extracted from the document.
<= 500 characters
Example:
This document contains a special promotion.
title
string 
required
The title of the document (doctype + sender name)
>= 1 characters<= 50 characters
Example:
Docpier AG
identifications
array[object (Identification) {2}] 
required
officialEntity
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
amountGross
object 
Amount
optional
amountNet
object 
Amount
optional
object (Credit Note) 
optional
Defines the structure for a credit note (Gutschrift) document extracted by Docpier. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy.
reasonForCredit
string 
optional
The reason for issuing the credit note (e.g., 'RETURN_OF_GOODS', 'PRICE_CORRECTION', 'SERVICE_CANCELLATION'). Minimum 1 character, maximum 250.
>= 1 characters<= 250 characters
Example:
RETURN_OF_GOODS
vatDetails
object 
VAT Details Schema
optional
Standardized schema for Value Added Tax (VAT) related information. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy, only present when extracted.
documentId
string 
required
Unique ID assigned by Docpier for the uploaded document and its processing operation (UUID format).
Example:
a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
Match pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
documentType
enum<string> 
required
The specific type of the document identified by Docpier.
Allowed values:
INVOICEACCOUNT_STATEMENTREMINDERRECEIPTCREDIT_NOTEUNKNOWN
Example:
INVOICE
documentDate
string <date>
optional
The date when the document was originally issued (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-06-15
sender
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
recipient
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
language
enum<string> 
optional
The primary language detected in the document content (ISO 639-1 alpha-2, e.g., 'DE', 'FR', 'IT', 'EN').
Allowed values:
DEFRITEN
Example:
DE
notes
string 
optional
General notes or comments extracted from the document.
<= 500 characters
Example:
This document contains a special promotion.
title
string 
required
The title of the document (doctype + sender name)
>= 1 characters<= 50 characters
Example:
Docpier AG
identifications
array[object (Identification) {2}] 
required
officialEntity
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
amountGross
object 
Amount
optional
amountNet
object 
Amount
optional
object (Unknown Document) 
optional
Represents a document whose specific type could not be identified or fully structured by Docpier. Contains basic document metadata and any detected errors/warnings. Each field that is extracted will include a 'confidence' property (0.0-1.0) indicating extraction accuracy.
processingWarnings
array[string]
optional
List of warnings encountered during document processing (e.g., low quality, partial extraction).
>= 0 items
extractionErrors
array[string]
optional
List of errors encountered during data extraction (e.g., missing required fields, unparseable data).
>= 0 items
documentId
string 
required
Unique ID assigned by Docpier for the uploaded document and its processing operation (UUID format).
Example:
a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d
Match pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
documentType
enum<string> 
required
The specific type of the document identified by Docpier.
Allowed values:
INVOICEACCOUNT_STATEMENTREMINDERRECEIPTCREDIT_NOTEUNKNOWN
Example:
INVOICE
documentDate
string <date>
optional
The date when the document was originally issued (YYYY-MM-DD). Conforms to ISO 8601 date format. Must be 10 characters.
>= 10 characters<= 10 characters
Example:
2025-06-15
sender
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
recipient
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
language
enum<string> 
optional
The primary language detected in the document content (ISO 639-1 alpha-2, e.g., 'DE', 'FR', 'IT', 'EN').
Allowed values:
DEFRITEN
Example:
DE
notes
string 
optional
General notes or comments extracted from the document.
<= 500 characters
Example:
This document contains a special promotion.
title
string 
required
The title of the document (doctype + sender name)
>= 1 characters<= 50 characters
Example:
Docpier AG
identifications
array[object (Identification) {2}] 
required
officialEntity
object 
LegalEntityInfo
optional
Details of the beneficiary of the payment (often same as sender, but can differ on invoice).
amountGross
object 
Amount
optional
amountNet
object 
Amount
optional
🟢202Accepted
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
🔴500Server Error
Modified at 2025-07-08 20:19:41
Previous
Upload a document for processing
Next
Provide feedback on document extraction results
Built with