Qargo Use case / Document import API
This section provides an overview of all available methods to import documents into Qargo.  ### Document import methods There are five ways to get documents into Qargo, grouped by domain: #### Operational #### 1. Generic document import webhook The most flexible option for importing documents at the **order level**. Query parameters are fully configurable per integration and are used to pass file metadata and order matching criteria. Only order-level document types are supported. - **Scope**: Order-level - **Auth**: Basic Auth (webhook credentials) - **Query parameters**: Configurable per integration (`filename` is always required) - **Supported content**: Binary files, text, or base64-encoded content See the [generic document import webhook](/docs/use-case-document-import/document-import-webhook) for full details. #### Master Data #### 2. Synchronous API upload Upload documents directly via the REST API. Used for master data synchronisation (e.g. importing reference documents). Suited for integrations that require a synchronous response. - **Scope**: Master data (sync / import) - **Auth**: OAuth2 (API credentials) See the [document upload endpoint](/docs/api-document/upload_document_content_v1_documents_document_upload_content_post) for full details. #### 3. Subcontractor document upload webhook Upload documents linked to a specific **stop** on a subcontracted trip. Uses fixed query parameters for stop identification and document type mapping. - **Scope**: Stop-level (subcontractor trips) - **Auth**: Basic Auth (webhook credentials) - **Query parameters**: `question_path_key`, `stop_id` See the [subcontractor document upload webhook](/docs/use-case-subcontractor-dispatch/subcontractor-document-upload-webhook) for full details and example. #### 4. Fleet document upload webhook Upload documents linked to a specific **stop** or **stop group** on a fleet-dispatched trip. Same pattern as the subcontractor variant. - **Scope**: Stop-level (fleet trips) - **Auth**: Basic Auth (webhook credentials) - **Query parameters**: `question_path_key`, `stop_id`, `stop_group_id` See the [fleet document upload webhook](/docs/use-case-fleet-dispatch/fleet-document-upload-webhook) for full details and example. #### Accounting #### 5. E-invoicing webhook Import structured purchase invoices or credit notes, optionally with file attachments (e.g. invoice PDF, CMR). Supports JSON, XML (UBL/Peppol), and multipart uploads. - **Scope**: Purchase invoices / credit notes - **Auth**: Basic Auth (webhook credentials) - **Formats**: JSON, XML (Peppol UBL), multipart/form-data - **Attachments**: Supported via `attachments` array (base64-encoded) in JSON, or as additional parts in multipart uploads See the [e-invoicing webhook](/docs/use-case-e-invoicing/e-invoicing-webhook) for full details, format examples, and attachment handling. ### Choosing the right method | Method | Domain | Scope | Auth | Best for | |--------|--------|-------|------|----------| | Generic document import | Operational | Order | Basic Auth | CMR, POD, packing lists — any order-level document | | Subcontractor document upload | Operational | Stop | Basic Auth | POD/CMR from subcontractor systems (per stop) | | Fleet document upload | Operational | Stop / Stop group | Basic Auth | POD/CMR from fleet apps (per stop or stop group) | | Synchronous API upload | Master Data | Master data | OAuth2 | Reference document synchronisation | | E-invoicing | Accounting | Invoice / Credit note | Basic Auth | Purchase invoices via Peppol, EDI, or custom format | > **Note:** The generic document import webhook currently supports **order-level document types only**. For stop-level documents, use the subcontractor or fleet document upload webhooks.