### GET /v1/trips/trip/{trip_id} Source: https://api.qargo.com/docs/openapi.json Get trip ```markdown ### Parameters - **trip_id** (string (uuid), path, required) ### Responses #### 200 - Successful Response **TripOutput** - **id** (string (uuid)) (required): ID of the trip - **name** (string) (required): Name of the trip - **status** (string (CREATED|PLANNED|COMPLETED)) (required) ("CREATED"|"PLANNED"|"COMPLETED") - **orders** (array (MinimalOrderOutput)) (required): List of orders associated with the trip Array items: - **id** (string (uuid)) (required): ID of the order - **name** (string) (required): Name of the order - **resource_allocations** (array (ResourceAllocation-Output)): List of resources allocated to the trip Array items: - **resource** (object) (required) - **name** (string) - **code** (string) - **is_archived** (boolean) - **custom_fields** (object): Store values for user defined fields - **subcontractor** (object) - **id** (string (uuid)) (required): The unique identifier of the company. - **code** (string) - **currency** (string) (required): Currency of the company (ISO 4217, 3 letter code) - **custom_fields** (object) - **is_customer** (boolean): Indicate that this company is a customer - **is_subcontractor** (boolean): Indicate that this company is a subcontractor (supplier) - **is_buyer_or_seller** (boolean) - **name** (string) (required): Name of the company. - **legal_name** (string) - **vat_number** (string) - **note** (string) - **tax_type** (string (VAT|REVERSE_CHARGE|TRANSIT|NO_VAT|CO_CONTRACTING|OTHER)) ("VAT"|"REVERSE_CHARGE"|"TRANSIT"|"NO_VAT"|"CO_CONTRACTING"|"OTHER") - **status** (string (PROSPECT|NOT_APPROVED|APPROVED|WARNING|BLOCKED)) ("PROSPECT"|"NOT_APPROVED"|"APPROVED"|"WARNING"|"BLOCKED") - **accounting_code** (string) - **billing_location** (object) - **address** (string) - **address_second_line** (string) - **city** (string) - **state** (string) - **country** (string) - **postal_code** (string) - **name** (string) - **id** (string (uuid)) - **code** (string) - **latitude** (number) - **longitude** (number) - **payment_term** (object) - **code** (string (END_OF_MONTH_2|END_OF_MONTH_1|END_OF_MONTH_0_NET_65|END_OF_MONTH_0_NET_60|END_OF_MONTH_0_NET_50|END_OF_MONTH_0_NET_45|END_OF_MONTH_0_NET_35|END_OF_MONTH_0_NET_31|END_OF_MONTH_0_NET_30|END_OF_MONTH_0_NET_25|END_OF_MONTH_0_NET_21|END_OF_MONTH_0_NET_14|END_OF_MONTH_0_NET_7|END_OF_MONTH_0_NET_1|END_OF_MONTH_0|PREPAID|CUSTOM_DUE_DATE|UPON_RECEIPT|NET_1|NET_2|NET_3|NET_5|NET_7|NET_8|NET_10|NET_12|NET_14|NET_15|NET_20|NET_21|NET_28|NET_30|NET_35|NET_40|NET_42|NET_45|NET_48|NET_49|NET_50|NET_52|NET_55|NET_56|NET_60|NET_63|NET_70|NET_75|NET_77|NET_80|NET_84|NET_90|NET_91|NET_98)) (required) ("END_OF_MONTH_2"|"END_OF_MONTH_1"|"END_OF_MONTH_0_NET_65"|"END_OF_MONTH_0_NET_60"|"END_OF_MONTH_0_NET_50"|"END_OF_MONTH_0_NET_45"|"END_OF_MONTH_0_NET_35"|"END_OF_MONTH_0_NET_31"|"END_OF_MONTH_0_NET_30"|"END_OF_MONTH_0_NET_25"|"END_OF_MONTH_0_NET_21"|"END_OF_MONTH_0_NET_14"|"END_OF_MONTH_0_NET_7"|"END_OF_MONTH_0_NET_1"|"END_OF_MONTH_0"|"PREPAID"|"CUSTOM_DUE_DATE"|"UPON_RECEIPT"|"NET_1"|"NET_2"|"NET_3"|"NET_5"|"NET_7"|"NET_8"|"NET_10"|"NET_12"|"NET_14"|"NET_15"|"NET_20"|"NET_21"|"NET_28"|"NET_30"|"NET_35"|"NET_40"|"NET_42"|"NET_45"|"NET_48"|"NET_49"|"NET_50"|"NET_52"|"NET_55"|"NET_56"|"NET_60"|"NET_63"|"NET_70"|"NET_75"|"NET_77"|"NET_80"|"NET_84"|"NET_90"|"NET_91"|"NET_98") - **locale** (string) - **reference_numbers** (object) - **eori_number** (string) - **duns_number** (string) - **scac_code** (string) - **company_registration_number** (string) - **tss_registration_number** (string) - **bank_accounts** (array (BankAccount)): List of associated bank accounts. Array items: - **bic_code** (string) - **iban_code** (string) - **contacts** (array (CompanyContactOutput)) Array items: - **id** (string (uuid)) - **roles** (array (ContactType)): List of roles associated with the contact. - **name** (string) - **note** (string) - **email** (string) - **phone_number** (string) - **is_blocked** (boolean): Set to true to disallow new order creation for companies representing companies. **Note**: Deprecated in favor of `status`. - **resource_type** (string (COMPARTMENT|CONTAINER|DRIVER|FERRY|FULL_TRAILER|HANDLING|RIGID|SUBCONTRACTOR|TRACTOR|TRAILER|TRAIN|VAN)) ("COMPARTMENT"|"CONTAINER"|"DRIVER"|"FERRY"|"FULL_TRAILER"|"HANDLING"|"RIGID"|"SUBCONTRACTOR"|"TRACTOR"|"TRAILER"|"TRAIN"|"VAN") - **stops** (array (TripStopOutput)) (required): List of stops associated with the trip Array items: - **activity_label** (string) - **note** (string) - **reference_number** (string) - **email** (string) - **phone_number** (string) - **mobile_number** (string) - **time_window** (object) - **name** (string) - **code** (string) - **start_time** (string (time)) - **end_time** (string (time)) - **custom_fields** (object): Store values for user defined fields - **is_enforced** (boolean) - **planning_instructions** (string) - **extras** (array (StopExtra)) Array items: - **name** (string) - **code** (string) - **amazon** (object) - **asn_number** (string) - **fba_number** (string) - **po_number** (string) - **amazon_number** (string) - **carton_count** (string) - **unit_count** (string) - **booking_date** (string) - **booking_time** (string) - **custom_fields** (object): Additional user defined fields to fill in - **date** (string (date)) - **depot** (object) - **load_sequence_number** (integer) - **unload_timestamp** (string (date-time)) - **unload_sequence_number** (integer) - **load_timestamp** (string (date-time)) - **load_planned** (boolean) - **unload_planned** (boolean) - **load_pickup_stop_id** (string (uuid)) - **unload_delivery_stop_id** (string (uuid)) - **id** (string (uuid)) (required): Unique identifier for stop - **location** (object) (required) - **address** (string) - **address_second_line** (string) - **city** (string) - **state** (string) - **country** (string) - **postal_code** (string) - **name** (string) - **id** (string (uuid)) - **code** (string) - **latitude** (number) - **longitude** (number) - **terminal_metadata** (object) - **terminal_email** (string) - **sgkv_code** (string) - **uirr_code** (string) - **unlo_code** (string) - **gateway** (object) - **name** (string) (required) - **mileage_km** (number) - **end_timestamp** (string (date-time)) - **start_timestamp** (string (date-time)) - **incidents** (array (Incident)) Array items: - **name** (string) - **code** (string) - **description** (string) - **custom_fields** (object): Store values for user defined fields - **status** (string) - **order** (object) - **row_id** (string (uuid)) (required): Identifier of the reference #### 422 - Validation Error **HTTPValidationError** - **detail** (array (ValidationError)) Array items: - **loc** (array (union)) (required) - **msg** (string) (required) - **type** (string) (required) ### Example Usage ```bash curl -X GET "https://api.example.com/v1/trips/trip/{trip_id}" ``` ``` -------------------------------- ### POST /v1/webhook/document-import Source: https://api.qargo.com/docs/openapi.json Webhook for importing documents and attaching them to existing orders in Qargo. ## How it works 1. An external system sends a file to this endpoint with metadata as query parameters. 2. The system matches the document to an order in Qargo using the provided query parameters. 3. The document is created and attached to the matched order. ## Query parameters The `filename` parameter is always required. Additional query parameters are **configurable per integration** during setup and are used to pass metadata about the file and to match the document to an order. Query parameters can carry two types of information: ### File metadata Information about the document itself, for example: - `filename` (required) — Name of the uploaded file including extension - `document_type` — The type of document (e.g. `PROOF_OF_DELIVERY`, `WAYBILL`, `INVOICE`, `CMR`) - `document_name` — Display name for the document in Qargo ### Matching to Qargo orders Information used to resolve which order the document should be attached to. The following order fields can be matched against: - `customer_reference_number` — The customer reference number on the order - `name` — The order name (e.g. `OR-12345`) - `id` — The order UUID The match must resolve to **exactly one order**. If no order or multiple orders match, the import will be discarded. The actual set of query parameters and how they map to the above is configured per integration. ## Content encoding | Content format | Content-Type header | Behavior | |---|---|---| | Binary (e.g. PDF, image) | `application/pdf`, `image/png`, etc. | Passed through as-is | | Text | `text/plain`, `text/xml`, etc. | Encoded as UTF-8 bytes | | Base64-encoded string | Non-text or no header | Base64 decode attempted; raw string used on failure | Please provide the `Content-Type` header matching the file format. ## Error handling | Scenario | Behavior | |----------|----------| | No order matches the provided criteria | Import is discarded | | Multiple orders match the criteria | Import is discarded | | Document metadata not provided | Import is discarded | ```markdown ### Parameters - **filename** (string, query, required): Name of the file being uploaded, including extension. This is used as the primary source for the file name in Qargo. ### Request Body **Content-Type:** application/json ### Responses #### 200 - Successful Response **DocumentImportResponse** - **errors** (array (ErrorStatus)) Array items: - **error_type** (string (USER_INPUT_ERROR|INTERNAL_ERROR|NOT_SUPPORTED)) (required) ("USER_INPUT_ERROR"|"INTERNAL_ERROR"|"NOT_SUPPORTED") - **error_message** (string) #### 422 - Validation Error **HTTPValidationError** - **detail** (array (ValidationError)) Array items: - **loc** (array (union)) (required) - **msg** (string) (required) - **type** (string) (required) ### Example Usage ```bash curl -X POST "https://api.example.com/v1/webhook/document-import?filename=string" \ -H "Content-Type: application/json" \ -d '"string"' ``` ``` -------------------------------- ### POST /v1/webhook Source: https://api.qargo.com/docs/openapi.json Webhook to receive e-invoices in structured format or as file uploads. ## Supported Formats This endpoint accepts e-invoices in multiple formats: - **JSON payloads**: Structured data using application/json content type. - **XML payloads**: Structured data using application/xml content type. Must be a valid UBL document. - **File uploads**: JSON + binary files (PDF, XML, etc.) using multipart/form-data. ## Multipart Upload Support When using multipart form data, the endpoint expects: - First part: JSON document (PurchaseEInvoiceInput or PurchaseECreditNoteInput). XML is not supported at the moment. - Subsequent parts: Supporting documents (invoice PDF, CMR PDF, etc.). ## Examples **JSON payload example (application/json).** ```json { "name": "INV-2023-001", "date": "2023-01-15", "due_date": "2023-02-15", "invoice_type": "PURCHASE", "currency": "EUR", "total_excl_tax": 999.99, "total_incl_tax": 1209.99, "total_tax": 210.00, "custom_fields": {}, "supplier": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Supplier Company Ltd", "vat_number": "BE1234.123.123", "billing_location": { "address": "Gaston Crommenlaan 4", "city": "Gent", "postal_code": "9050", "country": "BE" } }, "customer_reference_numbers": ["12345"], "line_items": [ { "id": "550e8400-e29b-41d4-a716-446655440001", "name": "Transport Service", "description": "International freight transport", "amount": 999.99, "currency": "EUR", "tax_rate": { "rate": 21.0, "name": "VAT" }, "account": { "code": "6000", "name": "Transport Costs" }, "references": { "order_name": "OR-1234" } } ], "attachments": [ { "document": { "base64": "JVBERi0xLjQKJcfs... (truncated for brevity) ...", "content_type": "application/pdf", "document_type": "INVOICE", "filename": "invoice_123.pdf" } } ] } ``` **XML payload example (application/xml).** ```xml urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 25900027 2025-10-28 2025-10-28 380 EUR 25900027 600947 JVBERi0xLjQKJcfs... (truncated for brevity) ... 0564730040 qargo-peppol-dev Gaston Crommenlaan 4 Gent 9050 Oost-Vlaanderen BE BE0772640434 VAT qargo-peppol-dev 0564730040 +324854244512 simon@qargo.com 0772640434 Qargo Gaston Crommenlaan 4 Gent 9050 BE Qargo 0772640434 162.71 774.83 162.71 S 21.00 VAT 774.83 774.83 937.54 937.54 1 1.0 65.00 Administratiekost S 21.00 VAT 65.0 2 1.0 709.83 Transport charge S 21.00 VAT 709.83 ``` **Multipart Form Data example.** ``` POST /v1/webhook Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryABC123XYZ ----WebKitFormBoundaryABC123XYZ Content-Disposition: form-data; name="document"; filename="invoice_data.json" Content-Type: application/json { "name": "INV-2023-001", "date": "2023-01-15", "due_date": "2023-02-15", "invoice_type": "PURCHASE", "currency": "EUR", "total_excl_tax": 999.99, "total_incl_tax": 1209.99, "total_tax": 210.00, "custom_fields": {}, "supplier": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Supplier Company Ltd", "vat_number": "BE1234.123.123", "billing_location": { "address": "Gaston Crommenlaan 4", "city": "Gent", "postal_code": "9050", "country": "BE" } }, "customer_reference_numbers": ["12345"], "line_items": [ { "id": "550e8400-e29b-41d4-a716-446655440001", "name": "Transport Service", "description": "International freight transport", "amount": 999.99, "currency": "EUR", "tax_rate": { "rate": 21.0, "name": "VAT" }, "account": { "code": "6000", "name": "Transport Costs" }, "references": { "order_name": "OR-1234" } } ] } ----WebKitFormBoundaryABC123XYZ Content-Disposition: form-data; name="invoice"; filename="invoice_123.pdf" Content-Type: application/pdf [binary PDF content] ----WebKitFormBoundaryABC123XYZ Content-Disposition: form-data; name="cmr"; filename="cmr_document.pdf" Content-Type: application/pdf [binary PDF content] ----WebKitFormBoundaryABC123XYZ-- ``` ## Processing Notes on Multipart Uploads - First part must be the JSON document containing invoice/credit note data. - Supporting documents follow as additional parts. - Content-Type headers determine document processing. ```markdown ### Request Body **Content-Type:** application/json - **name** (string) (required): Reference from invoicing party. - **date** (string (date)) (required): Invoice transaction date. - **currency** (string) (required): Currency code of the e-invoice. - **exchange_rate** (object) - **rate_date** (string (date)) - **rate** (number) (required) - **inverse_rate** (number) (required) - **total_excl_tax** (number) (required) - **total_incl_tax** (number) (required) - **total_tax** (number) (required) - **custom_fields** (object): Custom fields associated with this e-invoice. - **supplier** (object) (required) - **id** (string (uuid)) - **name** (string) (required): Name of the company. - **vat_number** (string) - **billing_location** (object) - **address** (string) - **address_second_line** (string) - **city** (string) - **state** (string) - **country** (string) - **postal_code** (string) - **name** (string) - **id** (string (uuid)) - **latitude** (number) - **longitude** (number) - **description** (string) - **location_identifier** (string) - **customer_reference_numbers** (array (string)): Reference numbers used to match the invoice. - **line_items** (array (EInvoiceLineItem)) (required): List of invoice lines associated with this e-invoice. Array items: - **name** (string) (required): Name of the charge line. - **description** (string) - **amount** (number) (required) - **account** (object) - **code** (string) (required): Code of the general ledger in the accounting software linked to this charge line. - **tax_rate** (object) - **id** (string (uuid)) - **name** (string) - **percentage** (number) - **code** (string) - **tax_type** (string (VAT|NO_VAT|REVERSE_CHARGE|TRANSIT|CO_CONTRACTING|OTHER)) ("VAT"|"NO_VAT"|"REVERSE_CHARGE"|"TRANSIT"|"CO_CONTRACTING"|"OTHER") - **currency** (string) (required): Currency of the line item. - **references** (object) - **attachments** (array (EInvoiceAttachment)) Array items: - **document** (object) (required) - **base64** (string) (required): Base64 encoded content of the document attachment. - **content_type** (string) (required): MIME type of the document attachment, e.g., 'application/pdf', 'application/xml'. - **document_type** (string (INVOICE|CREDIT_NOTE|OTHER)) (required) ("INVOICE"|"CREDIT_NOTE"|"OTHER") - **filename** (string) (required): Filename of the document attachment. - **due_date** (string (date)) (required): Payment due date. - **invoice_type** (string) (required): Indicates that this is a purchase invoice. ### Responses #### 200 - Successful Response #### 422 - Validation Error **HTTPValidationError** - **detail** (array (ValidationError)) Array items: - **loc** (array (union)) (required) - **msg** (string) (required) - **type** (string) (required) ### Example Usage ```bash curl -X POST "https://api.example.com/v1/webhook" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "date": "2023-01-01", "currency": "string", "exchange_rate": "value", "total_excl_tax": "value", "total_incl_tax": "value", "total_tax": "value", "custom_fields": "value", "supplier": "value", "customer_reference_numbers": [ "string" ], "line_items": [ "value" ], "attachments": "value", "due_date": "2023-01-01", "invoice_type": "string" }' ``` ``` -------------------------------- ### GET /v1/tasks/available-tasks Source: https://api.qargo.com/docs/openapi.json API endpoint for GET /v1/tasks/available-tasks ```markdown ### Responses #### 200 - Successful Response **AvailableTasks** - **tasks** (array (AvailableTask)) (required) Array items: - **id** (string (uuid)) (required) - **invoice_id** (string (uuid)) - **task_type** (string (POST_INVOICE|POST_INVOICE_PURCHASE|POST_CREDIT_NOTE|POST_CREDIT_NOTE_PURCHASE|PAID_INVOICE|PAID_INVOICE_PURCHASE|REFUNDED_CREDIT_NOTE|REFUNDED_CREDIT_NOTE_PURCHASE)) (required) ("POST_INVOICE"|"POST_INVOICE_PURCHASE"|"POST_CREDIT_NOTE"|"POST_CREDIT_NOTE_PURCHASE"|"PAID_INVOICE"|"PAID_INVOICE_PURCHASE"|"REFUNDED_CREDIT_NOTE"|"REFUNDED_CREDIT_NOTE_PURCHASE") - **status** (string (TODO|COMPLETED|FAILED|WAITING)) (required) ("TODO"|"COMPLETED"|"FAILED"|"WAITING") ### Example Usage ```bash curl -X GET "https://api.example.com/v1/tasks/available-tasks" ``` ```